eBPF for Windows
if_ether.h
Go to the documentation of this file.
1 // Copyright (c) eBPF for Windows contributors
2 // SPDX-License-Identifier: MIT
3 #pragma once
4 
5 typedef uint8_t mac_address_t[6];
6 
7 #define ETHERNET_TYPE_IPV4 0x0800
8 #define ETHERNET_TYPE_IPV6 0x86dd
9 
10 #if defined(_MSC_VER)
11 #pragma warning(push)
12 #pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
13 #endif
14 typedef struct _ETHERNET_HEADER
15 {
16  uint8_t Destination[6];
17  uint8_t Source[6];
18  union
19  {
20  uint16_t Type; // Ethernet
21  uint16_t Length; // IEEE 802
22  };
24 #if defined(_MSC_VER)
25 #pragma warning(pop)
26 #endif
27 
28 // Linux mappings for cross-platform eBPF programs.
29 #define h_proto Type
30 #define ethhdr _ETHERNET_HEADER
31 #define ETH_P_IP ETHERNET_TYPE_IPV4
struct _ETHERNET_HEADER ETHERNET_HEADER
struct _ETHERNET_HEADER * PETHERNET_HEADER
uint8_t mac_address_t[6]
Definition: if_ether.h:5
Definition: if_ether.h:15
uint8_t Source[6]
Definition: if_ether.h:17
uint8_t Destination[6]
Definition: if_ether.h:16
uint16_t Type
Definition: if_ether.h:20
uint16_t Length
Definition: if_ether.h:21