ReactOS 0.4.16-dev-297-gc569aee
ethernetutils.h File Reference
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for ethernetutils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _ETH_HEADER
 
struct  _tagIPv4Header
 
struct  _tagTCPHeader
 
struct  _tagUDPHeader
 

Macros

#define ETH_IS_LOCALLY_ADMINISTERED(Address)    (BOOLEAN)(((PUCHAR)(Address))[0] & ((UCHAR)0x02))
 
#define ETH_IS_EMPTY(Address)    ((((PUCHAR)(Address))[0] == ((UCHAR)0x00)) && (((PUCHAR)(Address))[1] == ((UCHAR)0x00)) && (((PUCHAR)(Address))[2] == ((UCHAR)0x00)) && (((PUCHAR)(Address))[3] == ((UCHAR)0x00)) && (((PUCHAR)(Address))[4] == ((UCHAR)0x00)) && (((PUCHAR)(Address))[5] == ((UCHAR)0x00)))
 
#define ETH_HAS_PRIO_HEADER(Address)    (((PUCHAR)(Address))[12] == ((UCHAR)0x81) && ((PUCHAR)(Address))[13] == ((UCHAR)0x00))
 
#define ETH_HEADER_SIZE   (sizeof(ETH_HEADER))
 
#define ETH_MIN_PACKET_SIZE   60
 
#define ETH_PRIORITY_HEADER_OFFSET   12
 
#define ETH_PRIORITY_HEADER_SIZE   4
 
#define TCP_CHECKSUM_OFFSET   16
 
#define UDP_CHECKSUM_OFFSET   6
 
#define MAX_IPV4_HEADER_SIZE   60
 
#define MAX_TCP_HEADER_SIZE   60
 

Typedefs

typedef struct _ETH_HEADER ETH_HEADER
 
typedef struct _ETH_HEADERPETH_HEADER
 
typedef enum _tag_eInspectedPacketType eInspectedPacketType
 
typedef struct _tagIPv4Header IPv4Header
 
typedef struct _tagTCPHeader TCPHeader
 
typedef struct _tagUDPHeader UDPHeader
 

Enumerations

enum  _tag_eInspectedPacketType { iptUnicast , iptBroadcast , iptMulticast , iptInvalid }
 

Functions

static void FORCEINLINE SetPriorityData (UCHAR *pDest, ULONG priority, ULONG VlanID)
 
static __inline USHORT swap_short (USHORT us)
 

Macro Definition Documentation

◆ ETH_HAS_PRIO_HEADER

#define ETH_HAS_PRIO_HEADER (   Address)     (((PUCHAR)(Address))[12] == ((UCHAR)0x81) && ((PUCHAR)(Address))[13] == ((UCHAR)0x00))

Definition at line 41 of file ethernetutils.h.

◆ ETH_HEADER_SIZE

#define ETH_HEADER_SIZE   (sizeof(ETH_HEADER))

Definition at line 53 of file ethernetutils.h.

◆ ETH_IS_EMPTY

#define ETH_IS_EMPTY (   Address)     ((((PUCHAR)(Address))[0] == ((UCHAR)0x00)) && (((PUCHAR)(Address))[1] == ((UCHAR)0x00)) && (((PUCHAR)(Address))[2] == ((UCHAR)0x00)) && (((PUCHAR)(Address))[3] == ((UCHAR)0x00)) && (((PUCHAR)(Address))[4] == ((UCHAR)0x00)) && (((PUCHAR)(Address))[5] == ((UCHAR)0x00)))

Definition at line 38 of file ethernetutils.h.

◆ ETH_IS_LOCALLY_ADMINISTERED

#define ETH_IS_LOCALLY_ADMINISTERED (   Address)     (BOOLEAN)(((PUCHAR)(Address))[0] & ((UCHAR)0x02))

Definition at line 35 of file ethernetutils.h.

◆ ETH_MIN_PACKET_SIZE

#define ETH_MIN_PACKET_SIZE   60

Definition at line 54 of file ethernetutils.h.

◆ ETH_PRIORITY_HEADER_OFFSET

#define ETH_PRIORITY_HEADER_OFFSET   12

Definition at line 55 of file ethernetutils.h.

◆ ETH_PRIORITY_HEADER_SIZE

#define ETH_PRIORITY_HEADER_SIZE   4

Definition at line 56 of file ethernetutils.h.

◆ MAX_IPV4_HEADER_SIZE

#define MAX_IPV4_HEADER_SIZE   60

Definition at line 114 of file ethernetutils.h.

◆ MAX_TCP_HEADER_SIZE

#define MAX_TCP_HEADER_SIZE   60

Definition at line 115 of file ethernetutils.h.

◆ TCP_CHECKSUM_OFFSET

#define TCP_CHECKSUM_OFFSET   16

Definition at line 112 of file ethernetutils.h.

◆ UDP_CHECKSUM_OFFSET

#define UDP_CHECKSUM_OFFSET   6

Definition at line 113 of file ethernetutils.h.

Typedef Documentation

◆ eInspectedPacketType

◆ ETH_HEADER

◆ IPv4Header

◆ PETH_HEADER

◆ TCPHeader

◆ UDPHeader

Enumeration Type Documentation

◆ _tag_eInspectedPacketType

Enumerator
iptUnicast 
iptBroadcast 
iptMulticast 
iptInvalid 

Definition at line 67 of file ethernetutils.h.

68{
enum _tag_eInspectedPacketType eInspectedPacketType
@ iptUnicast
Definition: ethernetutils.h:69
@ iptMulticast
Definition: ethernetutils.h:71
@ iptBroadcast
Definition: ethernetutils.h:70
@ iptInvalid
Definition: ethernetutils.h:72

Function Documentation

◆ SetPriorityData()

static void FORCEINLINE SetPriorityData ( UCHAR pDest,
ULONG  priority,
ULONG  VlanID 
)
static

Definition at line 59 of file ethernetutils.h.

60{
61 pDest[0] = 0x81;
62 pDest[2] = (UCHAR)(priority << 5);
63 pDest[2] |= (UCHAR)(VlanID >> 8);
64 pDest[3] |= (UCHAR)VlanID;
65}
static int priority
Definition: timer.c:163
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by PrepareSendEntry().

◆ swap_short()

static __inline USHORT swap_short ( USHORT  us)
static

Definition at line 117 of file ethernetutils.h.

118{
119 return (us << 8) | (us >> 8);
120}
static const BYTE us[]
Definition: encode.c:689

Referenced by CalculateIpv4PseudoHeaderChecksum(), CalculateIpv6PseudoHeaderChecksum(), GetXxpHeaderAndPayloadLen(), ProcessUDPHeader(), and QualifyIpPacket().