hdr.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
20 #include <inttypes.h>
21 
22 #include "byteorder.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #define ETHERNET_ADDR_LEN (6)
30 #ifndef ETH_ALEN
31 #define ETH_ALEN ETHERNET_ADDR_LEN
34 #endif
35 
39 typedef struct __attribute__((packed)) {
40  uint8_t dst[ETHERNET_ADDR_LEN];
41  uint8_t src[ETHERNET_ADDR_LEN];
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
Functions to work with different byte orders.
#define ETHERNET_ADDR_LEN
Length of an Ethernet address.
Definition: hdr.h:28
Adds include for missing inttype definitions.
Ethernet header.
Definition: hdr.h:39
network_uint16_t type
ether type (see Ether types)
Definition: hdr.h:42
A 16 bit integer in big endian aka network byte order.
Definition: byteorder.h:70