This commit is contained in:
Gustavo J. A. M. Carneiro
2009-12-28 17:57:24 +00:00
7 changed files with 93 additions and 15 deletions

View File

@@ -260,7 +260,7 @@ EXTRACT_ALL = NO
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = YES
EXTRACT_PRIVATE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
@@ -496,7 +496,6 @@ WARN_LOGFILE =
INPUT = doc/modules \
doc/main.h \
doc/introspected-doxygen.h \
doc/howtos/ \
src
# This tag can be used to specify the character encoding of the source files that
@@ -528,8 +527,7 @@ RECURSIVE = YES
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = src/routing/olsr/olsr-state.h \
src/routing/olsr/repositories.h \
src/routing/olsr/routing-table.h \
src/routing/olsr/olsr-repositories.h \
src/simulator/high-precision.h \
src/simulator/high-precision-128.h \
src/simulator/high-precision-double.h
@@ -546,7 +544,7 @@ EXCLUDE_SYMLINKS = NO
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
EXCLUDE_PATTERNS =
EXCLUDE_PATTERNS = */test/*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the output.

View File

@@ -0,0 +1,63 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ns3/simulator.h"
#include "ns3/nstime.h"
#include "ns3/command-line.h"
#include "ns3/random-variable.h"
#include <iostream>
using namespace ns3;
using namespace std;
/*
* This program can be run from waf such as "./waf --run sample-random-variable"
*
* This program is about as simple as possible to display the use of ns-3
* to generate random numbers. By default, the uniform random variate that
* will be outputted is 0.816532. Because ns-3 uses a fixed seed for the
* pseudo-random number generator, this program should always output the
* same number. Likewise, ns-3 simulations using random variables will
* behave deterministically unless the user changes the RunNumber or the
* Seed.
*
* There are three primary mechanisms to change the seed or run numbers
* from their default integer value of 1
* 1) Through explicit call of SeedManager::SetSeed () and
* SeedManager::SetRun () (commented out below)
* 2) Through the passing of command line arguments such as:
* "./waf --command-template="%s --RngRun=<value>" --run program-name"
* 3) Through the use of the NS_GLOBAL_VALUE environment variable, such as:
* "NS_GLOBAL_VALUE="RngRun=<value>" ./waf --run program-name"
*
* For instance, setting the run number to 3 will change the program output to
* 0.775417
*
* Consult the ns-3 manual for more information about the use of the
* random number generator
*/
int main (int argc, char *argv[])
{
CommandLine cmd;
cmd.Parse (argc, argv);
// SeedManager::SetRun (3);
UniformVariable uv;
cout << uv.GetValue () << endl;
}

View File

@@ -54,3 +54,7 @@ def build(bld):
['core', 'simulator', 'mobility', 'wifi'])
obj.source = 'main-ns2-mob.cc'
obj = bld.create_ns3_program('sample-random-variable',
['core', 'simulator'])
obj.source = 'sample-random-variable.cc'

View File

@@ -356,7 +356,7 @@ InternetStackHelper::Install (Ptr<Node> node) const
CreateAndAggregateObjectFromTypeId (node, "ns3::Ipv6L3Protocol");
CreateAndAggregateObjectFromTypeId (node, "ns3::Icmpv6L4Protocol");
/* TODO add UdpL4Protocol / TcpL4Protocol for IPv6 */
/* TODO add UdpL4Protocol/TcpL4Protocol for IPv6 */
Ptr<Ipv6> ipv6 = node->GetObject<Ipv6> ();
Ptr<Ipv6RoutingProtocol> ipv6Routing = m_routingv6->Create (node);
ipv6->SetRoutingProtocol (ipv6Routing);

View File

@@ -1093,7 +1093,6 @@ Ptr<NdiscCache> Icmpv6L4Protocol::FindCache (Ptr<NetDevice> device)
Ptr<NdiscCache> Icmpv6L4Protocol::CreateCache (Ptr<NetDevice> device, Ptr<Ipv6Interface> interface)
{
Ptr<Ipv6L3Protocol> ipv6 = m_node->GetObject<Ipv6L3Protocol> ();
Ptr<NdiscCache> cache = CreateObject<NdiscCache> ();
cache->SetDevice (device, interface);

View File

@@ -75,11 +75,6 @@ void Ipv6Interface::DoSetup ()
{
return;
}
if (!m_device->NeedsArp ())
{
return;
}
/* set up link-local address */
if (!DynamicCast<LoopbackNetDevice> (m_device)) /* no autoconf for ip6-localhost */
@@ -96,6 +91,10 @@ void Ipv6Interface::DoSetup ()
NS_ASSERT_MSG (false, "IPv6 autoconf for this kind of address not implemented.");
}
}
else
{
return; /* no NDISC cache for ip6-localhost */
}
Ptr<Icmpv6L4Protocol> icmpv6 = m_node->GetObject<Ipv6L3Protocol> ()->GetIcmpv6 ();
m_ndCache = icmpv6->CreateCache (m_device, this);

View File

@@ -59,17 +59,24 @@ struct RoutingTableEntry
destAddr (), nextAddr (),
interface (0), distance (0) {};
};
class RoutingProtocol;
/// Testcase for MPR computation mechanism
class OlsrMprTestCase : public TestCase {
public:
OlsrMprTestCase ();
~OlsrMprTestCase ();
/// \brief Run test case
virtual bool DoRun (void);
;
};
///
/// \ingroup olsr
///
/// \brief OLSR routing protocol for IPv4
///
class RoutingProtocol : public Ipv4RoutingProtocol
{
public:
@@ -79,8 +86,18 @@ public:
RoutingProtocol ();
virtual ~RoutingProtocol ();
///
/// \brief Set the OLSR main address to the first address on the indicated
/// interface
/// \param interface IPv4 interface index
///
void SetMainInterface (uint32_t interface);
///
/// Dump the neighbor table, two-hop neighbor table, and routing table
/// to logging output (NS_LOG_DEBUG log level). If logging is disabled,
/// this function does nothing.
///
void Dump (void);
protected:
@@ -114,8 +131,6 @@ private:
Ptr<Ipv4> m_ipv4;
private:
void Clear ();
uint32_t GetSize () const { return m_table.size (); }
std::vector<RoutingTableEntry> GetEntries () const;