A very small encapsulating class, entirely in C++, tracks a number of assorted state information. Each member of the group, , uses one SRMinfo block for every other member of the group.
An SRMinfo object about group member at , contains information about the session messages received by from . can use this information to compute its distance to .
If sends is active in sending data traffic, then the SRMinfo object will also contain information about the received data, including a bit vector indicating all packets received from .
The agent keeps a list of SRMinfo objects, one per group member,
in its member variable, sip_.
Its method, [int sender]get_state
will return the object corresponding to that sender,
possibly creating that object, if it did not already exist.
The SRMinfo../ns-2/srm-state.h has two methods
to access and set the bit vector, ,
The session message variables to access timing information are public;
no encapsulating methods are provided. These are:
int lsess_; /* # of last session msg received /
int sendTime_; /* Time sess. msg. # sent /
int recvTime_; /* Time sess. msg. # received /
double distance_;
/* Data messages */
int ldata_; /* # of last data msg sent /
Paul Kroon 2008-03-16