libpcap  1.10.1
About: libpcap is a packet filter library used by tools like tcpdump.
  Fossies Dox: libpcap-1.10.1.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pcap-common.c File Reference
#include <pcap-types.h>
#include "pcap-int.h"
#include "extract.h"
#include "pcap/sll.h"
#include "pcap/usb.h"
#include "pcap/nflog.h"
#include "pcap/can_socketcan.h"
#include "pcap-common.h"
Include dependency graph for pcap-common.c:

Go to the source code of this file.

Data Structures

struct  linktype_map
 

Macros

#define LINKTYPE_NULL   DLT_NULL
 
#define LINKTYPE_ETHERNET   DLT_EN10MB /* also for 100Mb and up */
 
#define LINKTYPE_EXP_ETHERNET   DLT_EN3MB /* 3Mb experimental Ethernet */
 
#define LINKTYPE_AX25   DLT_AX25
 
#define LINKTYPE_PRONET   DLT_PRONET
 
#define LINKTYPE_CHAOS   DLT_CHAOS
 
#define LINKTYPE_IEEE802_5   DLT_IEEE802 /* DLT_IEEE802 is used for 802.5 Token Ring */
 
#define LINKTYPE_ARCNET_BSD   DLT_ARCNET /* BSD-style headers */
 
#define LINKTYPE_SLIP   DLT_SLIP
 
#define LINKTYPE_PPP   DLT_PPP
 
#define LINKTYPE_FDDI   DLT_FDDI
 
#define LINKTYPE_PPP_HDLC   50 /* PPP in HDLC-like framing */
 
#define LINKTYPE_PPP_ETHER   51 /* NetBSD PPP-over-Ethernet */
 
#define LINKTYPE_SYMANTEC_FIREWALL   99 /* Symantec Enterprise Firewall */
 
#define LINKTYPE_ATM_RFC1483   100 /* LLC/SNAP-encapsulated ATM */
 
#define LINKTYPE_RAW   101 /* raw IP */
 
#define LINKTYPE_SLIP_BSDOS   102 /* BSD/OS SLIP BPF header */
 
#define LINKTYPE_PPP_BSDOS   103 /* BSD/OS PPP BPF header */
 
#define LINKTYPE_MATCHING_MIN   104 /* lowest value in the "matching" range */
 
#define LINKTYPE_C_HDLC   104 /* Cisco HDLC */
 
#define LINKTYPE_IEEE802_11   105 /* IEEE 802.11 (wireless) */
 
#define LINKTYPE_ATM_CLIP   106 /* Linux Classical IP over ATM */
 
#define LINKTYPE_FRELAY   107 /* Frame Relay */
 
#define LINKTYPE_LOOP   108 /* OpenBSD loopback */
 
#define LINKTYPE_ENC   109 /* OpenBSD IPSEC enc */
 
#define LINKTYPE_LANE8023   110 /* ATM LANE + 802.3 */
 
#define LINKTYPE_HIPPI   111 /* NetBSD HIPPI */
 
#define LINKTYPE_HDLC   112 /* NetBSD HDLC framing */
 
#define LINKTYPE_LINUX_SLL   113 /* Linux cooked socket capture */
 
#define LINKTYPE_LTALK   114 /* Apple LocalTalk hardware */
 
#define LINKTYPE_ECONET   115 /* Acorn Econet */
 
#define LINKTYPE_IPFILTER   116
 
#define LINKTYPE_PFLOG   117 /* OpenBSD DLT_PFLOG */
 
#define LINKTYPE_CISCO_IOS   118 /* For Cisco-internal use */
 
#define LINKTYPE_IEEE802_11_PRISM   119 /* 802.11 plus Prism II monitor mode radio metadata header */
 
#define LINKTYPE_IEEE802_11_AIRONET   120 /* 802.11 plus FreeBSD Aironet driver radio metadata header */
 
#define LINKTYPE_HHDLC   121
 
#define LINKTYPE_IP_OVER_FC   122 /* RFC 2625 IP-over-Fibre Channel */
 
#define LINKTYPE_SUNATM   123 /* Solaris+SunATM */
 
#define LINKTYPE_RIO   124 /* RapidIO */
 
#define LINKTYPE_PCI_EXP   125 /* PCI Express */
 
#define LINKTYPE_AURORA   126 /* Xilinx Aurora link layer */
 
#define LINKTYPE_IEEE802_11_RADIOTAP   127 /* 802.11 plus radiotap radio metadata header */
 
#define LINKTYPE_TZSP   128 /* Tazmen Sniffer Protocol */
 
#define LINKTYPE_ARCNET_LINUX   129 /* Linux-style headers */
 
#define LINKTYPE_JUNIPER_MLPPP   130
 
#define LINKTYPE_JUNIPER_MLFR   131
 
#define LINKTYPE_JUNIPER_ES   132
 
#define LINKTYPE_JUNIPER_GGSN   133
 
#define LINKTYPE_JUNIPER_MFR   134
 
#define LINKTYPE_JUNIPER_ATM2   135
 
#define LINKTYPE_JUNIPER_SERVICES   136
 
#define LINKTYPE_JUNIPER_ATM1   137
 
#define LINKTYPE_APPLE_IP_OVER_IEEE1394   138 /* Apple IP-over-IEEE 1394 cooked header */
 
#define LINKTYPE_MTP2_WITH_PHDR   139
 
#define LINKTYPE_MTP2   140
 
#define LINKTYPE_MTP3   141
 
#define LINKTYPE_SCCP   142
 
#define LINKTYPE_DOCSIS   143 /* DOCSIS MAC frames */
 
#define LINKTYPE_LINUX_IRDA   144 /* Linux-IrDA */
 
#define LINKTYPE_IBM_SP   145
 
#define LINKTYPE_IBM_SN   146
 
#define LINKTYPE_USER0   147
 
#define LINKTYPE_USER1   148
 
#define LINKTYPE_USER2   149
 
#define LINKTYPE_USER3   150
 
#define LINKTYPE_USER4   151
 
