csocket.c File Reference

#include <cybergarage/net/csocket.h>
#include <cybergarage/net/cinterface.h>
#include <cybergarage/util/ctime.h>
#include <cybergarage/upnp/ssdp/cssdp.h>
#include <cybergarage/util/clog.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <signal.h>

Defines

#define cg_socket_getrawtype(socket)   ((socket->type == CG_NET_SOCKET_STREAM) ? SOCK_STREAM : SOCK_DGRAM)
#define CG_NET_SOCKET_SEND_RETRY_CNT   10
#define CG_NET_SOCKET_SEND_RETRY_WAIT_MSEC   20

Functions

BOOL cg_socket_tosockaddrin (char *addr, int port, struct sockaddr_in *sockaddr, BOOL isBindAddr)
BOOL cg_socket_tosockaddrinfo (int sockType, char *addr, int port, struct addrinfo **addrInfo, BOOL isBindAddr)
void cg_socket_startup ()
void cg_socket_cleanup ()
CgSocketcg_socket_new (int type)
int cg_socket_delete (CgSocket *sock)
BOOL cg_socket_isbound (CgSocket *sock)
void cg_socket_setid (CgSocket *socket, SOCKET value)
BOOL cg_socket_close (CgSocket *sock)
BOOL cg_socket_listen (CgSocket *sock)
BOOL cg_socket_bind (CgSocket *sock, int bindPort, char *bindAddr, BOOL bindFlag, BOOL reuseFlag)
BOOL cg_socket_accept (CgSocket *serverSock, CgSocket *clientSock)
BOOL cg_socket_connect (CgSocket *sock, char *addr, int port)
int cg_socket_read (CgSocket *sock, char *buffer, int bufferLen)
int cg_socket_write (CgSocket *sock, char *cmd, int cmdLen)
int cg_socket_readline (CgSocket *sock, char *buffer, int bufferLen)
long cg_socket_skip (CgSocket *sock, long skipLen)
int cg_socket_sendto (CgSocket *sock, char *addr, int port, char *data, int dataLen)
static int parse_ancillary (struct msghdr *my_hdr, int *ifn)
int cg_socket_recv (CgSocket *sock, CgDatagramPacket *dgmPkt)
BOOL cg_socket_setreuseaddress (CgSocket *sock, BOOL flag)
BOOL cg_socket_setmulticastttl (CgSocket *sock, int ttl)
BOOL cg_socket_settimeout (CgSocket *sock, int sec)
BOOL cg_socket_joingroup (CgSocket *sock, char *mcastAddr, char *ifAddr)

Variables

static int socketCnt = 0

Define Documentation

#define CG_NET_SOCKET_SEND_RETRY_CNT   10
 

#define CG_NET_SOCKET_SEND_RETRY_WAIT_MSEC   20
 

#define cg_socket_getrawtype socket   )     ((socket->type == CG_NET_SOCKET_STREAM) ? SOCK_STREAM : SOCK_DGRAM)
 


Function Documentation

BOOL cg_socket_accept CgSocket serverSock,
CgSocket clientSock
 

BOOL cg_socket_bind CgSocket sock,
int  bindPort,
char *  bindAddr,
BOOL  bindFlag,
BOOL  reuseFlag
 

void cg_socket_cleanup  ) 
 

BOOL cg_socket_close CgSocket sock  ) 
 

BOOL cg_socket_connect CgSocket sock,
char *  addr,
int  port
 

int cg_socket_delete CgSocket sock  ) 
 

BOOL cg_socket_isbound CgSocket sock  ) 
 

BOOL cg_socket_joingroup CgSocket sock,
char *  mcastAddr,
char *  ifAddr
 

BOOL cg_socket_listen CgSocket sock  ) 
 

CgSocket* cg_socket_new int  type  ) 
 

int cg_socket_read CgSocket sock,
char *  buffer,
int  bufferLen
 

int cg_socket_readline CgSocket sock,
char *  buffer,
int  bufferLen
 

int cg_socket_recv CgSocket sock,
CgDatagramPacket dgmPkt
 

int cg_socket_sendto CgSocket sock,
char *  addr,
int  port,
char *  data,
int  dataLen
 

void cg_socket_setid CgSocket socket,
SOCKET  value
 

BOOL cg_socket_setmulticastttl CgSocket sock,
int  ttl
 

BOOL cg_socket_setreuseaddress CgSocket sock,
BOOL  flag
 

BOOL cg_socket_settimeout CgSocket sock,
int  sec
 

long cg_socket_skip CgSocket sock,
long  skipLen
 

void cg_socket_startup  ) 
 

BOOL cg_socket_tosockaddrin char *  addr,
int  port,
struct sockaddr_in *  sockaddr,
BOOL  isBindAddr
 

BOOL cg_socket_tosockaddrinfo int  sockType,
char *  addr,
int  port,
struct addrinfo **  addrInfo,
BOOL  isBindAddr
 

int cg_socket_write CgSocket sock,
char *  cmd,
int  cmdLen
 

static int parse_ancillary struct msghdr *  my_hdr,
int *  ifn
[static]
 


Variable Documentation

int socketCnt = 0 [static]
 


Generated on Fri Jun 16 16:58:33 2006 for CyberLinkC by  doxygen 1.4.6