#include <DiscoveryPacket.h>
Inheritance diagram for DiscoveryPacket::
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 |
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.
|
Definition at line 17 of file DiscoveryPacket.cpp. |
|
Definition at line 14 of file DiscoveryPacket.h. |
|
Used to decode a packet coming in over a socket.
Definition at line 27 of file DiscoveryPacket.cpp. |
|
Definition at line 49 of file DiscoveryPacket.cpp. Referenced by NetworkLayer::handleDiscoveryPacket().
|
|
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. |
|
Definition at line 55 of file DiscoveryPacket.cpp. |
|
Gets the length of the whole packet and makes sure the length makes sense.
Reimplemented from NpPacket. Definition at line 61 of file DiscoveryPacket.cpp. |
|
Definition at line 22 of file DiscoveryPacket.h. |
|
Definition at line 23 of file DiscoveryPacket.h. |