OpenNet
Functions
Ethernet.h File Reference

Go to the source code of this file.

Functions

OPEN_NET_GLOBAL unsigned char * Ethernet_Data (OPEN_NET_GLOBAL unsigned char *aBase, OPEN_NET_GLOBAL const OpenNet_PacketInfo *aPacketInfo)
 This function returns a pointer to the Ethernet payload. More...
 
unsigned int Ethernet_DataSize (OPEN_NET_GLOBAL unsigned char *aBase, OPEN_NET_GLOBAL const OpenNet_PacketInfo *aPacketInfo)
 This function returns the size of the Ethernet payload. More...
 
OPEN_NET_GLOBAL unsigned short * Ethernet_Destination (OPEN_NET_GLOBAL unsigned char *aBase, OPEN_NET_GLOBAL const OpenNet_PacketInfo *aPacketInfo)
 This function returns a pointer to the Ethernet destination address. More...
 
OPEN_NET_GLOBAL unsigned short * Ethernet_Source (OPEN_NET_GLOBAL unsigned char *aBase, OPEN_NET_GLOBAL const OpenNet_PacketInfo *aPacketInfo)
 This function returns a pointer to the Ethernet source address. More...
 
unsigned short Ethernet_Type (OPEN_NET_GLOBAL const unsigned char *aBase, OPEN_NET_GLOBAL const OpenNet_PacketInfo *aPacketInfo)
 This function returns Ethernet packet type. More...
 
int Ethernet_Vlan (OPEN_NET_GLOBAL const unsigned char *aBase, OPEN_NET_GLOBAL const OpenNet_PacketInfo *aPacketInfo)
 This function indicate if a VLAN tag is present. More...
 
unsigned short Ethernet_VlanTag (OPEN_NET_GLOBAL const unsigned char *aBase, OPEN_NET_GLOBAL const OpenNet_PacketInfo *aPacketInfo)
 This function returns the VLAN tag. More...
 

Detailed Description

Author
KMS - Martin Dubois, ing.

Function Documentation

OPEN_NET_GLOBAL unsigned char* Ethernet_Data ( OPEN_NET_GLOBAL unsigned char *  aBase,
OPEN_NET_GLOBAL const OpenNet_PacketInfo aPacketInfo 
)

This function returns a pointer to the Ethernet payload.

Parameters
aBaseA pointer to the buffer
aPacketInfoA pointer to the information about the packet to process
Returns
This function returns a pointer to the Etehrnet payload.
unsigned int Ethernet_DataSize ( OPEN_NET_GLOBAL unsigned char *  aBase,
OPEN_NET_GLOBAL const OpenNet_PacketInfo aPacketInfo 
)

This function returns the size of the Ethernet payload.

Parameters
aBaseA pointer to the buffer
aPacketInfoA pointer to the information about the packet to process
Returns
This function returns the size of the Etehrnet payload.
OPEN_NET_GLOBAL unsigned short* Ethernet_Destination ( OPEN_NET_GLOBAL unsigned char *  aBase,
OPEN_NET_GLOBAL const OpenNet_PacketInfo aPacketInfo 
)

This function returns a pointer to the Ethernet destination address.

Parameters
aBaseA pointer to the buffer
aPacketInfoA pointer to the information about the packet to process
Returns
This function returns a pointer to the Etehrnet destination address.
OPEN_NET_GLOBAL unsigned short* Ethernet_Source ( OPEN_NET_GLOBAL unsigned char *  aBase,
OPEN_NET_GLOBAL const OpenNet_PacketInfo aPacketInfo 
)

This function returns a pointer to the Ethernet source address.

Parameters
aBaseA pointer to the buffer
aPacketInfoA pointer to the information about the packet to process
Returns
This function returns a pointer to the Etehrnet source address.
unsigned short Ethernet_Type ( OPEN_NET_GLOBAL const unsigned char *  aBase,
OPEN_NET_GLOBAL const OpenNet_PacketInfo aPacketInfo 
)

This function returns Ethernet packet type.

Parameters
aBaseA pointer to the buffer
aPacketInfoA pointer to the information about the packet to process
Returns
This function returns the Etehrnet packet type.
int Ethernet_Vlan ( OPEN_NET_GLOBAL const unsigned char *  aBase,
OPEN_NET_GLOBAL const OpenNet_PacketInfo aPacketInfo 
)

This function indicate if a VLAN tag is present.

Parameters
aBaseA pointer to the buffer
aPacketInfoA pointer to the information about the packet to process
Return values
0No
1Yes
unsigned short Ethernet_VlanTag ( OPEN_NET_GLOBAL const unsigned char *  aBase,
OPEN_NET_GLOBAL const OpenNet_PacketInfo aPacketInfo 
)

This function returns the VLAN tag.

Parameters
aBaseA pointer to the buffer
aPacketInfoA pointer to the information about the packet to process
Returns
This function returns 0 if the packet does not include a VLAN tag.