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.cpp File Reference
#include "config.h"
#include "pcap_fake.h"
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <iostream>
Include dependency graph for pcap_fake.cpp:

Go to the source code of this file.

Classes

struct  pcap
 

Macros

#define SET_BINMODE(f)   /* ignore */
 

Functions

char * pcap_geterr (pcap_t *p)
 
pcap_tpcap_open_offline (const char *fname, char *errbuf)
 
char * pcap_lookupdev (char *)
 
pcap_tpcap_open_live (const char *, int, int, int, char *)
 
uint32_t swap4 (uint32_t x)
 
uint32_t swap2 (uint16_t x)
 
pcap_tpcap_fopen_offline (FILE *fp, char *errbuf)
 
int pcap_compile (pcap_t *p, struct bpf_program *program, const char *expression, int optimize, uint32_t mask)
 
int pcap_datalink (pcap_t *p)
 
int pcap_setfilter (pcap_t *p, struct bpf_program *prog)
 
int pcap_loop (pcap_t *p, int cnt, pcap_handler callback, uint8_t *user)
 
void pcap_break_loop (pcap_t *p)
 
void pcap_close (pcap_t *p)
 

Macro Definition Documentation

◆ SET_BINMODE

#define SET_BINMODE (   f)    /* ignore */

Definition at line 17 of file pcap_fake.cpp.

Function Documentation

◆ pcap_break_loop()

void pcap_break_loop ( pcap_t p)

Definition at line 213 of file pcap_fake.cpp.

References pcap::break_loop.

◆ 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().

◆ swap2()

uint32_t swap2 ( uint16_t  x)
inline

Definition at line 80 of file pcap_fake.cpp.

Referenced by pcap_fopen_offline().

◆ swap4()

uint32_t swap4 ( uint32_t  x)
inline

Definition at line 71 of file pcap_fake.cpp.

Referenced by pcap_fopen_offline(), and pcap_loop().