VxWorks Reference Manual : Libraries
endLib - support library for END-based drivers
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
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.
mib2Init( ) - initialize a MIB-II structure
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 */ )
Initialize a MIB-II structure. Set all error counts to zero. Assume a 10Mbps Ethernet device.
OK or ERROR.
mib2ErrorAdd( ) - change a MIB-II error count
STATUS mib2ErrorAdd ( M2_INTERFACETBL * pMib, int errCode, int value )
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.
OK or ERROR.
endObjInit( ) - initialize an END_OBJ structure
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 )
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.
OK or ERROR.
endObjFlagSet( ) - set the flags member of an END_OBJ structure
STATUS endObjFlagSet ( END_OBJ * pEnd, UINT flags )
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.
OK
endEtherAddressForm( ) - form an Ethernet address into a packet
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? */ )
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.
M_BLK_ID or NULL.
endEtherPacketDataGet( ) - return the beginning of the packet data
STATUS endEtherPacketDataGet ( M_BLK_ID pMblk, LL_HDR_INFO * pLinkHdrInfo )
This routine fills the given pLinkHdrInfo with the appropriate offsets.
OK or ERROR.
endEtherPacketAddrGet( ) - locate the addresses in a packet
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) */ )
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.
OK or ERROR.