VxWorks Reference Manual : Libraries

strmSockLib

NAME

strmSockLib - interface to STREAMS sockets (STREAMS Option)

ROUTINES

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)

DESCRIPTION

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.

SEE ALSO

strmSockLib, WindNet STREAMS Optional Component Supplement


Libraries : Routines

strmSockProtoAdd( )

NAME

strmSockProtoAdd( ) - add a new transport-protocol entry to STREAMS sockets (STREAMS Option)

SYNOPSIS

STATUS strmSockProtoAdd
    (
    int    family, /* address family of added protocol */
    int    type,   /* socket type of added protocol */
    char * devName /* transport provider device name */
    )

DESCRIPTION

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( ).

WARNING

Two different transport providers having the same address family and socket type cannot be added to the table.

EXAMPLE

strmSockProtoAdd (AF_INET, SOCK_DGRAM, "/dev/udp")

RETURNS

OK, or ERROR if the transport-provider entry cannot be made.

ERRNO

S_strmLib_DUPLICATE_PROVIDER

SEE ALSO

strmSockLib


Libraries : Routines

strmSockProtoDelete( )

NAME

strmSockProtoDelete( ) - remove a protocol entry from the table (STREAMS Option)

SYNOPSIS

STATUS strmSockProtoDelete
    (
    int family, /* address family */
    int type    /* socket type */
    )

DESCRIPTION

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.

RETURNS

OK if successful, ERROR otherwise.

SEE ALSO

strmSockLib


Libraries : Routines

strmSockDevNameGet( )

NAME

strmSockDevNameGet( ) - get the transport-provider device name (STREAMS Option)

SYNOPSIS

char * strmSockDevNameGet
    (
    int family, /* Address family of the transport provider */
    int type    /* Socket type of the transport provider */
    )

DESCRIPTION

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.

RETURNS

A transport-protocol device name if successful, NULL otherwise.

ERRNO

ENXIO

SEE ALSO

strmSockLib