forest-net
an overlay networks for large-scale virtual worlds
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
forest::CpHandler Class Reference

This class is designed for use with multi-threaded controllers (NetMgr, ComtCtl, etc) that use control packets to communicate with routers and other components. More...

#include <CpHandler.h>

Collaboration diagram for forest::CpHandler:

Public Member Functions

 CpHandler (Queue *q1, Queue *q2, fAdr_t myAdr1, Logger *log, PacketStoreTs *ps1)
 
pktx clientAddComtree (fAdr_t, int, CtlPkt &)
 Send a client add comtree request. More...
 
pktx clientDropComtree (fAdr_t, comt_t, CtlPkt &)
 Send a client drop comtree request. More...
 
pktx clientJoinComtree (fAdr_t, comt_t, ipa_t, ipp_t, CtlPkt &)
 Send a client join comtree request. More...
 
pktx clientLeaveComtree (fAdr_t, comt_t, ipa_t, ipp_t, CtlPkt &)
 Send a client leave comtree request. More...
 
pktx addIface (fAdr_t, int, ipa_t, RateSpec &, CtlPkt &)
 Send an add interface request packet. More...
 
pktx dropIface (fAdr_t, int, CtlPkt &)
 Send a drop interface request packet. More...
 
pktx modIface (fAdr_t, int, ipa_t, RateSpec &, CtlPkt &)
 Send a modify interface request packet. More...
 
pktx getIface (fAdr_t, int, CtlPkt &)
 Send a get interface request packet. More...
 
pktx getIfaceSet (fAdr_t, int, int, CtlPkt &)
 Send a get iface set request packet. More...
 
pktx addLink (fAdr_t, Forest::ntyp_t, int, int, ipa_t, ipp_t, fAdr_t, uint64_t, CtlPkt &)
 Send an add link request packet. More...
 
pktx addLink (fAdr_t, Forest::ntyp_t, int, uint64_t, CtlPkt &)
 Send an add link request packet (short form for dynamic leaf nodes). More...
 
pktx dropLink (fAdr_t, int, fAdr_t, CtlPkt &)
 Send a drop link request packet. More...
 
pktx modLink (fAdr_t, int, RateSpec &, CtlPkt &)
 Send a modify link request packet. More...
 
pktx getLink (fAdr_t, int, CtlPkt &)
 Send a get link request packet. More...
 
pktx getLinkSet (fAdr_t, int, int, CtlPkt &)
 Send a get link set request packet. More...
 
pktx addComtree (fAdr_t, comt_t, CtlPkt &)
 Send an add comtree request packet. More...
 
pktx dropComtree (fAdr_t, comt_t, CtlPkt &)
 Send a drop comtree request packet. More...
 
pktx modComtree (fAdr_t, comt_t, int, int, CtlPkt &)
 Send a modify comtree request packet. More...
 
pktx getComtree (fAdr_t, comt_t, CtlPkt &)
 Send a get comtree request packet. More...
 
pktx getComtreeSet (fAdr_t, int, int, CtlPkt &)
 Send a get comtree set request packet. More...
 
pktx addComtreeLink (fAdr_t, comt_t, int, int, CtlPkt &)
 Send an add comtree link request packet. More...
 
pktx addComtreeLink (fAdr_t, comt_t, fAdr_t, CtlPkt &)
 Send an add comtree link request packet. More...
 
pktx dropComtreeLink (fAdr_t, comt_t, int, fAdr_t, CtlPkt &)
 Send an add comtree link request packet. More...
 
pktx modComtreeLink (fAdr_t, comt_t, int, RateSpec &, CtlPkt &)
 Send a drop comtree link request packet. More...
 
pktx getComtreeLink (fAdr_t, comt_t, int, CtlPkt &)
 Send a get comtree link request packet. More...
 
pktx getRouteSet (fAdr_t, int, int, CtlPkt &)
 Send a get route set request packet. More...
 
