Function

int openNetLog (char * filename)

Arguments

filename
The prefix of the filename. ie. no .nlog

Preconditions

No other NETLOG file has been opened by a call to this function and not closed.

SRS Refs

3.2.1.9

Function

void initFields ( void)

Arguments

void
no arguments

Description

SRS Refs

3.2.1.9

Function

void newNLPacket (PacketInfo * info)

Arguments

info
Info on the captured packet

Preconditions

None

Postconditions

None

The following psuedocode is used, since data is not always written:

if intervaltype = TIME and time since last dump >= interval: write data for all streams seen clear data on all streams seen

record information about packet in the stream's packet info

if intervaltype = PACKETS and packets since last dump >= packets: write data for all streams seen clear data on all streams seen

SRS Refs

3.2.1.9

Function

void writeInfos (PIList ** list, int numofinterval)

Arguments

list
A pointer to the head of the list pointer
numofinterval
How many intervals have passed

SRS Refs

3.2.1.9

Function

void writeInfo (PacketInfo* info)

Arguments

info
The PacketInfo for the captured packet or stream of packets

Preconditions

An output file has been opened At least one field is present in fields[]

Pseudocode

For each field in fields[]: print info->field Print newline

SRS Refs

3.2.1.9a

Function

void addNLField (int field)

Arguments

field
A field ID number as defined in NetLogger.h

SRS Refs

3.2.1.9a

Function

void setNLInterval (int newintervaltype, int newinterval)

Arguments

newintervaltype
The type of interval. This must be either INTERVAL_TIME or INTERVAL_PACKETS

SRS Refs

3.2.1.9d

Function

void closeNetLog ( void)

Arguments

void
no arguments

Description

SRS Refs

3.2.1.9

Function

void writeNLHead ( void)

Arguments

void
no arguments

Description

Preconditions

The output file has been opened

SRS Refs

3.2.1.9

Function

void writeNLFieldHead ( void)

Arguments

void
no arguments

Description

SRS Refs

3.2.1.9a

Function

u_int32_t timeDiff (struct timeval time1, struct timeval time2)

Arguments

time1
The more recent of the times
time2
The oldest of the times

SRS Refs

3.2.1.9d

Returns the difference in milliseconds.


Function

void outputReset ( void)

Arguments

void
no arguments

Description

SRS Refs

3.2.1.9