suricata
decode-ethernet.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2021 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Victor Julien <victor@inliniac.net>
22  */
23 
24 #ifndef SURICATA_DECODE_ETHERNET_H
25 #define SURICATA_DECODE_ETHERNET_H
26 
27 #define ETHERNET_HEADER_LEN 14
28 
29 /* Cisco Fabric Path / DCE header length. */
30 #define ETHERNET_DCE_HEADER_LEN (ETHERNET_HEADER_LEN + 2)
31 
32 /* Ethernet types -- taken from Snort and Libdnet */
33 #define ETHERNET_TYPE_PUP 0x0200 /* PUP protocol */
34 #define ETHERNET_TYPE_IP 0x0800
35 #define ETHERNET_TYPE_ARP 0x0806
36 #define ETHERNET_TYPE_BRIDGE 0x6558 /* transparent ethernet bridge (GRE) */
37 #define ETHERNET_TYPE_REVARP 0x8035
38 #define ETHERNET_TYPE_EAPOL 0x888e
39 #define ETHERNET_TYPE_IPV6 0x86dd
40 #define ETHERNET_TYPE_IPX 0x8137
41 #define ETHERNET_TYPE_PPPOE_DISC 0x8863 /* discovery stage */
42 #define ETHERNET_TYPE_PPPOE_SESS 0x8864 /* session stage */
43 #define ETHERNET_TYPE_8021AD 0x88a8
44 #define ETHERNET_TYPE_8021AH 0x88e7
45 #define ETHERNET_TYPE_8021Q 0x8100
46 #define ETHERNET_TYPE_LOOP 0x9000
47 #define ETHERNET_TYPE_8021QINQ 0x9100
48 #define ETHERNET_TYPE_ERSPAN 0x88BE
49 #define ETHERNET_TYPE_DCE 0x8903 /* Data center ethernet,
50  * Cisco Fabric Path */
51 #define ETHERNET_TYPE_NSH 0x894F
52 #define ETHERNET_TYPE_VNTAG 0x8926 /* 802.1Qbh */
53 
54 typedef struct EthernetHdr_ {
55  uint8_t eth_dst[6];
56  uint8_t eth_src[6];
57  uint16_t eth_type;
58 } __attribute__((__packed__)) EthernetHdr;
59 
61 
62 #endif /* SURICATA_DECODE_ETHERNET_H */
__attribute__
struct EthernetHdr_ __attribute__((__packed__)) EthernetHdr
DNP3 link header.
Definition: decode-vlan.c:103
EthernetHdr_::eth_type
uint16_t eth_type
Definition: decode-ethernet.h:56
EthernetHdr_
Definition: decode-ethernet.h:53
EthernetHdr_::eth_src
uint8_t eth_src[6]
Definition: decode-ethernet.h:55
EthernetHdr_::eth_dst
uint8_t eth_dst[6]
Definition: decode-ethernet.h:54
DecodeEthernetRegisterTests
void DecodeEthernetRegisterTests(void)
Registers Ethernet unit tests.
Definition: decode-ethernet.c:176