The friendly Operating System for the Internet of Things
ethernet/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 
22 #ifndef ETHERNET_HDR_H
23 #define ETHERNET_HDR_H
24 
25 #include <inttypes.h>
26 
27 #include "byteorder.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #define ETHERNET_ADDR_LEN (6)
35 #ifndef ETH_ALEN
36 #define ETH_ALEN ETHERNET_ADDR_LEN
39 #endif
40 
44 typedef struct __attribute__((packed)) {
45  uint8_t dst[ETHERNET_ADDR_LEN];
46  uint8_t src[ETHERNET_ADDR_LEN];
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 
54 #endif /* ETHERNET_HDR_H */
55 
A 16 bit integer in big endian aka network byte order.
Definition: byteorder.h:76
Ethernet header.
Definition: ethernet/hdr.h:46
#define ETHERNET_ADDR_LEN
Length of an Ethernet address.
Definition: ethernet/hdr.h:33
Functions to work with different byte orders.
Adds include for missing inttype definitions.