pktx addFilter (fAdr_t, CtlPkt &)
 Send an add filter request packet. More...
 
pktx dropFilter (fAdr_t, int, CtlPkt &)
 Send a drop filter request packet. More...
 
pktx modFilter (fAdr_t, int, string &, CtlPkt &)
 Send a modify filter request packet. More...
 
pktx getFilter (fAdr_t, int, CtlPkt &)
 Send a get filter request packet. More...
 
pktx getFilterSet (fAdr_t, int, int, CtlPkt &)
 Send a get filter set request packet. More...
 
pktx getLoggedPackets (fAdr_t, CtlPkt &)
 Send a get logged packets request packet. More...
 
pktx enablePacketLog (fAdr_t, bool, bool, CtlPkt &)
 Send an enable packet log request packet. More...
 
pktx newSession (fAdr_t, ipa_t, RateSpec &, CtlPkt &)
 Send a new session request packet. More...
 
pktx cancelSession (fAdr_t, fAdr_t, fAdr_t, CtlPkt &)
 Send a cancel session request packet. More...
 
pktx clientConnect (fAdr_t, fAdr_t, fAdr_t, CtlPkt &)
 Send a client connect request packet. More...
 
pktx clientDisconnect (fAdr_t, fAdr_t, fAdr_t, CtlPkt &)
 Send a client disconnect request packet. More...
 
pktx setLeafRange (fAdr_t, fAdr_t, fAdr_t, CtlPkt &)
 Send a set leaf range packet to a router. More...
 
pktx configLeaf (fAdr_t, fAdr_t, fAdr_t, ipa_t, ipp_t, uint64_t, CtlPkt &)
 Send a leaf config packet. More...
 
pktx bootRouter (fAdr_t, CtlPkt &)
 Send a boot router packet. More...
 
pktx bootLeaf (fAdr_t, CtlPkt &)
 Send a boot leaf packet. More...
 
pktx bootComplete (fAdr_t, CtlPkt &)
 Send a boot complete packet. More...
 
pktx bootAbort (fAdr_t, CtlPkt &)
 Send a boot abort packet. More...
 
int sendRequest (CtlPkt &, fAdr_t, CtlPkt &)
 Send a control packet request back through the main thread. More...
 
bool handleReply (pktx, CtlPkt &, string &, string &)
 
void sendReply (CtlPkt &, fAdr_t)
 Send a control packet reply back through the main thread. More...
 
void errReply (pktx, CtlPkt &, const string &)
 Build and send error reply packet for ps. More...
 
void setTunnel (ipa_t, ipp_t)
 
 CpHandler (Queue *q1, Queue *q2, fAdr_t myAdr1, Logger *log, PacketStoreTs *ps1)
 
pktx clientAddComtree (fAdr_t, int, CtlPkt &)
 
pktx clientDropComtree (fAdr_t, comt_t, CtlPkt &)
 
pktx clientJoinComtree (fAdr_t, comt_t, ipa_t, ipp_t, CtlPkt &)
 
pktx clientLeaveComtree (fAdr_t, comt_t, ipa_t, ipp_t, CtlPkt &)
 
pktx addIface (fAdr_t, int, ipa_t, RateSpec &, CtlPkt &)
 
pktx dropIface (fAdr_t, int, CtlPkt &)
 
pktx modIface (fAdr_t, int, ipa_t, RateSpec &, CtlPkt &)
 
pktx getIface (fAdr_t, int, CtlPkt &)
 
pktx addLink (fAdr_t, Forest::ntyp_t, int, int, ipa_t, ipp_t, fAdr_t, uint64_t, CtlPkt &)
 
pktx addLink (fAdr_t, Forest::ntyp_t, int, uint64_t, CtlPkt &)
 
pktx dropLink (fAdr_t, int, fAdr_t, CtlPkt &)
 
pktx modLink (fAdr_t, int, RateSpec &, CtlPkt &)
 
pktx getLink (fAdr_t, int, CtlPkt &)
 
