Files
pcas/src/ca/bhe_IL.h
2000-11-20 17:34:19 +00:00

51 lines
1.2 KiB
C

/*
* $Id$
*
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
*
* Copyright, 1986, The Regents of the University of California.
*
* Author: Jeff Hill
*/
/*
* set average to -1.0 so that when the next beacon
* occurs we can distinguish between:
* o new server
* o existing server's beacon we are seeing
* for the first time shortly after program
* start up
*
* if creating this in response to a search reply
* and not in response to a beacon then
* we set the beacon time stamp to
* zero (so we can correctly compute the period
* between the 1st and 2nd beacons)
*/
inline bhe::bhe ( const osiTime &initialTimeStamp, const inetAddrID &addr ) :
inetAddrID (addr), piiu (0), timeStamp (initialTimeStamp), averagePeriod (-1.0)
{
# ifdef DEBUG
{
char name[64];
ipAddrToDottedIP (&addr, name, sizeof(name));
printf ("created beacon entry for %s\n", name);
}
# endif
}
inline tcpiiu *bhe::getIIU ()const
{
return this->piiu;
}
inline void bhe::bindToIIU ( tcpiiu &iiuIn )
{
assert ( this->piiu == 0 );
this->piiu = &iiuIn;
}