#define LINKTYPE_USER5   152
 
#define LINKTYPE_USER6   153
 
#define LINKTYPE_USER7   154
 
#define LINKTYPE_USER8   155
 
#define LINKTYPE_USER9   156
 
#define LINKTYPE_USER10   157
 
#define LINKTYPE_USER11   158
 
#define LINKTYPE_USER12   159
 
#define LINKTYPE_USER13   160
 
#define LINKTYPE_USER14   161
 
#define LINKTYPE_USER15   162
 
#define LINKTYPE_IEEE802_11_AVS   163 /* 802.11 plus AVS radio metadata header */
 
#define LINKTYPE_JUNIPER_MONITOR   164
 
#define LINKTYPE_BACNET_MS_TP   165
 
#define LINKTYPE_PPP_PPPD   166
 
#define LINKTYPE_JUNIPER_PPPOE   167
 
#define LINKTYPE_JUNIPER_PPPOE_ATM   168
 
#define LINKTYPE_GPRS_LLC   169 /* GPRS LLC */
 
#define LINKTYPE_GPF_T   170 /* GPF-T (ITU-T G.7041/Y.1303) */
 
#define LINKTYPE_GPF_F   171 /* GPF-F (ITU-T G.7041/Y.1303) */
 
#define LINKTYPE_GCOM_T1E1   172
 
#define LINKTYPE_GCOM_SERIAL   173
 
#define LINKTYPE_JUNIPER_PIC_PEER   174
 
#define LINKTYPE_ERF_ETH   175 /* Ethernet */
 
#define LINKTYPE_ERF_POS   176 /* Packet-over-SONET */
 
#define LINKTYPE_LINUX_LAPD   177
 
#define LINKTYPE_JUNIPER_ETHER   178
 
#define LINKTYPE_JUNIPER_PPP   179
 
#define LINKTYPE_JUNIPER_FRELAY   180
 
#define LINKTYPE_JUNIPER_CHDLC   181
 
#define LINKTYPE_MFR   182
 
#define LINKTYPE_JUNIPER_VP   183
 
#define LINKTYPE_A429   184
 
#define LINKTYPE_A653_ICM   185
 
#define LINKTYPE_USB_FREEBSD   186
 
#define LINKTYPE_BLUETOOTH_HCI_H4   187
 
#define LINKTYPE_IEEE802_16_MAC_CPS   188
 
#define LINKTYPE_USB_LINUX   189
 
#define LINKTYPE_CAN20B   190
 
#define LINKTYPE_IEEE802_15_4_LINUX   191
 
#define LINKTYPE_PPI   192
 
#define LINKTYPE_IEEE802_16_MAC_CPS_RADIO   193
 
#define LINKTYPE_JUNIPER_ISM   194
 
#define LINKTYPE_IEEE802_15_4_WITHFCS   195
 
#define LINKTYPE_SITA   196
 
#define LINKTYPE_ERF   197
 
#define LINKTYPE_RAIF1   198
 
#define LINKTYPE_IPMB_KONTRON   199
 
#define LINKTYPE_JUNIPER_ST   200
 
#define LINKTYPE_BLUETOOTH_HCI_H4_WITH_PHDR   201
 
#define LINKTYPE_AX25_KISS   202
 
#define LINKTYPE_LAPD   203
 
#define LINKTYPE_PPP_WITH_DIR   204 /* Don't confuse with LINKTYPE_PPP_PPPD */
 
#define LINKTYPE_C_HDLC_WITH_DIR   205 /* Cisco HDLC */
 
#define LINKTYPE_FRELAY_WITH_DIR   206 /* Frame Relay */
 
#define LINKTYPE_LAPB_WITH_DIR   207 /* LAPB */
 
#define LINKTYPE_IPMB_LINUX   209
 
#define LINKTYPE_FLEXRAY   210
 
#define LINKTYPE_MOST   211
 
#define LINKTYPE_LIN   212
 
#define LINKTYPE_X2E_SERIAL   213
 
#define LINKTYPE_X2E_XORAYA   214
 
#define LINKTYPE_IEEE802_15_4_NONASK_PHY   215
 
#define LINKTYPE_LINUX_EVDEV   216
 
#define LINKTYPE_GSMTAP_UM   217
 
#define LINKTYPE_GSMTAP_ABIS   218
 
#define LINKTYPE_MPLS   219
 
#define LINKTYPE_USB_LINUX_MMAPPED   220
 
#define LINKTYPE_DECT   221
 
#define LINKTYPE_AOS   222
 
#define LINKTYPE_WIHART   223
 
#define LINKTYPE_FC_2   224
 
#define LINKTYPE_FC_2_WITH_FRAME_DELIMS   225
 
#define LINKTYPE_IPNET   226
 
#define LINKTYPE_CAN_SOCKETCAN   227
 
#define LINKTYPE_IPV4   228
 
#define LINKTYPE_IPV6   229
 
#define LINKTYPE_IEEE802_15_4_NOFCS   230
 
#define LINKTYPE_DBUS   231
 
#define LINKTYPE_JUNIPER_VS   232
 
#define LINKTYPE_JUNIPER_SRX_E2E   233
 
#define LINKTYPE_JUNIPER_FIBRECHANNEL   234
 
#define LINKTYPE_DVB_CI   235
 
#define LINKTYPE_MUX27010   236
 
#define LINKTYPE_STANAG_5066_D_PDU   237
 
#define LINKTYPE_JUNIPER_ATM_CEMIC   238
 
#define LINKTYPE_NFLOG   239
 
#define LINKTYPE_NETANALYZER   240
 
#define LINKTYPE_NETANALYZER_TRANSPARENT   241
 
#define LINKTYPE_IPOIB   242
 
#define LINKTYPE_MPEG_2_TS   243
 
#define LINKTYPE_NG40   244
 
#define LINKTYPE_NFC_LLCP   245
 
#define LINKTYPE_PFSYNC   246
 
#define LINKTYPE_INFINIBAND   247
 