pktx addComtree (fAdr_t, comt_t, CtlPkt &)
 
pktx dropComtree (fAdr_t, comt_t, CtlPkt &)
 
pktx modComtree (fAdr_t, comt_t, int, int, CtlPkt &)
 
pktx getComtree (fAdr_t, comt_t, CtlPkt &)
 
pktx addComtreeLink (fAdr_t, comt_t, int, int, CtlPkt &)
 
pktx addComtreeLink (fAdr_t, comt_t, fAdr_t, CtlPkt &)
 
pktx dropComtreeLink (fAdr_t, comt_t, int, fAdr_t, CtlPkt &)
 
pktx modComtreeLink (fAdr_t, comt_t, int, RateSpec &, CtlPkt &)
 
pktx getComtreeLink (fAdr_t, comt_t, int, CtlPkt &)
 
pktx newSession (fAdr_t, ipa_t, RateSpec &, CtlPkt &)
 
pktx clientConnect (fAdr_t, fAdr_t, fAdr_t, CtlPkt &)
 
pktx clientDisconnect (fAdr_t, fAdr_t, fAdr_t, CtlPkt &)
 
pktx setLeafRange (fAdr_t, fAdr_t, fAdr_t, CtlPkt &)
 
pktx configLeaf (fAdr_t, fAdr_t, fAdr_t, ipa_t, ipp_t, uint64_t, CtlPkt &)
 
pktx bootRouter (fAdr_t, CtlPkt &)
 
pktx bootLeaf (fAdr_t, CtlPkt &)
 
pktx bootComplete (fAdr_t, CtlPkt &)
 
pktx bootAbort (fAdr_t, CtlPkt &)
 
pktx getLinkSet (fAdr_t, CtlPkt &, int, int)
 Send a get link table request packet. More...
 
int sendRequest (CtlPkt &, fAdr_t, CtlPkt &)
 
bool handleReply (pktx, CtlPkt &, string &, string &)
 
void sendReply (CtlPkt &, fAdr_t)
 
void errReply (pktx, CtlPkt &, const string &)
 
void setTunnel (ipa_t, ipp_t)
 

Static Public Attributes

static const int NORESPONSE = (1 << 31)
 

Private Member Functions

int sendAndWait (pktx, CtlPkt &)
 Send a control request packet multiple times before giving up. More...
 
int sendAndWait (pktx, CtlPkt &)
 

Private Attributes

Queueinq
 from main thread
 
Queueoutq
 going back to main thread
 
fAdr_t myAdr
 address of this host
 
ipa_t tunIp
 ip address for tunnel
 
ipp_t tunPort
 port number for tunnel
 
PacketStoreTsps
 thread-safe packet store
 
Loggerlogger
 for reporting error messages
 

Detailed Description

This class is designed for use with multi-threaded controllers (NetMgr, ComtCtl, etc) that use control packets to communicate with routers and other components.

It handles retransmission of control packet requests, on behalf of the thread using it. Each thread instantiates and initializes its own CpHandler. The threads use a pair of queues to communicate with a "main thread" that handles IO and routing of packets to the appropriate thread.

Definition at line 31 of file CpHandler.h.

Member Function Documentation

pktx forest::CpHandler::addComtree ( fAdr_t  dest,
comt_t  comtree,
CtlPkt repCp 
)

Send an add comtree request packet.

Parameters
destis the destination address for the packet
comtreeis the comtree number of the comtree to be added (may be 0)
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 284 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::addComtreeLink ( fAdr_t  dest,
comt_t  comtree,
int  link,
int  peerCoreFlag,
CtlPkt repCp 
)

Send an add comtree link request packet.

Parameters
destis the destination address for the packet
comtreeis the comtree number of the comtree to be added
linkis the link number of the link to be added
peerCoreFlagis the core flag of the peer for this link (may be -1)
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 342 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::addComtreeLink ( fAdr_t  dest,
comt_t  comtree,
fAdr_t  peerAdr,
CtlPkt repCp 
)

