PPL Logo

conv-ccs/ccs-server.C File Reference

Go to the source code of this file.

Data Structures

struct  CcsSecMan
struct  CCS_AUTH_clients

Typedefs

typedef int(* CcsSecMan_allowFn )(struct CcsSecMan *self, CcsSecAttr *attr)
typedef CcsSec_secretKey *(* CcsSecMan_getKeyFn )(struct CcsSecMan *self, CcsSecAttr *attr)

Functions

static void CCS_AUTH_new (CCS_AUTH_clients *cl)
static int CCS_AUTH_numClients (CCS_AUTH_clients *cl)
static int CCS_AUTH_addClient (CCS_AUTH_clients *cl)
static int CCS_AUTH_clientSalt (CCS_AUTH_clients *cl, int clientNo)
static void CCS_AUTH_advanceSalt (CCS_AUTH_clients *cl, int clientNo)
static void CcsServer_writeReply (SOCKET fd, CcsSecMan *security, CcsSecAttr *attr, int replyLen, char *reply)
static const char * CcsServer_createSalt (SOCKET fd, CCS_AUTH_clients *cl, CcsSecMan *security, CcsSecAttr *attr)
static const char * CcsServer_SHA1_message (SOCKET fd, CCS_AUTH_clients *cl, CcsSecMan *security, CcsSecAttr *attr, CcsMessageHeader *hdr)
static const char * CcsServer_readHeader (SOCKET fd, CCS_AUTH_clients *cl, CcsSecMan *security, CcsSecAttr *attr, CcsMessageHeader *hdr)
static int allowRequest_default (struct CcsSecMan *self, CcsSecAttr *attr)
static CcsSec_secretKeygetKey_default (struct CcsSecMan *self, CcsSecAttr *attr)
static void CcsSecMan_make_otp (const char *str, CcsSec_secretKey *key)
static void CcsSecMan_printkey (FILE *out, int level, CcsSec_secretKey *k)
static CcsSecManCcsSecMan_default (const char *authFile)
void CcsServer_new (skt_ip_t *ret_ip, int *use_port, const char *authFile)
SOCKET CcsServer_fd (void)
static int req_abortFn (SOCKET skt, int code, const char *msg)
static int CcsServer_recvRequestData (SOCKET fd, CcsImplHeader *hdr, void **reqData)
int CcsServer_recvRequest (CcsImplHeader *hdr, void **reqData)
static int reply_abortFn (SOCKET skt, int code, const char *msg)
void CcsServer_sendReply (CcsImplHeader *hdr, int repBytes, const void *repData)
void write_stdio_duplicate (char *data)
int check_stdio_header (CcsImplHeader *hdr)
void print_fw_handler (char *msg)
void print_node0 (const char *format, va_list args)

Variables

static SOCKET ccs_server_fd = SOCKET_ERROR
static CCS_AUTH_clients ccs_clientlist
static CcsSecMansecurity
char * stdio_buffer = NULL
int stdio_size = 0
int stdio_alloc = 0
int stdio_waiting = 0
CcsImplHeader stdio_waiting_hdr
int print_fw_handler_idx


Typedef Documentation

typedef int(* CcsSecMan_allowFn)(struct CcsSecMan *self, CcsSecAttr *attr)

Definition at line 21 of file ccs-server.C.

typedef CcsSec_secretKey*(* CcsSecMan_getKeyFn)(struct CcsSecMan *self, CcsSecAttr *attr)

Definition at line 23 of file ccs-server.C.


Function Documentation

static void CCS_AUTH_new ( CCS_AUTH_clients cl  )  [static]

Definition at line 39 of file ccs-server.C.

References CCS_RAND_new(), CCS_AUTH_clients::clients, CCS_AUTH_clients::nClients, and CCS_AUTH_clients::rand.

Referenced by CcsServer_new().

Here is the call graph for this function:

Here is the caller graph for this function:

static int CCS_AUTH_numClients ( CCS_AUTH_clients cl  )  [static]

Definition at line 45 of file ccs-server.C.

References CCS_AUTH_clients::nClients.

Referenced by CcsServer_SHA1_message().

Here is the caller graph for this function:

static int CCS_AUTH_addClient ( CCS_AUTH_clients cl  )  [static]

Definition at line 48 of file ccs-server.C.