#define LINKTYPE_SCTP   248
 
#define LINKTYPE_USBPCAP   249
 
#define LINKTYPE_RTAC_SERIAL   250
 
#define LINKTYPE_BLUETOOTH_LE_LL   251
 
#define LINKTYPE_WIRESHARK_UPPER_PDU   252
 
#define LINKTYPE_NETLINK   253
 
#define LINKTYPE_BLUETOOTH_LINUX_MONITOR   254
 
#define LINKTYPE_BLUETOOTH_BREDR_BB   255
 
#define LINKTYPE_BLUETOOTH_LE_LL_WITH_PHDR   256
 
#define LINKTYPE_PROFIBUS_DL   257
 
#define LINKTYPE_PKTAP   258
 
#define LINKTYPE_EPON   259
 
#define LINKTYPE_IPMI_HPM_2   260
 
#define LINKTYPE_ZWAVE_R1_R2   261
 
#define LINKTYPE_ZWAVE_R3   262
 
#define LINKTYPE_WATTSTOPPER_DLM   263
 
#define LINKTYPE_ISO_14443   264
 
#define LINKTYPE_RDS   265
 
#define LINKTYPE_USB_DARWIN   266
 
#define LINKTYPE_OPENFLOW   267
 
#define LINKTYPE_SDLC   268
 
#define LINKTYPE_TI_LLN_SNIFFER   269
 
#define LINKTYPE_LORATAP   270
 
#define LINKTYPE_VSOCK   271
 
#define LINKTYPE_NORDIC_BLE   272
 
#define LINKTYPE_DOCSIS31_XRA31   273
 
#define LINKTYPE_ETHERNET_MPACKET   274
 
#define LINKTYPE_DISPLAYPORT_AUX   275
 
#define LINKTYPE_LINUX_SLL2   276
 
#define LINKTYPE_SERCOS_MONITOR   277
 
#define LINKTYPE_OPENVIZSLA   278
 
#define LINKTYPE_EBHSCR   279
 
#define LINKTYPE_VPP_DISPATCH   280
 
#define LINKTYPE_DSA_TAG_BRCM   281
 
#define LINKTYPE_DSA_TAG_BRCM_PREPEND   282
 
#define LINKTYPE_IEEE802_15_4_TAP   283
 
#define LINKTYPE_DSA_TAG_DSA   284
 
#define LINKTYPE_DSA_TAG_EDSA   285
 
#define LINKTYPE_ELEE   286
 
#define LINKTYPE_Z_WAVE_SERIAL   287
 
#define LINKTYPE_USB_2_0   288
 
#define LINKTYPE_ATSC_ALP   289
 
#define LINKTYPE_MATCHING_MAX   289 /* highest value in the "matching" range */
 

Functions

int dlt_to_linktype (int dlt)
 
int linktype_to_dlt (int linktype)
 
u_int max_snaplen_for_dlt (int dlt)
 
static void swap_linux_sll_header (const struct pcap_pkthdr *hdr, u_char *buf)
 
static void swap_linux_usb_header (const struct pcap_pkthdr *hdr, u_char *buf, int header_len_64_bytes)
 
static void swap_nflog_header (const struct pcap_pkthdr *hdr, u_char *buf)
 
void swap_pseudo_headers (int linktype, struct pcap_pkthdr *hdr, u_char *data)
 

Variables

static struct linktype_map map []
 

Macro Definition Documentation

◆ LINKTYPE_A429

#define LINKTYPE_A429   184

Definition at line 410 of file pcap-common.c.

◆ LINKTYPE_A653_ICM

#define LINKTYPE_A653_ICM   185

Definition at line 417 of file pcap-common.c.

◆ LINKTYPE_AOS

#define LINKTYPE_AOS   222

Definition at line 689 of file pcap-common.c.

◆ LINKTYPE_APPLE_IP_OVER_IEEE1394

#define LINKTYPE_APPLE_IP_OVER_IEEE1394   138 /* Apple IP-over-IEEE 1394 cooked header */

Definition at line 236 of file pcap-common.c.

◆ LINKTYPE_ARCNET_BSD

#define LINKTYPE_ARCNET_BSD   DLT_ARCNET /* BSD-style headers */

Definition at line 114 of file pcap-common.c.

◆ LINKTYPE_ARCNET_LINUX

#define LINKTYPE_ARCNET_LINUX   129 /* Linux-style headers */

Definition at line 219 of file pcap-common.c.

◆ LINKTYPE_ATM_CLIP

#define LINKTYPE_ATM_CLIP   106 /* Linux Classical IP over ATM */

Definition at line 165 of file pcap-common.c.

◆ LINKTYPE_ATM_RFC1483

#define LINKTYPE_ATM_RFC1483   100 /* LLC/SNAP-encapsulated ATM */

Definition at line 146 of file pcap-common.c.

◆ LINKTYPE_ATSC_ALP

#define LINKTYPE_ATSC_ALP   289

Definition at line 1192 of file pcap-common.c.

◆ LINKTYPE_AURORA

#define LINKTYPE_AURORA   126 /* Xilinx Aurora link layer */

Definition at line 205 of file pcap-common.c.

◆ LINKTYPE_AX25

#define LINKTYPE_AX25   DLT_AX25

Definition at line 110 of file pcap-common.c.

◆ LINKTYPE_AX25_KISS

#define LINKTYPE_AX25_KISS   202

Definition at line 552 of file pcap-common.c.

◆ LINKTYPE_BACNET_MS_TP

#define LINKTYPE_BACNET_MS_TP   165

Definition at line 316 of file pcap-common.c.

◆ LINKTYPE_BLUETOOTH_BREDR_BB

#define LINKTYPE_BLUETOOTH_BREDR_BB   255

Definition at line 983 of file pcap-common.c.

◆ LINKTYPE_BLUETOOTH_HCI_H4

#define LINKTYPE_BLUETOOTH_HCI_H4   187

Definition at line 436 of file pcap-common.c.

◆ LINKTYPE_BLUETOOTH_HCI_H4_WITH_PHDR

