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
CpHandler.h
Go to the documentation of this file.
1
9
#ifndef CPHANDLER_H
10
#define CPHANDLER_H
11
12
#include "
Forest.h
"
13
#include "
Logger.h
"
14
#include "
CtlPkt.h
"
15
#include "
RateSpec.h
"
16
#include "
Queue.h
"
17
#include "
PacketStoreTs.h
"
18
19
namespace
forest {
20
21
31
class
CpHandler
{
32
public
:
33
CpHandler
(
Queue
* q1,
Queue
* q2,
fAdr_t
myAdr1,
Logger
* log,
34
PacketStoreTs
*ps1) :
inq
(q1),
outq
(q2),
myAdr
(myAdr1),
35
tunIp
(0),
tunPort
(0),
ps
(ps1),
logger
(log) {}
36
37
static
const
int
NORESPONSE = (1 << 31);
38
39
pktx
clientAddComtree
(
fAdr_t
,
int
,
CtlPkt
&);
40
pktx
clientDropComtree
(
fAdr_t
,
comt_t
,
CtlPkt
&);
41
pktx
clientJoinComtree
(
fAdr_t
,
comt_t
,ipa_t, ipp_t,
CtlPkt
&);
42
pktx
clientLeaveComtree
(
fAdr_t
,
comt_t
,ipa_t, ipp_t,
CtlPkt
&);
43
44
pktx
addIface
(
fAdr_t
,
int
,ipa_t,
RateSpec
&,
CtlPkt
&);
45
pktx
dropIface
(
fAdr_t
,
int
,
CtlPkt
&);
46
pktx
modIface
(
fAdr_t
,
int
,ipa_t,
RateSpec
&,
CtlPkt
&);
47
pktx
getIface
(
fAdr_t
,
int
,
CtlPkt
&);
48
pktx
getIfaceSet
(
fAdr_t
,
int
,
int
,
CtlPkt
&);
49
50
pktx
addLink
(
fAdr_t
,
Forest::ntyp_t
,
int
,
int
,ipa_t,ipp_t,
fAdr_t
,uint64_t,
CtlPkt
&);
51
pktx
addLink
(
fAdr_t
,
Forest::ntyp_t
,
int
,uint64_t,
CtlPkt
&);
52
pktx
dropLink
(
fAdr_t
,
int
,
fAdr_t
,
CtlPkt
&);
53
pktx
modLink
(
fAdr_t
,
int
,
RateSpec
&,
CtlPkt
&);
54
pktx
getLink
(
fAdr_t
,
int
,
CtlPkt
&);
55
pktx
getLinkSet
(
fAdr_t
,
int
,
int
,
CtlPkt
&);
56
57
pktx
addComtree
(
fAdr_t
,
comt_t
,
CtlPkt
&);
58
pktx
dropComtree
(
fAdr_t
,
comt_t
,
CtlPkt
&);
59
pktx
modComtree
(
fAdr_t
,
comt_t
,
int
,
int
,
CtlPkt
&);
60
pktx
getComtree
(
fAdr_t
,
comt_t
,
CtlPkt
&);
61
pktx
getComtreeSet
(
fAdr_t
,
int
,
int
,
CtlPkt
&);
62
63
pktx
addComtreeLink
(
fAdr_t
,
comt_t
,
int
,
int
,
CtlPkt
&);
64
pktx
addComtreeLink
(
fAdr_t
,
comt_t
,
fAdr_t
,
CtlPkt
&);
65
pktx
dropComtreeLink
(
fAdr_t
,
comt_t
,
int
,
fAdr_t
,
CtlPkt
&);
66
pktx
modComtreeLink
(
fAdr_t
,
comt_t
,
int
,
RateSpec
&,
CtlPkt
&);
67
pktx
getComtreeLink
(
fAdr_t
,
comt_t
,
int
,
CtlPkt
&);
68
69
pktx
getRouteSet
(
fAdr_t
,
int
,
int
,
CtlPkt
&);
70
71
pktx
addFilter
(
fAdr_t
,
CtlPkt
&);
72
pktx
dropFilter
(
fAdr_t
,
int
,
CtlPkt
&);
73
pktx
modFilter
(
fAdr_t
,
int
,
string
&,
CtlPkt
&);
74
pktx
getFilter
(
fAdr_t
,
int
,
CtlPkt
&);
75
pktx
getFilterSet
(
fAdr_t
,
int
,
int
,
CtlPkt
&);
76
pktx
getLoggedPackets
(
fAdr_t
,
CtlPkt
&);
77
pktx
enablePacketLog
(
fAdr_t
,
bool
,
bool
,
CtlPkt
&);
78
79
pktx
newSession
(
fAdr_t
,ipa_t,
RateSpec
&,
CtlPkt
&);
80
pktx
cancelSession
(
fAdr_t
,
fAdr_t
,
fAdr_t
,
CtlPkt
&);
81
pktx
clientConnect
(
fAdr_t
,
fAdr_t
,
fAdr_t
,
CtlPkt
&);
82
pktx
clientDisconnect
(
fAdr_t
,
fAdr_t
,
fAdr_t
,
CtlPkt
&);
83
84
pktx
setLeafRange
(
fAdr_t
,
fAdr_t
,
fAdr_t
,
CtlPkt
&);
85
pktx
configLeaf
(
fAdr_t
,
fAdr_t
,
fAdr_t
,ipa_t,ipp_t,uint64_t,
CtlPkt
&);
86
pktx
bootRouter
(
fAdr_t
,
CtlPkt
&);
87
pktx
bootLeaf
(
fAdr_t
,
CtlPkt
&);
88
pktx
bootComplete
(
fAdr_t
,
CtlPkt
&);
89
pktx
bootAbort
(
fAdr_t
,
CtlPkt
&);
90
91
int
sendRequest
(
CtlPkt
&,
fAdr_t
,
CtlPkt
&);
92
bool
handleReply(pktx,
CtlPkt
&,
string
&,
string
&);
93
void
sendReply
(
CtlPkt
&,
fAdr_t
);
94
void
errReply
(pktx,
CtlPkt
&,
const
string
&);
95
96
void
setTunnel(ipa_t, ipp_t);
97
98
private
:
99
Queue
*
inq
;
100
Queue
*
outq
;
101
fAdr_t
myAdr
;
102
ipa_t
tunIp
;
103
ipp_t
tunPort
;
104
PacketStoreTs
*
ps
;
105
Logger
*
logger
;
106
107
int
sendAndWait
(pktx,
CtlPkt
&);
108
};
109
110
inline
void
CpHandler::setTunnel(ipa_t ip, ipp_t port) {
111
tunIp
= ip;
tunPort
= port;
112
}
113
114
}
// ends namespace
115
116
117
#endif
forest-net
cpp
include
CpHandler.h
Generated on Mon Aug 4 2014 11:13:35 for forest-net by
1.8.4