References CCS_RAND_next(), CCS_AUTH_clients::clients, CCS_AUTH_clients::nClients, CCS_AUTH_clients::rand, and realloc().

Referenced by CcsServer_createSalt().

Here is the call graph for this function:

Here is the caller graph for this function:

static int CCS_AUTH_clientSalt ( CCS_AUTH_clients cl,
int  clientNo 
) [static]

Definition at line 55 of file ccs-server.C.

References CCS_AUTH_clients::clients.

Referenced by CcsServer_createSalt(), and CcsServer_SHA1_message().

Here is the caller graph for this function:

static void CCS_AUTH_advanceSalt ( CCS_AUTH_clients cl,
int  clientNo 
) [static]

Definition at line 58 of file ccs-server.C.

References CCS_AUTH_clients::clients.

Referenced by CcsServer_SHA1_message().

Here is the caller graph for this function:

static void CcsServer_writeReply ( SOCKET  fd,
CcsSecMan security,
CcsSecAttr attr,
int  replyLen,
char *  reply 
) [static]

Definition at line 68 of file ccs-server.C.

References CcsSecAttr::auth, CCS_AUTH_hash(), ChMessageInt(), ChMessageInt_new(), CcsSecMan::getKey, len, CcsSecAttr::replySalt, skt_close(), and skt_sendV().

Referenced by CcsServer_sendReply().

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* CcsServer_createSalt ( SOCKET  fd,
CCS_AUTH_clients cl,
CcsSecMan security,
CcsSecAttr attr 
) [static]

Definition at line 110 of file ccs-server.C.

References CCS_AUTH_addClient(), CCS_AUTH_clientSalt(), CCS_AUTH_differ(), CCS_AUTH_hash(), CCS_RAND_next(), ChMessageInt(), ChMessageInt_new(), CcsSecMan::getKey, CCS_AUTH_clients::rand, skt_recvN(), and skt_sendN().

Referenced by CcsServer_readHeader().

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* CcsServer_SHA1_message ( SOCKET  fd,
CCS_AUTH_clients cl,
CcsSecMan security,
CcsSecAttr attr,
CcsMessageHeader hdr 
) [static]

Definition at line 149 of file ccs-server.C.

References CCS_AUTH_advanceSalt(), CCS_AUTH_clientSalt(), CCS_AUTH_differ(), CCS_AUTH_numClients(), ChMessageInt(), CcsSecMan::getKey, CcsSecAttr::replySalt, and skt_recvN().

Referenced by CcsServer_readHeader().

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* CcsServer_readHeader ( SOCKET  fd,
CCS_AUTH_clients cl,
CcsSecMan security,
CcsSecAttr attr,
CcsMessageHeader hdr 
) [static]

static int allowRequest_default ( struct CcsSecMan self,
CcsSecAttr attr 
) [static]

Definition at line 241 of file ccs-server.C.

References CcsSecAttr::auth, and CcsSecAttr::level.

Referenced by CcsSecMan_default().

Here is the caller graph for this function:

static CcsSec_secretKey* getKey_default ( struct CcsSecMan self,
CcsSecAttr attr 
) [static]

Definition at line 253 of file ccs-server.C.

References CcsSecAttr::level.

Referenced by CcsSecMan_default().

Here is the caller graph for this function:

static void CcsSecMan_make_otp ( const char *  str,
CcsSec_secretKey key 
) [static]

Definition at line 258 of file ccs-server.C.

References CCS_RAND_new(), CCS_RAND_next(), CcsSec_secretKey::data, and CCS_RAND_state::state.

Referenced by CcsSecMan_default().

Here is the call graph for this function:

Here is the caller graph for this function:

static void CcsSecMan_printkey ( FILE *  out,
int  level,
CcsSec_secretKey k 
) [static]

Definition at line 277 of file ccs-server.C.

References CcsSec_secretKey::data.

Referenced by CcsSecMan_default().

Here is the caller graph for this function:

static CcsSecMan* CcsSecMan_default ( const char *  authFile  )  [static]

Definition at line 286 of file ccs-server.C.

References CcsSecMan::allowRequest, allowRequest_default(), CCS_AUTH_makeSecretKey(), CcsSecMan_make_otp(), CcsSecMan_printkey(), CcsSec_secretKey::data, CcsSecMan::getKey, getKey_default(), key, CcsSecMan::keys, level, and malloc().