#define LINKTYPE_BLUETOOTH_HCI_H4_WITH_PHDR   201

Definition at line 543 of file pcap-common.c.

◆ LINKTYPE_BLUETOOTH_LE_LL

#define LINKTYPE_BLUETOOTH_LE_LL   251

Definition at line 954 of file pcap-common.c.

◆ LINKTYPE_BLUETOOTH_LE_LL_WITH_PHDR

#define LINKTYPE_BLUETOOTH_LE_LL_WITH_PHDR   256

Definition at line 988 of file pcap-common.c.

◆ LINKTYPE_BLUETOOTH_LINUX_MONITOR

#define LINKTYPE_BLUETOOTH_LINUX_MONITOR   254

Definition at line 977 of file pcap-common.c.

◆ LINKTYPE_C_HDLC

#define LINKTYPE_C_HDLC   104 /* Cisco HDLC */

Definition at line 163 of file pcap-common.c.

◆ LINKTYPE_C_HDLC_WITH_DIR

#define LINKTYPE_C_HDLC_WITH_DIR   205 /* Cisco HDLC */

Definition at line 573 of file pcap-common.c.

◆ LINKTYPE_CAN20B

#define LINKTYPE_CAN20B   190

Definition at line 457 of file pcap-common.c.

◆ LINKTYPE_CAN_SOCKETCAN

#define LINKTYPE_CAN_SOCKETCAN   227

Definition at line 777 of file pcap-common.c.

◆ LINKTYPE_CHAOS

#define LINKTYPE_CHAOS   DLT_CHAOS

Definition at line 112 of file pcap-common.c.

◆ LINKTYPE_CISCO_IOS

#define LINKTYPE_CISCO_IOS   118 /* For Cisco-internal use */

Definition at line 187 of file pcap-common.c.

◆ LINKTYPE_DBUS

#define LINKTYPE_DBUS   231

Definition at line 809 of file pcap-common.c.

◆ LINKTYPE_DECT

#define LINKTYPE_DECT   221

Definition at line 678 of file pcap-common.c.

◆ LINKTYPE_DISPLAYPORT_AUX

#define LINKTYPE_DISPLAYPORT_AUX   275

Definition at line 1110 of file pcap-common.c.

◆ LINKTYPE_DOCSIS

#define LINKTYPE_DOCSIS   143 /* DOCSIS MAC frames */

Definition at line 243 of file pcap-common.c.

◆ LINKTYPE_DOCSIS31_XRA31

#define LINKTYPE_DOCSIS31_XRA31   273

Definition at line 1097 of file pcap-common.c.

◆ LINKTYPE_DSA_TAG_BRCM

#define LINKTYPE_DSA_TAG_BRCM   281

Definition at line 1155 of file pcap-common.c.

◆ LINKTYPE_DSA_TAG_BRCM_PREPEND

#define LINKTYPE_DSA_TAG_BRCM_PREPEND   282

Definition at line 1156 of file pcap-common.c.

◆ LINKTYPE_DSA_TAG_DSA

#define LINKTYPE_DSA_TAG_DSA   284

Definition at line 1169 of file pcap-common.c.

◆ LINKTYPE_DSA_TAG_EDSA

#define LINKTYPE_DSA_TAG_EDSA   285

Definition at line 1170 of file pcap-common.c.

◆ LINKTYPE_DVB_CI

#define LINKTYPE_DVB_CI   235

Definition at line 829 of file pcap-common.c.

◆ LINKTYPE_EBHSCR

#define LINKTYPE_EBHSCR   279

Definition at line 1143 of file pcap-common.c.

◆ LINKTYPE_ECONET

#define LINKTYPE_ECONET   115 /* Acorn Econet */

Definition at line 179 of file pcap-common.c.

◆ LINKTYPE_ELEE

#define LINKTYPE_ELEE   286

Definition at line 1177 of file pcap-common.c.

◆ LINKTYPE_ENC

#define LINKTYPE_ENC   109 /* OpenBSD IPSEC enc */

Definition at line 168 of file pcap-common.c.

◆ LINKTYPE_EPON

#define LINKTYPE_EPON   259

Definition at line 1021 of file pcap-common.c.

◆ LINKTYPE_ERF

#define LINKTYPE_ERF   197

Definition at line 507 of file pcap-common.c.

◆ LINKTYPE_ERF_ETH

#define LINKTYPE_ERF_ETH   175 /* Ethernet */

Definition at line 367 of file pcap-common.c.

◆ LINKTYPE_ERF_POS

#define LINKTYPE_ERF_POS   176 /* Packet-over-SONET */

Definition at line 368 of file pcap-common.c.

◆ LINKTYPE_ETHERNET

#define LINKTYPE_ETHERNET   DLT_EN10MB /* also for 100Mb and up */

Definition at line 108 of file pcap-common.c.

◆ LINKTYPE_ETHERNET_MPACKET

#define LINKTYPE_ETHERNET_MPACKET   274

Definition at line 1103 of file pcap-common.c.

◆ LINKTYPE_EXP_ETHERNET

#define LINKTYPE_EXP_ETHERNET   DLT_EN3MB /* 3Mb experimental Ethernet */

Definition at line 109 of file pcap-common.c.

◆ LINKTYPE_FC_2

#define LINKTYPE_FC_2   224

Definition at line 704 of file pcap-common.c.

◆ LINKTYPE_FC_2_WITH_FRAME_DELIMS

#define LINKTYPE_FC_2_WITH_FRAME_DELIMS   225

Definition at line 718 of file pcap-common.c.

◆ LINKTYPE_FDDI

#define LINKTYPE_FDDI   DLT_FDDI

Definition at line 117 of file pcap-common.c.

◆ LINKTYPE_FLEXRAY

#define LINKTYPE_FLEXRAY   210

Definition at line 606 of file pcap-common.c.

◆ LINKTYPE_FRELAY

#define LINKTYPE_FRELAY   107 /* Frame Relay */

Definition at line 166 of file pcap-common.c.

