FlatNetworkConfigurator6 Class Reference

#include <FlatNetworkConfigurator6.h>

List of all members.


Detailed Description

Configures IPv6 addresses and routing tables for a "flat" network, "flat" meaning that all hosts and routers will have the same network address.

For more info please see the NED file.


Public Types

typedef std::vector< std::string > StringVector

Protected Member Functions

virtual int numInitStages () const
virtual void initialize (int stage)
virtual void handleMessage (cMessage *msg)
void configureAdvPrefixes (cTopology &topo, StringVector &nonIPTypes)
void addOwnAdvPrefixRoutes (cTopology &topo, StringVector &nonIPTypes)
void addStaticRoutes (cTopology &topo, StringVector &nonIPTypes)
void setDisplayString (int numIPNodes, int numNonIPNodes)
bool isNonIPType (cTopology::Node *node, StringVector &nonIPTypes)


Member Typedef Documentation

typedef std::vector<std::string> FlatNetworkConfigurator6::StringVector


Member Function Documentation

void FlatNetworkConfigurator6::addOwnAdvPrefixRoutes ( cTopology &  topo,
StringVector nonIPTypes 
) [protected]

void FlatNetworkConfigurator6::addStaticRoutes ( cTopology &  topo,
StringVector nonIPTypes 
) [protected]

void FlatNetworkConfigurator6::configureAdvPrefixes ( cTopology &  topo,
StringVector nonIPTypes 
) [protected]

void FlatNetworkConfigurator6::handleMessage ( cMessage *  msg  )  [protected, virtual]

00068 {
00069     error("this module doesn't handle messages, it runs only in initialize()");
00070 }

void FlatNetworkConfigurator6::initialize ( int  stage  )  [protected, virtual]

00038 {
00039 #ifdef WITH_IPv6
00040     // FIXME refactor: make routers[] array? (std::vector<cTopology::Node*>)
00041     // FIXME: spare common beginning for all stages?
00042 
00043     cTopology topo("topo");
00044     StringVector types = cStringTokenizer(par("moduleTypes"), " ").asVector();
00045     StringVector nonIPTypes = cStringTokenizer(par("nonIPModuleTypes"), " ").asVector();
00046     for (unsigned int i=0; i<nonIPTypes.size(); i++)
00047         types.push_back(nonIPTypes[i]);
00048 
00049     // extract topology
00050     topo.extractByModuleType(types);
00051     EV << "cTopology found " << topo.nodes() << " nodes\n";
00052 
00053     if (stage==2)
00054     {
00055         configureAdvPrefixes(topo, nonIPTypes);
00056     }
00057     else if (stage==3)
00058     {
00059         addOwnAdvPrefixRoutes(topo, nonIPTypes);
00060         addStaticRoutes(topo, nonIPTypes);
00061     }
00062 #else
00063     error("FlatNetworkConfigurator6 not supported: WITH_IPv6 option was off during compilation");
00064 #endif
00065 }

bool FlatNetworkConfigurator6::isNonIPType ( cTopology::Node *  node,
StringVector nonIPTypes 
) [protected]

00081 {
00082     return std::find(nonIPTypes.begin(), nonIPTypes.end(), node->module()->className())!=nonIPTypes.end();
00083 }

virtual int FlatNetworkConfigurator6::numInitStages (  )  const [inline, protected, virtual]

00040 {return 4;}

void FlatNetworkConfigurator6::setDisplayString ( int  numIPNodes,
int  numNonIPNodes 
) [protected]

00073 {
00074     // update display string
00075     char buf[80];
00076     sprintf(buf, "%d IPv6 nodes\n%d non-IP nodes", numIPNodes, numNonIPNodes);
00077     displayString().setTagArg("t", 0, buf);
00078 }


The documentation for this class was generated from the following files:
Generated on Wed Apr 4 13:20:19 2007 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.7