Send an add comtree link request packet.

This version is used only when the peer is a leaf node.

Parameters
destis the destination address for the packet
comtreeis the comtree number of the comtree to be added
peerAdris the forest address of the peer
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 359 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::addFilter ( fAdr_t  dest,
CtlPkt repCp 
)

Send an add filter request packet.

Parameters
destis the destination address for the packet
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response; the reply packet should include the link number assigned by the router and the Forest address assigned to the peer by the router.

Definition at line 462 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::addIface ( fAdr_t  dest,
int  iface,
ipa_t  ifip,
RateSpec rates,
CtlPkt repCp 
)

Send an add interface request packet.

Parameters
destis the destination address for the packet
ifaceis the number of the interface to be added
ifipis the IP address to be associated with the interface
ratesis the rate spec for the interface
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 82 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::addLink ( fAdr_t  dest,
Forest::ntyp_t  peerType,
int  iface,
int  lnk,
ipa_t  peerIp,
ipp_t  peerPort,
fAdr_t  peerAdr,
uint64_t  nonce,
CtlPkt repCp 
)

Send an add link request packet.

Parameters
destis the destination address for the packet
peerTypeis the node type of the peer of the new link
ifaceis the number of the interface for the link
linkis the link number of the link to be added
peerIpis the ip address of the peer
peerPortis the ip port of the peer
peerAdris the address for the peer
nonceis the nonce that must be included in client connect
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 147 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::addLink ( fAdr_t  dest,
Forest::ntyp_t  peerType,
int  iface,
uint64_t  nonce,
CtlPkt repCp 
)

Send an add link request packet (short form for dynamic leaf nodes).

Parameters
destis the destination address for the packet
peerTypeis the node type of the peer of the new link
ifaceis the number of the interface for the link
nonceis the nonce that must be included in client connect
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response; the reply packet should include the link number assigned by the router and the Forest address assigned to the peer by the router.

Definition at line 168 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::bootAbort ( fAdr_t  dest,
CtlPkt repCp 
)

Send a boot abort packet.

Parameters
destis the destination address for the packet
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 679 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::bootComplete ( fAdr_t  dest,
CtlPkt repCp 
)

Send a boot complete packet.

Parameters
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 668 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::bootLeaf ( fAdr_t  dest,
CtlPkt repCp 
)

Send a boot leaf packet.

Parameters
destis the destination address for the packet
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 658 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::bootRouter ( fAdr_t  dest,
CtlPkt repCp 
)

Send a boot router packet.

Parameters
destis the destination address for the packet
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 611 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::cancelSession ( fAdr_t  dest,
fAdr_t  clientAdr,
fAdr_t  rtrAdr,
CtlPkt repCp 
)

Send a cancel session request packet.

Parameters
destis the destination address for the packet
clientAdris the forest address of the client
rtAdris the forest address of the client's router
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 570 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::clientAddComtree ( fAdr_t  dest,
int  zipCode,
CtlPkt repCp 
)

Send a client add comtree request.

Parameters
destis the destination address for the packet
zipCodeis the number of the interface to be added
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 20 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::clientConnect ( fAdr_t  dest,
fAdr_t  clientAdr,
fAdr_t  rtrAdr,
CtlPkt repCp 
)

Send a client connect request packet.

Parameters
destis the destination address for the packet
clientAdris the address of the client
rtrAdris the address of the client's access router
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 585 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::clientDisconnect ( fAdr_t  dest,
fAdr_t  clientAdr,
fAdr_t  rtrAdr,
CtlPkt repCp 
)

Send a client disconnect request packet.

Parameters
destis the destination address for the packet
clientAdris the address of the client
rtrAdris the address of the client's access router
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 599 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::clientDropComtree ( fAdr_t  dest,
comt_t  comt,
CtlPkt repCp 
)

Send a client drop comtree request.

