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)  

scan_tcpdemux.cpp File Reference
#include "config.h"
#include "tcpflow.h"
#include "tcpip.h"
#include "tcpdemux.h"
#include <iostream>
#include <sys/types.h>
#include "bulk_extractor_i.h"
Include dependency graph for scan_tcpdemux.cpp:

Go to the source code of this file.

Functions

static void packet_handler (void *user, const be13::packet_info &pi)
 
void scan_tcpdemux (const class scanner_params &sp, const recursion_control_block &rcb)
 

Function Documentation

◆ packet_handler()

static void packet_handler ( void *  user,
const be13::packet_info pi 
)
static

tcp demultiplixier scanner.

We have a single global tcpdemultiplixer because it needs to manage a global resource — the maximum number of open files. We get the singleton instance and put it in the user argument of the global callback array. We could have designed the callback system to take an instance which is subclassed from an abstract superclass, but that would require a virtual function resolution on every function call, whereas here we simply have a function call with two arguments (which is faster, but less safe.) callback called by process_packet()

Definition at line 25 of file scan_tcpdemux.cpp.

Referenced by scan_tcpdemux().

◆ scan_tcpdemux()