The Pedigree Project 0.1
Classes | Macros | Enumerations | Variables
ethernet.h File Reference
#include "lwip/arch.h"
+ Include dependency graph for lwip/prot/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 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 ETHADDR32_COPY(dst, src)   SMEMCPY(dst, src, ETH_HWADDR_LEN)
 
#define ETHADDR16_COPY(dst, src)   SMEMCPY(dst, src, ETH_HWADDR_LEN)
 
#define eth_addr_cmp(addr1, addr2)   (memcmp((addr1)->addr, (addr2)->addr, ETH_HWADDR_LEN) == 0)
 

Enumerations

enum  eth_type {
  ETHTYPE_IP = 0x0800U , ETHTYPE_ARP = 0x0806U , ETHTYPE_WOL = 0x0842U , ETHTYPE_RARP = 0x8035U ,
  ETHTYPE_VLAN = 0x8100U , ETHTYPE_IPV6 = 0x86DDU , ETHTYPE_PPPOEDISC = 0x8863U , ETHTYPE_PPPOE = 0x8864U ,
  ETHTYPE_JUMBO = 0x8870U , ETHTYPE_PROFINET = 0x8892U , ETHTYPE_ETHERCAT = 0x88A4U , ETHTYPE_LLDP = 0x88CCU ,
  ETHTYPE_SERCOS = 0x88CDU , ETHTYPE_MRP = 0x88E3U , ETHTYPE_PTP = 0x88F7U , ETHTYPE_QINQ = 0x9100U
}
 

Variables

PACK_STRUCT_BEGIN struct eth_addr PACK_STRUCT_STRUCT
 

Detailed Description

Ethernet protocol definitions

Definition in file lwip/prot/ethernet.h.

Macro Definition Documentation

◆ eth_addr_cmp

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

Definition at line 183 of file lwip/prot/ethernet.h.

◆ ETH_HWADDR_LEN

#define ETH_HWADDR_LEN   6

Definition at line 69 of file lwip/prot/ethernet.h.

◆ ETHADDR16_COPY

#define ETHADDR16_COPY (   dst,
  src 
)    SMEMCPY(dst, src, ETH_HWADDR_LEN)

MEMCPY-like macro to copy to/from struct eth_addr's that are no local variables and known to be 16-bit aligned within the protocol header.

Definition at line 180 of file lwip/prot/ethernet.h.

◆ ETHADDR32_COPY

#define ETHADDR32_COPY (   dst,
  src 
)    SMEMCPY(dst, src, ETH_HWADDR_LEN)

MEMCPY-like macro to copy to/from struct eth_addr's that are local variables or known to be 32-bit aligned within the protocol header.

Definition at line 174 of file lwip/prot/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 163 of file lwip/prot/ethernet.h.

◆ LL_IP4_MULTICAST_ADDR_1

#define LL_IP4_MULTICAST_ADDR_1   0x00

Definition at line 164 of file lwip/prot/ethernet.h.

◆ LL_IP4_MULTICAST_ADDR_2

#define LL_IP4_MULTICAST_ADDR_2   0x5e

Definition at line 165 of file lwip/prot/ethernet.h.

◆ LL_IP6_MULTICAST_ADDR_0

#define LL_IP6_MULTICAST_ADDR_0   0x33

IPv6 multicast uses this prefix

Definition at line 168 of file lwip/prot/ethernet.h.

◆ LL_IP6_MULTICAST_ADDR_1

#define LL_IP6_MULTICAST_ADDR_1   0x33

Definition at line 169 of file lwip/prot/ethernet.h.

◆ SIZEOF_ETH_HDR

#define SIZEOF_ETH_HDR   (14 + ETH_PAD_SIZE)

Definition at line 103 of file lwip/prot/ethernet.h.

◆ SIZEOF_VLAN_HDR

#define SIZEOF_VLAN_HDR   4

Definition at line 121 of file lwip/prot/ethernet.h.

◆ VLAN_ID

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

Definition at line 122 of file lwip/prot/ethernet.h.