Objective Systems, Inc.  

ooSocket.h File Reference

Common runtime constants, data structure definitions, and run-time functions to support the sockets' operations. More...

#include <sys/types.h>
#include "sys/time.h"
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <net/if.h>
#include "ooasn1.h"

Go to the source code of this file.

Data Structures

struct  OOInterface

Defines

#define OOSOCKET_INVALID   ((OOSOCKET)-1)
#define OOIPADDR_ANY   ((OOIPADDR)0)
#define OOIPADDR_LOCAL   ((OOIPADDR)0x7f000001UL)

Typedefs

typedef int OOSOCKET
 Socket's handle.
typedef unsigned long OOIPADDR
 The IP address represented as unsigned long value.

Functions

EXTERN int ooSocketAccept (OOSOCKET socket, OOSOCKET *pNewSocket, OOIPADDR *destAddr, int *destPort)
 This function permits an incoming connection attempt on a socket.
EXTERN int ooSocketAddrToStr (OOIPADDR ipAddr, char *pbuf, int bufsize)
 This function converts an IP address to its string representation.
EXTERN int ooSocketBind (OOSOCKET socket, OOIPADDR addr, int port)
 This function associates a local address with a socket.
EXTERN int ooSocketClose (OOSOCKET socket)
 This function closes an existing socket.
EXTERN int ooSocketConnect (OOSOCKET socket, const char *host, int port)
 This function establishes a connection to a specified socket.
EXTERN int ooSocketCreate (OOSOCKET *psocket)
 This function creates a socket.
EXTERN int ooSocketCreateUDP (OOSOCKET *psocket)
 This function creates a UDP datagram socket.
EXTERN int ooSocketsInit (void)
 This function initiates use of sockets by an application.
EXTERN int ooSocketsCleanup (void)
 This function terminates use of sockets by an application.
EXTERN int ooSocketListen (OOSOCKET socket, int maxConnection)
 This function places a socket a state where it is listening for an incoming connection.
EXTERN int ooSocketRecvPeek (OOSOCKET socket, ASN1OCTET *pbuf, ASN1UINT bufsize)
 This function is used to peek at the received data without actually removing it from the receive socket buffer.
EXTERN int ooSocketRecv (OOSOCKET socket, ASN1OCTET *pbuf, ASN1UINT bufsize)
 This function receives data from a connected socket.
EXTERN int ooSocketRecvFrom (OOSOCKET socket, ASN1OCTET *pbuf, ASN1UINT bufsize, char *remotehost, ASN1UINT hostBufLen, int *remoteport)
 This function receives data from a connected/unconnected socket.
EXTERN int ooSocketSend (OOSOCKET socket, const ASN1OCTET *pdata, ASN1UINT size)
 This function sends data on a connected socket.
EXTERN int ooSocketSendTo (OOSOCKET socket, const ASN1OCTET *pdata, ASN1UINT size, const char *remotehost, int remoteport)
 This function sends data on a connected or unconnected socket.
EXTERN int ooSocketSelect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
 This function is used for synchronous monitoring of multiple sockets.
EXTERN int ooSocketStrToAddr (const char *pIPAddrStr, OOIPADDR *pIPAddr)
 This function converts the string with IP address to a double word representation.
EXTERN int ooSocketConvertIpToNwAddr (const char *inetIp, ASN1OCTET *netIp, size_t bufsiz)
 This function converts an internet dotted ip address to network address.
EXTERN int ooGetLocalIPAddress (char *pIPAddrs)
 This function retrives the IP address of the local host.
EXTERN int ooSocketGetSockName (OOSOCKET socket, struct sockaddr_in *name, socklen_t *size)
EXTERN long ooSocketHTONL (long val)
EXTERN short ooSocketHTONS (short val)
EXTERN int ooSocketGetIpAndPort (OOSOCKET socket, char *ip, int len, int *port)
 This function is used to retrieve the ip and port number used by the socket passed as parameter.
EXTERN int ooSocketGetInterfaceList (OOCTXT *pctxt, OOInterface **ifList)


Detailed Description

Common runtime constants, data structure definitions, and run-time functions to support the sockets' operations.

Definition in file ooSocket.h.


This file was last modified on 28 May 2010.
Objective Open H.323 Stack, 0.9.1