Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

DiscoveryPacket Class Reference

A request for more IP addresses in the network. More...

#include <DiscoveryPacket.h>

Inheritance diagram for DiscoveryPacket::

NpPacket Packet BasicObject List of all members.

Public Methods

 DiscoveryPacket ()
virtual ~DiscoveryPacket ()
 DiscoveryPacket (unsigned char *rawData)
 Used to decode a packet coming in over a socket. More...

unsigned int getId ()
void setId (unsigned int id)
virtual unsigned char * getRawData ()
 Encode the packet. More...

virtual void toStream (std::ostream &)
 Gets the length of the whole packet and makes sure the length makes sense. More...


Private Attributes

unsigned int m_id
TRanrotBGenerator m_randomNumberGenerator

Detailed Description

A request for more IP addresses in the network.

A discovery packet contains a randomly generated ID in order to suppress infinite forwarding.

Discovery Packet structure: NP packet header ID (4 bytes)

Definition at line 7 of file DiscoveryPacket.h.


Constructor & Destructor Documentation

DiscoveryPacket::DiscoveryPacket
 

Definition at line 17 of file DiscoveryPacket.cpp.

virtual DiscoveryPacket::~DiscoveryPacket [inline, virtual]
 

Definition at line 14 of file DiscoveryPacket.h.

DiscoveryPacket::DiscoveryPacket unsigned char * rawData
 

Used to decode a packet coming in over a socket.

Definition at line 27 of file DiscoveryPacket.cpp.


Member Function Documentation

unsigned int DiscoveryPacket::getId
 

Definition at line 49 of file DiscoveryPacket.cpp.

Referenced by NetworkLayer::handleDiscoveryPacket().

unsigned char * DiscoveryPacket::getRawData [virtual]
 

Encode the packet.

This is called right before the packet is sent over the wire.

Reimplemented from NpPacket.

Definition at line 39 of file DiscoveryPacket.cpp.

void DiscoveryPacket::setId unsigned int id
 

Definition at line 55 of file DiscoveryPacket.cpp.

void DiscoveryPacket::toStream std::ostream & out [virtual]
 

Gets the length of the whole packet and makes sure the length makes sense.

Returns:
< 0 if the length is invalid

Reimplemented from NpPacket.

Definition at line 61 of file DiscoveryPacket.cpp.


Member Data Documentation

unsigned int DiscoveryPacket::m_id [private]
 

Definition at line 22 of file DiscoveryPacket.h.

TRanrotBGenerator DiscoveryPacket::m_randomNumberGenerator [private]
 

Definition at line 23 of file DiscoveryPacket.h.


The documentation for this class was generated from the following files:
Generated at Thu Jul 11 13:31:56 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001