◆ LINKTYPE_FRELAY_WITH_DIR

#define LINKTYPE_FRELAY_WITH_DIR   206 /* Frame Relay */

Definition at line 581 of file pcap-common.c.

◆ LINKTYPE_GCOM_SERIAL

#define LINKTYPE_GCOM_SERIAL   173

Definition at line 352 of file pcap-common.c.

◆ LINKTYPE_GCOM_T1E1

#define LINKTYPE_GCOM_T1E1   172

Definition at line 351 of file pcap-common.c.

◆ LINKTYPE_GPF_F

#define LINKTYPE_GPF_F   171 /* GPF-F (ITU-T G.7041/Y.1303) */

Definition at line 345 of file pcap-common.c.

◆ LINKTYPE_GPF_T

#define LINKTYPE_GPF_T   170 /* GPF-T (ITU-T G.7041/Y.1303) */

Definition at line 344 of file pcap-common.c.

◆ LINKTYPE_GPRS_LLC

#define LINKTYPE_GPRS_LLC   169 /* GPRS LLC */

Definition at line 343 of file pcap-common.c.

◆ LINKTYPE_GSMTAP_ABIS

#define LINKTYPE_GSMTAP_ABIS   218

Definition at line 659 of file pcap-common.c.

◆ LINKTYPE_GSMTAP_UM

#define LINKTYPE_GSMTAP_UM   217

Definition at line 658 of file pcap-common.c.

◆ LINKTYPE_HDLC

#define LINKTYPE_HDLC   112 /* NetBSD HDLC framing */

Definition at line 175 of file pcap-common.c.

◆ LINKTYPE_HHDLC

#define LINKTYPE_HHDLC   121

Definition at line 194 of file pcap-common.c.

◆ LINKTYPE_HIPPI

#define LINKTYPE_HIPPI   111 /* NetBSD HIPPI */

Definition at line 174 of file pcap-common.c.

◆ LINKTYPE_IBM_SN

#define LINKTYPE_IBM_SN   146

Definition at line 251 of file pcap-common.c.

◆ LINKTYPE_IBM_SP

#define LINKTYPE_IBM_SP   145

Definition at line 250 of file pcap-common.c.

◆ LINKTYPE_IEEE802_11

#define LINKTYPE_IEEE802_11   105 /* IEEE 802.11 (wireless) */

Definition at line 164 of file pcap-common.c.

◆ LINKTYPE_IEEE802_11_AIRONET

#define LINKTYPE_IEEE802_11_AIRONET   120 /* 802.11 plus FreeBSD Aironet driver radio metadata header */

Definition at line 189 of file pcap-common.c.

◆ LINKTYPE_IEEE802_11_AVS

#define LINKTYPE_IEEE802_11_AVS   163 /* 802.11 plus AVS radio metadata header */

Definition at line 303 of file pcap-common.c.

◆ LINKTYPE_IEEE802_11_PRISM

#define LINKTYPE_IEEE802_11_PRISM   119 /* 802.11 plus Prism II monitor mode radio metadata header */

Definition at line 188 of file pcap-common.c.

◆ LINKTYPE_IEEE802_11_RADIOTAP

#define LINKTYPE_IEEE802_11_RADIOTAP   127 /* 802.11 plus radiotap radio metadata header */

Definition at line 207 of file pcap-common.c.

◆ LINKTYPE_IEEE802_15_4_LINUX

#define LINKTYPE_IEEE802_15_4_LINUX   191

Definition at line 463 of file pcap-common.c.

◆ LINKTYPE_IEEE802_15_4_NOFCS

#define LINKTYPE_IEEE802_15_4_NOFCS   230

Definition at line 791 of file pcap-common.c.

◆ LINKTYPE_IEEE802_15_4_NONASK_PHY

#define LINKTYPE_IEEE802_15_4_NONASK_PHY   215

Definition at line 643 of file pcap-common.c.

◆ LINKTYPE_IEEE802_15_4_TAP

#define LINKTYPE_IEEE802_15_4_TAP   283

Definition at line 1164 of file pcap-common.c.

◆ LINKTYPE_IEEE802_15_4_WITHFCS

#define LINKTYPE_IEEE802_15_4_WITHFCS   195

Definition at line 494 of file pcap-common.c.

◆ LINKTYPE_IEEE802_16_MAC_CPS

#define LINKTYPE_IEEE802_16_MAC_CPS   188

Definition at line 442 of file pcap-common.c.

◆ LINKTYPE_IEEE802_16_MAC_CPS_RADIO

#define LINKTYPE_IEEE802_16_MAC_CPS_RADIO   193

Definition at line 475 of file pcap-common.c.

◆ LINKTYPE_IEEE802_5

#define LINKTYPE_IEEE802_5   DLT_IEEE802 /* DLT_IEEE802 is used for 802.5 Token Ring */

Definition at line 113 of file pcap-common.c.

◆ LINKTYPE_INFINIBAND

#define LINKTYPE_INFINIBAND   247

Definition at line 925 of file pcap-common.c.

◆ LINKTYPE_IP_OVER_FC

#define LINKTYPE_IP_OVER_FC   122 /* RFC 2625 IP-over-Fibre Channel */

Definition at line 196 of file pcap-common.c.

◆ LINKTYPE_IPFILTER

#define LINKTYPE_IPFILTER   116

Definition at line 184 of file pcap-common.c.

◆ LINKTYPE_IPMB_KONTRON

#define LINKTYPE_IPMB_KONTRON   199

Definition at line 530 of file pcap-common.c.

◆ LINKTYPE_IPMB_LINUX

#define LINKTYPE_IPMB_LINUX   209

Definition at line 600 of file pcap-common.c.

◆ LINKTYPE_IPMI_HPM_2

#define LINKTYPE_IPMI_HPM_2   260

Definition at line 1027 of file pcap-common.c.

◆ LINKTYPE_IPNET

#define LINKTYPE_IPNET   226

Definition at line 766 of file pcap-common.c.

