PPL Logo

util/sockRoutines.C File Reference

Go to the source code of this file.

Typedefs

typedef int socklen_t
typedef void(* skt_signal_handler_fn )(int sig)

Functions

static int default_skt_abort (SOCKET skt, int code, const char *msg)
void skt_set_idle (skt_idleFn f)
skt_abortFn skt_set_abort (skt_abortFn f)
static void doCleanup (void)
void skt_init (void)
void skt_close (SOCKET fd)
static void skt_SIGPIPE_handler (int sig)
void skt_buffer_begin (SOCKET sk)
void skt_buffer_end (SOCKET sk)
static int skt_should_retry (void)
int skt_tcp_no_nagle (SOCKET fd)
int skt_select1 (SOCKET fd, int msec)
skt_ip_t skt_my_ip (void)
static int skt_parse_dotted (const char *str, skt_ip_t *ret)
skt_ip_t skt_lookup_ip (const char *name)
skt_ip_t skt_innode_my_ip (void)
skt_ip_t skt_innode_lookup_ip (const char *name)
char * skt_print_ip (char *dest, skt_ip_t addr)
int skt_ip_match (skt_ip_t a, skt_ip_t b)
struct sockaddr_in skt_build_addr (skt_ip_t IP, int port)
SOCKET skt_datagram (unsigned int *port, int bufsize)
SOCKET skt_server (unsigned int *port)
SOCKET skt_server_ip (unsigned int *port, skt_ip_t *ip)
SOCKET skt_accept (SOCKET src_fd, skt_ip_t *pip, unsigned int *port)
SOCKET skt_connect (skt_ip_t ip, int port, int timeout)
void skt_setSockBuf (SOCKET skt, int bufsize)
int skt_recvN (SOCKET hSocket, void *buff, int nBytes)
int skt_sendN (SOCKET hSocket, const void *buff, int nBytes)
int skt_sendV (SOCKET fd, int nBuffers, const void **bufs, int *lens)
int skt_sendmsg (SOCKET hSocket, struct msghdr *mh, int num_bufs, int nBytes)
int skt_sendmsg (SOCKET hSocket, WSABUF *buffers, int num_bufs, int nBytes)
ChMessageInt_t ChMessageInt_new (unsigned int src)
unsigned int ChMessageInt (ChMessageInt_t src)
ChMessageLong_t ChMessageLong_new (CMK_TYPEDEF_UINT8 src)
CMK_TYPEDEF_UINT8 ChMessageLong (ChMessageLong_t src)
int ChMessage_recv (SOCKET fd, ChMessage *dst)
int ChMessageHeader_recv (SOCKET fd, ChMessage *dst)
int ChMessageData_recv (SOCKET fd, ChMessage *dst)
void ChMessage_free (ChMessage *doomed)
void ChMessageHeader_new (const char *type, int len, ChMessageHeader *dst)
void ChMessage_new (const char *type, int len, ChMessage *dst)
int ChMessage_send (SOCKET fd, const ChMessage *src)

Variables

static skt_idleFn idleFunc = NULL
static skt_abortFn skt_abort = default_skt_abort
static int skt_ignore_SIGPIPE = 0
static int skt_inited = 0
static skt_signal_handler_fn skt_fallback_SIGPIPE = NULL
static struct sigaction sa
static int ERRNO = -1
skt_ip_t _skt_invalid_ip = {{0}}


Typedef Documentation

typedef int socklen_t

Definition at line 29 of file sockRoutines.C.

typedef void(* skt_signal_handler_fn)(int sig)

Definition at line 82 of file sockRoutines.C.


Function Documentation

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

Definition at line 39 of file sockRoutines.C.

void skt_set_idle ( skt_idleFn  f  ) 

Definition at line 48 of file sockRoutines.C.

References idleFunc.

Referenced by arg_init().

Here is the caller graph for this function:

skt_abortFn skt_set_abort ( skt_abortFn  f  ) 

Definition at line 49 of file sockRoutines.C.

References skt_abort.

Referenced by arg_init(), CcsImpl_kill(), CcsServer_recvRequest(), CcsServer_sendReply(), and main().

Here is the caller graph for this function:

static void doCleanup ( void   )  [static]

Definition at line 62 of file sockRoutines.C.

Referenced by skt_init().

Here is the caller graph for this function:

void skt_init ( void   ) 

Definition at line 66 of file sockRoutines.C.

References doCleanup(), skt_inited, and version.

