1 //--------------------------------------------------------------------------
2 // Copyright (C) 2014-2021 Cisco and/or its affiliates. All rights reserved.
3 //
4 // This program is free software; you can redistribute it and/or modify it
5 // under the terms of the GNU General Public License Version 2 as published
6 // by the Free Software Foundation.  You may not use, modify or distribute
7 // this program under any other version of the GNU General Public License.
8 //
9 // This program is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 // General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License along
15 // with this program; if not, write to the Free Software Foundation, Inc.,
16 // 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 //--------------------------------------------------------------------------
18 // linux_sll.h author Josh Rosenbaum <jrosenba@cisco.com>
19 
20 #ifndef PROTOCOLS_LINUX_SLL_H
21 #define PROTOCOLS_LINUX_SLL_H
22 
23 namespace snort
24 {
25 namespace linux_sll
26 {
27 /* 'Linux cooked captures' data
28  * (taken from tcpdump source).
29  */
30 
31 const uint8_t SLL_HDR_LEN = 16;
32 const uint8_t SLL_ADDRLEN = 8;
33 
34 struct SLLHdr
35 {
36     uint16_t sll_pkttype;              /* packet type */
37     uint16_t sll_hatype;               /* link-layer address type */
38     uint16_t sll_halen;                /* link-layer address length */
39     uint8_t sll_addr[SLL_ADDRLEN];             /* link-layer address */
40     uint16_t sll_protocol;             /* protocol */
41 };
42 
43 /*
44  * sll_pkttype values.
45  */
46 
47 #define LINUX_SLL_HOST          0
48 #define LINUX_SLL_BROADCAST     1
49 #define LINUX_SLL_MULTICAST     2
50 #define LINUX_SLL_OTHERHOST     3
51 #define LINUX_SLL_OUTGOING      4
52 
53 /* sll protocol values */
54 
55 #define LINUX_SLL_P_802_3       0x0001  /* Novell 802.3 frames without 802.2 LLC header */
56 #define LINUX_SLL_P_802_2       0x0004  /* 802.2 frames (not D/I/X Ethernet) */
57 } // namespace linux_sll
58 } // namespace snort
59 
60 #endif /* LINUX_SLL_H */
61 
62