Referenced by CcsServer_new().

Here is the call graph for this function:

Here is the caller graph for this function:

void CcsServer_new ( skt_ip_t ret_ip,
int use_port,
const char *  authFile 
)

Definition at line 344 of file ccs-server.C.

References CCS_AUTH_new(), CcsSecMan_default(), skt_init(), skt_my_ip(), skt_print_ip(), and skt_server().

Referenced by arg_init(), and CcsInit().

Here is the call graph for this function:

Here is the caller graph for this function:

SOCKET CcsServer_fd ( void   ) 

Definition at line 365 of file ccs-server.C.

Referenced by arg_init(), and CcsServerCheck().

Here is the caller graph for this function:

static int req_abortFn ( SOCKET  skt,
int  code,
const char *  msg 
) [static]

Definition at line 372 of file ccs-server.C.

Referenced by CcsServer_recvRequest().

Here is the caller graph for this function:

static int CcsServer_recvRequestData ( SOCKET  fd,
CcsImplHeader hdr,
void **  reqData 
) [static]

int CcsServer_recvRequest ( CcsImplHeader hdr,
void **  reqData 
)

Definition at line 413 of file ccs-server.C.

References CcsImplHeader::attr, CcsServer_recvRequestData(), ChMessageInt_new(), fd, CcsSecAttr::ip, CcsSecAttr::port, req_abortFn(), skt_accept(), skt_close(), skt_print_ip(), and skt_set_abort().

Referenced by arg_init(), and CcsServerCheck().

Here is the call graph for this function:

Here is the caller graph for this function:

static int reply_abortFn ( SOCKET  skt,
int  code,
const char *  msg 
) [static]

Definition at line 443 of file ccs-server.C.

Referenced by arg_init(), and CcsServer_sendReply().

Here is the caller graph for this function:

void CcsServer_sendReply ( CcsImplHeader hdr,
int  repBytes,
const void *  repData 
)

Definition at line 453 of file ccs-server.C.

References CcsImplHeader::attr, CcsServer_writeReply(), ChMessageInt(), fd, CcsImplHeader::len, reply_abortFn(), CcsImplHeader::replyFd, skt_close(), and skt_set_abort().

Referenced by arg_init(), CcsImpl_reply(), check_stdio_header(), and write_stdio_duplicate().

Here is the call graph for this function:

Here is the caller graph for this function:

void write_stdio_duplicate ( char *  data  ) 

Definition at line 483 of file ccs-server.C.

References CcsServer_sendReply(), free(), malloc(), and size.

Referenced by arg_init(), print_fw_handler(), and print_node0().

Here is the call graph for this function:

Here is the caller graph for this function:

int check_stdio_header ( CcsImplHeader hdr  ) 

Definition at line 506 of file ccs-server.C.

References CcsServer_sendReply(), ChMessageInt_new(), CcsImplHeader::handler, CcsImplHeader::len, and malloc().

Referenced by arg_init(), and CcsServerCheck().

Here is the call graph for this function:

Here is the caller graph for this function:

void print_fw_handler ( char *  msg  ) 

Definition at line 546 of file ccs-server.C.

References write_stdio_duplicate().

Referenced by CcsInit().

Here is the call graph for this function:

Here is the caller graph for this function:

void print_node0 ( const char *  format,
va_list  args 
)

Definition at line 551 of file ccs-server.C.

References CmiAbort(), CmiAlloc(), CmiMyPe(), Converse::CmiSyncSendAndFree(), len, msg, and write_stdio_duplicate().

Referenced by CmiError(), and CmiPrintf().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

SOCKET ccs_server_fd = SOCKET_ERROR [static]

Definition at line 337 of file ccs-server.C.

Definition at line 338 of file ccs-server.C.

CcsSecMan* security [static]

Definition at line 339 of file ccs-server.C.

char* stdio_buffer = NULL

Definition at line 477 of file ccs-server.C.

Definition at line 478 of file ccs-server.C.

Definition at line 479 of file ccs-server.C.

Definition at line 480 of file ccs-server.C.

Definition at line 481 of file ccs-server.C.

Definition at line 541 of file ccs-server.C.

Referenced by CcsInit().


Generated on Mon Sep 21 07:59:57 2020 for Charm++ by  doxygen 1.5.5