Parameters
destis the destination address for the packet
comtis the number of the comtree to be dropped
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 33 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::clientJoinComtree ( fAdr_t  dest,
comt_t  comt,
ipa_t  clientIp,
ipp_t  clientPort,
CtlPkt repCp 
)

Send a client join comtree request.

Parameters
destis the destination address for the packet
comtis the number of the comtree to be dropped
clientIpis the client IP address
clientPortis the client IP port number
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 48 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::clientLeaveComtree ( fAdr_t  dest,
comt_t  comt,
ipa_t  clientIp,
ipp_t  clientPort,
CtlPkt repCp 
)

Send a client leave comtree request.

Parameters
destis the destination address for the packet
comtis the number of the comtree to be dropped
clientIpis the client IP address
clientPortis the client IP port number
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 65 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::configLeaf ( fAdr_t  dest,
fAdr_t  leafAdr,
fAdr_t  rtrAdr,
ipa_t  rtrIp,
ipp_t  rtrPort,
uint64_t  nonce,
CtlPkt repCp 
)

Send a leaf config packet.

Parameters
destis the destination address for the packet
leafAdris the forest address assigned to the leaf
rtrAdris the forest address of the leaf's access router
rtrIpis the IP of the leaf's access router
rtrPortis the port number of the leaf's access router
nonceis a nonce that the leaf can use to connect to router
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 627 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::dropComtree ( fAdr_t  dest,
comt_t  comtree,
CtlPkt repCp 
)

Send a drop comtree request packet.

Parameters
destis the destination address for the packet
comtreeis the number of the comtree to be dropped
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 297 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::dropComtreeLink ( fAdr_t  dest,
comt_t  comtree,
int  link,
fAdr_t  peerAdr,
CtlPkt repCp 
)

Send an add comtree link request packet.

Parameters
destis the destination address for the packet
comtreeis the comtree number of the comtree to be added
peerCoreFlagis the core flag of the peer for this link (may be -1)
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response pktx CpHandler::addComtreeLink(fAdr_t dest, comt_t comtree, ipa_t peerIp, ipp_t peerPort, int peerCoreFlag, CtlPkt& repCp) { CtlPkt reqCp(CtlPkt::ADD_COMTREE_LINK,CtlPkt::REQUEST,0); reqCp.comtree = comtree; reqCp.ip1 = peerIp; reqCp.port1 = peerPort; reqCp.coreFlag = peerCoreFlag; return sendRequest(reqCp,dest,repCp); }Send a drop comtree link request packet.
Parameters
destis the destination address for the packet
comtreeis the comtree number of the comtree
linkis the link number of the link to be added (may be 0)
peerAdris the address of the peer node (must be non-zero if link=0)
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 393 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::dropFilter ( fAdr_t  dest,
int  filter,
CtlPkt repCp 
)

Send a drop filter request packet.

Parameters
destis the destination address for the packet
filteris the number of the filter to be dropped
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 474 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::dropIface ( fAdr_t  dest,
int  iface,
CtlPkt repCp 
)

Send a drop interface request packet.

Parameters
destis the destination address for the packet
ifaceis the number of the interface to be dropped
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 97 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::dropLink ( fAdr_t  dest,
int  link,
fAdr_t  peerAdr,
CtlPkt repCp 
)

Send a drop link request packet.

Parameters
destis the destination address for the packet
linkis the number of the link to be dropped (may be 0)
peerAdris the address of the peer at the end of the link (may be 0)
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 183 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::enablePacketLog ( fAdr_t  dest,
bool  on,
bool  local,
CtlPkt repCp 
)

Send an enable packet log request packet.

Parameters
destis the destination address for the packet
oncontrols whether logging is to be turned on (true) or off (false)
localcontrols local logging in the same way
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 542 of file ControlSender.cpp.

Here is the call graph for this function:

void forest::CpHandler::errReply ( pktx  px,
CtlPkt cp,
const string &  msg 
)

Build and send error reply packet for ps.

