network

virtual class network

virtual Provides a logging function to store network transactions in the Wireshark hex format.

Summary
networkvirtual Provides a logging function to store network transactions in the Wireshark hex format.
Properties
fdsThe dynamic array of file descriptors.
Functions
dumpstatic Stores a network transaction to the file specified by the idx using the Wireshark hex format.

Properties

fds

static integer fds[]

The dynamic array of file descriptors.  It is user’s responsibility to open the file(s).

Example

network::fds    = new[2];
network::fds[0] = $fopen( "file0.hex", "w" );
network::fds[1] = $fopen( "file1.hex", "w" );

Functions

dump

static function void dump(string desc,  
int idx =  0)

static Stores a network transaction to the file specified by the idx using the Wireshark hex format.  It is user’s responsibility to open the file before calling this function.

Arguments

descThe description of a transaction.
idxoptional The index of the file descriptor array.  The default index is 0.

Example

network::fds    = new[2];
network::fds[0] = $fopen( "file0.hex", "w" );
network::fds[1] = $fopen( "file1.hex", "w" );
network::dump( "000000 01 02 03 04" ); // dump to fds[0] (file0.hex)
#100;
network::dump( "000000 11 12 13 14", .idx( 1 ) ); // dump to fds[1] (file1.hex)

/* file0.hex */
// 0.
// 000000 01 02 03 04

/* file1.hex */
// 100.
// 000000 11 12 13 14
virtual class network
virtual Provides a logging function to store network transactions in the Wireshark hex format.
static integer fds[]
The dynamic array of file descriptors.
static function void dump(string desc,  
int idx =  0)
static Stores a network transaction to the file specified by the idx using the Wireshark hex format.