ReactOS 0.4.16-dev-258-g81860b4
ethernet.h File Reference
#include "lwip/arch.h"
#include "lwip/prot/ieee.h"
Include dependency graph for ethernet.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  eth_addr
 
struct  eth_hdr
 
struct  eth_vlan_hdr
 

Macros

#define ETH_HWADDR_LEN   6
 
#define ETH_ADDR(b0, b1, b2, b3, b4, b5)   {{b0, b1, b2, b3, b4, b5}}
 
#define SIZEOF_ETH_HDR   (14 + ETH_PAD_SIZE)
 
#define SIZEOF_VLAN_HDR   4
 
#define VLAN_ID(vlan_hdr)   (lwip_htons((vlan_hdr)->prio_vid) & 0xFFF)
 
#define LL_IP4_MULTICAST_ADDR_0   0x01
 
#define LL_IP4_MULTICAST_ADDR_1   0x00
 
#define LL_IP4_MULTICAST_ADDR_2   0x5e
 
#define LL_IP6_MULTICAST_ADDR_0   0x33
 
#define LL_IP6_MULTICAST_ADDR_1   0x33
 
#define eth_addr_cmp(addr1, addr2)   eth_addr_eq((addr1), (addr2))
 
#define eth_addr_eq(addr1, addr2)   (memcmp((addr1)->addr, (addr2)->addr, ETH_HWADDR_LEN) == 0)
 

Variables

PACK_STRUCT_BEGIN struct eth_addr PACK_STRUCT_STRUCT
 

Detailed Description

Ethernet protocol definitions

Definition in file ethernet.h.

Macro Definition Documentation

◆ ETH_ADDR

#define ETH_ADDR (   b0,
  b1,
  b2,
  b3,
  b4,
  b5 
)    {{b0, b1, b2, b3, b4, b5}}

Initialize a struct eth_addr with its 6 bytes (takes care of correct braces)

Definition at line 69 of file ethernet.h.

◆ eth_addr_cmp

#define eth_addr_cmp (   addr1,
  addr2 
)    eth_addr_eq((addr1), (addr2))

Definition at line 120 of file ethernet.h.

◆ eth_addr_eq

#define eth_addr_eq (   addr1,
  addr2 
)    (memcmp((addr1)->addr, (addr2)->addr, ETH_HWADDR_LEN) == 0)

Definition at line 121 of file ethernet.h.

◆ ETH_HWADDR_LEN

#define ETH_HWADDR_LEN   6

Definition at line 51 of file ethernet.h.

◆ LL_IP4_MULTICAST_ADDR_0

#define LL_IP4_MULTICAST_ADDR_0   0x01

The 24-bit IANA IPv4-multicast OUI is 01-00-5e:

Definition at line 111 of file ethernet.h.

◆ LL_IP4_MULTICAST_ADDR_1

#define LL_IP4_MULTICAST_ADDR_1   0x00

Definition at line 112 of file ethernet.h.

◆ LL_IP4_MULTICAST_ADDR_2

#define LL_IP4_MULTICAST_ADDR_2   0x5e

Definition at line 113 of file ethernet.h.

◆ LL_IP6_MULTICAST_ADDR_0

#define LL_IP6_MULTICAST_ADDR_0   0x33

IPv6 multicast uses this prefix

Definition at line 116 of file ethernet.h.

◆ LL_IP6_MULTICAST_ADDR_1

#define LL_IP6_MULTICAST_ADDR_1   0x33

Definition at line 117 of file ethernet.h.

◆ SIZEOF_ETH_HDR

#define SIZEOF_ETH_HDR   (14 + ETH_PAD_SIZE)

Definition at line 89 of file ethernet.h.

◆ SIZEOF_VLAN_HDR

#define SIZEOF_VLAN_HDR   4

Definition at line 107 of file ethernet.h.

◆ VLAN_ID

#define VLAN_ID (   vlan_hdr)    (lwip_htons((vlan_hdr)->prio_vid) & 0xFFF)

Definition at line 108 of file ethernet.h.

Variable Documentation

◆ PACK_STRUCT_STRUCT