forest-net
an overlay networks for large-scale virtual worlds
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Host.cpp File Reference
#include "stdinc.h"
#include "Host.h"
Include dependency graph for Host.cpp:

Go to the source code of this file.

Namespaces

 forest
 The CtlPkt class is used to pack and unpack forest control messages.
 

Constant Groups

 forest
 The CtlPkt class is used to pack and unpack forest control messages.
 

Functions

int main (int argc, char *argv[])
 usage: fHost myIpAdr rtrIpAdr repeatFlag delta finTime More...
 

Detailed Description

Author
Jon Turner
Date
2011 This is open source software licensed under the Apache 2.0 license. See http://www.apache.org/licenses/LICENSE-2.0 for details.

Definition in file Host.cpp.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

usage: fHost myIpAdr rtrIpAdr repeatFlag delta finTime

FHost is a simple packet generator for a forest host. MyIpAdr and rtrIpAdr are the IP addresses of the host itself and the forest router it connects to. MyAdr is the forest adress of the host. Delta is the minimum number of microseconds between successive packet transmissions. FinTime is the number of seconds that the host should run.

The packets generated by Host are determined by a packet specification that is read from stdin. The input may include comment lines (which begin with '#'). Each non-blank, non-comment line specifies one packet in the form of a list of integer values separated by blanks. The first value on each line is a pause specification that indicates the number of microseconds to wait before sending the packet. This is ignored if it is less than delta. The next three values specify the packet's length (in bytes), its comtree number and destination forest address. The remaining values on the line are interpreted as the values of successive payload words. If the number of specified values is not sufficient for the specified packet length, remaining payload words are zero-padded.

A line with a negative number in the first field is treated as a repeat specification. If the value is -k, it goes back to the k-th previous non-comment line and continues from there. The number of repetitions is determined by the second value on the line containing the repeat specification. Repeat spec's can be combined and may be used to form nested loops. They can also be overlapped in more general ways, but the results are not likely to be useful.

If repeatFlag=0, Host sends each of the listed packets one time, ignoring all repeat specifications.

FHost also receives incoming packets from its attached router. It saves the first 50 of these and writes them to stdout at the end of execution. This is done as a basic debugging aid.

Definition at line 56 of file Host.cpp.

Here is the call graph for this function: