ConOpSys V2970  P004.07
ANVILEX control operating system
Classes | Macros | Variables
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)   (memcmp((addr1)->addr, (addr2)->addr, ETH_HWADDR_LEN) == 0)
 

Variables

PACK_STRUCT_BEGIN struct eth_addr PACK_STRUCT_STRUCT
 

Detailed Description

Ethernet protocol definitions

Macro Definition Documentation

◆ ETH_ADDR

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

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

◆ eth_addr_cmp

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

◆ ETH_HWADDR_LEN

#define ETH_HWADDR_LEN   6

◆ LL_IP4_MULTICAST_ADDR_0

#define LL_IP4_MULTICAST_ADDR_0   0x01

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

◆ LL_IP4_MULTICAST_ADDR_1

#define LL_IP4_MULTICAST_ADDR_1   0x00

◆ LL_IP4_MULTICAST_ADDR_2

#define LL_IP4_MULTICAST_ADDR_2   0x5e

◆ LL_IP6_MULTICAST_ADDR_0

#define LL_IP6_MULTICAST_ADDR_0   0x33

IPv6 multicast uses this prefix

◆ LL_IP6_MULTICAST_ADDR_1

#define LL_IP6_MULTICAST_ADDR_1   0x33

◆ SIZEOF_ETH_HDR

#define SIZEOF_ETH_HDR   (14 + ETH_PAD_SIZE)

◆ SIZEOF_VLAN_HDR

#define SIZEOF_VLAN_HDR   4

◆ VLAN_ID

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

Variable Documentation

◆ PACK_STRUCT_STRUCT

PACK_STRUCT_BEGIN struct eth_vlan_hdr PACK_STRUCT_STRUCT