Referenced by arg_init(), CcsConnectIpWithTimeout(), CcsConnectWithTimeout(), CcsServer_new(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

void skt_close ( SOCKET  fd  ) 

static void skt_SIGPIPE_handler ( int  sig  )  [static]

Definition at line 85 of file sockRoutines.C.

References sa, skt_fallback_SIGPIPE, and skt_ignore_SIGPIPE.

void skt_buffer_begin ( SOCKET  sk  ) 

Definition at line 116 of file sockRoutines.C.

void skt_buffer_end ( SOCKET  sk  ) 

Definition at line 117 of file sockRoutines.C.

static int skt_should_retry ( void   )  [static]

Definition at line 128 of file sockRoutines.C.

References ERRNO, idleFunc, and sleep().

Referenced by skt_accept(), skt_connect(), skt_datagram(), skt_recvN(), skt_select1(), skt_sendN(), and skt_server_ip().

Here is the call graph for this function:

Here is the caller graph for this function:

int skt_tcp_no_nagle ( SOCKET  fd  ) 

Definition at line 165 of file sockRoutines.C.

References flag.

Referenced by arg_init().

Here is the caller graph for this function:

int skt_select1 ( SOCKET  fd,
int  msec 
)

Definition at line 174 of file sockRoutines.C.

References skt_abort, skt_ignore_SIGPIPE, skt_should_retry(), and stats::time().

Referenced by arg_init(), CcsProbe(), CcsProbeTimeout(), CcsRecvResponse(), CcsRecvResponseMsg(), CcsServerCheck(), and skt_recvN().

Here is the call graph for this function:

Here is the caller graph for this function:

skt_ip_t skt_my_ip ( void   ) 

Definition at line 240 of file sockRoutines.C.

References skt_ip_t::data, and skt_lookup_ip().

Referenced by CcsServer_new(), CmiInitCPUAffinity(), getenv_display(), LrtsInitCpuTopo(), and skt_innode_my_ip().

Here is the call graph for this function:

Here is the caller graph for this function:

static int skt_parse_dotted ( const char *  str,
skt_ip_t ret 
) [static]

Definition at line 275 of file sockRoutines.C.

References skt_ip_t::data.

Referenced by skt_lookup_ip().

Here is the caller graph for this function:

skt_ip_t skt_lookup_ip ( const char *  name  ) 

Definition at line 295 of file sockRoutines.C.

References h, and skt_parse_dotted().

Referenced by arg_init(), CcsConnectWithTimeout(), skt_innode_lookup_ip(), and skt_my_ip().

Here is the call graph for this function:

Here is the caller graph for this function:

skt_ip_t skt_innode_my_ip ( void   ) 

Definition at line 312 of file sockRoutines.C.

References skt_innode_lookup_ip(), and skt_my_ip().

Referenced by arg_init(), and LrtsInitCpuTopo().

Here is the call graph for this function:

Here is the caller graph for this function:

skt_ip_t skt_innode_lookup_ip ( const char *  name  ) 

Definition at line 324 of file sockRoutines.C.

References len, and skt_lookup_ip().

Referenced by arg_init(), and skt_innode_my_ip().

Here is the call graph for this function:

Here is the caller graph for this function:

char* skt_print_ip ( char *  dest,
skt_ip_t  addr 
)

Definition at line 343 of file sockRoutines.C.

References skt_ip_t::data.

Referenced by arg_init(), CcsServer_new(), CcsServer_recvRequest(), getenv_display(), main(), and printSvr().

Here is the caller graph for this function:

int skt_ip_match ( skt_ip_t  a,
skt_ip_t  b 
)

Definition at line 355 of file sockRoutines.C.

Referenced by arg_init().

Here is the caller graph for this function:

struct sockaddr_in skt_build_addr ( skt_ip_t  IP,
int  port 
) [read]

Definition at line 359 of file sockRoutines.C.

Referenced by skt_connect(), skt_datagram(), and skt_server_ip().

Here is the caller graph for this function:

SOCKET skt_datagram ( unsigned int port,
int  bufsize 
)

Definition at line 368 of file sockRoutines.C.

References bind, int, len, skt_abort, skt_build_addr(), and skt_should_retry().

Here is the call graph for this function:

SOCKET skt_server ( unsigned int port  ) 

Definition at line 400 of file sockRoutines.C.

References skt_server_ip().

Referenced by arg_init(), CcsServer_new(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

SOCKET skt_server_ip ( unsigned int port,
skt_ip_t ip 
)

Definition at line 405 of file sockRoutines.C.

References bind, int, len, skt_abort, skt_build_addr(), and skt_should_retry().

Referenced by skt_server().

Here is the call graph for this function:

Here is the caller graph for this function:

SOCKET skt_accept ( SOCKET  src_fd,
skt_ip_t pip,
unsigned int port 
)

Definition at line 435 of file sockRoutines.C.

References len, skt_abort, and skt_should_retry().

Referenced by arg_init(), CcsServer_recvRequest(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

SOCKET skt_connect ( skt_ip_t  ip,
int  port,
int  timeout 
)

Definition at line 454 of file sockRoutines.C.

References ERRNO, skt_abort, skt_build_addr(), skt_close(), skt_should_retry(), and stats::time().

Referenced by arg_init(), CcsConnectIpWithTimeout(), CcsImpl_kill(), and CcsSendRequestGeneric().

Here is the call graph for this function:

Here is the caller graph for this function:

void skt_setSockBuf ( SOCKET  skt,
int  bufsize 
)

Definition at line 489 of file sockRoutines.C.

References int, len, and skt_abort.

int skt_recvN ( SOCKET  hSocket,
void *  buff,
int  nBytes 
)

int skt_sendN ( SOCKET  hSocket,
const void *  buff,
int  nBytes 
)

Definition at line 526 of file sockRoutines.C.

References skt_abort, skt_ignore_SIGPIPE, and skt_should_retry().

Referenced by arg_init(), CcsImpl_authInit(), CcsImpl_kill(), CcsServer_createSalt(), main(), and skt_sendV().

Here is the call graph for this function:

Here is the caller graph for this function:

int skt_sendV ( SOCKET  fd,
int  nBuffers,
const void **  bufs,
int lens 
)

Definition at line 557 of file sockRoutines.C.

References PUP::b, buf, CmiTmpAlloc(), CmiTmpFree(), dest, len, and skt_sendN().

Referenced by arg_init(), CcsSendRequestGeneric(), CcsServer_writeReply(), and ChMessage_send().

Here is the call graph for this function:

Here is the caller graph for this function:

int skt_sendmsg ( SOCKET  hSocket,
struct msghdr *  mh,
int  num_bufs,
int  nBytes 
)

Definition at line 583 of file sockRoutines.C.

References PUP::l, offset, skt_abort, and skt_ignore_SIGPIPE.

int skt_sendmsg ( SOCKET  hSocket,
WSABUF *  buffers,
int  num_bufs,
int  nBytes 
)

Definition at line 614 of file sockRoutines.C.

References skt_abort, and skt_ignore_SIGPIPE.

ChMessageInt_t ChMessageInt_new ( unsigned int  src  ) 

unsigned int ChMessageInt ( ChMessageInt_t  src  ) 

ChMessageLong_t ChMessageLong_new ( CMK_TYPEDEF_UINT8  src  ) 

Definition at line 672 of file sockRoutines.C.

References ChMessageLong_t::data.

CMK_TYPEDEF_UINT8 ChMessageLong ( ChMessageLong_t  src  ) 

Definition at line 678 of file sockRoutines.C.

References ChMessageLong_t::data.

int ChMessage_recv ( SOCKET  fd,
ChMessage dst 
)

Definition at line 685 of file sockRoutines.C.

References ChMessageData_recv(), and ChMessageHeader_recv().

Referenced by arg_init().

Here is the call graph for this function:

Here is the caller graph for this function:

int ChMessageHeader_recv ( SOCKET  fd,
ChMessage dst 
)

Definition at line 693 of file sockRoutines.C.

References ChMessageInt(), ChMessage::data, ChMessage::header, ChMessageHeader::len, ChMessage::len, and skt_recvN().

Referenced by arg_init(), and ChMessage_recv().

Here is the call graph for this function:

Here is the caller graph for this function:

int ChMessageData_recv ( SOCKET  fd,
ChMessage dst 
)

Definition at line 702 of file sockRoutines.C.

References ChMessage::data, ChMessage::len, malloc(), and skt_recvN().

Referenced by arg_init(), and ChMessage_recv().

Here is the call graph for this function:

Here is the caller graph for this function:

void ChMessage_free ( ChMessage doomed  ) 

Definition at line 710 of file sockRoutines.C.

References ChMessage::data, free(), ChMessage::header, ChMessage::len, and ChMessageHeader::type.

Referenced by arg_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void ChMessageHeader_new ( const char *  type,
int  len,
ChMessageHeader dst 
)

Definition at line 717 of file sockRoutines.C.

References ChMessageInt_new(), ChMessageHeader::len, and ChMessageHeader::type.

Referenced by arg_init(), and ChMessage_new().

Here is the call graph for this function:

Here is the caller graph for this function:

void ChMessage_new ( const char *  type,
int  len,
ChMessage dst 
)

Definition at line 723 of file sockRoutines.C.

References ChMessageHeader_new(), ChMessage::data, ChMessage::header, ChMessage::len, and malloc().

Referenced by arg_init().

Here is the call graph for this function:

Here is the caller graph for this function:

int ChMessage_send ( SOCKET  fd,
const ChMessage src 
)

Definition at line 729 of file sockRoutines.C.

References ChMessage::data, ChMessage::header, ChMessage::len, and skt_sendV().

Referenced by arg_init().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

skt_idleFn idleFunc = NULL [static]

Definition at line 46 of file sockRoutines.C.

Referenced by skt_set_idle(), and skt_should_retry().

skt_abortFn skt_abort = default_skt_abort [static]

int skt_ignore_SIGPIPE = 0 [static]

Definition at line 59 of file sockRoutines.C.

Referenced by skt_recvN(), skt_select1(), skt_sendmsg(), skt_sendN(), and skt_SIGPIPE_handler().

int skt_inited = 0 [static]

Definition at line 64 of file sockRoutines.C.

Referenced by skt_init().

Definition at line 83 of file sockRoutines.C.

Referenced by skt_SIGPIPE_handler().

struct sigaction sa [static]

int ERRNO = -1 [static]

Definition at line 121 of file sockRoutines.C.

Referenced by skt_connect(), and skt_should_retry().

Definition at line 238 of file sockRoutines.C.

Referenced by arg_init().


Generated on Mon Sep 21 08:12:07 2020 for Charm++ by  doxygen 1.5.5