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)  

flow Class Reference

#include <tcpip.h>

Inheritance diagram for flow:
[legend]
Collaboration diagram for flow:
[legend]

Public Member Functions

 flow ()
 
 flow (const flow_addr &flow_addr_, uint64_t id_, const be13::packet_info &pi)
 
virtual ~flow ()
 
std::string filename (uint32_t connection_count, bool)
 
std::string new_filename (int *fd, int flags, int mode)
 
std::string new_pcap_filename ()
 
bool has_mac_daddr ()
 
bool has_mac_saddr ()
 
- Public Member Functions inherited from flow_addr
 flow_addr ()
 
 flow_addr (const ipaddr &s, const ipaddr &d, uint16_t sp, uint16_t dp, sa_family_t f)
 
 flow_addr (const flow_addr &f)
 
virtual ~flow_addr ()
 
uint64_t hash () const
 
bool operator== (const flow_addr &b) const
 
bool operator< (const flow_addr &b) const
 
std::string str () const
 

Static Public Member Functions

static void usage ()
 

Public Attributes

uint64_t id
 
int32_t vlan
 
uint8_t mac_daddr [6]
 
uint8_t mac_saddr [6]
 
struct timeval tstart
 
struct timeval tlast
 
uint64_t len
 
uint64_t caplen
 
uint64_t packet_count
 
uint64_t session_id
 
- Public Attributes inherited from flow_addr
ipaddr src
 
ipaddr dst
 
uint16_t sport
 
uint16_t dport
 
sa_family_t family
 

Static Public Attributes

static std::string filename_template
 
static std::string outdir
 

Detailed Description

Definition at line 156 of file tcpip.h.

Constructor & Destructor Documentation

◆ flow() [1/2]

flow::flow ( )
inline

Definition at line 161 of file tcpip.h.

◆ flow() [2/2]

flow::flow ( const flow_addr flow_addr_,
uint64_t  id_,
const be13::packet_info pi 
)
inline

◆ ~flow()

virtual flow::~flow ( )
inlinevirtual

Definition at line 176 of file tcpip.h.

Member Function Documentation

◆ filename()

std::string flow::filename ( uint32_t  connection_count,
bool  is_pcap 
)

◆ has_mac_daddr()

bool flow::has_mac_daddr ( )
inline

Definition at line 196 of file tcpip.h.

References mac_daddr.

Referenced by tcpip::dump_xml().

◆ has_mac_saddr()

bool flow::has_mac_saddr ( )
inline

Definition at line 200 of file tcpip.h.

References mac_saddr.

Referenced by tcpip::dump_xml().

◆ new_filename()

std::string flow::new_filename ( int *  fd,
int  flags,
int  mode 
)

Find an unused filename for the flow and optionally open it. This is called from tcpip::open_file().

Definition at line 167 of file flow.cpp.

References die(), filename(), tcpdemux::getInstance(), mkdirs_for_path(), and tcpdemux::retrying_open().

Referenced by tcpip::open_file().

◆ new_pcap_filename()

std::string flow::new_pcap_filename ( )

Definition at line 183 of file flow.cpp.

References filename(), and mkdirs_for_path().

Referenced by tcpdemux::dissect_tcp().

◆ usage()

void flow::usage ( )
static

Definition at line 31 of file flow.cpp.

References filename_template.

Referenced by usage().

Member Data Documentation

◆ caplen

uint64_t flow::caplen

Definition at line 184 of file tcpip.h.

Referenced by tcpip::dump_xml(), and tcpdemux::process_tcp().

◆ filename_template

std::string flow::filename_template
static

flow.cpp:

The flow class is used to track individual TCP/IP flows (2 per connection). The class implements the methods that turn a flow into a filename.

This file is part of tcpflow by Jeremy Elson jelso.nosp@m.n@ci.nosp@m.rclem.nosp@m.ud.o.nosp@m.rg Initial Release: 7 April 1999.

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

Definition at line 159 of file tcpip.h.

Referenced by filename(), main(), usage(), and usage().

◆ id

uint64_t flow::id

Definition at line 177 of file tcpip.h.

◆ len

uint64_t flow::len

Definition at line 183 of file tcpip.h.

Referenced by tcpip::dump_xml(), and tcpdemux::process_tcp().

◆ mac_daddr

uint8_t flow::mac_daddr[6]

Definition at line 179 of file tcpip.h.

Referenced by tcpip::dump_xml(), filename(), flow(), and has_mac_daddr().

◆ mac_saddr

uint8_t flow::mac_saddr[6]

Definition at line 180 of file tcpip.h.

Referenced by tcpip::dump_xml(), filename(), flow(), and has_mac_saddr().

◆ outdir

std::string flow::outdir
static

Definition at line 160 of file tcpip.h.

Referenced by filename(), and main().

◆ packet_count

uint64_t flow::packet_count

Definition at line 185 of file tcpip.h.

Referenced by tcpip::dump_xml(), and tcpdemux::process_tcp().

◆ session_id

uint64_t flow::session_id

Definition at line 186 of file tcpip.h.

Referenced by filename(), and tcpdemux::process_tcp().

◆ tlast

struct timeval flow::tlast

Definition at line 180 of file tcpip.h.

Referenced by tcpip::dump_xml(), tcpdemux::process_pkt(), and tcpdemux::process_tcp().

◆ tstart

struct timeval flow::tstart

Definition at line 180 of file tcpip.h.

Referenced by tcpip::close_file(), tcpip::dump_xml(), and filename().

◆ vlan

int32_t flow::vlan

Definition at line 178 of file tcpip.h.

Referenced by filename().


The documentation for this class was generated from the following files: