DPDK
19.08.0-rc0
|
#include <stdint.h>
#include <stdio.h>
#include <rte_memcpy.h>
#include <rte_random.h>
#include <rte_mbuf.h>
#include <rte_byteorder.h>
Go to the source code of this file.
Data Structures | |
struct | rte_ether_addr |
struct | rte_ether_hdr |
struct | rte_vlan_hdr |
struct | rte_vxlan_hdr |
struct | rte_vxlan_gpe_hdr |
Functions | |
static int | rte_is_same_ether_addr (const struct rte_ether_addr *ea1, const struct rte_ether_addr *ea2) |
static int | rte_is_zero_ether_addr (const struct rte_ether_addr *ea) |
static int | rte_is_unicast_ether_addr (const struct rte_ether_addr *ea) |
static int | rte_is_multicast_ether_addr (const struct rte_ether_addr *ea) |
static int | rte_is_broadcast_ether_addr (const struct rte_ether_addr *ea) |
static int | rte_is_universal_ether_addr (const struct rte_ether_addr *ea) |
static int | rte_is_local_admin_ether_addr (const struct rte_ether_addr *ea) |
static int | rte_is_valid_assigned_ether_addr (const struct rte_ether_addr *ea) |
static void | rte_eth_random_addr (uint8_t *addr) |
static void | rte_ether_addr_copy (const struct rte_ether_addr *ea_from, struct rte_ether_addr *ea_to) |
static void | rte_ether_format_addr (char *buf, uint16_t size, const struct rte_ether_addr *eth_addr) |
static int | rte_vlan_strip (struct rte_mbuf *m) |
static int | rte_vlan_insert (struct rte_mbuf **m) |
Ethernet Helpers in RTE
Definition in file rte_ether.h.
#define RTE_ETHER_ADDR_LEN 6 |
Length of Ethernet address.
Definition at line 26 of file rte_ether.h.
#define RTE_ETHER_TYPE_LEN 2 |
Length of Ethernet type field.
Definition at line 27 of file rte_ether.h.
#define RTE_ETHER_CRC_LEN 4 |
Length of Ethernet CRC.
Definition at line 28 of file rte_ether.h.
#define RTE_ETHER_HDR_LEN |
Length of Ethernet header.
Definition at line 29 of file rte_ether.h.
#define RTE_ETHER_MIN_LEN 64 |
Minimum frame len, including CRC.
Definition at line 32 of file rte_ether.h.
#define RTE_ETHER_MAX_LEN 1518 |
Maximum frame len, including CRC.
Definition at line 33 of file rte_ether.h.
#define RTE_ETHER_MTU |
#define RTE_ETHER_MAX_VLAN_FRAME_LEN (RTE_ETHER_MAX_LEN + 4) |
Maximum VLAN frame length, including CRC.
Definition at line 38 of file rte_ether.h.
#define RTE_ETHER_MAX_JUMBO_FRAME_LEN 0x3F00 |
Maximum Jumbo frame length, including CRC.
Definition at line 42 of file rte_ether.h.
#define RTE_ETHER_MAX_VLAN_ID 4095 |
Maximum VLAN ID.
Definition at line 45 of file rte_ether.h.
#define RTE_ETHER_MIN_MTU 68 |
Minimum MTU for IPv4 packets, see RFC 791.
Definition at line 47 of file rte_ether.h.
#define RTE_ETHER_LOCAL_ADMIN_ADDR 0x02 |
Locally assigned Eth. address.
Definition at line 64 of file rte_ether.h.
#define RTE_ETHER_GROUP_ADDR 0x01 |
Multicast or broadcast Eth. address.
Definition at line 65 of file rte_ether.h.
#define RTE_ETHER_TYPE_IPV4 0x0800 |
IPv4 Protocol.
Definition at line 301 of file rte_ether.h.
#define RTE_ETHER_TYPE_IPV6 0x86DD |
IPv6 Protocol.
Definition at line 302 of file rte_ether.h.
#define RTE_ETHER_TYPE_ARP 0x0806 |
#define RTE_ETHER_TYPE_RARP 0x8035 |
Reverse Arp Protocol.
Definition at line 304 of file rte_ether.h.
#define RTE_ETHER_TYPE_VLAN 0x8100 |
IEEE 802.1Q VLAN tagging.
Definition at line 305 of file rte_ether.h.
#define RTE_ETHER_TYPE_QINQ 0x88A8 |
IEEE 802.1ad QinQ tagging.
Definition at line 306 of file rte_ether.h.
#define ETHER_TYPE_PPPOE_DISCOVERY 0x8863 |
PPPoE Discovery Stage.
Definition at line 307 of file rte_ether.h.
#define ETHER_TYPE_PPPOE_SESSION 0x8864 |
PPPoE Session Stage.
Definition at line 308 of file rte_ether.h.
#define RTE_ETHER_TYPE_ETAG 0x893F |
IEEE 802.1BR E-Tag.
Definition at line 309 of file rte_ether.h.
#define RTE_ETHER_TYPE_1588 0x88F7 |
IEEE 802.1AS 1588 Precise Time Protocol.
Definition at line 310 of file rte_ether.h.
#define RTE_ETHER_TYPE_SLOW 0x8809 |
Slow protocols (LACP and Marker).
Definition at line 312 of file rte_ether.h.
#define RTE_ETHER_TYPE_TEB 0x6558 |
Transparent Ethernet Bridging.
Definition at line 313 of file rte_ether.h.
#define RTE_ETHER_TYPE_LLDP 0x88CC |
LLDP Protocol.
Definition at line 314 of file rte_ether.h.
#define RTE_ETHER_TYPE_MPLS 0x8847 |
MPLS ethertype.
Definition at line 315 of file rte_ether.h.
#define RTE_ETHER_TYPE_MPLSM 0x8848 |
MPLS multicast ethertype.
Definition at line 316 of file rte_ether.h.
#define RTE_ETHER_VXLAN_HLEN (sizeof(struct rte_udp_hdr) + sizeof(struct rte_vxlan_hdr)) |
VXLAN tunnel header length.
Definition at line 318 of file rte_ether.h.
#define RTE_VXLAN_GPE_TYPE_IPV4 1 |
IPv4 Protocol.
Definition at line 335 of file rte_ether.h.
#define RTE_VXLAN_GPE_TYPE_IPV6 2 |
IPv6 Protocol.
Definition at line 336 of file rte_ether.h.
#define RTE_VXLAN_GPE_TYPE_ETH 3 |
Ethernet Protocol.
Definition at line 337 of file rte_ether.h.
#define RTE_VXLAN_GPE_TYPE_NSH 4 |
NSH Protocol.
Definition at line 338 of file rte_ether.h.
#define RTE_VXLAN_GPE_TYPE_MPLS 5 |
MPLS Protocol.
Definition at line 339 of file rte_ether.h.
#define RTE_VXLAN_GPE_TYPE_GBP 6 |
GBP Protocol.
Definition at line 340 of file rte_ether.h.
#define RTE_VXLAN_GPE_TYPE_VBNG 7 |
vBNG Protocol.
Definition at line 341 of file rte_ether.h.
#define RTE_ETHER_VXLAN_GPE_HLEN |
VXLAN-GPE tunnel header length.
Definition at line 343 of file rte_ether.h.
|
inlinestatic |
Check if two Ethernet addresses are the same.
ea1 | A pointer to the first ether_addr structure containing the ethernet address. |
ea2 | A pointer to the second ether_addr structure containing the ethernet address. |
Definition at line 81 of file rte_ether.h.
|
inlinestatic |
Check if an Ethernet address is filled with zeros.
ea | A pointer to a ether_addr structure containing the ethernet address to check. |
Definition at line 101 of file rte_ether.h.
|
inlinestatic |
Check if an Ethernet address is a unicast address.
ea | A pointer to a ether_addr structure containing the ethernet address to check. |
Definition at line 120 of file rte_ether.h.
|
inlinestatic |
Check if an Ethernet address is a multicast address.
ea | A pointer to a ether_addr structure containing the ethernet address to check. |
Definition at line 135 of file rte_ether.h.
|
inlinestatic |
Check if an Ethernet address is a broadcast address.
ea | A pointer to a ether_addr structure containing the ethernet address to check. |
Definition at line 150 of file rte_ether.h.
|
inlinestatic |
Check if an Ethernet address is a universally assigned address.
ea | A pointer to a ether_addr structure containing the ethernet address to check. |
Definition at line 168 of file rte_ether.h.
|
inlinestatic |
Check if an Ethernet address is a locally assigned address.
ea | A pointer to a ether_addr structure containing the ethernet address to check. |
Definition at line 183 of file rte_ether.h.
|
inlinestatic |
Check if an Ethernet address is a valid address. Checks that the address is a unicast address and is not filled with zeros.
ea | A pointer to a ether_addr structure containing the ethernet address to check. |
Definition at line 199 of file rte_ether.h.
|
inlinestatic |
Generate a random Ethernet address that is locally administered and not multicast.
addr | A pointer to Ethernet address. |
Definition at line 210 of file rte_ether.h.
|
inlinestatic |
Fast copy an Ethernet address.
ea_from | A pointer to a ether_addr structure holding the Ethernet address to copy. |
ea_to | A pointer to a ether_addr structure where to copy the Ethernet address. |
Definition at line 228 of file rte_ether.h.
|
inlinestatic |
Format 48bits Ethernet address in pattern xx:xx:xx:xx:xx:xx.
buf | A pointer to buffer contains the formatted MAC address. |
size | The format buffer size. |
eth_addr | A pointer to a ether_addr structure. |
Definition at line 258 of file rte_ether.h.
|
inlinestatic |
Extract VLAN tag information into mbuf
Software version of VLAN stripping
m | The packet mbuf. |
Definition at line 358 of file rte_ether.h.
|
inlinestatic |
Insert VLAN tag into mbuf.
Software version of VLAN unstripping
m | The packet mbuf. |
Definition at line 390 of file rte_ether.h.