VxWorks Reference Manual : Libraries

endLib

NAME

endLib - support library for END-based drivers

ROUTINES

mib2Init( ) - initialize a MIB-II structure
mib2ErrorAdd( ) - change a MIB-II error count
endObjInit( ) - initialize an END_OBJ structure
endObjFlagSet( ) - set the flags member of an END_OBJ structure
endEtherAddressForm( ) - form an Ethernet address into a packet
endEtherPacketDataGet( ) - return the beginning of the packet data
endEtherPacketAddrGet( ) - locate the addresses in a packet

DESCRIPTION

This library contains support routines for Enhanced Network Drivers. These routines are common to ALL ENDs. Specialized routines should only appear in the drivers themselves.

INCLUDE FILES

SEE ALSO

endLib


Libraries : Routines

mib2Init( )

NAME

mib2Init( ) - initialize a MIB-II structure

SYNOPSIS

STATUS mib2Init
    (
    M2_INTERFACETBL * pMib,       /* struct to be initialized */
    long              ifType,     /* ifType from m2Lib.h */
    UCHAR *           phyAddr,    /* MAC/PHY address */
    int               addrLength, /* MAC/PHY address length */
    int               mtuSize,    /* MTU size */
    int               speed       /* interface speed */
    )

DESCRIPTION

Initialize a MIB-II structure. Set all error counts to zero. Assume a 10Mbps Ethernet device.

RETURNS

OK or ERROR.

SEE ALSO

endLib


Libraries : Routines

mib2ErrorAdd( )

NAME

mib2ErrorAdd( ) - change a MIB-II error count

SYNOPSIS

STATUS mib2ErrorAdd
    (
    M2_INTERFACETBL * pMib,
    int               errCode,
    int               value
    )

DESCRIPTION

This function adds a specified value to one of the MIB-II error counters in a MIB-II interface table. The counter to be altered is specified by the errCode argument. Specifying a negative value reduces the error count, a positive value increases the error count.

RETURNS

OK or ERROR.

SEE ALSO

endLib


Libraries : Routines

endObjInit( )

NAME

endObjInit( ) - initialize an END_OBJ structure

SYNOPSIS

STATUS endObjInit
    (
    END_OBJ *   pEndObj,     /* object to be initialized */
    DEV_OBJ*    pDevice,     /* ptr to device struct */
    char *      pBaseName,   /* device base name, for example, "ln" */
    int         unit,        /* unit number */
    NET_FUNCS * pFuncTable,  /* END device functions */
    char*       pDescription
    )

DESCRIPTION

This routine initializes an END_OBJ structure and fills it with data from the argument list. It also creates and initializes semaphores and protocol list.

RETURNS

OK or ERROR.

SEE ALSO

endLib


Libraries : Routines

endObjFlagSet( )

NAME

endObjFlagSet( ) - set the flags member of an END_OBJ structure

SYNOPSIS

STATUS endObjFlagSet
    (
    END_OBJ * pEnd,
    UINT      flags
    )

DESCRIPTION

As input, this routine expects a pointer to an END_OBJ structure (the pEnd parameter) and a flags value (the flags parameter). This routine sets the flags member of the END_OBJ structure to the value of the flags parameter.

Because this routine assumes that the driver interface is now up, this routine also sets the attached member of the referenced END_OBJ structure to TRUE.

RETURNS

OK

SEE ALSO

endLib


Libraries : Routines

endEtherAddressForm( )

NAME

endEtherAddressForm( ) - form an Ethernet address into a packet

SYNOPSIS

M_BLK_ID endEtherAddressForm
    (
    M_BLK_ID pMblk,    /* pointer to packet mBlk */
    M_BLK_ID pSrcAddr, /* pointer to source address */
    M_BLK_ID pDstAddr, /* pointer to destination address */
    BOOL     bcastFlag /* use link-level broadcast? */
    )

DESCRIPTION

This routine accepts the source and destination addressing information through pSrcAddr and pDstAddr and returns an M_BLK_ID that points to the assembled link-level header. To do this, this routine prepends the link-level header into the cluster associated with pMblk if there is enough space available in the cluster. It then returns a pointer to the pointer referenced in pMblk. However, if there is not enough space in the cluster associated with pMblk, this routine reserves a new mBlk-clBlk-cluster construct for the header information. It then prepends the new mBlk to the mBlk passed in pMblk. As the function value, this routine then returns a pointer to the new mBlk, which the head of a chain of mBlk structures. The second element of this chain is the mBlk referenced in pMblk.

RETURNS

M_BLK_ID or NULL.

SEE ALSO

endLib


Libraries : Routines

endEtherPacketDataGet( )

NAME

endEtherPacketDataGet( ) - return the beginning of the packet data

SYNOPSIS

STATUS endEtherPacketDataGet
    (
    M_BLK_ID      pMblk,
    LL_HDR_INFO * pLinkHdrInfo
    )

DESCRIPTION

This routine fills the given pLinkHdrInfo with the appropriate offsets.

RETURNS

OK or ERROR.

SEE ALSO

endLib


Libraries : Routines

endEtherPacketAddrGet( )

NAME

endEtherPacketAddrGet( ) - locate the addresses in a packet

SYNOPSIS

STATUS endEtherPacketAddrGet
    (
    M_BLK_ID pMblk, /* pointer to packet */
    M_BLK_ID pSrc,  /* pointer to local source address */
    M_BLK_ID pDst,  /* pointer to local destination address */
    M_BLK_ID pESrc, /* pointer to remote source address (if any) */
    M_BLK_ID pEDst  /* pointer to remote destination address (if any) */
    )

DESCRIPTION

This routine takes a M_BLK_ID, locates the address information, and adjusts the M_BLK_ID structures referenced in pSrc, pDst, pESrc, and pEDst so that their pData members point to the addressing information in the packet. The addressing information is not copied. All mBlk structures share the same cluster.

RETURNS

OK or ERROR.

SEE ALSO

endLib