forest-net
an overlay networks for large-scale virtual worlds
|
Class that defines fields in Forest packets. More...
#include <Packet.h>
Public Member Functions | |
bool | unpack () |
Unpack the packet from the buffer. More... | |
bool | pack () |
Pack the packet into the buffer. More... | |
uint32_t * | payload () const |
bool | hdrErrCheck () const |
buffer error checking More... | |
bool | payErrCheck () const |
Verify the payload error check. More... | |
void | hdrErrUpdate () |
Update the header error check based on buffer contents. More... | |
void | payErrUpdate () |
Update the payload error check based on buffer contents. More... | |
bool | read (istream &) |
input/output More... | |
string | toString () const |
Create a string representing packet contents. More... | |
Static Public Member Functions | |
static string | pktTyp2string (Forest::ptyp_t) |
static bool | string2pktTyp (string &, Forest::ptyp_t &) |
Public Attributes | |
int | version |
version number field | |
int | length |
length field | |
Forest::ptyp_t | type |
packet type field | |
flgs_t | flags |
flags | |
comt_t | comtree |
comtree field | |
fAdr_t | srcAdr |
source address | |
fAdr_t | dstAdr |
destination address | |
int | inLink |
link on which packet arrived | |
int | outLink |
outgoing link for packet | |
ipa_t | tunIp |
peer IP addr from substrate header | |
ipp_t | tunPort |
peer port # from substrate header | |
int64_t | rcvSeqNum |
used by router to identify packets | |
int | bufferLen |
number of valid bytes in buffer | |
buffer_t * | buffer |
pointer to packet buffer | |
Static Public Attributes | |
static int const | HDRLEN = 5*sizeof(uint32_t) |
static int const | OVERHEAD = HDRLEN + sizeof(uint32_t) |
Class that defines fields in Forest packets.
Note, packet fields and buffer are directly accessible. Use with care.
bool forest::Packet::hdrErrCheck | ( | ) | const |
buffer error checking
Verify the header error check.
Definition at line 59 of file Packet.cpp.
void forest::Packet::hdrErrUpdate | ( | ) |
Update the header error check based on buffer contents.
Definition at line 73 of file Packet.cpp.
bool forest::Packet::pack | ( | ) |
Pack the packet into the buffer.
Definition at line 42 of file Packet.cpp.
bool forest::Packet::payErrCheck | ( | ) | const |
void forest::Packet::payErrUpdate | ( | ) |
Update the payload error check based on buffer contents.
Definition at line 79 of file Packet.cpp.
bool forest::Packet::read | ( | istream & | ) |
input/output
Read an input packet and pack fields into buffer.
Definition at line 85 of file Packet.cpp.
string forest::Packet::toString | ( | ) | const |
Create a string representing packet contents.
b | is a reference to a buffer containing the packet |
Definition at line 152 of file Packet.cpp.
bool forest::Packet::unpack | ( | ) |
Unpack the packet from the buffer.
Definition at line 23 of file Packet.cpp.