Loading...
Searching...
No Matches
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
21#ifndef NET_ETHERNET_HDR_H
22#define NET_ETHERNET_HDR_H
23
24#include <inttypes.h>
25
26#include "byteorder.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#define ETHERNET_ADDR_LEN (6)
34#ifndef ETH_ALEN
35#define ETH_ALEN ETHERNET_ADDR_LEN
38#endif
39
43typedef struct __attribute__((packed)) {
44 uint8_t dst[ETHERNET_ADDR_LEN];
45 uint8_t src[ETHERNET_ADDR_LEN];
48
49#ifdef __cplusplus
50}
51#endif
52
53#endif /* NET_ETHERNET_HDR_H */
Functions to work with different byte orders.
#define ETHERNET_ADDR_LEN
Length of an Ethernet address.
Definition hdr.h:32
Adds include for missing inttype definitions.
Ethernet header.
Definition hdr.h:43
network_uint16_t type
ether type (see Ether types)
Definition hdr.h:46
A 16 bit integer in big endian aka network byte order.
Definition byteorder.h:74