TopologyReade: ran check-style.py and fixed documentation
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
/**
|
||||
* \addtogroup topology Topology Input Readers
|
||||
* \defgroup topology Topology Input Readers
|
||||
*
|
||||
* \section topologyOverview Topology Input Readers Overview
|
||||
*
|
||||
* The topology modules aim at reading a topology file generated by an automatic topology generator.
|
||||
*
|
||||
@@ -9,9 +11,12 @@
|
||||
*
|
||||
* Hence, model is focused on being able to read correctly the various topology formats.
|
||||
*
|
||||
* Currently there are two models:
|
||||
* - Orbis 0.7
|
||||
* - Inet 3.0
|
||||
* Currently there are three models:
|
||||
* - ns3::OrbisTopologyReader for Orbis 0.7 traces (http://sysnet.ucsd.edu/~pmahadevan/topo_research/topo.html)
|
||||
* - ns3::InetTopologyReader for Inet 3.0 traces (http://topology.eecs.umich.edu/inet/)
|
||||
* - ns3::RocketfuelTopologyReader for Rocketfuel traces (http://www.cs.washington.edu/research/networking/rocketfuel/)
|
||||
*
|
||||
* An helper ns3::TopologyReaderHelper is provided to assist on trivial tasks.
|
||||
*
|
||||
* A good source for topology data is also Archipelago (http://www.caida.org/projects/ark/)
|
||||
*
|
||||
@@ -29,4 +34,5 @@
|
||||
* used create a rescaled version of the topology, thus being the most effective way
|
||||
* (to my best knowledge) to make an internet-like topology.
|
||||
*
|
||||
* Examples can be found in the directory src/topology-read/examples/
|
||||
*/
|
||||
@@ -80,12 +80,12 @@ int main (int argc, char *argv[])
|
||||
|
||||
Ptr<TopologyReader> inFile = 0;
|
||||
TopologyReaderHelper topoHelp;
|
||||
|
||||
|
||||
NodeContainer nodes;
|
||||
|
||||
topoHelp.SetFileName(input);
|
||||
topoHelp.SetFileType(format);
|
||||
inFile = topoHelp.GetTopologyReader();
|
||||
|
||||
topoHelp.SetFileName (input);
|
||||
topoHelp.SetFileType (format);
|
||||
inFile = topoHelp.GetTopologyReader ();
|
||||
|
||||
if (inFile != 0)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup topology
|
||||
* \brief Helper class which makes it easier to configure and use a generic TopologyReader.
|
||||
*/
|
||||
class TopologyReaderHelper
|
||||
|
||||
@@ -32,7 +32,6 @@ namespace ns3 {
|
||||
// ------------------------------------------------------------
|
||||
// --------------------------------------------
|
||||
/**
|
||||
* \ingroup topology
|
||||
* \brief Topology file reader (Inet-format type).
|
||||
*
|
||||
* This class takes an input file in Inet format and extracts all
|
||||
|
||||
@@ -32,7 +32,6 @@ namespace ns3 {
|
||||
// ------------------------------------------------------------
|
||||
// --------------------------------------------
|
||||
/**
|
||||
* \ingroup topology
|
||||
* \brief Topology file reader (Orbis-format type).
|
||||
*
|
||||
* This class takes an input file in Orbis format and extracts all
|
||||
|
||||
@@ -96,10 +96,14 @@ RocketfuelTopologyReader::GenerateFromMapsFile (int argc, char *argv[])
|
||||
loc = argv[1];
|
||||
|
||||
if (argv[2])
|
||||
dns = true;
|
||||
{
|
||||
dns = true;
|
||||
}
|
||||
|
||||
if (argv[3])
|
||||
bb = true;
|
||||
{
|
||||
bb = true;
|
||||
}
|
||||
|
||||
num_neigh_s = ::atoi (argv[4]);
|
||||
if (num_neigh_s < 0)
|
||||
@@ -148,9 +152,9 @@ RocketfuelTopologyReader::GenerateFromMapsFile (int argc, char *argv[])
|
||||
|
||||
/* uid @loc [+] [bb] (num_neigh) [&ext] -> <nuid-1> <nuid-2> ... {-euid} ... =name[!] rn */
|
||||
NS_LOG_INFO ("Load Node[" << uid << "]: location: " << loc << " dns: " << dns
|
||||
<< " bb: " << bb << " neighbors: " << neigh_list.size ()
|
||||
<< "(" << "%d" << ") externals: \"%s\"(%d) "
|
||||
<< "name: " << name << " radius: " << radius);
|
||||
<< " bb: " << bb << " neighbors: " << neigh_list.size ()
|
||||
<< "(" << "%d" << ") externals: \"%s\"(%d) "
|
||||
<< "name: " << name << " radius: " << radius);
|
||||
|
||||
// Create node and link
|
||||
if (!uid.empty ())
|
||||
@@ -229,8 +233,8 @@ RocketfuelTopologyReader::GenerateFromWeightsFile (int argc, char *argv[])
|
||||
bool found = false;
|
||||
for (iter = LinksBegin (); iter != LinksEnd (); iter++)
|
||||
{
|
||||
if ((iter->GetFromNode () == nodeMap[tname]) &&
|
||||
(iter->GetToNode () == nodeMap[sname]))
|
||||
if ((iter->GetFromNode () == nodeMap[tname])
|
||||
&& (iter->GetToNode () == nodeMap[sname]))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
@@ -256,7 +260,7 @@ RocketfuelTopologyReader::GetFileType (const char *line)
|
||||
char errbuf[512];
|
||||
|
||||
// Check whether MAPS file or not
|
||||
ret = regcomp (®ex, ROCKETFUEL_MAPS_LINE, REG_EXTENDED|REG_NEWLINE);
|
||||
ret = regcomp (®ex, ROCKETFUEL_MAPS_LINE, REG_EXTENDED | REG_NEWLINE);
|
||||
if (ret != 0)
|
||||
{
|
||||
regerror (ret, ®ex, errbuf, sizeof (errbuf));
|
||||
@@ -271,7 +275,7 @@ RocketfuelTopologyReader::GetFileType (const char *line)
|
||||
regfree (®ex);
|
||||
|
||||
// Check whether Weights file or not
|
||||
ret = regcomp (®ex, ROCKETFUEL_WEIGHTS_LINE, REG_EXTENDED|REG_NEWLINE);
|
||||
ret = regcomp (®ex, ROCKETFUEL_WEIGHTS_LINE, REG_EXTENDED | REG_NEWLINE);
|
||||
if (ret != 0)
|
||||
{
|
||||
regerror (ret, ®ex, errbuf, sizeof (errbuf));
|
||||
@@ -337,7 +341,7 @@ RocketfuelTopologyReader::Read (void)
|
||||
|
||||
if (ftype == RF_MAPS)
|
||||
{
|
||||
ret = regcomp (®ex, ROCKETFUEL_MAPS_LINE, REG_EXTENDED|REG_NEWLINE);
|
||||
ret = regcomp (®ex, ROCKETFUEL_MAPS_LINE, REG_EXTENDED | REG_NEWLINE);
|
||||
if (ret != 0)
|
||||
{
|
||||
regerror (ret, ®ex, errbuf, sizeof (errbuf));
|
||||
@@ -355,7 +359,7 @@ RocketfuelTopologyReader::Read (void)
|
||||
}
|
||||
else if (ftype == RF_WEIGHTS)
|
||||
{
|
||||
ret = regcomp (®ex, ROCKETFUEL_WEIGHTS_LINE, REG_EXTENDED|REG_NEWLINE);
|
||||
ret = regcomp (®ex, ROCKETFUEL_WEIGHTS_LINE, REG_EXTENDED | REG_NEWLINE);
|
||||
if (ret != 0)
|
||||
{
|
||||
regerror (ret, ®ex, errbuf, sizeof (errbuf));
|
||||
@@ -380,12 +384,12 @@ RocketfuelTopologyReader::Read (void)
|
||||
{
|
||||
if (regmatch[i].rm_so == -1)
|
||||
{
|
||||
argv[i-1] = NULL;
|
||||
argv[i - 1] = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
line[regmatch[i].rm_eo] = '\0';
|
||||
argv[i-1] = &line[regmatch[i].rm_so];
|
||||
argv[i - 1] = &line[regmatch[i].rm_so];
|
||||
argc = i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ namespace ns3 {
|
||||
// ------------------------------------------------------------
|
||||
// --------------------------------------------
|
||||
/**
|
||||
* \ingroup topology
|
||||
* \brief Topology file reader (Rocketfuel-format type).
|
||||
*
|
||||
* http://www.cs.washington.edu/research/networking/rocketfuel/
|
||||
@@ -71,11 +70,11 @@ private:
|
||||
NodeContainer GenerateFromWeightsFile (int argc, char *argv[]);
|
||||
|
||||
enum RF_FileType
|
||||
{
|
||||
RF_MAPS,
|
||||
RF_WEIGHTS,
|
||||
RF_UNKNOWN
|
||||
};
|
||||
{
|
||||
RF_MAPS,
|
||||
RF_WEIGHTS,
|
||||
RF_UNKNOWN
|
||||
};
|
||||
enum RF_FileType GetFileType (const char *);
|
||||
|
||||
// end class RocketfuelTopologyReader
|
||||
|
||||
@@ -33,11 +33,6 @@
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \defgroup topology Topology Input Readers
|
||||
*/
|
||||
|
||||
/**
|
||||
* \ingroup topology
|
||||
* \brief Interface for input file readers management.
|
||||
*
|
||||
* This interface perform the shared tasks among all possible input file readers.
|
||||
@@ -48,7 +43,6 @@ class TopologyReader : public Object
|
||||
|
||||
public:
|
||||
/**
|
||||
* \ingroup topology
|
||||
* \brief Inner class holding the details about a link between two nodes.
|
||||
*
|
||||
* The link is not described in terms of technology. Rather it is only stating
|
||||
@@ -190,7 +184,6 @@ private:
|
||||
void AddLink (Link link);
|
||||
|
||||
private:
|
||||
|
||||
TopologyReader (const TopologyReader&);
|
||||
TopologyReader& operator= (const TopologyReader&);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
class RocketfuelTopologyReaderTest: public TestCase
|
||||
class RocketfuelTopologyReaderTest : public TestCase
|
||||
{
|
||||
public:
|
||||
RocketfuelTopologyReaderTest ();
|
||||
@@ -42,8 +42,9 @@ private:
|
||||
};
|
||||
|
||||
RocketfuelTopologyReaderTest::RocketfuelTopologyReaderTest ()
|
||||
: TestCase ("RocketfuelTopologyReaderTest")
|
||||
{}
|
||||
: TestCase ("RocketfuelTopologyReaderTest")
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
@@ -51,11 +52,11 @@ RocketfuelTopologyReaderTest::DoRun (void)
|
||||
{
|
||||
Ptr<RocketfuelTopologyReader> inFile;
|
||||
NodeContainer nodes;
|
||||
|
||||
|
||||
std::string input ("./src/topology-read/examples/RocketFuel_toposample_1239_weights.txt");
|
||||
|
||||
inFile = CreateObject<RocketfuelTopologyReader> ();
|
||||
inFile->SetFileName(input);
|
||||
inFile->SetFileName (input);
|
||||
|
||||
if (inFile != 0)
|
||||
{
|
||||
@@ -76,7 +77,7 @@ class RocketfuelTopologyReaderTestSuite : public TestSuite
|
||||
public:
|
||||
RocketfuelTopologyReaderTestSuite ();
|
||||
private:
|
||||
};
|
||||
};
|
||||
|
||||
RocketfuelTopologyReaderTestSuite::RocketfuelTopologyReaderTestSuite ()
|
||||
: TestSuite ("rocketfuel-topology-reader", UNIT)
|
||||
|
||||
@@ -18,7 +18,6 @@ def build(bld):
|
||||
headers = bld.new_task_gen('ns3header')
|
||||
headers.module = 'topology-read'
|
||||
headers.source = [
|
||||
'model/topology.h',
|
||||
'model/topology-reader.h',
|
||||
'model/inet-topology-reader.h',
|
||||
'model/orbis-topology-reader.h',
|
||||
|
||||
Reference in New Issue
Block a user