VxWorks Reference Manual : Libraries
strmSockLib - interface to STREAMS sockets (STREAMS Option)
strmSockProtoAdd( ) - add a new transport-protocol entry to STREAMS sockets (STREAMS Option)
strmSockProtoDelete( ) - remove a protocol entry from the table (STREAMS Option)
strmSockDevNameGet( ) - get the transport-provider device name (STREAMS Option)
This library provides facilities to add transport provider names to the list of transport providers. This list is used by the STREAMS socket call to open the appropriate transport provider. The library also provides facilities to delete the protocol entry from the list.
The strmSockLibInit( ) routine initializes the table of function pointers with STREAMS sockets calls. This ensures that the socket calls are configured to use either BSD sockets or WindNet STREAMS sockets.
strmSockLib, WindNet STREAMS Optional Component Supplement
strmSockProtoAdd( ) - add a new transport-protocol entry to STREAMS sockets (STREAMS Option)
STATUS strmSockProtoAdd ( int family, /* address family of added protocol */ int type, /* socket type of added protocol */ char * devName /* transport provider device name */ )
This routine enables transport independence for the STREAMS socket library by adding transport-provider entries to the table. It must be called for all transport providers that use the STREAMS socket interface. This routine must be executed before applications call socket( ). The table consists of three fields: the address family (AF_INET, AF_CCITT), the socket type (SOCK_STREAM, SOCK_RAW), and the transport-provider device name. The socket library decides on an appropriate transport provider based on the address-family and socket-type parameters passed to the socket( ).
Two different transport providers having the same address family and socket type cannot be added to the table.
strmSockProtoAdd (AF_INET, SOCK_DGRAM, "/dev/udp")
OK, or ERROR if the transport-provider entry cannot be made.
S_strmLib_DUPLICATE_PROVIDER
strmSockProtoDelete( ) - remove a protocol entry from the table (STREAMS Option)
STATUS strmSockProtoDelete ( int family, /* address family */ int type /* socket type */ )
This routine removes a protocol entry from the table. It does a linear search of the table and removes an entry when there is a match.
OK if successful, ERROR otherwise.
strmSockDevNameGet( ) - get the transport-provider device name (STREAMS Option)
char * strmSockDevNameGet ( int family, /* Address family of the transport provider */ int type /* Socket type of the transport provider */ )
This routine returns the transport-provider device name based on the address family and socket type passed to it. This routine does a linear search of the socket table and returns the device name when a match is found.
A transport-protocol device name if successful, NULL otherwise.
ENXIO