/* ** Name: commUdp.h ** ** UDP and TCP client routines */ #ifndef DRV_COMM_UDP_H #define DRV_COMM_UDP_H #ifdef __cplusplus extern "C" { #endif #include #include #include #include #include #include #include #include #include #include #define UDP 0 #define TCP 1 #define NODE_NAME_MAX 25 typedef char nodename_ta[NODE_NAME_MAX]; /* Structure for communication with a TCP/UDP client or server */ typedef struct { nodename_ta node_a; /* node name of remote server */ int socknum; /* local socket number */ struct sockaddr_in socket_s; /* socket struct */ int port; /* port number (ours if we're server; destination port number if we're client) */ }sockdesc_ts; int commUdpTcpClntInit (int *socknum_p, struct sockaddr_in *socket_ps, char *node, int proto, int port, int *connected); int commUdpTcpSrvrInit (int *socknum_p, struct sockaddr_in *socket_ps, int port); void commUdpTcpWrite(int *socknum_p, struct sockaddr_in *socket_ps, unsigned char *bufo_p, int count, int *outlet); int commUdpTcpRead(int *socknum_p, struct sockaddr_in *socket_ps, unsigned char *inmsgbuf, int elen, int *inmsglen, struct timeval timeout); #ifdef __cplusplus }; #endif #endif /* DRV_COMM_UDP_H guard macro */