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)  

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

Go to the source code of this file.

Macros

#define PROT_READ   0
 
#define MAP_FILE   0
 
#define MAP_SHARED   0
 

Functions

std::string ssprintf (const char *fmt,...)
 
std::string comma_number_string (int64_t input)
 
std::string macaddr (const uint8_t *addr)
 
void init_debug (const char *pfx, int include_pid)
 
void mkdirs_for_path (std::string path)
 
void print_debug_message (const char *fmt, va_list ap)
 
void debug_real (const char *fmt,...)
 
void die (const char *fmt,...)
 
void * mmap (void *addr, size_t length, int prot, int flags, int fd, off_t offset)
 
void munmap (void *buf, size_t size)
 

Variables

static char * debug_prefix = NULL
 
void(*)(int) portable_signal (int signo, void(*func)(int))
 

Macro Definition Documentation

◆ MAP_FILE

#define MAP_FILE   0

Definition at line 228 of file util.cpp.

◆ MAP_SHARED

#define MAP_SHARED   0

Definition at line 229 of file util.cpp.

◆ PROT_READ

#define PROT_READ   0

MMAP *** fake implementation of mmap and munmap if we don't have them

Definition at line 227 of file util.cpp.

Function Documentation

◆ comma_number_string()

std::string comma_number_string ( int64_t  input)

Definition at line 33 of file util.cpp.

References tokens.

◆ debug_real()

void debug_real ( const char *  fmt,
  ... 
)

Definition at line 164 of file util.cpp.

References print_debug_message().

◆ die()

void die ( const char *  fmt,
  ... 
)

◆ init_debug()

void init_debug ( const char *  pfx,
int  include_pid 
)

Definition at line 74 of file util.cpp.

References debug_prefix, and die().

Referenced by main().

◆ macaddr()

std::string macaddr ( const uint8_t addr)

Definition at line 61 of file util.cpp.

Referenced by tcpip::dump_xml().

◆ mkdirs_for_path()

void mkdirs_for_path ( std::string  path)

Definition at line 112 of file util.cpp.

References MKDIR, and split().

Referenced by flow::new_filename(), and flow::new_pcap_filename().

◆ mmap()

void* mmap ( void *  addr,
size_t  length,
int  prot,
int  flags,
int  fd,
off_t  offset 
)

Definition at line 230 of file util.cpp.

Referenced by sbuf_t::map_file().

◆ munmap()

void munmap ( void *  buf,
size_t  size 
)

Definition at line 238 of file util.cpp.

Referenced by sbuf_t::release().

◆ print_debug_message()

void print_debug_message ( const char *  fmt,
va_list  ap 
)

Definition at line 150 of file util.cpp.

References debug_prefix.

Referenced by debug_real(), and die().

◆ ssprintf()

std::string ssprintf ( const char *  fmt,
  ... 
)

Definition at line 20 of file util.cpp.

Referenced by main(), and process_infile().

Variable Documentation

◆ debug_prefix

char* debug_prefix = NULL
static

Definition at line 15 of file util.cpp.

Referenced by init_debug(), main(), and print_debug_message().

◆ portable_signal

void(*)(int) portable_signal(int signo, void(*func)(int)) ( int  signo,
void(*)(int)  func 
)

Definition at line 195 of file util.cpp.