Ether Object
A-29
Internal Stack Functions
Create New Ether Object
EtherNew
Syntax
HANDLE EtherNew( uint PhysIndex );
Return Value
Returns a handle to the Ether object, or NULL on a memory allocation error.
Description
Installs a new Ether object in the system. This call should be made for every
ethernet device installed. Once called, the stack will make calls to the HAL
packet driver interface to get more information about the device. The argument
is the physical device id used by the HAL to identify the device.
Destroy Ether Object
EtherFree
Syntax
void EtherFree( HANDLE hEther );
Description
Destroys the indicated Ether object, and frees its associated memory. This
function should be called to remove devices after the stack has shut down.
Calling this function will not result in any calls to the HAL.
Configure Ether Object
EtherConfig
Syntax
void EtherConfig( HANDLE hEther, uint PhysMTU, uint EthHdrSize, uint
OffDstMac, uint OffSrcMac, uint OffEthType, uint PacketPad );
Description
Describes to the Ether object how the Ethernet header is constructed on this
device. Although the MAC address is assumed to be 6 bytes long, various de-
vices have a small variety of packet variances. The Ether device object must
know this information to both process and construct packets in buffers that are
native to the physical device.
The arguments are defined as follows:
PhysMTU
Physical MTU of the packet (usually 1514)
EthHdrSize
Minimum (non-802.2 SNAP) header size (usually 14)
OffDstMac
Byte offset from header start to Dst Mac Addr (usually 0)
OffSrcMax
Byte offset from header start to Src Mac Addr (usually 6)
OffEthType
Byte offset from header start to ether type (usually 12)
PacketPad
Required byte pad at end of frame (usually 0 or 4)