diff --git a/doc/doxygen.conf b/doc/doxygen.conf index 26172164e..8af9dc443 100644 --- a/doc/doxygen.conf +++ b/doc/doxygen.conf @@ -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. diff --git a/samples/sample-random-variable.cc b/samples/sample-random-variable.cc new file mode 100644 index 000000000..f388e5dfd --- /dev/null +++ b/samples/sample-random-variable.cc @@ -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 + +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=" --run program-name" + * 3) Through the use of the NS_GLOBAL_VALUE environment variable, such as: + * "NS_GLOBAL_VALUE="RngRun=" ./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; + +} diff --git a/samples/wscript b/samples/wscript index d9cea73a6..0d32f375c 100644 --- a/samples/wscript +++ b/samples/wscript @@ -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' + diff --git a/src/helper/internet-stack-helper.cc b/src/helper/internet-stack-helper.cc index 909d0062b..34d8721fc 100644 --- a/src/helper/internet-stack-helper.cc +++ b/src/helper/internet-stack-helper.cc @@ -356,7 +356,7 @@ InternetStackHelper::Install (Ptr node) const CreateAndAggregateObjectFromTypeId (node, "ns3::Ipv6L3Protocol"); CreateAndAggregateObjectFromTypeId (node, "ns3::Icmpv6L4Protocol"); - /* TODO add UdpL4Protocol / TcpL4Protocol for IPv6 */ + /* TODO add UdpL4Protocol/TcpL4Protocol for IPv6 */ Ptr ipv6 = node->GetObject (); Ptr ipv6Routing = m_routingv6->Create (node); ipv6->SetRoutingProtocol (ipv6Routing); diff --git a/src/internet-stack/icmpv6-l4-protocol.cc b/src/internet-stack/icmpv6-l4-protocol.cc index ca3505cc8..924b5d4a0 100644 --- a/src/internet-stack/icmpv6-l4-protocol.cc +++ b/src/internet-stack/icmpv6-l4-protocol.cc @@ -1093,7 +1093,6 @@ Ptr Icmpv6L4Protocol::FindCache (Ptr device) Ptr Icmpv6L4Protocol::CreateCache (Ptr device, Ptr interface) { - Ptr ipv6 = m_node->GetObject (); Ptr cache = CreateObject (); cache->SetDevice (device, interface); diff --git a/src/internet-stack/ipv6-interface.cc b/src/internet-stack/ipv6-interface.cc index 712b33d10..d2a08c3aa 100644 --- a/src/internet-stack/ipv6-interface.cc +++ b/src/internet-stack/ipv6-interface.cc @@ -75,11 +75,6 @@ void Ipv6Interface::DoSetup () { return; } - - if (!m_device->NeedsArp ()) - { - return; - } /* set up link-local address */ if (!DynamicCast (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 icmpv6 = m_node->GetObject ()->GetIcmpv6 (); m_ndCache = icmpv6->CreateCache (m_device, this); diff --git a/src/routing/olsr/olsr-routing-protocol.h b/src/routing/olsr/olsr-routing-protocol.h index 94730f360..bba86b183 100644 --- a/src/routing/olsr/olsr-routing-protocol.h +++ b/src/routing/olsr/olsr-routing-protocol.h @@ -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 m_ipv4; -private: - void Clear (); uint32_t GetSize () const { return m_table.size (); } std::vector GetEntries () const;