◆ LINKTYPE_IPOIB

#define LINKTYPE_IPOIB   242

Definition at line 882 of file pcap-common.c.

◆ LINKTYPE_IPV4

#define LINKTYPE_IPV4   228

Definition at line 783 of file pcap-common.c.

◆ LINKTYPE_IPV6

#define LINKTYPE_IPV6   229

Definition at line 784 of file pcap-common.c.

◆ LINKTYPE_ISO_14443

#define LINKTYPE_ISO_14443   264

Definition at line 1044 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_ATM1

#define LINKTYPE_JUNIPER_ATM1   137

Definition at line 234 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_ATM2

#define LINKTYPE_JUNIPER_ATM2   135

Definition at line 232 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_ATM_CEMIC

#define LINKTYPE_JUNIPER_ATM_CEMIC   238

Definition at line 847 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_CHDLC

#define LINKTYPE_JUNIPER_CHDLC   181

Definition at line 388 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_ES

#define LINKTYPE_JUNIPER_ES   132

Definition at line 229 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_ETHER

#define LINKTYPE_JUNIPER_ETHER   178

Definition at line 385 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_FIBRECHANNEL

#define LINKTYPE_JUNIPER_FIBRECHANNEL   234

Definition at line 817 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_FRELAY

#define LINKTYPE_JUNIPER_FRELAY   180

Definition at line 387 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_GGSN

#define LINKTYPE_JUNIPER_GGSN   133

Definition at line 230 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_ISM

#define LINKTYPE_JUNIPER_ISM   194

Definition at line 483 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_MFR

#define LINKTYPE_JUNIPER_MFR   134

Definition at line 231 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_MLFR

#define LINKTYPE_JUNIPER_MLFR   131

Definition at line 228 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_MLPPP

#define LINKTYPE_JUNIPER_MLPPP   130

Definition at line 227 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_MONITOR

#define LINKTYPE_JUNIPER_MONITOR   164

Definition at line 311 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_PIC_PEER

#define LINKTYPE_JUNIPER_PIC_PEER   174

Definition at line 359 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_PPP

#define LINKTYPE_JUNIPER_PPP   179

Definition at line 386 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_PPPOE

#define LINKTYPE_JUNIPER_PPPOE   167

Definition at line 340 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_PPPOE_ATM

#define LINKTYPE_JUNIPER_PPPOE_ATM   168

Definition at line 341 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_SERVICES

#define LINKTYPE_JUNIPER_SERVICES   136

Definition at line 233 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_SRX_E2E

#define LINKTYPE_JUNIPER_SRX_E2E   233

Definition at line 816 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_ST

#define LINKTYPE_JUNIPER_ST   200

Definition at line 537 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_VP

#define LINKTYPE_JUNIPER_VP   183

Definition at line 401 of file pcap-common.c.

◆ LINKTYPE_JUNIPER_VS

#define LINKTYPE_JUNIPER_VS   232

Definition at line 815 of file pcap-common.c.

◆ LINKTYPE_LANE8023

#define LINKTYPE_LANE8023   110 /* ATM LANE + 802.3 */

Definition at line 173 of file pcap-common.c.

◆ LINKTYPE_LAPB_WITH_DIR

#define LINKTYPE_LAPB_WITH_DIR   207 /* LAPB */

Definition at line 589 of file pcap-common.c.

◆ LINKTYPE_LAPD

#define LINKTYPE_LAPD   203

Definition at line 559 of file pcap-common.c.

◆ LINKTYPE_LIN

#define LINKTYPE_LIN   212

Definition at line 620 of file pcap-common.c.

◆ LINKTYPE_LINUX_EVDEV

#define LINKTYPE_LINUX_EVDEV   216

Definition at line 651 of file pcap-common.c.

◆ LINKTYPE_LINUX_IRDA

#define LINKTYPE_LINUX_IRDA   144 /* Linux-IrDA */

Definition at line 245 of file pcap-common.c.

◆ LINKTYPE_LINUX_LAPD

#define LINKTYPE_LINUX_LAPD   177

Definition at line 376 of file pcap-common.c.

◆ LINKTYPE_LINUX_SLL

#define LINKTYPE_LINUX_SLL   113 /* Linux cooked socket capture */

Definition at line 177 of file pcap-common.c.

◆ LINKTYPE_LINUX_SLL2

#define LINKTYPE_LINUX_SLL2   276

Definition at line 1115 of file pcap-common.c.

◆ LINKTYPE_LOOP

#define LINKTYPE_LOOP   108 /* OpenBSD loopback */

Definition at line 167 of file pcap-common.c.

◆ LINKTYPE_LORATAP

#define LINKTYPE_LORATAP   270

Definition at line 1077 of file pcap-common.c.

◆ LINKTYPE_LTALK

#define LINKTYPE_LTALK   114 /* Apple LocalTalk hardware */

Definition at line 178 of file pcap-common.c.

◆ LINKTYPE_MATCHING_MAX

#define LINKTYPE_MATCHING_MAX   289 /* highest value in the "matching" range */

Definition at line 1194 of file pcap-common.c.

◆ LINKTYPE_MATCHING_MIN

#define LINKTYPE_MATCHING_MIN   104 /* lowest value in the "matching" range */

Definition at line 161 of file pcap-common.c.

◆ LINKTYPE_MFR

#define LINKTYPE_MFR   182

Definition at line 393 of file pcap-common.c.

◆ LINKTYPE_MOST

#define LINKTYPE_MOST   211

Definition at line 613 of file pcap-common.c.

◆ LINKTYPE_MPEG_2_TS

#define LINKTYPE_MPEG_2_TS   243

Definition at line 889 of file pcap-common.c.

◆ LINKTYPE_MPLS

#define LINKTYPE_MPLS   219

Definition at line 666 of file pcap-common.c.

◆ LINKTYPE_MTP2

#define LINKTYPE_MTP2   140

Definition at line 239 of file pcap-common.c.

◆ LINKTYPE_MTP2_WITH_PHDR