Parameters
pxis the packet index of the request packet we are replying to
cpis the control packet structure for p (already unpacked)
msgis the error message to be sent.

Definition at line 828 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::getComtree ( fAdr_t  dest,
comt_t  comtree,
CtlPkt repCp 
)

Send a get comtree request packet.

Parameters
destis the destination address for the packet
comtreeis the number of the comtree
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 327 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::getComtreeLink ( fAdr_t  dest,
comt_t  comtree,
int  link,
CtlPkt repCp 
)

Send a get comtree link request packet.

Parameters
destis the destination address for the packet
comtreeis the number of the comtree
linkis the number of the link
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 448 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::getComtreeSet ( fAdr_t  dest,
int  link,
int  count,
CtlPkt repCp 
)

Send a get comtree set request packet.

Parameters
destis the destination address for the packet
firstLinkis the table index for the first comtree to be returned; if zero, start with the first comtree in the table
countis the number of comtrees whose table entries are requested
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 241 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::getFilter ( fAdr_t  dest,
int  filter,
CtlPkt repCp 
)

Send a get filter request packet.

Parameters
destis the destination address for the packet
filteris the number of the filter
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 502 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::getFilterSet ( fAdr_t  dest,
int  firstFilter,
int  count,
CtlPkt repCp 
)

Send a get filter set request packet.

Parameters
destis the destination address for the packet
firstFilteris the table index for the first filter to be returned; if zero, start with the first filter in the table
countis the number of filters whose table entries are requested
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 517 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::getIface ( fAdr_t  dest,
int  iface,
CtlPkt repCp 
)

Send a get interface request packet.

Parameters
destis the destination address for the packet
ifaceis the number of the interface
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 127 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::getIfaceSet ( fAdr_t  dest,
int  iface,
int  count,
CtlPkt repCp 
)

Send a get iface set request packet.

Parameters
destis the destination address for the packet
firstIfaceis the table index for the first iface to be returned; if zero, start with the first iface in the table
countis the number of ifaces whose table entries are requested
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 256 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::getLink ( fAdr_t  dest,
int  link,
CtlPkt repCp 
)

Send a get link request packet.

Parameters
destis the destination address for the packet
linkis the number of the link
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 211 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::getLinkSet ( fAdr_t  dest,
int  link,
int  count,
CtlPkt repCp 
)

Send a get link set request packet.

Parameters
destis the destination address for the packet
firstLinkis the table index for the first link to be returned; if zero, start with the first link in the table
countis the number of links whose table entries are requested
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 226 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::getLinkSet ( fAdr_t  dest,
CtlPkt repCp,
int  firstLinkNum,
int  numOfLinks 
)

Send a get link table request packet.

Parameters
destis the destination address for the packet
repCpis a reference to a control packet in which the control packet in the response is returned (if reponse is != 0)
firstLinkNumis the first link number
numOfLinksis the number of links sent
Returns
the index of the response packet or 0 if there is no response

Definition at line 571 of file CpHandlerDoowon.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::getLoggedPackets ( fAdr_t  dest,
CtlPkt repCp 
)

Send a get logged packets request packet.

Parameters
destis the destination address for the packet
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 529 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::getRouteSet ( fAdr_t  dest,
int  route,
int  count,
CtlPkt repCp 
)

Send a get route set request packet.

Parameters
destis the destination address for the packet
firstRouteis the table index for the first route to be returned; if zero, start with the first route in the table
countis the number of routes whose table entries are requested
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 271 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::modComtree ( fAdr_t  dest,
comt_t  comtree,
int  pLink,
int  coreFlag,
CtlPkt repCp 
)

Send a modify comtree request packet.

Parameters
destis the destination address for the packet
comtreeis the number of the comtree to be modified
pLinkis the parent link for the comtree
coreFlagis the core flag for the comtree
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 312 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::modComtreeLink ( fAdr_t  dest,
comt_t  comtree,
int  link,
RateSpec rates,
CtlPkt repCp 
)

Send a drop comtree link request packet.

