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)  

pcap_fake.h File Reference
#include <sys/cdefs.h>
#include <stdint.h>
#include <sys/time.h>
#include <stdio.h>
Include dependency graph for pcap_fake.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pcap_file_header
 
struct  pcap_pkthdr
 
struct  bpf_program
 

Macros

#define PCAP_VERSION_MAJOR   2
 
#define PCAP_VERSION_MINOR   4
 
#define PCAP_ERRBUF_SIZE   256
 
#define DLT_NULL   0 /* BSD loopback encapsulation */
 
#define DLT_EN10MB   1 /* Ethernet (10Mb) */
 
#define DLT_EN3MB   2 /* Experimental Ethernet (3Mb) */
 
#define DLT_AX25   3 /* Amateur Radio AX.25 */
 
#define DLT_PRONET   4 /* Proteon ProNET Token Ring */
 
#define DLT_CHAOS   5 /* Chaos */
 
#define DLT_IEEE802   6 /* 802.5 Token Ring */
 
#define DLT_ARCNET   7 /* ARCNET, with BSD-style header */
 
#define DLT_SLIP   8 /* Serial Line IP */
 
#define DLT_PPP   9 /* Point-to-point Protocol */
 
#define DLT_FDDI   10 /* FDDI */
 
#define DLT_RAW   101 /* just packets */
 

Typedefs

typedef struct pcap pcap_t
 
typedef void(* pcap_handler) (uint8_t *, const struct pcap_pkthdr *, const uint8_t *)
 

Functions

char * pcap_lookupdev (char *)
 
pcap_tpcap_open_live (const char *, int, int, int, char *)
 
pcap_tpcap_open_offline (const char *, char *)
 
pcap_tpcap_fopen_offline (FILE *fp, char *errbuf)
 
void pcap_close (pcap_t *)
 
int pcap_loop (pcap_t *, int, pcap_handler, uint8_t *)
 
int pcap_datalink (pcap_t *)
 
int pcap_setfilter (pcap_t *, struct bpf_program *)
 
int pcap_compile (pcap_t *, struct bpf_program *, const char *, int, uint32_t)
 
char * pcap_geterr (pcap_t *)
 

Macro Definition Documentation

◆ DLT_ARCNET

#define DLT_ARCNET   7 /* ARCNET, with BSD-style header */

Definition at line 75 of file pcap_fake.h.

◆ DLT_AX25

#define DLT_AX25   3 /* Amateur Radio AX.25 */

Definition at line 71 of file pcap_fake.h.

◆ DLT_CHAOS

#define DLT_CHAOS   5 /* Chaos */

Definition at line 73 of file pcap_fake.h.

◆ DLT_EN10MB

#define DLT_EN10MB   1 /* Ethernet (10Mb) */

Definition at line 69 of file pcap_fake.h.

◆ DLT_EN3MB

#define DLT_EN3MB   2 /* Experimental Ethernet (3Mb) */

Definition at line 70 of file pcap_fake.h.

◆ DLT_FDDI

#define DLT_FDDI   10 /* FDDI */

Definition at line 78 of file pcap_fake.h.

◆ DLT_IEEE802

#define DLT_IEEE802   6 /* 802.5 Token Ring */

Definition at line 74 of file pcap_fake.h.

◆ DLT_NULL

#define DLT_NULL   0 /* BSD loopback encapsulation */

Definition at line 68 of file pcap_fake.h.

◆ DLT_PPP

#define DLT_PPP   9 /* Point-to-point Protocol */

Definition at line 77 of file pcap_fake.h.

◆ DLT_PRONET

#define DLT_PRONET   4 /* Proteon ProNET Token Ring */

Definition at line 72 of file pcap_fake.h.

◆ DLT_RAW

#define DLT_RAW   101 /* just packets */

Definition at line 79 of file pcap_fake.h.

◆ DLT_SLIP

#define DLT_SLIP   8 /* Serial Line IP */

Definition at line 76 of file pcap_fake.h.

◆ PCAP_ERRBUF_SIZE

#define PCAP_ERRBUF_SIZE   256

Definition at line 23 of file pcap_fake.h.

◆ PCAP_VERSION_MAJOR

#define PCAP_VERSION_MAJOR   2

Definition at line 21 of file pcap_fake.h.

◆ PCAP_VERSION_MINOR

#define PCAP_VERSION_MINOR   4

Definition at line 22 of file pcap_fake.h.

Typedef Documentation

◆ pcap_handler

typedef void(* pcap_handler) (uint8_t *, const struct pcap_pkthdr *, const uint8_t *)

Definition at line 48 of file pcap_fake.h.

◆ pcap_t

typedef struct pcap pcap_t

Definition at line 12 of file pcap_fake.h.

Function Documentation

◆ pcap_close()

void pcap_close ( pcap_t p)

Definition at line 218 of file pcap_fake.cpp.

References pcap::fp, pcap::must_close, and pcap::pktbuf.

Referenced by Wifipcap::InitNext(), and process_infile().

◆ pcap_compile()

int pcap_compile ( pcap_t p,
struct bpf_program program,
const char *  expression,
int  optimize,
uint32_t  mask 
)

Definition at line 150 of file pcap_fake.cpp.

References bpf_program::valid.

Referenced by process_infile(), and Wifipcap::SetFilter().

◆ pcap_datalink()

int pcap_datalink ( pcap_t p)

Definition at line 159 of file pcap_fake.cpp.

References pcap::linktype.

Referenced by Wifipcap::Init(), and process_infile().

◆ pcap_fopen_offline()

◆ pcap_geterr()

char* pcap_geterr ( pcap_t p)

Definition at line 35 of file pcap_fake.cpp.

References pcap::err_buf.

Referenced by process_infile().

◆ pcap_lookupdev()

char* pcap_lookupdev ( char *  )

Definition at line 59 of file pcap_fake.cpp.

Referenced by process_infile().

◆ pcap_loop()

int pcap_loop ( pcap_t p,
int  cnt,
pcap_handler  callback,
uint8_t user 
)

◆ pcap_open_live()

pcap_t* pcap_open_live ( const char *  ,
int  ,
int  ,
int  ,
char *   
)

Definition at line 65 of file pcap_fake.cpp.

Referenced by Wifipcap::Init(), and process_infile().

◆ pcap_open_offline()

pcap_t* pcap_open_offline ( const char *  fname,
char *  errbuf 
)

pcap_open_offline() – "The name "-" is a synonym for stdin" (pcap manual) – allocate the pcap_t structure – open a pcap capture file.

Definition at line 47 of file pcap_fake.cpp.

References pcap::fp, pcap::must_close, PCAP_ERRBUF_SIZE, and pcap_fopen_offline().

Referenced by process_infile().

◆ pcap_setfilter()

int pcap_setfilter ( pcap_t p,
struct bpf_program prog 
)

Definition at line 163 of file pcap_fake.cpp.

References bpf_program::valid.

Referenced by process_infile(), and Wifipcap::SetFilter().