#define LINKTYPE_MTP2_WITH_PHDR   139

Definition at line 238 of file pcap-common.c.

◆ LINKTYPE_MTP3

#define LINKTYPE_MTP3   141

Definition at line 240 of file pcap-common.c.

◆ LINKTYPE_MUX27010

#define LINKTYPE_MUX27010   236

Definition at line 835 of file pcap-common.c.

◆ LINKTYPE_NETANALYZER

#define LINKTYPE_NETANALYZER   240

Definition at line 865 of file pcap-common.c.

◆ LINKTYPE_NETANALYZER_TRANSPARENT

#define LINKTYPE_NETANALYZER_TRANSPARENT   241

Definition at line 875 of file pcap-common.c.

◆ LINKTYPE_NETLINK

#define LINKTYPE_NETLINK   253

Definition at line 972 of file pcap-common.c.

◆ LINKTYPE_NFC_LLCP

#define LINKTYPE_NFC_LLCP   245

Definition at line 907 of file pcap-common.c.

◆ LINKTYPE_NFLOG

#define LINKTYPE_NFLOG   239

Definition at line 855 of file pcap-common.c.

◆ LINKTYPE_NG40

#define LINKTYPE_NG40   244

Definition at line 897 of file pcap-common.c.

◆ LINKTYPE_NORDIC_BLE

#define LINKTYPE_NORDIC_BLE   272

Definition at line 1090 of file pcap-common.c.

◆ LINKTYPE_NULL

#define LINKTYPE_NULL   DLT_NULL

Definition at line 107 of file pcap-common.c.

◆ LINKTYPE_OPENFLOW

#define LINKTYPE_OPENFLOW   267

Definition at line 1060 of file pcap-common.c.

◆ LINKTYPE_OPENVIZSLA

#define LINKTYPE_OPENVIZSLA   278

Definition at line 1131 of file pcap-common.c.

◆ LINKTYPE_PCI_EXP

#define LINKTYPE_PCI_EXP   125 /* PCI Express */

Definition at line 204 of file pcap-common.c.

◆ LINKTYPE_PFLOG

#define LINKTYPE_PFLOG   117 /* OpenBSD DLT_PFLOG */

Definition at line 186 of file pcap-common.c.

◆ LINKTYPE_PFSYNC

#define LINKTYPE_PFSYNC   246

Definition at line 918 of file pcap-common.c.

◆ LINKTYPE_PKTAP

#define LINKTYPE_PKTAP   258

Definition at line 1014 of file pcap-common.c.

◆ LINKTYPE_PPI

#define LINKTYPE_PPI   192

Definition at line 469 of file pcap-common.c.

◆ LINKTYPE_PPP

#define LINKTYPE_PPP   DLT_PPP

Definition at line 116 of file pcap-common.c.

◆ LINKTYPE_PPP_BSDOS

#define LINKTYPE_PPP_BSDOS   103 /* BSD/OS PPP BPF header */

Definition at line 149 of file pcap-common.c.

◆ LINKTYPE_PPP_ETHER

#define LINKTYPE_PPP_ETHER   51 /* NetBSD PPP-over-Ethernet */

Definition at line 136 of file pcap-common.c.

◆ LINKTYPE_PPP_HDLC

#define LINKTYPE_PPP_HDLC   50 /* PPP in HDLC-like framing */

Definition at line 134 of file pcap-common.c.

◆ LINKTYPE_PPP_PPPD

#define LINKTYPE_PPP_PPPD   166

Definition at line 332 of file pcap-common.c.

◆ LINKTYPE_PPP_WITH_DIR

#define LINKTYPE_PPP_WITH_DIR   204 /* Don't confuse with LINKTYPE_PPP_PPPD */

Definition at line 566 of file pcap-common.c.

◆ LINKTYPE_PROFIBUS_DL

#define LINKTYPE_PROFIBUS_DL   257

Definition at line 993 of file pcap-common.c.

◆ LINKTYPE_PRONET

#define LINKTYPE_PRONET   DLT_PRONET

Definition at line 111 of file pcap-common.c.

◆ LINKTYPE_RAIF1

#define LINKTYPE_RAIF1   198

Definition at line 514 of file pcap-common.c.

◆ LINKTYPE_RAW

#define LINKTYPE_RAW   101 /* raw IP */

Definition at line 147 of file pcap-common.c.

◆ LINKTYPE_RDS

#define LINKTYPE_RDS   265

Definition at line 1050 of file pcap-common.c.

◆ LINKTYPE_RIO

#define LINKTYPE_RIO   124 /* RapidIO */

Definition at line 203 of file pcap-common.c.

◆ LINKTYPE_RTAC_SERIAL

#define LINKTYPE_RTAC_SERIAL   250

Definition at line 947 of file pcap-common.c.

◆ LINKTYPE_SCCP

#define LINKTYPE_SCCP   142

Definition at line 241 of file pcap-common.c.

◆ LINKTYPE_SCTP

#define LINKTYPE_SCTP   248

Definition at line 932 of file pcap-common.c.

◆ LINKTYPE_SDLC

#define LINKTYPE_SDLC   268

Definition at line 1065 of file pcap-common.c.

◆ LINKTYPE_SERCOS_MONITOR

#define LINKTYPE_SERCOS_MONITOR   277

Definition at line 1120 of file pcap-common.c.

◆ LINKTYPE_SITA

#define LINKTYPE_SITA   196

Definition at line 500 of file pcap-common.c.

◆ LINKTYPE_SLIP

#define LINKTYPE_SLIP   DLT_SLIP

Definition at line 115 of file pcap-common.c.

◆ LINKTYPE_SLIP_BSDOS

#define LINKTYPE_SLIP_BSDOS   102 /* BSD/OS SLIP BPF header */

Definition at line 148 of file pcap-common.c.

◆ LINKTYPE_STANAG_5066_D_PDU

#define LINKTYPE_STANAG_5066_D_PDU   237

Definition at line 841 of file pcap-common.c.

◆ LINKTYPE_SUNATM

