pcap_parser/
linktype.rs

1use rusticata_macros::newtype_enum;
2
3/// Data link type
4///
5/// The link-layer header type specifies the type of headers at the beginning
6/// of the packet.
7///
8/// See <http://www.tcpdump.org/linktypes.html>
9#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10pub struct Linktype(pub i32);
11
12newtype_enum! {
13impl display Linktype {
14    NULL = 0,
15    ETHERNET = 1,
16
17    FDDI = 10,
18
19    RAW = 101,
20
21    LOOP = 108,
22    LINUX_SLL = 113,
23    LINUX_SLL2 = 276,
24
25    // Raw IPv4; the packet begins with an IPv4 header.
26    IPV4 = 228,
27    // Raw IPv6; the packet begins with an IPv6 header.
28    IPV6 = 229,
29
30    // Linux netlink NETLINK NFLOG socket log messages.
31    // Use the [`pcap_nflog`] module to access content.
32    NFLOG = 239,
33
34    //  Upper-layer protocol saves from Wireshark
35    WIRESHARK_UPPER_PDU = 252,
36}
37}