00001
00005 #ifndef __CCS_CLIENT_H_
00006 #define __CCS_CLIENT_H_
00007
00008 #include "sockRoutines.h"
00009 #include "ccs-auth.h"
00010
00011 #ifdef __cplusplus
00012 extern "C" {
00013 #endif
00014
00015 typedef struct CcsServer {
00016
00017 char hostAddr[128];
00018 skt_ip_t hostIP;
00019 unsigned int hostPort;
00020
00021
00022 int isAuth;
00023 int level;
00024 CcsSec_secretKey key;
00025 int clientID,clientSalt;
00026 int replySalt;
00027 CCS_RAND_state rand;
00028
00029
00030 int numNodes;
00031 int numPes;
00032 int *numProcs;
00033
00034
00035 SOCKET replyFd;
00036 } CcsServer;
00037
00038
00039 int CcsConnect(CcsServer *svr, const char *host, int port,const CcsSec_secretKey *key);
00040 int CcsConnectWithTimeout(CcsServer *svr, const char *host, int port,
00041 const CcsSec_secretKey *key, int timeout);
00042
00043 int CcsConnectIp(CcsServer *svr,skt_ip_t ip, int port,const CcsSec_secretKey *key);
00044 int CcsConnectIpWithTimeout(CcsServer *svr,skt_ip_t ip, int port,const CcsSec_secretKey *key, int timeout);
00045
00046 int CcsSendRequest(CcsServer *svr, const char *hdlrID, int pe,
00047 int size, const void *msg);
00048 int CcsSendRequestWithTimeout(CcsServer *svr, const char *hdlrID, int pe,
00049 int size, const void *msg, int timeout);
00050 int CcsSendBroadcastRequest(CcsServer *svr, const char *hdlrID,
00051 int size, const void *msg);
00052 int CcsSendBroadcastRequestWithTimeout(CcsServer *svr, const char *hdlrID,
00053 int size, const void *msg, int timeout);
00054 int CcsSendMulticastRequest(CcsServer *svr, const char *hdlrID, int npes,
00055 int *pes, int size, const void *msg);
00056 int CcsSendMulticastRequestWithTimeout(CcsServer *svr, const char *hdlrID, int npes,
00057 int *pes, int size, const void *msg, int timeout);
00058
00059 int CcsNoResponse(CcsServer *svr);
00060 int CcsRecvResponse(CcsServer *svr,
00061 int maxsize, void *recvBuffer, int timeout);
00062 int CcsRecvResponseMsg(CcsServer *svr,
00063 int *retSize,void **newBuf, int timeout);
00064 int CcsNumNodes(CcsServer *svr);
00065 int CcsNumPes(CcsServer *svr);
00066 int CcsNodeFirst(CcsServer *svr, int node);
00067 int CcsNodeSize(CcsServer *svr,int node);
00068 int CcsProbe(CcsServer *svr);
00069 int CcsProbeTimeout(CcsServer *svr,int timeoutMs);
00070 void CcsFinalize(CcsServer *svr);
00071
00072 #ifdef __cplusplus
00073 };
00074 #endif
00075
00076 #endif