Parameters
destis the destination address for the packet
comtreeis the comtree number of the comtree
peerIpis the ip address of the peer
peerPortis the ip port of the peer
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response pktx CpHandler::dropComtreeLink(fAdr_t dest, comt_t comtree, ipa_t peerIp, ipp_t peerPort,CtlPkt& repCp) { CtlPkt reqCp(CtlPkt::DROP_COMTREE_LINK,CtlPkt::REQUEST,0); reqCp.comtree = comtree; reqCp.ip1 = peerIp; reqCp.port1 = peerPort; return sendRequest(reqCp,dest,repCp); }Send a modify comtree link request packet.
Parameters
destis the destination address for the packet
comtreeis the number of the comtree to be modified
linkis the link number for the comtree
ratesis the rate spec for the comtree link
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 432 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::modFilter ( fAdr_t  dest,
int  filter,
string &  filterString,
CtlPkt repCp 
)

Send a modify filter request packet.

Parameters
destis the destination address for the packet
filteris the number of the filter to be modified
filterStringis a string representation fo the filter
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 488 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::modIface ( fAdr_t  dest,
int  iface,
ipa_t  ifip,
RateSpec rates,
CtlPkt repCp 
)

Send a modify interface request packet.

Parameters
destis the destination address for the packet
ifaceis the number of the interface to be modified
ifipis the IP address to be associated with the interface
ratesis the rate spec for the interface
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 112 of file ControlSender.cpp.

Here is the call graph for this function:

pktx forest::CpHandler::modLink ( fAdr_t  dest,
int  link,
RateSpec rates,
CtlPkt repCp 
)

Send a modify link request packet.

Parameters
destis the destination address for the packet
linkis the number of the link to be modified
ratesis the rate spec for the link
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 198 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::newSession ( fAdr_t  dest,
ipa_t  clientIp,
RateSpec rates,
CtlPkt repCp 
)

Send a new session request packet.

Parameters
destis the destination address for the packet
clientIpis the ip address of the client
ratesis the rate spec for this session
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 556 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int forest::CpHandler::sendAndWait ( pktx  px,
CtlPkt cp 
)
private

Send a control request packet multiple times before giving up.

This method makes a copy of the original and sends the copy back to the main thread. If no reply is received after 1 second, it tries again; it makes a total of three attempts before giving up.

Parameters
pxis the packet index of the packet to be sent; the header for px is assumed to be unpacked
cpis the control packet structure for p (already unpacked)
Returns
the packet number for the reply packet, or 0 if there was an error or no reply

Definition at line 741 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void forest::CpHandler::sendReply ( CtlPkt cp,
fAdr_t  dest 
)

Send a control packet reply back through the main thread.

The control packet object is assumed to be already initialized.

Parameters
cpis the pre-formatted control packet
destis the destination address to which it is to be sent

Definition at line 797 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::sendRequest ( CtlPkt cp,
fAdr_t  dest,
CtlPkt repCp 
)

Send a control packet request back through the main thread.

The control packet object is assumed to be already initialized. It is packed into a packet object whose index is then placed in the outq. It then waits for a reply. If the reply is not received after one second, it tries again. After three failed attempts, it gives up.

Parameters
cpis the pre-formatted control packet
destis the destination address to which it is to be sent
repCpis a reference to a control packet in which the response control packet is returned.
Returns
the packet index of the reply, when there is one, and 0 on an error, or if there is no reply.

Definition at line 696 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pktx forest::CpHandler::setLeafRange ( fAdr_t  dest,
fAdr_t  first,
fAdr_t  last,
CtlPkt repCp 
)

Send a set leaf range packet to a router.

Parameters
destis the destination address for the packet
firstis the first forest address in the target router's leaf range
lastis the last forest address in the target router's leaf range
repCpis a reference to a control packet in which the control packet in the response is returned (if response is != 0)
Returns
the index of the response packet or 0 if there is no response

Definition at line 645 of file ControlSender.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: