forest-net
an overlay networks for large-scale virtual worlds
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Packet.h
Go to the documentation of this file.
1
9
#ifndef PACKET_H
10
#define PACKET_H
11
12
#include "
Forest.h
"
13
14
namespace
forest {
15
16
20
class
Packet
{
21
public
:
22
Packet
();
23
~
Packet
();
24
25
int
static
const
HDRLEN = 5*
sizeof
(uint32_t);
26
int
static
const
OVERHEAD = HDRLEN +
sizeof
(uint32_t);
27
28
bool
unpack
();
29
bool
pack
();
30
uint32_t* payload()
const
{
return
&((*buffer)[5]); };
31
33
bool
hdrErrCheck
()
const
;
34
bool
payErrCheck
()
const
;
35
void
hdrErrUpdate
();
36
void
payErrUpdate
();
37
39
bool
read
(istream&);
40
string
toString
()
const
;
41
static
string
pktTyp2string(
Forest::ptyp_t
);
42
static
bool
string2pktTyp(
string
&,
Forest::ptyp_t
&);
43
44
// packet fields - note: all public
45
int
version
;
46
int
length
;
47
Forest::ptyp_t
type
;
48
flgs_t
flags
;
49
comt_t
comtree
;
50
fAdr_t
srcAdr
;
51
fAdr_t
dstAdr
;
52
int
inLink
;
53
int
outLink
;
54
ipa_t
tunIp
;
55
ipp_t
tunPort
;
56
int64_t
rcvSeqNum
;
57
int
bufferLen
;
58
buffer_t*
buffer
;
59
60
private
:
61
};
62
63
}
// ends namespace
64
65
66
#endif
forest-net
cpp
include
Packet.h
Generated on Mon Aug 4 2014 11:13:35 for forest-net by
1.8.4