#define LINKTYPE_SUNATM   123 /* Solaris+SunATM */

Definition at line 197 of file pcap-common.c.

◆ LINKTYPE_SYMANTEC_FIREWALL

#define LINKTYPE_SYMANTEC_FIREWALL   99 /* Symantec Enterprise Firewall */

Definition at line 138 of file pcap-common.c.

◆ LINKTYPE_TI_LLN_SNIFFER

#define LINKTYPE_TI_LLN_SNIFFER   269

Definition at line 1071 of file pcap-common.c.

◆ LINKTYPE_TZSP

#define LINKTYPE_TZSP   128 /* Tazmen Sniffer Protocol */

Definition at line 217 of file pcap-common.c.

◆ LINKTYPE_USB_2_0

#define LINKTYPE_USB_2_0   288

Definition at line 1187 of file pcap-common.c.

◆ LINKTYPE_USB_DARWIN

#define LINKTYPE_USB_DARWIN   266

Definition at line 1055 of file pcap-common.c.

◆ LINKTYPE_USB_FREEBSD

#define LINKTYPE_USB_FREEBSD   186

Definition at line 430 of file pcap-common.c.

◆ LINKTYPE_USB_LINUX

#define LINKTYPE_USB_LINUX   189

Definition at line 448 of file pcap-common.c.

◆ LINKTYPE_USB_LINUX_MMAPPED

#define LINKTYPE_USB_LINUX_MMAPPED   220

Definition at line 672 of file pcap-common.c.

◆ LINKTYPE_USBPCAP

#define LINKTYPE_USBPCAP   249

Definition at line 939 of file pcap-common.c.

◆ LINKTYPE_USER0

#define LINKTYPE_USER0   147

Definition at line 279 of file pcap-common.c.

◆ LINKTYPE_USER1

#define LINKTYPE_USER1   148

Definition at line 280 of file pcap-common.c.

◆ LINKTYPE_USER10

#define LINKTYPE_USER10   157

Definition at line 289 of file pcap-common.c.

◆ LINKTYPE_USER11

#define LINKTYPE_USER11   158

Definition at line 290 of file pcap-common.c.

◆ LINKTYPE_USER12

#define LINKTYPE_USER12   159

Definition at line 291 of file pcap-common.c.

◆ LINKTYPE_USER13

#define LINKTYPE_USER13   160

Definition at line 292 of file pcap-common.c.

◆ LINKTYPE_USER14

#define LINKTYPE_USER14   161

Definition at line 293 of file pcap-common.c.

◆ LINKTYPE_USER15

#define LINKTYPE_USER15   162

Definition at line 294 of file pcap-common.c.

◆ LINKTYPE_USER2

#define LINKTYPE_USER2   149

Definition at line 281 of file pcap-common.c.

◆ LINKTYPE_USER3

#define LINKTYPE_USER3   150

Definition at line 282 of file pcap-common.c.

◆ LINKTYPE_USER4

#define LINKTYPE_USER4   151

Definition at line 283 of file pcap-common.c.

◆ LINKTYPE_USER5

#define LINKTYPE_USER5   152

Definition at line 284 of file pcap-common.c.

◆ LINKTYPE_USER6

#define LINKTYPE_USER6   153

Definition at line 285 of file pcap-common.c.

◆ LINKTYPE_USER7

#define LINKTYPE_USER7   154

Definition at line 286 of file pcap-common.c.

◆ LINKTYPE_USER8

#define LINKTYPE_USER8   155

Definition at line 287 of file pcap-common.c.

◆ LINKTYPE_USER9

#define LINKTYPE_USER9   156

Definition at line 288 of file pcap-common.c.

◆ LINKTYPE_VPP_DISPATCH

#define LINKTYPE_VPP_DISPATCH   280

Definition at line 1150 of file pcap-common.c.

◆ LINKTYPE_VSOCK

#define LINKTYPE_VSOCK   271

Definition at line 1085 of file pcap-common.c.

◆ LINKTYPE_WATTSTOPPER_DLM

#define LINKTYPE_WATTSTOPPER_DLM   263

Definition at line 1039 of file pcap-common.c.

◆ LINKTYPE_WIHART

#define LINKTYPE_WIHART   223

Definition at line 698 of file pcap-common.c.

◆ LINKTYPE_WIRESHARK_UPPER_PDU

#define LINKTYPE_WIRESHARK_UPPER_PDU   252

Definition at line 967 of file pcap-common.c.

◆ LINKTYPE_X2E_SERIAL

#define LINKTYPE_X2E_SERIAL   213

Definition at line 626 of file pcap-common.c.

◆ LINKTYPE_X2E_XORAYA

#define LINKTYPE_X2E_XORAYA   214

Definition at line 632 of file pcap-common.c.

◆ LINKTYPE_Z_WAVE_SERIAL

#define LINKTYPE_Z_WAVE_SERIAL   287

Definition at line 1182 of file pcap-common.c.

◆ LINKTYPE_ZWAVE_R1_R2

#define LINKTYPE_ZWAVE_R1_R2   261

Definition at line 1032 of file pcap-common.c.

◆ LINKTYPE_ZWAVE_R3

#define LINKTYPE_ZWAVE_R3   262

Definition at line 1033 of file pcap-common.c.

Function Documentation

◆ dlt_to_linktype()

int dlt_to_linktype ( int  dlt)

◆ linktype_to_dlt()

◆ max_snaplen_for_dlt()

u_int max_snaplen_for_dlt ( int  dlt)

◆ swap_linux_sll_header()

static void swap_linux_sll_header ( const struct pcap_pkthdr hdr,
u_char *  buf 
)
static

◆ swap_linux_usb_header()

◆ swap_nflog_header()

static void swap_nflog_header ( const struct pcap_pkthdr hdr,
u_char *  buf 
)
static

◆ swap_pseudo_headers()

void swap_pseudo_headers ( int  linktype,
struct pcap_pkthdr hdr,
u_char *  data 
)

Variable Documentation

◆ map

struct linktype_map map[]
static