hdr.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for
6  * more details.
7  */
8 
9 #pragma once
10 
23 #include <inttypes.h>
24 
25 #include "byteorder.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #define ETHERNET_ADDR_LEN (6)
33 #ifndef ETH_ALEN
34 #define ETH_ALEN ETHERNET_ADDR_LEN
37 #endif
38 
42 typedef struct __attribute__((packed)) {
43  uint8_t dst[ETHERNET_ADDR_LEN];
44  uint8_t src[ETHERNET_ADDR_LEN];
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
Functions to work with different byte orders.
#define ETHERNET_ADDR_LEN
Length of an Ethernet address.
Definition: hdr.h:31
Adds include for missing inttype definitions.
Ethernet header.
Definition: hdr.h:42
network_uint16_t type
ether type (see Ether types)
Definition: hdr.h:45
A 16 bit integer in big endian aka network byte order.
Definition: byteorder.h:73