forest-net
an overlay networks for large-scale virtual worlds
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
NetMgr.cpp File Reference
#include "NetMgr.h"
#include "CpHandler.h"
Include dependency graph for NetMgr.cpp:

Go to the source code of this file.

Namespaces

 forest
 The CtlPkt class is used to pack and unpack forest control messages.
 

Constant Groups

 forest
 The CtlPkt class is used to pack and unpack forest control messages.
 

Functions

int main (int argc, char *argv[])
 usage: NetMgr topoFile prefixFile finTime More...
 
bool forest::init (const char *topoFile)
 Initialization of NetMgr. More...
 
void forest::cleanup ()
 
void * forest::handler (void *qp)
 Control packet handler. More...
 
bool forest::handleConsole (int sock, CpHandler &cph)
 Handle a connection from a remote console. More...
 
bool forest::login (NetBuffer &buf, string &clientName, string &reply)
 Handle a login request. More...
 
bool forest::newAccount (NetBuffer &buf, string &clientName, string &reply)
 Handle a new account request. More...
 
void forest::getProfile (NetBuffer &buf, string &clientName, string &reply)
 Handle a get profile request. More...
 
void forest::updateProfile (NetBuffer &buf, string &clientName, string &reply)
 Handle an update profile request. More...
 
void forest::changePassword (NetBuffer &buf, string &clientName, string &reply)
 Handle a change password request. More...
 
void forest::addFilter (NetBuffer &buf, string &reply, CpHandler &cph)
 Allocate log filter in router and return filter index to Console. More...
 
void forest::modFilter (NetBuffer &buf, string &reply, CpHandler &cph)
 Modify log filter in router. More...
 
void forest::dropFilter (NetBuffer &buf, string &reply, CpHandler &cph)
 Drop log filter from router. More...
 
void forest::getFilter (NetBuffer &buf, string &reply, CpHandler &cph)
 Get log filter from router and return to Console. More...
 
void forest::getFilterSet (NetBuffer &buf, string &reply, CpHandler &cph)
 Get log filter set from router and return to Console. More...
 
void forest::getLoggedPackets (NetBuffer &buf, string &reply, CpHandler &cph)
 Get logged packets from router and return to Console. More...
 
void forest::enableLocalLog (NetBuffer &buf, string &reply, CpHandler &cph)
 Enable local log in router Reads router name from the socket. More...
 
void forest::getLinkTable (NetBuffer &buf, string &reply, CpHandler &cph)
 Get link table from router and return to Console. More...
 
void forest::getComtreeTable (NetBuffer &buf, string &reply, CpHandler &cph)
 Get comtree table from router and return to Console. More...
 
void forest::getIfaceTable (NetBuffer &buf, string &reply, CpHandler &cph)
 Get iface table from router and return to Console. More...
 
void forest::getRouteTable (NetBuffer &buf, string &reply, CpHandler &cph)
 Get route table from router and return to Console. More...
 
bool forest::handleConDisc (pktx px, CtlPkt &cp, CpHandler &cph)
 Handle a connection/disconnection notification from a router. More...
 
bool forest::handleNewSession (pktx px, CtlPkt &cp, CpHandler &cph)
 Handle a new session request. More...
 
fAdr_t forest::setupLeaf (int leaf, pktx px, CtlPkt &cp, int rtr, int iface, uint64_t nonce, CpHandler &cph, bool useTunnel)
 Setup a leaf by sending configuration packets to its access router. More...
 
bool forest::handleCancelSession (pktx px, CtlPkt &cp, CpHandler &cph)
 Handle a cancel session request. More...
 
bool forest::handleBootLeaf (pktx px, CtlPkt &cp, CpHandler &cph)
 Handle boot process for a pre-configured leaf node. More...
 
uint64_t forest::generateNonce ()
 Return a random nonce suitable for use when connecting a leaf. More...
 
bool forest::processReply (pktx px, CtlPkt &cp, pktx reply, CtlPkt &repCp, CpHandler &cph, const string &msg)
 Process the reply from an outgoing request packet This method implements a common pattern used by handlers that are configuring routers in response to a received request. More...
 
bool forest::handleBootRouter (pktx px, CtlPkt &cp, CpHandler &cph)
 Handle a boot request from a router. More...
 
bool forest::setupEndpoint (int lnk, int rtr, pktx px, CtlPkt &cp, CpHandler &cph, bool useTunnel)
 Configure a link endpoint at a router. More...
 
bool forest::setupComtree (int ctx, int rtr, pktx px, CtlPkt &cp, CpHandler &cph, bool useTunnel)
 Setup a pre-configured comtree at a booting router. More...
 
bool forest::findCliRtr (ipa_t cliIp, fAdr_t &rtrAdr)
 Finds the router address of the router based on IP prefix. More...
 
bool forest::readPrefixInfo (char filename[])
 Reads the prefix file. More...
 
void forest::writeAdminRecord (int adx)
 Write a record to the file of network administrators. More...
 

Detailed Description

Author
Jon Turner
Date
2011 This is open source software licensed under the Apache 2.0 license. See http://www.apache.org/licenses/LICENSE-2.0 for details.

Definition in file NetMgr.cpp.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

usage: NetMgr topoFile prefixFile finTime

The first argument is the topology file (aka NetInfo file) that describes the network topology. PrefixFile is a file that maps IP prefixes of clients to forest routers. FinTime is the number of seconds to run. If zero, the NetMgr runs forever.

Definition at line 23 of file NetMgr.cpp.

Here is the call graph for this function: