Pinger Struct Reference

List of all members.

Public Member Functions

 Pinger (awds::Routing *awdsRouting)
ostream & dbg ()
void resetStats ()
void print_stats (std::ostream &out)
int startPing (Handle *h=0)
int parse_opts (int argc, const char *const *argv)

Static Public Member Functions

static void next_ping (gea::Handle *h, gea::AbsTime t, void *data)
static void ping_recv (BasePacket *p, void *data)

Public Attributes

bool busy
 flag to indicate that a ping is currently active
NodeId dest
 the node we are currently pinging
unsigned ttl
 the maxium number of hops in each ping packet
int numRepeat
 number of pings to send
bool doTracePath
 flag, if the path should be traced
double minRTT
double maxRTT
double sumRTT
 measured round trip time
int numReceived
 number of received packets
int numTransmitted
 number of transmitted packets
awds::RoutingawdsRouting
 used awds instance
gea::Blocker blocker
 blocker for creating periodic events
ostream * out
 ostream to write user messages to
ShellClientshellClient
 state of the interactive shell, if present
Duration period
 perdiod of ping packets
size_t pingSize
 size of ping packets including header
AbsTime myT0
 some fized point in time


Detailed Description

the Pinger class holds the state of the pinger module

Member Function Documentation

ostream& Pinger::dbg (  )  [inline]

get the ostream for user interaction

References out.

Referenced by parse_opts(), and startPing().

void Pinger::next_ping ( gea::Handle *  h,
gea::AbsTime  t,
void *  data 
) [static]

int Pinger::parse_opts ( int  argc,
const char *const *  argv 
)

parse the given options

Parameters:
argc number of arguments
argv vector of string pointers
Returns:
-1 on error, 0 otherwise.

References awdsRouting, dbg(), dest, doTracePath, awds::Routing::getNodeByName(), numRepeat, period, pingSize, and ttl.

void Pinger::ping_recv ( BasePacket p,
void *  data 
) [static]

void Pinger::print_stats ( std::ostream &  out  ) 

prints summary after stopping the ping session

Parameters:
out ostream to write the text to.

References dest, numReceived, numTransmitted, and sumRTT.

void Pinger::resetStats (  ) 

reset the internal state

reset the ping stats.

References numReceived, numTransmitted, and sumRTT.

Referenced by startPing().

int Pinger::startPing ( Handle *  h = 0  ) 

start ping

start the client side of the ping protocol

Parameters:
h handle of interactive shell, used for generating periodic events and for stopping the ping
Returns:
-1 on error, 0 on success

References blocker, busy, dbg(), dest, next_ping(), and resetStats().


The documentation for this struct was generated from the following file:

Generated on Fri Mar 27 13:58:26 2009 for AWDS by  doxygen 1.5.8