tcpflow  1.6.1
About: tcpflow is a TCP/IP packet demultiplexer that captures data transmitted as part of TCP connections (flows), and stores the data in a way that is convenient for protocol analysis and debugging.
  Fossies Dox: tcpflow-1.6.1.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

datalink.cpp File Reference
#include <stddef.h>
#include "tcpflow.h"
Include dependency graph for datalink.cpp:

Go to the source code of this file.

Macros

#define NULL_HDRLEN   4
 
#define ETH_P_QINQ1   0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
 
#define ETH_P_8021AD   0x88A8 /* 802.1ad Service VLAN */
 
#define PPP_HDRLEN   4
 
#define DLT_IEEE802_11_RADIO   127 /* 802.11 plus radiotap radio header */
 

Functions

void dl_null (u_char *user, const struct pcap_pkthdr *h, const u_char *p)
 
void dl_raw (u_char *user, const struct pcap_pkthdr *h, const u_char *p)
 
void dl_ethernet (u_char *user, const struct pcap_pkthdr *h, const u_char *p)
 
void dl_ppp (u_char *user, const struct pcap_pkthdr *h, const u_char *p)
 
pcap_handler find_handler (int datalink_type, const char *device)
 

Variables

int32_t datalink_tdelta = 0
 
static uint64_t counter =0
 
dlt_handler_t handlers []
 

Macro Definition Documentation

◆ DLT_IEEE802_11_RADIO

#define DLT_IEEE802_11_RADIO   127 /* 802.11 plus radiotap radio header */

Definition at line 267 of file datalink.cpp.

◆ ETH_P_8021AD

#define ETH_P_8021AD   0x88A8 /* 802.1ad Service VLAN */

Definition at line 38 of file datalink.cpp.

◆ ETH_P_QINQ1

#define ETH_P_QINQ1   0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */

Definition at line 34 of file datalink.cpp.

◆ NULL_HDRLEN

#define NULL_HDRLEN   4

This file is part of tcpflow. Originally by Jeremy Elson jelso.nosp@m.n@ci.nosp@m.rclem.nosp@m.ud.o.nosp@m.rg, rewritten by Simson Garfinkel.

Initial Release: 7 April 1999.

This source code is under the GNU Public License (GPL). See COPYING for details.

This file contains datalink handlers which are called by the pcap callback. The purpose of each handler is to make a packet_info() object and then call process_packet. The packet_info() object contains both the original MAC-layer (with some of the fields broken out) and the packet data layer.

For wifi datalink handlers, please see datalink_wifi.cpp

Definition at line 26 of file datalink.cpp.

◆ PPP_HDRLEN

#define PPP_HDRLEN   4

Definition at line 187 of file datalink.cpp.

Function Documentation

◆ dl_ethernet()

◆ dl_null()

void dl_null ( u_char *  user,
const struct pcap_pkthdr h,
const u_char *  p 
)

◆ dl_ppp()

void dl_ppp ( u_char *  user,
const struct pcap_pkthdr h,
const u_char *  p 
)

◆ dl_raw()

void dl_raw ( u_char *  user,
const struct pcap_pkthdr h,
const u_char *  p 
)

◆ find_handler()

pcap_handler find_handler ( int  datalink_type,
const char *  device 
)

Definition at line 293 of file datalink.cpp.

References DEBUG, die(), dlt_handler_t::handler, and handlers.

Referenced by process_infile().

Variable Documentation

◆ counter

uint64_t counter =0
static

Definition at line 73 of file datalink.cpp.

Referenced by dl_raw().

◆ datalink_tdelta

int32_t datalink_tdelta = 0

Definition at line 42 of file datalink.cpp.

Referenced by main(), and tvshift().

◆ handlers

dlt_handler_t handlers[]
Initial value:
= {
{ dl_null, 0 },
{ dl_raw, 12 },
{ dl_raw, 14 },
{ dl_raw, 101 },
{ dl_ethernet, 1 },
{ dl_ethernet, 6 },
{ dl_ppp, 9 },
{ NULL, 0 }
}

Definition at line 271 of file datalink.cpp.

Referenced by find_handler().