diff -Naur ns-3.20/AUTHORS ns-3.21/AUTHORS --- ns-3.20/AUTHORS 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/AUTHORS 2014-09-17 20:03:14.000000000 -0700 @@ -2,6 +2,7 @@ Rohit Agarwal (mindprince@gmail.com) Kirill Andreev (andreev@iitp.ru) Dean Armstrong (deanarm@gmail.com) +Stefano Avallone (stefano.avallone@unina.it) Ghada Badawy (gbadawy@gmail.com) Nicola Baldo (nbaldo@cttc.es) Mirko Banchi (mk.banchi@gmail.com) @@ -11,12 +12,12 @@ Raj Bhattacharjea (raj.b@gatech.edu) Timo Bingmann (timo.bingmann@student.kit.edu) Julien Boite (juboite@gmail.com) -Biljana Bojovic +Biljana Bojovic (bbojovic@cttc.es) Elena Borovkova (borokovaes@iitp.ru) Pavel Boyko (boyko@iitp.ru) Dan Broyles (muxman@sbcglobal.net) Jonathan Brugge (j.d.brugge@student.utwente.nl) -Junling Bu +Junling Bu (linlinjavaer@gmail.com) Elena Buchatskaia (borovkovaes@iitp.ru) Gustavo Carneiro (gjc@inescporto.pt, gjcarneiro@gmail.com) Scott Carpenter (scarpen@ncsu.edu) @@ -31,18 +32,19 @@ Alexander D'souza (moijes12@gmail.com) Sébastien Deronne (sebastien.deronne@gmail.com) Craig Dowell (craigdo@ee.washington.edu) -Gilaras Drakeson -Christian Facchini +Gilaras Drakeson (gilaras@gmail.com) +Christian Facchini (c.facchini@gmail.com) Denis Fakhriev (fakhriev@iitp.ru) Jahanzeb Farooq (Jahanzeb.Farooq@inria.fr, Jahanzeb.Farooq@gmail.com) -Luca Favatella -Margherita Filippetti +Luca Favatella (slackydeb@gmail.com) +Margherita Filippetti (morag87@gmail.com) Pedro Fortuna (pedro.fortuna@inescporto.pt) Juliana Freitag Borin (juliana.freitag@gmail.com) +Piotr Gawlowicz (gawlowicz.p@gmail.com) Eric Gamess (egamess@gmail.com) -Yida Gao +Yida Gao (yidapb@gmail.com) Thomas Geithner (thomas.geithner@dai-labor.de) -Ashim Ghosh +Ashim Ghosh (ashim.atiit@gmail.com) Martin Giachino (martin.giachino@gmail.com,giachino@fing.edu.uy) Tom Goff (tgoff@tgoff.net) Juan C. Granda (jcgranda@uniovi.es) @@ -53,9 +55,10 @@ Bruno Haick (bghaick@hotmail.com) Frank Helbert (frank@ime.usp.br) Tom Henderson (tomhend@u.washington.edu) -Budiarto Herman -Tom Hewer -Kim Højgaard-Hansen +Budiarto Herman (budiarto.herman@magister.fi) +Tom Hewer (tomhewer@mac.com) +Kristian A. Hiorth (kristahi@ifi.uio.no) +Kim Højgaard-Hansen (kimrhh@gmail.com) Chris Hood (chood8@gatech.edu) Blake Hurd (naimorai@gmail.com) ishan (ishan.chhabra@gmail.com) @@ -67,7 +70,7 @@ Liu Jian (liujatp@gmail.com) Piotr Jurkiewicz (piotr.jerzy.jurkiewicz@gmail.com) Evgeny Kalishenko (ydginster@gmail.com) -Konstantinos Katsaros +Konstantinos Katsaros (dinos.katsaros@gmail.com) Morteza Kheirkhah (m.kheirkhah@sussex.ac.uk) Flavio Kobuta (flaviokubota@gmail.com) Joe Kopena (tjkopena@cs.drexel.edu) @@ -75,11 +78,11 @@ Aleksey Kovalenko (kovalenko@iitp.ru) Mathieu Lacage (mathieu.lacage@inria.fr) Emmanuelle Laprise (emmmanuelle.laprise@bluekazoo.ca) -Kristijan Lenković +Kristijan Lenković (k.lenkovic@me.com) Daniel Lertpratchya (nikkipui@gmail.com) Björn Lichtblau (lichtbla@informatik.hu-berlin.de) -Timo Lindhorst -Erwan Livolant +Timo Lindhorst (tlnd@online.de) +Erwan Livolant (erwan.livolant@inria.fr) Keith Ma (keith.nwsuaf@gmail.com) Federico Maguolo (maguolof@dei.unipd.it) Antti Makela (zarhan@cc.hut.fi) @@ -88,26 +91,29 @@ Fabian Mauchle (f1mauchl@hsr.ch) Andrey Mazo (mazo@iitp.ru) Jonathan McCrohan (jmccroha@tcd.ie) +Andrew McGregor (andrewmcgr@gmail.com) Vedran Miletić (rivanvx@gmail.com) -Jens Mittag +Jens Mittag (jens.mittag@kit.edu) Marco Miozzo (mmiozzo@cttc.es) Faker Moatamri (faker.moatamri@inria.fr) -Edvin Močibob +Edvin Močibob (edvin.mocibob@gmail.com) Mike Moreton (mjvm_ns@hotmail.com) -Michele Muccio +Michele Muccio (michelemuccio@virgilio.it) Sidharth Nabar (snabar@uw.edu) Hemanth Narra (hemanth@ittc.ku.edu) -Andreas Nilsson +Roman Naumann (naumann@informatik.hu-berlin.de) +Andreas Nilsson (andrnils@gmail.com) Jaume Nin (jnin@cttc.es) Michael Nowatkowski (nowatkom@gmail.com) -Anh Nguyen +Anh Nguyen (annguyen@ittc.ku.edu) Duy Nguyen (duy@soe.ucsc.edu) -Lluís Parcerisa +Lluís Parcerisa (parcerisa@gmail.com) +Natale Patriciello (natale.patriciello@gmail.com) Tommaso Pecorella (tommaso.pecorella@unifi.it) Vikas Pushkar (vikaskupushkar@gmail.com) Josh Pelkey (jpelkey@gatech.edu) -Per -Fernando Pereira +Per (per_e_lists@rocketmail.com) +Fernando Pereira (ferdonfeup@gmail.com) Colin Perkins (csp@csperkins.org) Giuseppe Piro (g.piro@poliba.it) Yana Podkosova (yanapdk@rambler.ru) @@ -117,30 +123,33 @@ Ken Renard (kenneth.renard@arl.army.mil) Manuel Requena (mrequena@cttc.es) George F. Riley (riley@ece.gatech.edu) -Juergen Rinas +Juergen Rinas (jrinas@gmx.de) Sebastian Rohde (sebastian.rohde@tu-dortmund.de) -Karsten Roscher +Karsten Roscher (sfx@rocktale.de) Bill Roome (wdr@bell-labs.com) -David +David (david.rua@gmail.com) Andrea Sacco (andrea.sacco85@gmail.com) +Lynne Salameh (l.salameh@cs.ucl.ac.uk) Providence Salumu Munga (Providence.Salumu@gmail.com, Providence.Salumu_Munga@it-sudparis.eu) -Francisco Javier Sánchez-Roselly -l.salameh@cs.ucl.ac.uk +Francisco Javier Sánchez-Roselly (fnavarro@ujaen.es) Florian Schmidt (Florian.Schmidt@cs.rwth-aachen.de) Guillaume Seguin (guillaume.seguin@inria.fr) Tomasz Seweryn (tomasz.seweryn7@gmail.com) +Dmitrii Shakshin (d.shakshin@gmail.com) Kulin Shah (m.kulin@gmail.com) -Guowang Shi +Guowang Shi (shiguowang2007@gmail.com) Phillip Sitbon (phillip.sitbon@gmail.com) Anirudh Sivaraman (sk.anirudh@gmail.com) -Steven Smith -Andrew Stanton +Steven Smith (smith84@llnl.gov) +Andrew Stanton (acstanton515@gmail.com) Ewgenij Starostin (estar@cs.tu-berlin.de) YunQiang Su (wzssyqa@gmail.com) Brian Swenson (bswenson3@gatech.edu) Lalith Suresh (suresh.lalith@gmail.com) +Dave Taht (dave.taht@bufferbloat.net) Marcos Talau (talau@users.sourceforge.net) Adrian S. W. Tam (adrian.sw.tam@gmail.com) +Cristiano Tapparello (cristiano.tapparello@rochester.edu) Hajime Tazaki (tazaki@sfc.wide.ad.jp) Wilson Thong (wilsonwk@ee.cityu.edu.hk) Mauro Tortonesi (mauro.tortonesi@unife.it) diff -Naur ns-3.20/bindings/python/wscript ns-3.21/bindings/python/wscript --- ns-3.20/bindings/python/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/bindings/python/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -13,7 +13,7 @@ # after = TaskGen.after ## https://launchpad.net/pybindgen/ -REQUIRED_PYBINDGEN_VERSION = (0, 17, 0, 868) +REQUIRED_PYBINDGEN_VERSION = (0, 17, 0, 876) REQUIRED_PYGCCXML_VERSION = (0, 9, 5) RUN_ME=-3 diff -Naur ns-3.20/CHANGES.html ns-3.21/CHANGES.html --- ns-3.20/CHANGES.html 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/CHANGES.html 2014-09-17 20:03:14.000000000 -0700 @@ -51,6 +51,89 @@ us a note on ns-developers mailing list.


+

Changes from ns-3.20 to ns-3.21

+

New API:

+
    +
  • New "const double& SpectrumValue:: operator[] (size_t index) const". +
  • +
  • A new TraceSource has been added to TCP sockets: SlowStartThreshold. +
  • +
  • New method CommmandLine::AddValue (name, attibutePath) to provide a + shorthand argument "name" for the Attribute "path". This also has + the effect of including the help string for the Attribute in the + Usage message. +
  • +
  • The GSoC 2014 project in the LTE module has brought some additional APIs: +
      +
    • a new abstract class LteFfrAlgorithm, which every future + implementation of frequency reuse algorithm should inherit from
    • +
    • a new SAPs: one between MAC Scheduler and FrAlgorithm, one between + RRC and FrAlgorithm
    • +
    • new attribute to enable Uplink Power Control in LteUePhy
    • +
    • new LteUePowerControl class, an implementation of Uplink Power Control, which is + configurable by attributes. ReferenceSignalPower is sent by eNB in SIB2. + Uplink Power Control in Closed Loop Accumulative Mode is enabled by default
    • +
    • seven different Frequency Reuse Algorithms (each has its own attributes):
    • +
        +
      • LteFrNoOpAlgorithm
      • +
      • LteFrHardAlgorithm
      • +
      • LteFrStrictAlgorithm
      • +
      • LteFrSoftAlgorithm
      • +
      • LteFfrSoftAlgorithm
      • +
      • LteFfrEnhancedAlgorithm
      • +
      • LteFfrDistributedAlgorithm
      • +
      +
    • attribute in LteFfrAlgorithm to set FrCellTypeId which is used in automatic + Frequency Reuse algorithm configuration
    • +
    • LteHelper has been updated with new methods related to frequency reuse algorithm: + SetFfrAlgorithmType and SetFfrAlgorithmAttribute
    • +
    +
  • +
  • A new SimpleNetDeviceHelper can now be used to install SimpleNetDevices. +
  • +
  • New PacketSocketServer and PacketSocketClient apps, meant to be used in tests. +
  • +
  • Tcp Timestamps and Window Scale options have been added and are enabled by default (controllable by attribute). +
  • +
  • A new CoDel queue model has been added to the 'internet' module. +
  • +
+ +

Changes to existing API:

+
    +
  • "Icmpv6L4Protocol::ForgeEchoRequest" is now returning a packet with the proper IPv6 header. +
  • +
  • The TCP socket Attribute "SlowStartThreshold" has been renamed "InitialSlowStartThreshold" to + clarify that the effect is only on the initial value. +
  • +
  • all schedulers were updated to interact with FR entity via FFR-SAP. Only PF, PSS, CQA, + FD-TBFQ, TD-TBFQ schedulers supports Frequency Reuse functionality. In the beginning + of scheduling process, schedulers ask FR entity for avaiable RBGs and then ask if UE + can be scheduled on RB
  • +
  • eNB RRC interacts with FFR entity via RRC-FFR SAP
  • +
  • new DL-CQI generation approach was implemented. Now DL-CQI is computed from control channel as signal + and data channel (if received) as interference. New attribute in LteHelper was added to specify + DL-CQI generation approach. New approach is default one in LteHelper
  • +
  • RadioEnvironmentMap can be generated for Data or Control channel and for specified RbId; + Data or Control channel and RbId can be configured by new attributes in RadioEnvironmentMapHelper
  • +
  • lte-sinr-chunk-processor refactored to lte-chunk-processor. Removed all lte-xxx-chunk-processor + implementations
  • +
  • BindToNetDevice affects also sockets using IPv6.
  • +
  • BindToNetDevice now calls implicitly Bind (). To bind a socket to a NetDevice and to a specific address, + the correct sequence is Bind (address) - BindToNetDevice (device). The opposite will raise an error.
  • +
+ +

Changes to build system:

+
    +
  • None for this release.
  • +
+ +

Changed behavior:

+
    +
  • Behavior will be changed due to the list of bugs fixed (listed in RELEASE_NOTES); users are requested to review that list as well. +
+ +

Changes from ns-3.19 to ns-3.20

New API:

    @@ -204,6 +287,10 @@ value class that represents simulation time; the largest unit prior to this addition was Second. +
  • SimpleNetDevice and SimpleChannel are not so simple anymore. SimpleNetDevice can be now a + Broadcast or PointToPoint NetDevice, it can have a limited bandwidth and it uses an output + queue. +

Changes to build system:

diff -Naur ns-3.20/doc/manual/source/attributes.rst ns-3.21/doc/manual/source/attributes.rst --- ns-3.20/doc/manual/source/attributes.rst 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/doc/manual/source/attributes.rst 2014-09-17 20:03:14.000000000 -0700 @@ -1,24 +1,62 @@ .. include:: replace.txt .. highlight:: cpp +.. Section Separators: + ---- + **** + ++++ + ==== + ~~~~ .. _Attributes: -Attributes ----------- +Configuration and Attributes +---------------------------- In |ns3| simulations, there are two main aspects to configuration: -* the simulation topology and how objects are connected -* the values used by the models instantiated in the topology +* The simulation topology and how objects are connected. +* The values used by the models instantiated in the topology. This chapter focuses on the second item above: how the many values in use in |ns3| are organized, documented, and modifiable by |ns3| users. The |ns3| attribute system is also the underpinning of how traces and statistics are gathered in the simulator. +In the course of this chapter we will discuss the various ways to set or +modify the values used by |ns3| model objects. In increasing order of +specificity, these are: + ++---------------------------------------+-------------------------------------+ +| Method | Scope | ++=======================================+=====================================+ +| Default Attribute values set when | Affect all instances of the class. | +| Attributes are defined in | | +| :cpp:func:`GetTypeId ()`. | | ++---------------------------------------+-------------------------------------+ +| | :cpp:class:`CommandLine` | Affect all future instances. | +| | :cpp:func:`Config::SetDefault()` | | +| | :cpp:class:`ConfigStore` | | ++---------------------------------------+-------------------------------------+ +| :cpp:class:`ObjectFactory` | Affects all instances created with | +| | the factory. | ++---------------------------------------+-------------------------------------+ +| :cpp:func:`XHelperSetAttribute ()` | Affects all instances created by | +| | the helper. | ++---------------------------------------+-------------------------------------+ +| | :cpp:func:`MyClass::SetX ()` | Alters this particular instance. | +| | :cpp:func:`Object::SetAttribute ()` | Generally this is the only form | +| | :cpp:func:`Config::Set()` | which can be scheduled to alter | +| | an instance once the simulation | +| | is running. | ++---------------------------------------+-------------------------------------+ + +By "specificity" we mean that methods in later rows in the table +override the values set by, and typically affect fewer instances than, +earlier methods. + Before delving into details of the attribute value system, it will help to -review some basic properties of class :cpp:class:`ns3::Object`. +review some basic properties of class :cpp:class:`Object`. Object Overview *************** @@ -26,30 +64,35 @@ |ns3| is fundamentally a C++ object-based system. By this we mean that new C++ classes (types) can be declared, defined, and subclassed as usual. -Many |ns3| objects inherit from the :cpp:class:`ns3::Object` base class. These +Many |ns3| objects inherit from the :cpp:class:`Object` base class. These objects have some additional properties that we exploit for organizing the system and improving the memory management of our objects: -* a "metadata" system that links the class name to a lot of meta-information - about the object, including the base class of the subclass, the set of - accessible constructors in the subclass, and the set of "attributes" of the - subclass -* a reference counting smart pointer implementation, for memory management. +* "Metadata" system that links the class name to a lot of meta-information + about the object, including: + + * The base class of the subclass, + * The set of accessible constructors in the subclass, + * The set of "attributes" of the subclass, + * Whether each attribute can be set, or is read-only, + * The allowed range of values for each attribute. + +* Reference counting smart pointer implementation, for memory management. |ns3| objects that use the attribute system derive from either -:cpp:class:`ns3::Object` or :cpp:class:`ns3::ObjectBase`. Most |ns3| objects we -will discuss derive from :cpp:class:`ns3::Object`, but a few that are outside +:cpp:class:`Object` or :cpp:class:`ObjectBase`. Most |ns3| objects we +will discuss derive from :cpp:class:`Object`, but a few that are outside the smart pointer memory management framework derive from -:cpp:class:`ns3::ObjectBase`. +:cpp:class:`ObjectBase`. Let's review a couple of properties of these objects. -Smart pointers -************** +Smart Pointers +++++++++++++++ As introduced in the |ns3| tutorial, |ns3| objects are memory managed by a `reference counting smart pointer implementation -`_, class :cpp:class:`ns3::Ptr`. +`_, class :cpp:class:`Ptr`. Smart pointers are used extensively in the |ns3| APIs, to avoid passing references to heap-allocated objects that may cause memory leaks. @@ -59,13 +102,16 @@ nd->CallSomeFunction (); // etc. +So how do you get a smart pointer to an object, as in the first line +of this example? + CreateObject -++++++++++++ +============ As we discussed above in :ref:`Memory-management-and-class-Ptr`, at the -lowest-level API, objects of type :cpp:class:`ns3::Object` are not instantiated +lowest-level API, objects of type :cpp:class:`Object` are not instantiated using ``operator new`` as usual but instead by a templated function called -:cpp:func:`CreateObject()`. +:cpp:func:`CreateObject ()`. A typical way to create such an object is as follows:: @@ -75,34 +121,36 @@ WifiNetDevice* nd = new WifiNetDevice (); -Objects that derive from :cpp:class:`ns3::Object` must be allocated on the heap -using CreateObject(). Those deriving from :cpp:class:`ns3::ObjectBase`, such as -|ns3| helper functions and packet headers and trailers, can be allocated on the -stack. - -In some scripts, you may not see a lot of CreateObject() calls in the code; this -is because there are some helper objects in effect that are doing the -CreateObject()s for you. +Objects that derive from :cpp:class:`Object` must be allocated on the heap +using :cpp:func:`CreateObject ()`. Those deriving from :cpp:class:`ObjectBase`, +such as |ns3| helper functions and packet headers and trailers, +can be allocated on the stack. + +In some scripts, you may not see a lot of :cpp:func:`CreateObject ()` calls +in the code; this is because there are some helper objects in effect +that are doing the :cpp:func:`CreateObject ()` calls for you. TypeId ++++++ -|ns3| classes that derive from class ns3::Object can include a metadata class -called ``TypeId`` that records meta-information about the class, for use in the -object aggregation and component manager systems: - -* a unique string identifying the class -* the base class of the subclass, within the metadata system -* the set of accessible constructors in the subclass +|ns3| classes that derive from class :cpp:class:`Object` can include +a metadata class called :cpp:class:`TypeId` that records meta-information +about the class, for use in the object aggregation and component manager +systems: + +* A unique string identifying the class. +* The base class of the subclass, within the metadata system. +* The set of accessible constructors in the subclass. +* A list of publicly accessible properties ("attributes") of the class. Object Summary ++++++++++++++ Putting all of these concepts together, let's look at a specific -example: class :cpp:class:`ns3::Node`. +example: class :cpp:class:`Node`. -The public header file node.h has a declaration that includes a static GetTypeId -function call:: +The public header file ``node.h`` has a declaration that includes +a static :cpp:func:`GetTypeId ()` function call:: class Node : public Object { @@ -118,15 +166,18 @@ static TypeId tid = TypeId ("ns3::Node") .SetParent () .AddConstructor () - .AddAttribute ("DeviceList", "The list of devices associated to this Node.", + .AddAttribute ("DeviceList", + "The list of devices associated to this Node.", ObjectVectorValue (), MakeObjectVectorAccessor (&Node::m_devices), MakeObjectVectorChecker ()) - .AddAttribute ("ApplicationList", "The list of applications associated to this Node.", + .AddAttribute ("ApplicationList", + "The list of applications associated to this Node.", ObjectVectorValue (), MakeObjectVectorAccessor (&Node::m_applications), MakeObjectVectorChecker ()) - .AddAttribute ("Id", "The id (unique integer) of this Node.", + .AddAttribute ("Id", + "The id (unique integer) of this Node.", TypeId::ATTR_GET, // allow only getting it. UintegerValue (0), MakeUintegerAccessor (&Node::m_id), @@ -135,33 +186,38 @@ return tid; } -Consider the TypeId of an |ns3| ``Object`` class as an extended form of run time -type information (RTTI). The C++ language includes a simple kind of RTTI in -order to support ``dynamic_cast`` and ``typeid`` operators. +Consider the :cpp:class:`TypeId` of the |ns3| :cpp:class:`Object` class +as an extended form of run time type information (RTTI). The C++ language +includes a simple kind of RTTI in order to support ``dynamic_cast`` and +``typeid`` operators. -The "``.SetParent ()``" call in the declaration above is used in +The :cpp:func:`SetParent ()` call in the definition above is used in conjunction with our object aggregation mechanisms to allow safe up- and -down-casting in inheritance trees during ``GetObject``. +down-casting in inheritance trees during :cpp:func:`GetObject ()`. +It also enables subclasses to inherit the Attributes of their parent class. -The "``.AddConstructor ()``" call is used in conjunction with our abstract -object factory mechanisms to allow us to construct C++ objects without forcing a -user to know the concrete class of the object she is building. - -The three calls to "``.AddAttribute``" associate a given string with a strongly -typed value in the class. Notice that you must provide a help string which may -be displayed, for example, via command line processors. Each ``Attribute`` is -associated with mechanisms for accessing the underlying member variable in the -object (for example, ``MakeUintegerAccessor`` tells the generic ``Attribute`` +The :cpp:func:`AddConstructor ()` call is used in conjunction +with our abstract object factory mechanisms to allow us to construct +C++ objects without forcing a user to know the concrete class of +the object she is building. + +The three calls to :cpp:func:`AddAttribute ()` associate a given string +with a strongly typed value in the class. Notice that you must provide +a help string which may be displayed, for example, *via* command line +processors. Each :cpp:class:`Attribute` is associated with mechanisms +for accessing the underlying member variable in the object (for example, +:cpp:func:`MakeUintegerAccessor ()` tells the generic :cpp:class:`Attribute` code how to get to the node ID above). There are also "Checker" methods which -are used to validate values. +are used to validate values against range limitations, such as maximum +and minimum allowed values. When users want to create Nodes, they will usually call some form of -``CreateObject``,:: +:cpp:func:`CreateObject ()`,:: Ptr n = CreateObject (); -or more abstractly, using an object factory, you can create a ``Node`` object -without even knowing the concrete C++ type:: +or more abstractly, using an object factory, you can create a +:cpp:class:`Node` object without even knowing the concrete C++ type:: ObjectFactory factory; const std::string typeId = "ns3::Node''; @@ -169,13 +225,13 @@ Ptr node = factory.Create (); Both of these methods result in fully initialized attributes being available -in the resulting ``Object`` instances. +in the resulting :cpp:class:`Object` instances. We next discuss how attributes (values associated with member variables or -functions of the class) are plumbed into the above TypeId. +functions of the class) are plumbed into the above :cpp:class:`TypeId`. -Attribute Overview -****************** +Attributes +********** The goal of the attribute system is to organize the access of internal member objects of a simulation. This goal arises because, @@ -184,11 +240,11 @@ but often will be interested in studying or tracing particular internal variables. For instance, use cases such as: -* "I want to trace the packets on the wireless interface only on the first - access point" -* "I want to trace the value of the TCP congestion window (every time it - changes) on a particular TCP socket" -* "I want a dump of all values that were used in my simulation." +* *"I want to trace the packets on the wireless interface only on the first + access point."* +* *"I want to trace the value of the TCP congestion window (every time it + changes) on a particular TCP socket."* +* *"I want a dump of all values that were used in my simulation."* Similarly, users may want fine-grained access to internal variables in the simulation, or may want to broadly change the initial value used for a @@ -201,16 +257,17 @@ the node and its constituent member objects, and help text and default values for each parameter. -Functional overview +Defining Attributes +++++++++++++++++++ We provide a way for users to access values deep in the system, without having to plumb accessors (pointers) through the system and walk pointer chains to get -to them. Consider a class DropTailQueue that has a member variable that is an -unsigned integer ``m_maxPackets``; this member variable controls the depth of -the queue. +to them. Consider a class :cpp:class:`DropTailQueue` that has a member variable +that is an unsigned integer :cpp:member:`m_maxPackets`; this member variable controls +the depth of the queue. -If we look at the declaration of DropTailQueue, we see the following:: +If we look at the declaration of :cpp:class:`DropTailQueue`, we see +the following:: class DropTailQueue : public Queue { public: @@ -223,21 +280,23 @@ }; Let's consider things that a user may want to do with the value of -m_maxPackets: +:cpp:member:`m_maxPackets`: -* Set a default value for the system, such that whenever a new DropTailQueue is - created, this member is initialized to that default. +* Set a default value for the system, such that whenever a new + :cpp:class:`DropTailQueue` is created, this member is initialized + to that default. * Set or get the value on an already instantiated queue. -The above things typically require providing Set() and Get() functions, and some -type of global default value. +The above things typically require providing ``Set ()`` and ``Get ()`` +functions, and some type of global default value. -In the |ns3| attribute system, these value definitions and accessor functions -are moved into the TypeId class; e.g.:: +In the |ns3| attribute system, these value definitions and accessor function +registrations are moved into the :cpp:class:`TypeId` class; *e.g*.:: NS_OBJECT_ENSURE_REGISTERED (DropTailQueue); - TypeId DropTailQueue::GetTypeId (void) + TypeId + DropTailQueue::GetTypeId (void) { static TypeId tid = TypeId ("ns3::DropTailQueue") .SetParent () @@ -252,22 +311,24 @@ return tid; } -The AddAttribute() method is performing a number of things with this -value: +The :cpp:func:`AddAttribute ()` method is performing a number of things for the +:cpp:member:`m_maxPackets` value: -* Binding the variable m_maxPackets to a string "MaxPackets" -* Providing a default value (100 packets) -* Providing some help text defining the value -* Providing a "checker" (not used in this example) that can be used to set - bounds on the allowable range of values +* Binding the (usually private) member variable :cpp:member:`m_maxPackets` + to a public string ``"MaxPackets"``. +* Providing a default value (100 packets). +* Providing some help text defining the meaning of the value. +* Providing a "Checker" (not used in this example) that can be used to set + bounds on the allowable range of values. The key point is that now the value of this variable and its default value are accessible in the attribute namespace, which is based on strings such as -"MaxPackets" and TypeId strings. In the next section, we will provide an example -script that shows how users may manipulate these values. +``"MaxPackets"`` and :cpp:class:`TypeId` name strings. In the next section, +we will provide an example script that shows how users may manipulate +these values. Note that initialization of the attribute relies on the macro -``NS_OBJECT_ENSURE_REGISTERED`` (DropTailQueue) being called; if you leave this +``NS_OBJECT_ENSURE_REGISTERED (DropTailQueue)`` being called; if you leave this out of your new class implementation, your attributes will not be initialized correctly. @@ -278,14 +339,23 @@ attributes of their models, and how does a user access these attributes, or document their values as part of the record of their simulation? -Default values and command-line arguments -+++++++++++++++++++++++++++++++++++++++++ +Detailed documentation of the actual attributes defined for a type, +and a global list of all defined attributes, are available in +the API documentation. For the rest of this document we are going +to demonstrate the various ways of getting and setting attribute values. -Let's look at how a user script might access these values. -This is based on the script found at ``src/point-to-point/examples/main-attribute-value.cc``, -with some details stripped out.:: +Setting Default Values +++++++++++++++++++++++ + +Config::SetDefault and CommandLine +================================== + +Let's look at how a user script might access a specific attribute value. +We're going to use the +``src/point-to-point/examples/main-attribute-value.cc`` +script for illustration, with some details stripped out. The ``main`` +function begins:: - // // This is a basic example of how to use the attribute system to // set and get a value in the underlying system; namely, an unsigned // integer of the maximum number of packets in a queue @@ -305,20 +375,33 @@ Config::SetDefault ("ns3::DropTailQueue::MaxPackets", UintegerValue (80)); // Allow the user to override any of the defaults and the above - // SetDefaults() at run-time, via command-line arguments + // SetDefaults () at run-time, via command-line arguments + // For example, via "--ns3::DropTailQueue::MaxPackets=80" CommandLine cmd; + // This provides yet another way to set the value from the command line: + cmd.AddValue ("maxPackets", "ns3::DropTailQueue::MaxPackets"); cmd.Parse (argc, argv); -The main thing to notice in the above are the two calls to -``Config::SetDefault``. This is how we set the default value -for all subsequently instantiated DropTailQueues. We illustrate -that two types of Value classes, a StringValue and a UintegerValue class, -can be used to assign the value to the attribute named by -"ns3::DropTailQueue::MaxPackets". - -Now, we will create a few objects using the low-level API; here, -our newly created queues will not have a m_maxPackets initialized to -100 packets but to 80 packets, because of what we did above with +The main thing to notice in the above are the two equivalent calls to +:cpp:func:`Config::SetDefault ()`. This is how we set the default value +for all subsequently instantiated :cpp:class:`DropTailQueue`\s. We illustrate +that two types of ``Value`` classes, a :cpp:class:`StringValue` and +a :cpp:class:`UintegerValue` class, can be used to assign the value +to the attribute named by "ns3::DropTailQueue::MaxPackets". + +It's also possible to manipulate Attributes using the :cpp:class:`CommandLine`; +we saw some examples early in the Tutorial. In particular, it is +straightforward to add a shorthand argument name, such as ``--maxPackets``, +for an Attribute that is particular relevant for your model, in this case +``"ns3::DropTailQueue::MaxPackets"``. This has the additional feature that +the help string for the Attribute will be printed as part of the usage +message for the script. For more information see +the :cpp:class:`CommandLine` API documentation. + +Now, we will create a few objects using the low-level API. Our +newly created queues will not have :cpp:member:`m_maxPackets` initialized to +100 packets, as defined in the :cpp:func:`DropTailQueue::GetTypeId ()` +function, but to 80 packets, because of what we did above with default values.:: Ptr n0 = CreateObject (); @@ -329,46 +412,96 @@ Ptr q = CreateObject (); net0->AddQueue(q); -At this point, we have created a single node (Node 0) and a single -PointToPointNetDevice (NetDevice 0) and added a DropTailQueue to it. +At this point, we have created a single :cpp:class:`Node` (``n0``) +and a single :cpp:class:`PointToPointNetDevice` (``net0``), +and added a :cpp:class:`DropTailQueue` (``q``) to ``net0``. -Now, we can manipulate the MaxPackets value of the already instantiated -DropTailQueue. Here are various ways to do that. +Constructors, Helpers and ObjectFactory +======================================= -Pointer-based access -++++++++++++++++++++ +Arbitrary combinations of attributes can be set and fetched from +the helper and low-level APIs; either from the constructors themselves:: -We assume that a smart pointer (Ptr) to a relevant network device is in hand; in -the current example, it is the ``net0`` pointer. + Ptr p = + CreateObjectWithAttributes + ("MinX", DoubleValue (-100.0), + "MinY", DoubleValue (-100.0), + "DeltaX", DoubleValue (5.0), + "DeltaY", DoubleValue (20.0), + "GridWidth", UintegerValue (20), + "LayoutType", StringValue ("RowFirst")); + +or from the higher-level helper APIs, such as:: + + mobility.SetPositionAllocator + ("ns3::GridPositionAllocator", + "MinX", DoubleValue (-100.0), + "MinY", DoubleValue (-100.0), + "DeltaX", DoubleValue (5.0), + "DeltaY", DoubleValue (20.0), + "GridWidth", UintegerValue (20), + "LayoutType", StringValue ("RowFirst")); + +We don't illustrate it here, but you can also configure an +:cpp:class:`ObjectFactory` with new values for specific attributes. +Instances created by the :cpp:class:`ObjectFactory` will have those +attributes set during construction. This is very similar to using +one of the helper APIs for the class. + +To review, there are several ways to set values for attributes for +class instances *to be created in the future:* + +* :cpp:func:`Config::SetDefault ()` +* :cpp:func:`CommandLine::AddValue ()` +* :cpp:func:`CreateObjectWithAttributes<> ()` +* Various helper APIs + +But what if you've already created an instance, and you want +to change the value of the attribute? In this example, how can we +manipulate the :cpp:member:`m_maxPackets` value of the already instantiated +:cpp:class:`DropTailQueue`? Here are various ways to do that. + + +Changing Values ++++++++++++++++ + +SmartPointer +============ + +Assume that a smart pointer (:cpp:class:`Ptr`) to a relevant network device +is in hand; in the current example, it is the ``net0`` pointer. One way to change the value is to access a pointer to the underlying queue and modify its attribute. -First, we observe that we can get a pointer to the (base class) queue via the -PointToPointNetDevice attributes, where it is called TxQueue:: +First, we observe that we can get a pointer to the (base class) +:cpp:class:`Queue` *via* the +:cpp:class:`PointToPointNetDevice` attributes, where it is called +``"TxQueue"``:: PointerValue tmp; net0->GetAttribute ("TxQueue", tmp); Ptr txQueue = tmp.GetObject (); -Using the GetObject function, we can perform a safe downcast to a DropTailQueue, -where MaxPackets is a member:: +Using the :cpp:func:`GetObject ()` function, we can perform a safe downcast +to a :cpp:class:`DropTailQueue`, where ``"MaxPackets"`` is an attribute:: Ptr dtq = txQueue->GetObject (); NS_ASSERT (dtq != 0); Next, we can get the value of an attribute on this queue. We have introduced -wrapper "Value" classes for the underlying data types, similar to Java wrappers -around these types, since the attribute system stores values and not disparate -types. Here, the attribute value is assigned to a UintegerValue, and the Get() -method on this value produces the (unwrapped) uint32_t.:: +wrapper ``Value`` classes for the underlying data types, similar +to Java wrappers around these types, since the attribute system stores values +serialized to strings, and not disparate types. Here, the attribute value +is assigned to a :cpp:class:`UintegerValue`, and the :cpp:func:`Get ()` +method on this value produces the (unwrapped) ``uint32_t``.:: UintegerValue limit; dtq->GetAttribute ("MaxPackets", limit); NS_LOG_INFO ("1. dtq limit: " << limit.Get () << " packets"); -Note that the above downcast is not really needed; we could have done the same -using the Ptr even though the attribute is a member of the subclass:: +Note that the above downcast is not really needed; we could have gotten +the attribute value directly from ``txQueue``, which is an :cpp:class:`Object`:: txQueue->GetAttribute ("MaxPackets", limit); NS_LOG_INFO ("2. txQueue limit: " << limit.Get () << " packets"); @@ -379,78 +512,81 @@ txQueue->GetAttribute ("MaxPackets", limit); NS_LOG_INFO ("3. txQueue limit changed: " << limit.Get () << " packets"); -Namespace-based access -++++++++++++++++++++++ + +Config Namespace Path +===================== An alternative way to get at the attribute is to use the configuration namespace. Here, this attribute resides on a known path in this namespace; this approach is useful if one doesn't have access to the underlying pointers and would like to configure a specific attribute with a single statement.:: - Config::Set ("/NodeList/0/DeviceList/0/TxQueue/MaxPackets", UintegerValue (25)); + Config::Set ("/NodeList/0/DeviceList/0/TxQueue/MaxPackets", + UintegerValue (25)); txQueue->GetAttribute ("MaxPackets", limit); - NS_LOG_INFO ("4. txQueue limit changed through namespace: " << - limit.Get () << " packets"); + NS_LOG_INFO ("4. txQueue limit changed through namespace: " + << limit.Get () << " packets"); +The configuration path often has the form of +``"...///...//"`` +to refer to a specific instance by index of an object in the container. +In this case the first container is the list of all :cpp:class:`Node`\s; +the second container is the list of all :cpp:class:`NetDevice`\s on +the chosen :cpp:class:`Node`. Finally, the configuration path usually +ends with a succession of member attributes, in this case the ``"MaxPackets"`` +attribute of the ``"TxQueue"`` of the chosen :cpp:class:`NetDevice`. + We could have also used wildcards to set this value for all nodes and all net devices (which in this simple example has the same effect as the previous -Set()):: +:cpp:func:`Config::Set ()`):: - Config::Set ("/NodeList/*/DeviceList/*/TxQueue/MaxPackets", UintegerValue (15)); + Config::Set ("/NodeList/*/DeviceList/*/TxQueue/MaxPackets", + UintegerValue (15)); txQueue->GetAttribute ("MaxPackets", limit); - NS_LOG_INFO ("5. txQueue limit changed through wildcarded namespace: " << - limit.Get () << " packets"); + NS_LOG_INFO ("5. txQueue limit changed through wildcarded namespace: " + << limit.Get () << " packets"); -Object Name Service-based access -++++++++++++++++++++++++++++++++ +Object Name Service +=================== Another way to get at the attribute is to use the object name service facility. -Here, this attribute is found using a name string. This approach is useful if -one doesn't have access to the underlying pointers and it is difficult to -determine the required concrete configuration namespaced path. +The object name service allows us to add items to the configuration +namespace under the ``"/Names/"`` path with a user-defined name string. +This approach is useful if one doesn't have access to the underlying +pointers and it is difficult to determine the required concrete configuration +namespace path. :: - Names::Add ("server", serverNode); - Names::Add ("server/eth0", serverDevice); + Names::Add ("server", n0); + Names::Add ("server/eth0", net0); ... Config::Set ("/Names/server/eth0/TxQueue/MaxPackets", UintegerValue (25)); -See :ref:`Object-names` for a fuller treatment of the |ns3| configuration namespace. - -Setting through constructors helper classes -+++++++++++++++++++++++++++++++++++++++++++ - -Arbitrary combinations of attributes can be set and fetched from -the helper and low-level APIs; either from the constructors themselves:: - - Ptr p = CreateObject ("n1", v1, "n2", v2, ...); +Here we've added the path elements ``"server"`` and ``"eth0"`` under +the ``"/Names/"`` namespace, then used the resulting configuration path +to set the attribute. -or from the higher-level helper APIs, such as:: - - mobility.SetPositionAllocator ("ns3::GridPositionAllocator", - "MinX", DoubleValue (-100.0), - "MinY", DoubleValue (-100.0), - "DeltaX", DoubleValue (5.0), - "DeltaY", DoubleValue (20.0), - "GridWidth", UintegerValue (20), - "LayoutType", StringValue ("RowFirst")); +See :ref:`Object-names` for a fuller treatment of the |ns3| configuration namespace. -Implementation details -++++++++++++++++++++++ +Implementation Details +********************** -Value classes -~~~~~~~~~~~~~ +Value Classes ++++++++++++++ -Readers will note the new FooValue classes which are subclasses of the -AttributeValue base class. These can be thought of as an intermediate class that -can be used to convert from raw types to the Values that are used by the -attribute system. Recall that this database is holding objects of many types -with a single generic type. Conversions to this type can either be done using an -intermediate class (IntegerValue, DoubleValue for "floating point") or via -strings. Direct implicit conversion of types to Value is not really practical. +Readers will note the ``TypeValue`` classes which are subclasses of the +:cpp:class:`AttributeValue` base class. These can be thought of as +intermediate classes which are used to convert from raw types to the +:cpp:class:`AttributeValue`\s that are used by the attribute system. +Recall that this database is holding objects of many types serialized +to strings. Conversions to this type can either be done using +an intermediate class (such as :cpp:class:`IntegerValue`, +or :cpp:class:`DoubleValue` for floating point numbers) +or *via* strings. Direct implicit conversion of types to +:cpp:class:`AttributeValue` is not really practical. So in the above, users have a choice of using strings or values:: p->Set ("cwnd", StringValue ("100")); // string-based setter @@ -460,16 +596,18 @@ new AttributeValue subclasses for new types that they want to introduce into the attribute system: -* ATTRIBUTE_HELPER_HEADER -* ATTRIBUTE_HELPER_CPP +* ``ATTRIBUTE_HELPER_HEADER`` +* ``ATTRIBUTE_HELPER_CPP`` -Initialization order -~~~~~~~~~~~~~~~~~~~~ +See the API documentation for these constructs for more information. + +Initialization Order +++++++++++++++++++++ Attributes in the system must not depend on the state of any other Attribute in this system. This is because an ordering of Attribute initialization is not specified, nor enforced, by the system. A specific example of this can be seen -in automated configuration programs such as :cpp:class:`ns3::ConfigStore`. +in automated configuration programs such as :cpp:class:`ConfigStore`. Although a given model may arrange it so that Attributes are initialized in a particular order, another automatic configurator may decide independently to change Attributes in, for example, alphabetic order. @@ -481,13 +619,14 @@ This is a very strong restriction and there are cases where Attributes must set consistently to allow correct operation. To this end we do allow for consistency -checking *when the attribute is used* (cf. NS_ASSERT_MSG or NS_ABORT_MSG). +checking *when the attribute is used* (*cf*. ``NS_ASSERT_MSG`` +or ``NS_ABORT_MSG``). In general, the attribute code to assign values to the underlying class member variables is executed after an object is constructed. But what if you need the values assigned before the constructor body executes, because you need them in the logic of the constructor? There is a way to do this, used for example in the -class :cpp:class:`ns3::ConfigStore`: call ``ObjectBase::ConstructSelf ()`` as +class :cpp:class:`ConfigStore`: call :cpp:func:`ObjectBase::ConstructSelf ()` as follows:: ConfigStore::ConfigStore () @@ -496,28 +635,38 @@ // continue on with constructor. } -Beware that the object and all its derived classes must also implement a -``virtual TypeId GetInstanceTypeId (void) const;`` method. Otherwise the -``ObjectBase::ConstructSelf ()`` will not be able to read the attributes. +Beware that the object and all its derived classes must also implement +a :cpp:func:`GetInstanceTypeId ()` method. Otherwise +the :cpp:func:`ObjectBase::ConstructSelf ()` will not be able to read +the attributes. -Extending attributes -******************** +Adding Attributes ++++++++++++++++++ The |ns3| system will place a number of internal values under the attribute system, but undoubtedly users will want to extend this to pick up ones we have -missed, or to add their own classes to this. +missed, or to add their own classes to the system. + +There are three typical use cases: + +* Making an existing class data member accessible as an Attribute, + when it isn't already. +* Making a new class able to expose some data members as Attributes + by giving it a TypeId. +* Creating an :cpp:class:`AttributeValue` subclass for a new class + so that it can be accessed as an Attribute. -Adding an existing internal variable to the metadata system -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Existing Member Variable +======================== -Consider this variable in class TcpSocket:: +Consider this variable in :cpp:class:`TcpSocket`:: uint32_t m_cWnd; // Congestion window Suppose that someone working with TCP wanted to get or set the value of that variable using the metadata system. If it were not already provided by |ns3|, the user could declare the following addition in the runtime metadata system (to -the TypeId declaration for TcpSocket):: +the :cpp:func:`GetTypeId` definition for :cpp:class:`TcpSocket`):: .AddAttribute ("Congestion window", "Tcp congestion window (bytes)", @@ -525,70 +674,97 @@ MakeUintegerAccessor (&TcpSocket::m_cWnd), MakeUintegerChecker ()) -Now, the user with a pointer to the TcpSocket can perform operations such as +Now, the user with a pointer to a :cpp:class:`TcpSocket` instance +can perform operations such as setting and getting the value, without having to add these functions explicitly. Furthermore, access controls can be applied, such as allowing the parameter to be read and not written, or bounds checking on the permissible values can be applied. -Adding a new TypeId -+++++++++++++++++++ +New Class TypeId +================ + +Here, we discuss the impact on a user who wants to add a new class to |ns3|. +What additional things must be done to enable it to hold attributes? + +Let's assume our new class, called :cpp:class:`ns3::MyMobility`, +is a type of mobility model. First, the class should inherit from +it's parent class, :cpp:class:`ns3::MobilityModel`. +In the ``my-mobility.h`` header file:: + + namespace ns3 { + + class MyClass : public MobilityModel + { + +This requires we declare the :cpp:func:`GetTypeId ()` function. +This is a one-line public function declaration:: -Here, we discuss the impact on a user who wants to add a new class to |ns3|; -what additional things must be done to hook it into this system. + public: + /** + * Register this type. + * \return The object TypeId. + */ + static TypeId GetTypeId (void); -We've already introduced what a TypeId definition looks like:: +We've already introduced what a :cpp:class:`TypeId` definition will look like +in the ``my-mobility.cc`` implementation file:: + + NS_OBJECT_ENSURE_REGISTERED (MyMobility); TypeId - RandomWalk2dMobilityModel::GetTypeId (void) + MyMobility::GetTypeId (void) { - static TypeId tid = TypeId ("ns3::RandomWalk2dMobilityModel") + static TypeId tid = TypeId ("ns3::MyMobility") .SetParent () .SetGroupName ("Mobility") - .AddConstructor () + .AddConstructor () .AddAttribute ("Bounds", "Bounds of the area to cruise.", RectangleValue (Rectangle (0.0, 0.0, 100.0, 100.0)), - MakeRectangleAccessor (&RandomWalk2dMobilityModel::m_bounds), + MakeRectangleAccessor (&MyMobility::m_bounds), MakeRectangleChecker ()) .AddAttribute ("Time", "Change current direction and speed after moving for this delay.", TimeValue (Seconds (1.0)), - MakeTimeAccessor (&RandomWalk2dMobilityModel::m_modeTime), + MakeTimeAccessor (&MyMobility::m_modeTime), MakeTimeChecker ()) // etc (more parameters). ; return tid; } -The declaration for this in the class declaration is one-line public member -method:: - - public: - static TypeId GetTypeId (void); - +If we don't want to subclass from an existing class, in the header file +we just inherit from :cpp:class:`ns3::Object`, and in the object file +we set the parent class to :cpp:class:`ns3::Object` with +``.SetParent ()``. + Typical mistakes here involve: -* Not calling the SetParent method or calling it with the wrong type -* Not calling the AddConstructor method of calling it with the wrong type -* Introducing a typographical error in the name of the TypeId in its constructor -* Not using the fully-qualified c++ typename of the enclosing c++ class as the - name of the TypeId +* Not calling ``NS_OBJECT_ENSURE_REGISTERED ()`` +* Not calling the :cpp:func:`SetParent ()` method, + or calling it with the wrong type. +* Not calling the :cpp:func:`AddConstructor ()` method, + or calling it with the wrong type. +* Introducing a typographical error in the name of the :cpp:class:`TypeId` + in its constructor. +* Not using the fully-qualified C++ typename of the enclosing C++ class as the + name of the :cpp:class:`TypeId`. Note that ``"ns3::"`` is required. -None of these mistakes can be detected by the |ns3| codebase so, users +None of these mistakes can be detected by the |ns3| codebase, so users are advised to check carefully multiple times that they got these right. -Adding new class type to the attribute system -********************************************* +New AttributeValue Type +======================= From the perspective of the user who writes a new class in the system and wants -to hook it in to the attribute system, there is mainly the matter of writing the +it to be accessible as an attribute, there is mainly the matter of writing the conversions to/from strings and attribute values. Most of this can be -copy/pasted with macro-ized code. For instance, consider class declaration for -Rectangle in the ``src/mobility/model`` directory: +copy/pasted with macro-ized code. For instance, consider a class declaration +for :cpp:class:`Rectangle` in the ``src/mobility/model`` directory: -Header file -+++++++++++ +Header File +~~~~~~~~~~~ :: @@ -613,8 +789,8 @@ ATTRIBUTE_HELPER_HEADER (Rectangle); -Implementation file -+++++++++++++++++++ +Implementation File +~~~~~~~~~~~~~~~~~~~ In the class definition (``.cc`` file), the code looks like this:: @@ -643,31 +819,33 @@ } These stream operators simply convert from a string representation of the -Rectangle ("xMin|xMax|yMin|yMax") to the underlying Rectangle, and the modeler +Rectangle (``"xMin|xMax|yMin|yMax"``) to the underlying Rectangle. The modeler must specify these operators and the string syntactical representation of an instance of the new class. ConfigStore *********** -The ConfigStore is a specialized database for attribute values and -default values. Although it is a separately maintained module in +Values for |ns3| attributes can be stored in an ASCII or XML text file +and loaded into a future simulation run. This feature is known as the +|ns3| ConfigStore. The :cpp:class:`ConfigStore` is a specialized database for attribute values and default values. + +Although it is a separately maintained module in the ``src/config-store/`` directory, we document it here because of its sole dependency on |ns3| core module and attributes. -Values for |ns3| attributes can be stored in an ASCII or XML text file -and loaded into a future simulation. This feature is known as the -|ns3| ConfigStore. We can explore this system by using an example from +We can explore this system by using an example from ``src/config-store/examples/config-store-save.cc``. -First, all users must include the following statement:: +First, all users of the :cpp:class:`ConfigStore` must include +the following statement:: #include "ns3/config-store-module.h" -Next, this program adds a sample object A to show how the system -is extended:: +Next, this program adds a sample object :cpp:class:`ConfigExample` +to show how the system is extended:: - class A : public Object + class ConfigExample : public Object { public: static TypeId GetTypeId (void) { @@ -683,42 +861,48 @@ int16_t m_int16; }; - NS_OBJECT_ENSURE_REGISTERED (A); + NS_OBJECT_ENSURE_REGISTERED (ConfigExample); Next, we use the Config subsystem to override the defaults in a couple of ways:: - Config::SetDefault ("ns3::A::TestInt16", IntegerValue (-5)); + Config::SetDefault ("ns3::ConfigExample::TestInt16", IntegerValue (-5)); - Ptr a_obj = CreateObject (); - NS_ABORT_MSG_UNLESS (a_obj->m_int16 == -5, "Cannot set A's integer attribute via Config::SetDefault"); + Ptr a_obj = CreateObject (); + NS_ABORT_MSG_UNLESS (a_obj->m_int16 == -5, + "Cannot set ConfigExample's integer attribute via Config::SetDefault"); - Ptr a2_obj = CreateObject (); + Ptr a2_obj = CreateObject (); a2_obj->SetAttribute ("TestInt16", IntegerValue (-3)); IntegerValue iv; a2_obj->GetAttribute ("TestInt16", iv); - NS_ABORT_MSG_UNLESS (iv.Get () == -3, "Cannot set A's integer attribute via SetAttribute"); + NS_ABORT_MSG_UNLESS (iv.Get () == -3, + "Cannot set ConfigExample's integer attribute via SetAttribute"); The next statement is necessary to make sure that (one of) the objects created is rooted in the configuration namespace as an object instance. -This normally happens when you aggregate objects to ns3::Node or ns3::Channel +This normally happens when you aggregate objects to a :cpp:class:`ns3::Node` +or :cpp:class:`ns3::Channel` instance, but here, since we are working at the core level, we need to create a new root namespace object:: Config::RegisterRootNamespaceObject (a2_obj); +Writing ++++++++ + Next, we want to output the configuration store. The examples show how to do it in two formats, XML and raw text. In practice, one should perform -this step just before calling ``Simulator::Run ()``; it will allow the -configuration to be saved just before running the simulation. +this step just before calling :cpp:func:`Simulator::Run ()` to save the +final configuration just before running the simulation. -There are three attributes that govern the behavior of the ConfigStore: "Mode", -"Filename", and "FileFormat". The Mode (default "None") configures whether -|ns3| should load configuration from a previously saved file (specify -"Mode=Load") or save it to a file (specify "Mode=Save"). The Filename (default -"") is where the ConfigStore should store its output data. The FileFormat -(default "RawText") governs whether the ConfigStore format is Xml or RawText -format. +There are three Attributes that govern the behavior of the ConfigStore: +``"Mode"``, ``"Filename"``, and ``"FileFormat"``. The Mode (default ``"None"``) +configures whether |ns3| should load configuration from a previously saved file +(specify ``"Mode=Load"``) or save it to a file (specify ``"Mode=Save"``). +The Filename (default ``""``) is where the ConfigStore should read or write +its data. The FileFormat (default ``"RawText"``) governs whether +the ConfigStore format is plain text or Xml (``"FileFormat=Xml"``) The example shows:: @@ -743,10 +927,10 @@ Note the placement of these statements just prior to the :cpp:func:`Simulator::Run ()` statement. This output logs all of the -values in place just prior to starting the simulation (i.e. after +values in place just prior to starting the simulation (*i.e*. after all of the configuration has taken place). -After running, you can open the output-attributes.txt file and see: +After running, you can open the ``output-attributes.txt`` file and see: .. sourcecode:: text @@ -766,19 +950,19 @@ default ns3::ConfigStore::Mode "Save" default ns3::ConfigStore::Filename "output-attributes.txt" default ns3::ConfigStore::FileFormat "RawText" - default ns3::A::TestInt16 "-5" + default ns3::ConfigExample::TestInt16 "-5" global RngSeed "1" global RngRun "1" global SimulatorImplementationType "ns3::DefaultSimulatorImpl" global SchedulerType "ns3::MapScheduler" global ChecksumEnabled "false" - value /$ns3::A/TestInt16 "-3" + value /$ns3::ConfigExample/TestInt16 "-3" In the above, all of the default values for attributes for the core module are shown. Then, all the values for the |ns3| global values -are recorded. Finally, the value of the instance of A that was rooted -in the configuration namespace is shown. In a real ns-3 program, many -more models, attributes, and defaults would be shown. +are recorded. Finally, the value of the instance of :cpp:class:`ConfigExample` +that was rooted in the configuration namespace is shown. In a real +|ns3| program, many more models, attributes, and defaults would be shown. An XML version also exists in ``output-attributes.xml``: @@ -802,20 +986,23 @@ - + - + This file can be archived with your simulation script and output data. -Next, we discuss using this to configure simulations via an input -configuration file. There are a couple of key differences when -compared to use for logging the final simulation configuration. First, we +Reading ++++++++ + +Next, we discuss configuring simulations *via* a stored input +configuration file. There are a couple of key differences +compared to writing the final simulation configuration. First, we need to place statements such as these at the beginning of the program, before simulation configuration statements are written (so the values are registered before being used in object construction). @@ -828,27 +1015,32 @@ ConfigStore inputConfig; inputConfig.ConfigureDefaults (); -Next, note that loading of input configuration data is limited to attribute -default (i.e. not instance) values, and global values. Attribute instance +Next, note that loading of input configuration data is limited to Attribute +default (*i.e*. not instance) values, and global values. Attribute instance values are not supported because at this stage of the simulation, before any objects are constructed, there are no such object instances around. (Note, future enhancements to the config store may change this behavior). -Second, while the output of config store state will list everything in -the database, the input file need only contain the specific values to -be overridden. So, one way to use this class for input file configuration -is to generate an initial configuration using the output (Save) method -described above, extract from that configuration file only the elements -one wishes to change, and move these minimal elements to a new configuration -file which can then safely be edited and loaded in a subsequent simulation run. +Second, while the output of :cpp:class:`ConfigStore` state +will list everything in the database, the input file need only contain +the specific values to be overridden. So, one way to use this class +for input file configuration is to generate an initial configuration +using the output (``"Save"``) ``"Mode"`` described above, extract from +that configuration file only the elements one wishes to change, +and move these minimal elements to a new configuration file +which can then safely be edited and loaded in a subsequent simulation run. + +When the :cpp:class:`ConfigStore` object is instantiated, its attributes +``"Filename"``, ``"Mode"``, and ``"FileFormat"`` must be set, +either *via* command-line or *via* program statements. -When the ConfigStore object is instantiated, its attributes Filename, Mode, and -FileFormat must be set, either via command-line or via program statements. +Reading/Writing Example ++++++++++++++++++++++++ As a more complicated example, let's assume that we want to read in a -configuration of defaults from an input file named "input-defaults.xml", and +configuration of defaults from an input file named ``input-defaults.xml``, and write out the resulting attributes to a separate file called -"output-attributes.xml".:: +``output-attributes.xml``.:: #include "ns3/config-store-module.h" ... @@ -862,8 +1054,8 @@ inputConfig.ConfigureDefaults (); // - // Allow the user to override any of the defaults and the above Bind() at - // run-time, via command-line arguments + // Allow the user to override any of the defaults and the above Bind () at + // run-time, viacommand-line arguments // CommandLine cmd; cmd.Parse (argc, argv); @@ -879,15 +1071,15 @@ Simulator::Run (); } -GTK-based ConfigStore -+++++++++++++++++++++ +ConfigStore GUI ++++++++++++++++ There is a GTK-based front end for the ConfigStore. This allows users to use a GUI to access and change variables. Screenshots of this feature are available in the `|ns3| Overview `_ presentation. -To use this feature, one must install libgtk and libgtk-dev; an example +To use this feature, one must install ``libgtk`` and ``libgtk-dev``; an example Ubuntu installation command is: .. sourcecode:: bash @@ -917,7 +1109,7 @@ is rerun. Usage is almost the same as the non-GTK-based version, but there -are no ConfigStore attributes involved:: +are no :cpp:class:`ConfigStore` attributes involved:: // Invoke just before entering Simulator::Run () GtkConfigStore config; @@ -932,6 +1124,6 @@ +++++++++++ There are a couple of possible improvements: -* save a unique version number with date and time at start of file -* save rng initial seed somewhere. -* make each RandomVariable serialize its own initial seed and re-read it later +* Save a unique version number with date and time at start of file. +* Save rng initial seed somewhere. +* Make each RandomVariable serialize its own initial seed and re-read it later. diff -Naur ns-3.20/doc/manual/source/conf.py ns-3.21/doc/manual/source/conf.py --- ns-3.20/doc/manual/source/conf.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/doc/manual/source/conf.py 2014-09-17 20:03:14.000000000 -0700 @@ -48,9 +48,9 @@ # built documents. # # The short X.Y version. -version = 'ns-3.20' +version = 'ns-3.21' # The full version, including alpha/beta/rc tags. -release = 'ns-3.20' +release = 'ns-3.21' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -Naur ns-3.20/doc/models/Makefile ns-3.21/doc/models/Makefile --- ns-3.20/doc/models/Makefile 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/doc/models/Makefile 2014-09-17 20:03:14.000000000 -0700 @@ -58,6 +58,7 @@ $(SRC)/internet/doc/ipv6.rst \ $(SRC)/internet/doc/routing-overview.rst \ $(SRC)/internet/doc/tcp.rst \ + $(SRC)/internet/doc/codel.rst \ $(SRC)/mobility/doc/mobility.rst \ $(SRC)/olsr/doc/olsr.rst \ $(SRC)/openflow/doc/openflow-switch.rst \ @@ -75,7 +76,6 @@ $(SRC)/stats/doc/data-collection.rst \ $(SRC)/stats/doc/probe.rst \ $(SRC)/stats/doc/scope-and-limitations.rst \ - $(SRC)/stats/doc/statistics.rst \ $(SRC)/netanim/doc/animation.rst \ $(SRC)/flow-monitor/doc/flow-monitor.rst \ $(SRC)/wave/doc/wave.rst \ @@ -176,6 +176,32 @@ $(SRC)/lte/doc/source/figures/fading_vehicular.png \ $(SRC)/lte/doc/source/figures/fading_urban_3kmph.pdf \ $(SRC)/lte/doc/source/figures/fading_urban_3kmph.png \ + $(SRC)/lte/doc/source/figures/fr-enhanced-fractional-frequency-reuse-scheme.png \ + $(SRC)/lte/doc/source/figures/fr-enhanced-fractional-frequency-reuse-scheme.pdf \ + $(SRC)/lte/doc/source/figures/fr-full-frequency-reuse-scheme.png \ + $(SRC)/lte/doc/source/figures/fr-full-frequency-reuse-scheme.pdf \ + $(SRC)/lte/doc/source/figures/fr-hard-frequency-reuse-scheme.png \ + $(SRC)/lte/doc/source/figures/fr-hard-frequency-reuse-scheme.pdf \ + $(SRC)/lte/doc/source/figures/fr-soft-fractional-frequency-reuse-scheme.png \ + $(SRC)/lte/doc/source/figures/fr-soft-fractional-frequency-reuse-scheme.pdf \ + $(SRC)/lte/doc/source/figures/fr-soft-frequency-reuse-scheme-v1.png \ + $(SRC)/lte/doc/source/figures/fr-soft-frequency-reuse-scheme-v1.pdf \ + $(SRC)/lte/doc/source/figures/fr-soft-frequency-reuse-scheme-v2.png \ + $(SRC)/lte/doc/source/figures/fr-soft-frequency-reuse-scheme-v2.pdf \ + $(SRC)/lte/doc/source/figures/fr-strict-frequency-reuse-scheme.png \ + $(SRC)/lte/doc/source/figures/fr-strict-frequency-reuse-scheme.pdf \ + $(SRC)/lte/doc/source/figures/ffr-distributed-scheme.png \ + $(SRC)/lte/doc/source/figures/ffr-distributed-scheme.pdf \ + $(SRC)/lte/doc/source/figures/lte-fr-soft-1-rem.png \ + $(SRC)/lte/doc/source/figures/lte-fr-soft-1-rem.pdf \ + $(SRC)/lte/doc/source/figures/lte-ffr-soft-2-spectrum-trace.png \ + $(SRC)/lte/doc/source/figures/lte-ffr-soft-2-spectrum-trace.pdf \ + $(SRC)/lte/doc/source/figures/lte-fr-hard-1-rem.png \ + $(SRC)/lte/doc/source/figures/lte-fr-hard-1-rem.pdf \ + $(SRC)/lte/doc/source/figures/lte-fr-hard-2-rem.png \ + $(SRC)/lte/doc/source/figures/lte-fr-hard-2-rem.pdf \ + $(SRC)/lte/doc/source/figures/lte-fr-hard-3-rem.png \ + $(SRC)/lte/doc/source/figures/lte-fr-hard-3-rem.pdf \ $(SRC)/lte/doc/source/figures/MCS_1_4.pdf \ $(SRC)/lte/doc/source/figures/MCS_1_4.png \ $(SRC)/lte/doc/source/figures/MCS_5_8.pdf \ @@ -200,6 +226,10 @@ $(SRC)/lte/doc/source/figures/MCS_16_test.pdf \ $(SRC)/lte/doc/source/figures/miesm_scheme.pdf \ $(SRC)/lte/doc/source/figures/miesm_scheme.png \ + $(SRC)/lte/doc/source/figures/lte-dl-power-control.png \ + $(SRC)/lte/doc/source/figures/lte-dl-power-control.pdf \ + $(SRC)/lte/doc/source/figures/lte-ffr-scheduling.png \ + $(SRC)/lte/doc/source/figures/lte-ffr-scheduling.pdf \ $(SRC)/lte/doc/source/figures/lte-handover-campaign-rem.pdf \ $(SRC)/lte/doc/source/figures/lte-handover-campaign-rem.png \ $(SRC)/lte/doc/source/figures/lte-legacy-handover-algorithm.pdf \ diff -Naur ns-3.20/doc/models/source/conf.py ns-3.21/doc/models/source/conf.py --- ns-3.20/doc/models/source/conf.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/doc/models/source/conf.py 2014-09-17 20:03:14.000000000 -0700 @@ -48,9 +48,9 @@ # built documents. # # The short X.Y version. -version = 'ns-3.20' +version = 'ns-3.21' # The full version, including alpha/beta/rc tags. -release = 'ns-3.20' +release = 'ns-3.21' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -Naur ns-3.20/doc/models/source/internet-models.rst ns-3.21/doc/models/source/internet-models.rst --- ns-3.20/doc/models/source/internet-models.rst 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/doc/models/source/internet-models.rst 2014-09-17 20:03:14.000000000 -0700 @@ -8,3 +8,4 @@ ipv6 routing-overview tcp + codel diff -Naur ns-3.20/doc/tutorial/source/conceptual-overview.rst ns-3.21/doc/tutorial/source/conceptual-overview.rst --- ns-3.20/doc/tutorial/source/conceptual-overview.rst 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/doc/tutorial/source/conceptual-overview.rst 2014-09-17 20:03:14.000000000 -0700 @@ -743,6 +743,69 @@ return 0; } +When the simulator will stop? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +|ns3| is a Discrete Event (DE) simulator. In such a simulator, each event is +associated with its execution time, and the simulation proceeds by executing +events in the temporal order of simulation time. Events may cause future +events to be scheduled (for example, a timer may reschedule itself to +expire at the next interval). + +The initial events are usually triggered by each object, e.g., IPv6 will +schedule Router Advertisements, Neighbor Solicitations, etc., +an Application schedule the first packet sending event, etc. + +When an event is processed, it may generate zero, one or more events. +As a simulation executes, events are consumed, but more events may (or may +not) be generated. +The simulation will stop automatically when no further events are in the +event queue, or when a special Stop event is found. The Stop event is +created through the +``Simulator::Stop (stopTime);`` function. + +There is a typical case where ``Simulator::Stop`` is absolutely necessary +to stop the simulation: when there is a self-sustaining event. +Self-sustaining (or recurring) events are events that always reschedule +themselves. As a consequence, they always keep the event queue non-empty. + +There are many protocols and modules containing recurring events, e.g.: + +* FlowMonitor - periodic check for lost packets +* RIPng - periodic broadcast of routing tables update +* etc. + +In these cases, ``Simulator::Stop`` is necessary to gracefully stop the +simulation. In addition, when |ns3| is in emulation mode, the +``RealtimeSimulator`` is used to keep the simulation clock aligned with +the machine clock, and ``Simulator::Stop`` is necessary to stop the +process. + +Many of the simulation programs in the tutorial do not explicitly call +``Simulator::Stop``, since the event queue will automatically run out +of events. However, these programs will also accept a call to +``Simulator::Stop``. For example, the following additional statement +in the first example program will schedule an explicit stop at 11 seconds: + +:: + + + Simulator::Stop (Seconds (11.0)); + Simulator::Run (); + Simulator::Destroy (); + return 0; + } + +The above wil not actually change the behavior of this program, since +this particular simulation naturally ends after 10 seconds. But if you +were to change the stop time in the above statement from 11 seconds to 1 +second, you would notice that the simulation stops before any output is +printed to the screen (since the output occurs around time 2 seconds of +simulation time). + +It is important to call ``Simulator::Stop`` *before* calling +``Simulator::Run``; otherwise, ``Simulator::Run`` may never return control +to the main program to execute the stop! + Building Your Script ++++++++++++++++++++ We have made it trivial to build your simple scripts. All you have to do is diff -Naur ns-3.20/doc/tutorial/source/conf.py ns-3.21/doc/tutorial/source/conf.py --- ns-3.20/doc/tutorial/source/conf.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/doc/tutorial/source/conf.py 2014-09-17 20:03:14.000000000 -0700 @@ -48,9 +48,9 @@ # built documents. # # The short X.Y version. -version = 'ns-3.20' +version = 'ns-3.21' # The full version, including alpha/beta/rc tags. -release = 'ns-3.20' +release = 'ns-3.21' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -Naur ns-3.20/doc/tutorial-pt-br/source/conf.py ns-3.21/doc/tutorial-pt-br/source/conf.py --- ns-3.20/doc/tutorial-pt-br/source/conf.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/doc/tutorial-pt-br/source/conf.py 2014-09-17 20:03:14.000000000 -0700 @@ -50,9 +50,9 @@ # built documents. # # The short X.Y version. -version = 'ns-3.20' +version = 'ns-3.21' # The full version, including alpha/beta/rc tags. -release = 'ns-3.20' +release = 'ns-3.21' # The language for content autogenerated by . Refer to babel documentation # for a list of supported languages. diff -Naur ns-3.20/examples/energy/energy-model-with-harvesting-example.cc ns-3.21/examples/energy/energy-model-with-harvesting-example.cc --- ns-3.20/examples/energy/energy-model-with-harvesting-example.cc 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/examples/energy/energy-model-with-harvesting-example.cc 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,337 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * 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 + * + * Author: Cristiano Tapparello + */ + +/** + * + * This example extends the energy model example by connecting a basic energy + * harvester to the nodes. + * + * The example considers a simple communication link between a source and a + * destination node, where the source node sends a packet to the destination + * every 1 second. Each node is powered by a BasiEnergySource, which is recharged + * by a BasicEnergyHarvester, and the WiFi radio consumes energy for the transmission/ + * reception of the packets. + * + * For the receiver node, the example prints the energy consumption of the WiFi radio, + * the power harvested by the energy harvester and the residual energy in the + * energy source. + * + * The nodes initial energy is set to 1.0 J, the transmission and reception entail a + * current consumption of 0.0174 A and 0.0197 A, respectively (default values in + * WifiRadioEnergyModel). The energy harvester provides an amount of power that varies + * according to a random variable uniformly distributed in [0 0.1] W, and is updated + * every 1 s. The energy source voltage is 3 V (default value in BasicEnergySource) and + * the residual energy level is updated every 1 second (default value). + * + * The simulation start at time 0 and it is hard stopped at time 10 seconds. Given the + * packet size and the distance between the nodes, each transmission lasts 0.0023s. + * As a result, the destination node receives 10 messages. + * + */ + +#include "ns3/core-module.h" +#include "ns3/network-module.h" +#include "ns3/mobility-module.h" +#include "ns3/config-store-module.h" +#include "ns3/wifi-module.h" +#include "ns3/energy-module.h" +#include "ns3/internet-module.h" + +#include +#include +#include +#include + +NS_LOG_COMPONENT_DEFINE ("EnergyWithHarvestingExample"); + +using namespace ns3; + +static inline std::string +PrintReceivedPacket (Address& from) +{ + InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (from); + + std::ostringstream oss; + oss << "--\nReceived one packet! Socket: " << iaddr.GetIpv4 () + << " port: " << iaddr.GetPort () + << " at time = " << Simulator::Now ().GetSeconds () + << "\n--"; + + return oss.str (); +} + +/** + * \param socket Pointer to socket. + * + * Packet receiving sink. + */ +void +ReceivePacket (Ptr socket) +{ + Ptr packet; + Address from; + while ((packet = socket->RecvFrom (from))) + { + if (packet->GetSize () > 0) + { + NS_LOG_UNCOND (PrintReceivedPacket (from)); + } + } +} + +/** + * \param socket Pointer to socket. + * \param pktSize Packet size. + * \param n Pointer to node. + * \param pktCount Number of packets to generate. + * \param pktInterval Packet sending interval. + * + * Traffic generator. + */ +static void +GenerateTraffic (Ptr socket, uint32_t pktSize, Ptr n, + uint32_t pktCount, Time pktInterval) +{ + if (pktCount > 0) + { + socket->Send (Create (pktSize)); + Simulator::Schedule (pktInterval, &GenerateTraffic, socket, pktSize, n, + pktCount - 1, pktInterval); + } + else + { + socket->Close (); + } +} + +/// Trace function for remaining energy at node. +void +RemainingEnergy (double oldValue, double remainingEnergy) +{ + std::cout << Simulator::Now ().GetSeconds () + << "s Current remaining energy = " << remainingEnergy << "J" << std::endl; +} + +/// Trace function for total energy consumption at node. +void +TotalEnergy (double oldValue, double totalEnergy) +{ + std::cout << Simulator::Now ().GetSeconds () + << "s Total energy consumed by radio = " << totalEnergy << "J" << std::endl; +} + +/// Trace function for the power harvested by the energy harvester. +void +HarvestedPower (double oldValue, double harvestedPower) +{ + std::cout << Simulator::Now ().GetSeconds () + << "s Current harvested power = " << harvestedPower << " W" << std::endl; +} + +/// Trace function for the total energy harvested by the node. +void +TotalEnergyHarvested (double oldValue, double TotalEnergyHarvested) +{ + std::cout << Simulator::Now ().GetSeconds () + << "s Total energy harvested by harvester = " + << TotalEnergyHarvested << " J" << std::endl; +} + + +int +main (int argc, char *argv[]) +{ + /* + LogComponentEnable ("EnergySource", LOG_LEVEL_DEBUG); + LogComponentEnable ("BasicEnergySource", LOG_LEVEL_DEBUG); + LogComponentEnable ("DeviceEnergyModel", LOG_LEVEL_DEBUG); + LogComponentEnable ("WifiRadioEnergyModel", LOG_LEVEL_DEBUG); + LogComponentEnable ("EnergyHarvester", LOG_LEVEL_DEBUG); + LogComponentEnable ("BasicEnergyHarvester", LOG_LEVEL_DEBUG); + */ + + std::string phyMode ("DsssRate1Mbps"); + double Prss = -80; // dBm + uint32_t PpacketSize = 200; // bytes + bool verbose = false; + + // simulation parameters + uint32_t numPackets = 10000; // number of packets to send + double interval = 1; // seconds + double startTime = 0.0; // seconds + double distanceToRx = 100.0; // meters + /* + * This is a magic number used to set the transmit power, based on other + * configuration. + */ + double offset = 81; + + // Energy Harvester variables + double harvestingUpdateInterval = 1; // seconds + + CommandLine cmd; + cmd.AddValue ("phyMode", "Wifi Phy mode", phyMode); + cmd.AddValue ("Prss", "Intended primary RSS (dBm)", Prss); + cmd.AddValue ("PpacketSize", "size of application packet sent", PpacketSize); + cmd.AddValue ("numPackets", "Total number of packets to send", numPackets); + cmd.AddValue ("startTime", "Simulation start time", startTime); + cmd.AddValue ("distanceToRx", "X-Axis distance between nodes", distanceToRx); + cmd.AddValue ("verbose", "Turn on all device log components", verbose); + cmd.Parse (argc, argv); + + // Convert to time object + Time interPacketInterval = Seconds (interval); + + // disable fragmentation for frames below 2200 bytes + Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", + StringValue ("2200")); + // turn off RTS/CTS for frames below 2200 bytes + Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", + StringValue ("2200")); + // Fix non-unicast data rate to be the same as that of unicast + Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode", + StringValue (phyMode)); + + NodeContainer c; + c.Create (2); // create 2 nodes + NodeContainer networkNodes; + networkNodes.Add (c.Get (0)); + networkNodes.Add (c.Get (1)); + + // The below set of helpers will help us to put together the wifi NICs we want + WifiHelper wifi; + if (verbose) + { + wifi.EnableLogComponents (); + } + wifi.SetStandard (WIFI_PHY_STANDARD_80211b); + + /** Wifi PHY **/ + /***************************************************************************/ + YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); + wifiPhy.Set ("RxGain", DoubleValue (-10)); + wifiPhy.Set ("TxGain", DoubleValue (offset + Prss)); + wifiPhy.Set ("CcaMode1Threshold", DoubleValue (0.0)); + /***************************************************************************/ + + /** wifi channel **/ + YansWifiChannelHelper wifiChannel; + wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); + wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel"); + // create wifi channel + Ptr wifiChannelPtr = wifiChannel.Create (); + wifiPhy.SetChannel (wifiChannelPtr); + + /** MAC layer **/ + // Add a non-QoS upper MAC, and disable rate control + NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); + wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", + StringValue (phyMode), "ControlMode", + StringValue (phyMode)); + // Set it to ad-hoc mode + wifiMac.SetType ("ns3::AdhocWifiMac"); + + /** install PHY + MAC **/ + NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, networkNodes); + + /** mobility **/ + MobilityHelper mobility; + Ptr positionAlloc = CreateObject (); + positionAlloc->Add (Vector (0.0, 0.0, 0.0)); + positionAlloc->Add (Vector (2 * distanceToRx, 0.0, 0.0)); + mobility.SetPositionAllocator (positionAlloc); + mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); + mobility.Install (c); + + /** Energy Model **/ + /***************************************************************************/ + /* energy source */ + BasicEnergySourceHelper basicSourceHelper; + // configure energy source + basicSourceHelper.Set ("BasicEnergySourceInitialEnergyJ", DoubleValue (1.0)); + // install source + EnergySourceContainer sources = basicSourceHelper.Install (c); + /* device energy model */ + WifiRadioEnergyModelHelper radioEnergyHelper; + // configure radio energy model + radioEnergyHelper.Set ("TxCurrentA", DoubleValue (0.0174)); + radioEnergyHelper.Set ("RxCurrentA", DoubleValue (0.0197)); + // install device model + DeviceEnergyModelContainer deviceModels = radioEnergyHelper.Install (devices, sources); + + /* energy harvester */ + BasicEnergyHarvesterHelper basicHarvesterHelper; + // configure energy harvester + basicHarvesterHelper.Set ("PeriodicHarvestedPowerUpdateInterval", TimeValue (Seconds (harvestingUpdateInterval))); + basicHarvesterHelper.Set ("HarvestablePower", StringValue ("ns3::UniformRandomVariable[Min=0.0|Max=0.1]")); + // install harvester on all energy sources + EnergyHarvesterContainer harvesters = basicHarvesterHelper.Install (sources); + /***************************************************************************/ + + /** Internet stack **/ + InternetStackHelper internet; + internet.Install (networkNodes); + + Ipv4AddressHelper ipv4; + NS_LOG_INFO ("Assign IP Addresses."); + ipv4.SetBase ("10.1.1.0", "255.255.255.0"); + Ipv4InterfaceContainer i = ipv4.Assign (devices); + + TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); + Ptr recvSink = Socket::CreateSocket (networkNodes.Get (1), tid); // node 1, Destination + InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80); + recvSink->Bind (local); + recvSink->SetRecvCallback (MakeCallback (&ReceivePacket)); + + Ptr source = Socket::CreateSocket (networkNodes.Get (0), tid); // node 0, Source + InetSocketAddress remote = InetSocketAddress (Ipv4Address::GetBroadcast (), 80); + source->SetAllowBroadcast (true); + source->Connect (remote); + + /** connect trace sources **/ + /***************************************************************************/ + // all traces are connected to node 1 (Destination) + // energy source + Ptr basicSourcePtr = DynamicCast (sources.Get (1)); + basicSourcePtr->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback (&RemainingEnergy)); + // device energy model + Ptr basicRadioModelPtr = + basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (0); + NS_ASSERT (basicRadioModelPtr != 0); + basicRadioModelPtr->TraceConnectWithoutContext ("TotalEnergyConsumption", MakeCallback (&TotalEnergy)); + // energy harvester + Ptr basicHarvesterPtr = DynamicCast (harvesters.Get (1)); + basicHarvesterPtr->TraceConnectWithoutContext ("HarvestedPower", MakeCallback (&HarvestedPower)); + basicHarvesterPtr->TraceConnectWithoutContext ("TotalEnergyHarvested", MakeCallback (&TotalEnergyHarvested)); + /***************************************************************************/ + + + /** simulation setup **/ + // start traffic + Simulator::Schedule (Seconds (startTime), &GenerateTraffic, source, PpacketSize, + networkNodes.Get (0), numPackets, interPacketInterval); + + Simulator::Stop (Seconds (10.0)); + Simulator::Run (); + Simulator::Destroy (); + + return 0; +} diff -Naur ns-3.20/examples/energy/wscript ns-3.21/examples/energy/wscript --- ns-3.20/examples/energy/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/energy/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -3,3 +3,5 @@ def build(bld): obj = bld.create_ns3_program('energy-model-example', ['core', 'mobility', 'wifi', 'energy', 'internet']) obj.source = 'energy-model-example.cc' + obj = bld.create_ns3_program('energy-model-with-harvesting-example', ['core', 'mobility', 'wifi', 'energy', 'internet']) + obj.source = 'energy-model-with-harvesting-example.cc' \ No newline at end of file diff -Naur ns-3.20/examples/ipv6/wscript ns-3.21/examples/ipv6/wscript --- ns-3.20/examples/ipv6/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/ipv6/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -1,13 +1,13 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - obj = bld.create_ns3_program('icmpv6-redirect', ['csma', 'internet']) + obj = bld.create_ns3_program('icmpv6-redirect', ['csma', 'internet', 'applications']) obj.source = 'icmpv6-redirect.cc' - obj = bld.create_ns3_program('ping6', ['csma', 'internet']) + obj = bld.create_ns3_program('ping6', ['csma', 'internet', 'applications']) obj.source = 'ping6.cc' - obj = bld.create_ns3_program('radvd', ['csma', 'internet']) + obj = bld.create_ns3_program('radvd', ['csma', 'internet', 'applications']) obj.source = 'radvd.cc' obj = bld.create_ns3_program('radvd-two-prefix', ['csma', 'internet', 'applications']) @@ -16,15 +16,15 @@ obj = bld.create_ns3_program('test-ipv6', ['point-to-point', 'internet']) obj.source = 'test-ipv6.cc' - obj = bld.create_ns3_program('fragmentation-ipv6', ['csma', 'internet']) + obj = bld.create_ns3_program('fragmentation-ipv6', ['csma', 'internet', 'applications']) obj.source = 'fragmentation-ipv6.cc' - obj = bld.create_ns3_program('fragmentation-ipv6-two-MTU', ['csma', 'internet']) + obj = bld.create_ns3_program('fragmentation-ipv6-two-MTU', ['csma', 'internet', 'applications']) obj.source = 'fragmentation-ipv6-two-MTU.cc' - obj = bld.create_ns3_program('loose-routing-ipv6', ['csma', 'internet']) + obj = bld.create_ns3_program('loose-routing-ipv6', ['csma', 'internet', 'applications']) obj.source = 'loose-routing-ipv6.cc' - obj = bld.create_ns3_program('wsn-ping6', ['lr-wpan', 'internet', 'sixlowpan', 'mobility']) + obj = bld.create_ns3_program('wsn-ping6', ['lr-wpan', 'internet', 'sixlowpan', 'mobility', 'applications']) obj.source = 'wsn-ping6.cc' diff -Naur ns-3.20/examples/naming/wscript ns-3.21/examples/naming/wscript --- ns-3.20/examples/naming/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/naming/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -1,5 +1,5 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - obj = bld.create_ns3_program('object-names', ['core', 'csma', 'internet']) + obj = bld.create_ns3_program('object-names', ['core', 'csma', 'internet', 'applications']) obj.source = 'object-names.cc' diff -Naur ns-3.20/examples/realtime/wscript ns-3.21/examples/realtime/wscript --- ns-3.20/examples/realtime/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/realtime/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -1,7 +1,7 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - obj = bld.create_ns3_program('realtime-udp-echo', ['csma', 'internet']) + obj = bld.create_ns3_program('realtime-udp-echo', ['csma', 'internet', 'applications']) obj.source = 'realtime-udp-echo.cc' bld.register_ns3_script('realtime-udp-echo.py', ['csma', 'internet', 'applications']) diff -Naur ns-3.20/examples/routing/wscript ns-3.21/examples/routing/wscript --- ns-3.20/examples/routing/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/routing/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -2,19 +2,19 @@ def build(bld): obj = bld.create_ns3_program('dynamic-global-routing', - ['point-to-point', 'csma', 'internet']) + ['point-to-point', 'csma', 'internet', 'applications']) obj.source = 'dynamic-global-routing.cc' obj = bld.create_ns3_program('static-routing-slash32', - ['point-to-point', 'csma', 'internet']) + ['point-to-point', 'csma', 'internet', 'applications']) obj.source = 'static-routing-slash32.cc' obj = bld.create_ns3_program('global-routing-slash32', - ['point-to-point', 'csma', 'internet']) + ['point-to-point', 'csma', 'internet', 'applications']) obj.source = 'global-routing-slash32.cc' obj = bld.create_ns3_program('global-injection-slash32', - ['point-to-point', 'csma', 'internet']) + ['point-to-point', 'csma', 'internet', 'applications']) obj.source = 'global-injection-slash32.cc' obj = bld.create_ns3_program('simple-global-routing', @@ -25,12 +25,12 @@ ['point-to-point', 'internet', 'applications']) obj.source = 'simple-alternate-routing.cc' - obj = bld.create_ns3_program( 'mixed-global-routing', - ['point-to-point', 'internet', 'csma']) + obj = bld.create_ns3_program('mixed-global-routing', + ['point-to-point', 'internet', 'csma', 'applications']) obj.source = 'mixed-global-routing.cc' obj = bld.create_ns3_program('simple-routing-ping6', - ['csma', 'internet']) + ['csma', 'internet', 'applications']) obj.source = 'simple-routing-ping6.cc' obj = bld.create_ns3_program('manet-routing-compare', diff -Naur ns-3.20/examples/socket/wscript ns-3.21/examples/socket/wscript --- ns-3.20/examples/socket/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/socket/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -4,7 +4,7 @@ obj = bld.create_ns3_program('socket-bound-static-routing', ['network', 'csma', 'point-to-point', 'internet']) obj.source = 'socket-bound-static-routing.cc' - obj = bld.create_ns3_program('socket-bound-tcp-static-routing', ['network', 'csma', 'point-to-point', 'internet']) + obj = bld.create_ns3_program('socket-bound-tcp-static-routing', ['network', 'csma', 'point-to-point', 'internet', 'applications']) obj.source = 'socket-bound-tcp-static-routing.cc' obj = bld.create_ns3_program('socket-options-ipv4', ['network', 'csma', 'point-to-point', 'internet']) diff -Naur ns-3.20/examples/tcp/tcp-variants-comparison.cc ns-3.21/examples/tcp/tcp-variants-comparison.cc --- ns-3.20/examples/tcp/tcp-variants-comparison.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/tcp/tcp-variants-comparison.cc 2014-09-17 20:03:14.000000000 -0700 @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2013 ResiliNets, ITTC, University of Kansas + * Copyright (c) 2013 ResiliNets, ITTC, University of Kansas * * 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 @@ -54,92 +54,63 @@ NS_LOG_COMPONENT_DEFINE ("TcpVariantsComparison"); -double old_time = 0.0; -EventId output; -Time current = Time::FromInteger(3, Time::S); //Only record cwnd and ssthresh values every 3 seconds -bool first = true; +bool firstCwnd = true; +bool firstSshThr = true; +Ptr cWndStream; +Ptr ssThreshStream; +uint32_t cWndValue; +uint32_t ssThreshValue; -static void -OutputTrace () -{ - // *stream->GetStream() << newtime << " " << newval << std::endl; - // old_time = newval; -} static void -CwndTracer (Ptrstream, uint32_t oldval, uint32_t newval) +CwndTracer (uint32_t oldval, uint32_t newval) { - double new_time = Simulator::Now().GetSeconds(); - if (old_time == 0 && first) - { - double mycurrent = current.GetSeconds(); - *stream->GetStream() << new_time << " " << mycurrent << " " << newval << std::endl; - first = false; - output = Simulator::Schedule(current,&OutputTrace); - } - else - { - if (output.IsExpired()) + if (firstCwnd) { - *stream->GetStream() << new_time << " " << newval << std::endl; - output.Cancel(); - output = Simulator::Schedule(current,&OutputTrace); + *cWndStream->GetStream () << "0.0 " << oldval << std::endl; + firstCwnd = false; + } + *cWndStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval << std::endl; + cWndValue = newval; + + if (!firstSshThr) + { + *ssThreshStream->GetStream () << Simulator::Now ().GetSeconds () << " " << ssThreshValue << std::endl; } - } } static void -SsThreshTracer (Ptrstream, uint32_t oldval, uint32_t newval) +SsThreshTracer (uint32_t oldval, uint32_t newval) { - double new_time = Simulator::Now().GetSeconds(); - if (old_time == 0 && first) - { - double mycurrent = current.GetSeconds(); - *stream->GetStream() << new_time << " " << mycurrent << " " << newval << std::endl; - first = false; - output = Simulator::Schedule(current,&OutputTrace); - } - else - { - if (output.IsExpired()) + if (firstSshThr) { - *stream->GetStream() << new_time << " " << newval << std::endl; - output.Cancel(); - output = Simulator::Schedule(current,&OutputTrace); + *ssThreshStream->GetStream () << "0.0 " << oldval << std::endl; + firstSshThr = false; + } + *ssThreshStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval << std::endl; + ssThreshValue = newval; + + if (!firstCwnd) + { + *cWndStream->GetStream () << Simulator::Now ().GetSeconds () << " " << cWndValue << std::endl; } - } } + static void TraceCwnd (std::string cwnd_tr_file_name) { AsciiTraceHelper ascii; - if (cwnd_tr_file_name.compare("") == 0) - { - NS_LOG_DEBUG ("No trace file for cwnd provided"); - return; - } - else - { - Ptr stream = ascii.CreateFileStream(cwnd_tr_file_name.c_str()); - Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow",MakeBoundCallback (&CwndTracer, stream)); - } + cWndStream = ascii.CreateFileStream (cwnd_tr_file_name.c_str ()); + Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow", MakeCallback (&CwndTracer)); } static void -TraceSsThresh(std::string ssthresh_tr_file_name) +TraceSsThresh (std::string ssthresh_tr_file_name) { AsciiTraceHelper ascii; - if (ssthresh_tr_file_name.compare("") == 0) - { - NS_LOG_DEBUG ("No trace file for ssthresh provided"); - return; - } - else - { - Ptr stream = ascii.CreateFileStream(ssthresh_tr_file_name.c_str()); - Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/SlowStartThreshold",MakeBoundCallback (&SsThreshTracer, stream)); - } + ssThreshStream = ascii.CreateFileStream (ssthresh_tr_file_name.c_str ()); + Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/SlowStartThreshold",MakeCallback (&SsThreshTracer)); } int main (int argc, char *argv[]) @@ -162,25 +133,25 @@ CommandLine cmd; - cmd.AddValue("transport_prot", "Transport protocol to use: TcpTahoe, TcpReno, TcpNewReno, TcpWestwood, TcpWestwoodPlus ", transport_prot); - cmd.AddValue("error_p", "Packet error rate", error_p); - cmd.AddValue("bandwidth", "Bottleneck bandwidth", bandwidth); - cmd.AddValue("access_bandwidth", "Access link bandwidth", access_bandwidth); - cmd.AddValue("delay", "Access link delay", access_delay); - cmd.AddValue("tracing", "Flag to enable/disable tracing", tracing); - cmd.AddValue("tr_name", "Name of output trace file", tr_file_name); - cmd.AddValue("cwnd_tr_name", "Name of output trace file", cwnd_tr_file_name); - cmd.AddValue("ssthresh_tr_name", "Name of output trace file", ssthresh_tr_file_name); - cmd.AddValue("data", "Number of Megabytes of data to transmit", data_mbytes); - cmd.AddValue("mtu", "Size of IP packets to send in bytes", mtu_bytes); - cmd.AddValue("num_flows", "Number of flows", num_flows); - cmd.AddValue("duration", "Time to allow flows to run in seconds", duration); - cmd.AddValue("run", "Run index (for setting repeatable seeds)", run); - cmd.AddValue("flow_monitor", "Enable flow monitor", flow_monitor); + cmd.AddValue ("transport_prot", "Transport protocol to use: TcpTahoe, TcpReno, TcpNewReno, TcpWestwood, TcpWestwoodPlus ", transport_prot); + cmd.AddValue ("error_p", "Packet error rate", error_p); + cmd.AddValue ("bandwidth", "Bottleneck bandwidth", bandwidth); + cmd.AddValue ("access_bandwidth", "Access link bandwidth", access_bandwidth); + cmd.AddValue ("delay", "Access link delay", access_delay); + cmd.AddValue ("tracing", "Flag to enable/disable tracing", tracing); + cmd.AddValue ("tr_name", "Name of output trace file", tr_file_name); + cmd.AddValue ("cwnd_tr_name", "Name of output trace file", cwnd_tr_file_name); + cmd.AddValue ("ssthresh_tr_name", "Name of output trace file", ssthresh_tr_file_name); + cmd.AddValue ("data", "Number of Megabytes of data to transmit", data_mbytes); + cmd.AddValue ("mtu", "Size of IP packets to send in bytes", mtu_bytes); + cmd.AddValue ("num_flows", "Number of flows", num_flows); + cmd.AddValue ("duration", "Time to allow flows to run in seconds", duration); + cmd.AddValue ("run", "Run index (for setting repeatable seeds)", run); + cmd.AddValue ("flow_monitor", "Enable flow monitor", flow_monitor); cmd.Parse (argc, argv); - SeedManager::SetSeed(1); - SeedManager::SetRun(run); + SeedManager::SetSeed (1); + SeedManager::SetRun (run); // User may find it convenient to enable logging //LogComponentEnable("TcpVariantsComparison", LOG_LEVEL_ALL); @@ -188,12 +159,12 @@ //LogComponentEnable("DropTailQueue", LOG_LEVEL_ALL); // Calculate the ADU size - Header* temp_header = new Ipv4Header(); - uint32_t ip_header = temp_header->GetSerializedSize(); + Header* temp_header = new Ipv4Header (); + uint32_t ip_header = temp_header->GetSerializedSize (); NS_LOG_LOGIC ("IP Header size is: " << ip_header); delete temp_header; - temp_header = new TcpHeader(); - uint32_t tcp_header = temp_header->GetSerializedSize(); + temp_header = new TcpHeader (); + uint32_t tcp_header = temp_header->GetSerializedSize (); NS_LOG_LOGIC ("TCP Header size is: " << tcp_header); delete temp_header; uint32_t tcp_adu_size = mtu_bytes - (ip_header + tcp_header); @@ -204,22 +175,28 @@ float stop_time = start_time + duration; // Select TCP variant - if (transport_prot.compare("TcpTahoe") == 0) - Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpTahoe::GetTypeId())); - else if (transport_prot.compare("TcpReno") == 0) - Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpReno::GetTypeId())); - else if (transport_prot.compare("TcpNewReno") == 0) - Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpNewReno::GetTypeId())); - else if (transport_prot.compare("TcpWestwood") == 0) - {// the default protocol type in ns3::TcpWestwood is WESTWOOD - Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId())); - Config::SetDefault("ns3::TcpWestwood::FilterType", EnumValue(TcpWestwood::TUSTIN)); - } - else if (transport_prot.compare("TcpWestwoodPlus") == 0) - { - Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId())); - Config::SetDefault("ns3::TcpWestwood::ProtocolType", EnumValue(TcpWestwood::WESTWOODPLUS)); - Config::SetDefault("ns3::TcpWestwood::FilterType", EnumValue(TcpWestwood::TUSTIN)); + if (transport_prot.compare ("TcpTahoe") == 0) + { + Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpTahoe::GetTypeId ())); + } + else if (transport_prot.compare ("TcpReno") == 0) + { + Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpReno::GetTypeId ())); + } + else if (transport_prot.compare ("TcpNewReno") == 0) + { + Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpNewReno::GetTypeId ())); + } + else if (transport_prot.compare ("TcpWestwood") == 0) + { // the default protocol type in ns3::TcpWestwood is WESTWOOD + Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ())); + Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood::TUSTIN)); + } + else if (transport_prot.compare ("TcpWestwoodPlus") == 0) + { + Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ())); + Config::SetDefault ("ns3::TcpWestwood::ProtocolType", EnumValue (TcpWestwood::WESTWOODPLUS)); + Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood::TUSTIN)); } else { @@ -231,18 +208,18 @@ NodeContainer gateways; gateways.Create (1); NodeContainer sources; - sources.Create(num_flows); + sources.Create (num_flows); NodeContainer sinks; - sinks.Create(num_flows); + sinks.Create (num_flows); // Configure the error model // Here we use RateErrorModel with packet error rate - Ptr uv = CreateObject(); + Ptr uv = CreateObject (); uv->SetStream (50); RateErrorModel error_model; - error_model.SetRandomVariable(uv); - error_model.SetUnit(RateErrorModel::ERROR_UNIT_PACKET); - error_model.SetRate(error_p); + error_model.SetRandomVariable (uv); + error_model.SetUnit (RateErrorModel::ERROR_UNIT_PACKET); + error_model.SetRate (error_p); PointToPointHelper UnReLink; UnReLink.SetDeviceAttribute ("DataRate", StringValue (bandwidth)); @@ -262,16 +239,16 @@ LocalLink.SetDeviceAttribute ("DataRate", StringValue (access_bandwidth)); LocalLink.SetChannelAttribute ("Delay", StringValue (access_delay)); Ipv4InterfaceContainer sink_interfaces; - for (int i=0; i ascii_wrap; - if (tr_file_name.compare("") == 0) + if (tr_file_name.compare ("") != 0) { - NS_LOG_DEBUG ("No trace file provided"); - exit (1); + std::ofstream ascii; + Ptr ascii_wrap; + ascii.open (tr_file_name.c_str ()); + ascii_wrap = new OutputStreamWrapper (tr_file_name.c_str (), std::ios::out); + stack.EnableAsciiIpv4All (ascii_wrap); } - else + + if (cwnd_tr_file_name.compare ("") != 0) { - ascii.open (tr_file_name.c_str()); - ascii_wrap = new OutputStreamWrapper(tr_file_name.c_str(), std::ios::out); + Simulator::Schedule (Seconds (0.00001), &TraceCwnd, cwnd_tr_file_name); } - stack.EnableAsciiIpv4All (ascii_wrap); + if (ssthresh_tr_file_name.compare ("") != 0) + { + Simulator::Schedule (Seconds (0.00001), &TraceSsThresh, ssthresh_tr_file_name); + } - Simulator::Schedule(Seconds(0.00001), &TraceCwnd, cwnd_tr_file_name); - Simulator::Schedule(Seconds(0.00001), &TraceSsThresh, ssthresh_tr_file_name); } - UnReLink.EnablePcapAll("TcpVariantsComparison", true); - LocalLink.EnablePcapAll("TcpVariantsComparison", true); + UnReLink.EnablePcapAll ("TcpVariantsComparison", true); + LocalLink.EnablePcapAll ("TcpVariantsComparison", true); // Flow monitor FlowMonitorHelper flowHelper; if (flow_monitor) { - flowHelper.InstallAll(); + flowHelper.InstallAll (); } - Simulator::Stop (Seconds(stop_time)); + Simulator::Stop (Seconds (stop_time)); Simulator::Run (); if (flow_monitor) { - flowHelper.SerializeToXmlFile("TcpVariantsComparison.flowmonitor", true, true); + flowHelper.SerializeToXmlFile ("TcpVariantsComparison.flowmonitor", true, true); } Simulator::Destroy (); diff -Naur ns-3.20/examples/tutorial/wscript ns-3.21/examples/tutorial/wscript --- ns-3.20/examples/tutorial/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/tutorial/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -12,7 +12,7 @@ obj = bld.create_ns3_program('second', ['core', 'point-to-point', 'csma', 'internet', 'applications']) obj.source = 'second.cc' - obj = bld.create_ns3_program('third', ['core', 'point-to-point', 'csma', 'wifi', 'internet']) + obj = bld.create_ns3_program('third', ['core', 'point-to-point', 'csma', 'wifi', 'internet', 'applications']) obj.source = 'third.cc' obj = bld.create_ns3_program('fourth', ['core']) diff -Naur ns-3.20/examples/udp/wscript ns-3.21/examples/udp/wscript --- ns-3.20/examples/udp/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/udp/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -1,5 +1,5 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - obj = bld.create_ns3_program('udp-echo', ['csma', 'internet']) + obj = bld.create_ns3_program('udp-echo', ['csma', 'internet', 'applications']) obj.source = 'udp-echo.cc' diff -Naur ns-3.20/examples/udp-client-server/wscript ns-3.21/examples/udp-client-server/wscript --- ns-3.20/examples/udp-client-server/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/udp-client-server/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -1,7 +1,7 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - obj = bld.create_ns3_program('udp-client-server', ['csma', 'internet']) + obj = bld.create_ns3_program('udp-client-server', ['csma', 'internet', 'applications']) obj.source = 'udp-client-server.cc' obj = bld.create_ns3_program('udp-trace-client-server', ['csma', 'internet', 'applications']) diff -Naur ns-3.20/examples/wireless/wifi-simple-adhoc.cc ns-3.21/examples/wireless/wifi-simple-adhoc.cc --- ns-3.20/examples/wireless/wifi-simple-adhoc.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/wireless/wifi-simple-adhoc.cc 2014-09-17 20:03:14.000000000 -0700 @@ -69,7 +69,10 @@ void ReceivePacket (Ptr socket) { - NS_LOG_UNCOND ("Received one packet!"); + while (socket->Recv ()) + { + NS_LOG_UNCOND ("Received one packet!"); + } } static void GenerateTraffic (Ptr socket, uint32_t pktSize, diff -Naur ns-3.20/examples/wireless/wifi-simple-adhoc-grid.cc ns-3.21/examples/wireless/wifi-simple-adhoc-grid.cc --- ns-3.20/examples/wireless/wifi-simple-adhoc-grid.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/wireless/wifi-simple-adhoc-grid.cc 2014-09-17 20:03:14.000000000 -0700 @@ -90,7 +90,10 @@ void ReceivePacket (Ptr socket) { - NS_LOG_UNCOND ("Received one packet!"); + while (socket->Recv ()) + { + NS_LOG_UNCOND ("Received one packet!"); + } } static void GenerateTraffic (Ptr socket, uint32_t pktSize, diff -Naur ns-3.20/examples/wireless/wifi-simple-infra.cc ns-3.21/examples/wireless/wifi-simple-infra.cc --- ns-3.20/examples/wireless/wifi-simple-infra.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/wireless/wifi-simple-infra.cc 2014-09-17 20:03:14.000000000 -0700 @@ -70,7 +70,10 @@ void ReceivePacket (Ptr socket) { - NS_LOG_UNCOND ("Received one packet!"); + while (socket->Recv ()) + { + NS_LOG_UNCOND ("Received one packet!"); + } } static void GenerateTraffic (Ptr socket, uint32_t pktSize, diff -Naur ns-3.20/examples/wireless/wifi-simple-interference.cc ns-3.21/examples/wireless/wifi-simple-interference.cc --- ns-3.20/examples/wireless/wifi-simple-interference.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/examples/wireless/wifi-simple-interference.cc 2014-09-17 20:03:14.000000000 -0700 @@ -99,11 +99,16 @@ static inline std::string PrintReceivedPacket (Ptr socket) { Address addr; - socket->GetSockName (addr); - InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr); std::ostringstream oss; - oss << "Received one packet! Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort (); + + while (socket->Recv ()) + { + socket->GetSockName (addr); + InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr); + + oss << "Received one packet! Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort (); + } return oss.str (); } diff -Naur ns-3.20/examples/wireless/wifi-sleep.cc ns-3.21/examples/wireless/wifi-sleep.cc --- ns-3.20/examples/wireless/wifi-sleep.cc 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/examples/wireless/wifi-sleep.cc 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,247 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 The Boeing Company + * 2014 Universita' degli Studi di Napoli "Federico II" + * + * 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 + * + */ + +// +// This script configures two nodes on an 802.11b physical layer, with +// 802.11b NICs in adhoc mode. One of the nodes generates on-off traffic +// destined to the other node. +// +// The purpose is to test the energy depletion on the nodes and the +// activation of the callback that puts a node in the sleep state when +// its energy is depleted. Furthermore, this script can be used to test +// the available policies for updating the transmit current based on +// the nominal tx power used to transmit each frame. +// +// There are a number of command-line options available to control +// the default behavior. The list of available command-line options +// can be listed with the following command: +// ./waf --run "wifi-sleep --help" +// +// Note that all ns-3 attributes (not just the ones exposed in the below +// script) can be changed at command line; see the documentation. +// +// This script can also be helpful to put the Wifi layer into verbose +// logging mode; this command will turn on all wifi logging: +// +// ./waf --run "wifi-sleep --verbose=1" +// +// When you are done, you will notice four trace files in your directory: +// two for the remaining energy on each node and two for the state transitions +// of each node. +// + +#include "ns3/core-module.h" +#include "ns3/network-module.h" +#include "ns3/mobility-module.h" +#include "ns3/config-store-module.h" +#include "ns3/wifi-module.h" +#include "ns3/internet-module.h" +#include "ns3/applications-module.h" +#include "ns3/energy-module.h" + +#include +#include +#include +#include +#include + +NS_LOG_COMPONENT_DEFINE ("WifiSleep"); + +using namespace ns3; + +template +void RemainingEnergyTrace (double oldValue, double newValue) +{ + std::stringstream ss; + ss << "energy_" << node << ".log"; + + static std::fstream f (ss.str().c_str(), std::ios::out); + + f << Simulator::Now().GetSeconds() << " remaining energy=" << newValue << std::endl; +} + +template +void PhyStateTrace (std::string context, Time start, Time duration, enum WifiPhy::State state) +{ + std::stringstream ss; + ss << "state_" << node << ".log"; + + static std::fstream f (ss.str().c_str(), std::ios::out); + + f << Simulator::Now().GetSeconds() << " state=" << state << " start=" << start << " duration=" << duration << std::endl; +} + + + +int main (int argc, char *argv[]) +{ + std::string dataRate = "1Mbps"; + uint32_t packetSize = 1000; // bytes + double duration = 10.0; // seconds + double initialEnergy = 7.5; // joule + double voltage = 3.0; // volts + double txPowerStart = 0.0; // dbm + double txPowerEnd = 15.0; // dbm + uint32_t nTxPowerLevels = 16; + uint32_t txPowerLevel = 0; + double idleCurrent = 0.273; // Ampere + double txCurrent = 0.380; // Ampere + bool verbose = false; + + + CommandLine cmd; + + cmd.AddValue ("dataRate", "Data rate", dataRate); + cmd.AddValue ("packetSize", "size of application packet sent", packetSize); + cmd.AddValue ("duration", "duration (seconds) of the experiment", duration); + cmd.AddValue ("initialEnergy", "Initial Energy (Joule) of each node", initialEnergy); + cmd.AddValue ("voltage", "Supply voltage (Joule)", voltage); + cmd.AddValue ("txPowerStart", "Minimum available transmission level (dbm)", txPowerStart); + cmd.AddValue ("txPowerEnd", "Maximum available transmission level (dbm)", txPowerEnd); + cmd.AddValue ("nTxPowerLevels", "Number of transmission power levels available between txPowerStart and txPowerEnd included", nTxPowerLevels); + cmd.AddValue ("txPowerLevel", "Transmission power level", txPowerLevel); + cmd.AddValue ("idleCurrent", "The radio Idle current in Ampere", idleCurrent); + cmd.AddValue ("txCurrent", "The radio Tx current in Ampere", txCurrent); + cmd.AddValue ("verbose", "turn on all WifiNetDevice log components", verbose); + + cmd.Parse (argc, argv); + + + NodeContainer c; + c.Create (2); + + // The below set of helpers will help us to put together the wifi NICs we want + WifiHelper wifi; + if (verbose) + { + wifi.EnableLogComponents (); // Turn on all Wifi logging + } + wifi.SetStandard (WIFI_PHY_STANDARD_80211b); + + YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); + // ns-3 supports RadioTap and Prism tracing extensions for 802.11b + wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO); + + wifiPhy.Set ("TxPowerStart", DoubleValue (txPowerStart)); + wifiPhy.Set ("TxPowerEnd", DoubleValue (txPowerEnd)); + wifiPhy.Set ("TxPowerLevels", UintegerValue (nTxPowerLevels)); + + YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default (); + wifiPhy.SetChannel (wifiChannel.Create ()); + + // Add a non-QoS upper mac, and set the selected tx power level + NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); + wifi.SetRemoteStationManager ("ns3::ArfWifiManager", "DefaultTxPowerLevel", UintegerValue (txPowerLevel)); + // Set it to adhoc mode + wifiMac.SetType ("ns3::AdhocWifiMac"); + NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, c); + + MobilityHelper mobility; + Ptr positionAlloc = CreateObject (); + positionAlloc->Add (Vector (0.0, 0.0, 0.0)); + positionAlloc->Add (Vector (10.0, 0.0, 0.0)); + mobility.SetPositionAllocator (positionAlloc); + mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); + mobility.Install (c); + + InternetStackHelper internet; + internet.Install (c); + + Ipv4AddressHelper ipv4; + NS_LOG_INFO ("Assign IP Addresses."); + ipv4.SetBase ("10.1.1.0", "255.255.255.0"); + Ipv4InterfaceContainer i = ipv4.Assign (devices); + + ApplicationContainer apps; + + std::string transportProto = std::string("ns3::UdpSocketFactory"); + OnOffHelper onOff(transportProto, InetSocketAddress (Ipv4Address ("10.1.1.2"), 9000)); + + onOff.SetAttribute ("DataRate", DataRateValue (DataRate (dataRate))); + onOff.SetAttribute ("PacketSize", UintegerValue (packetSize)); + onOff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0.001]")); + + apps = onOff.Install (c.Get (0)); + + apps.Start (Seconds (0.01)); + apps.Stop (Seconds (duration)); + + // Create a packet sink to receive these packets + PacketSinkHelper sink (transportProto, InetSocketAddress (Ipv4Address::GetAny (), 9001)); + apps = sink.Install (c.Get (1)); + apps.Start (Seconds (0.01)); + apps.Stop (Seconds (duration)); + + // Energy sources + EnergySourceContainer eSources; + BasicEnergySourceHelper basicSourceHelper; + WifiRadioEnergyModelHelper radioEnergyHelper; + + basicSourceHelper.Set ("BasicEnergySourceInitialEnergyJ", DoubleValue (initialEnergy)); + basicSourceHelper.Set ("BasicEnergySupplyVoltageV", DoubleValue (voltage)); + + radioEnergyHelper.Set ("IdleCurrentA", DoubleValue (idleCurrent)); + radioEnergyHelper.Set ("TxCurrentA", DoubleValue (txCurrent)); + + // compute the efficiency of the power amplifier (eta) assuming that the provided value for tx current + // corresponds to the minimum tx power level + double eta = WifiTxCurrentModel::DbmToW (txPowerStart) / ((txCurrent - idleCurrent) * voltage); + + radioEnergyHelper.SetTxCurrentModel ("ns3::LinearWifiTxCurrentModel", + "Voltage", DoubleValue (voltage), + "IdleCurrent", DoubleValue (idleCurrent), + "Eta", DoubleValue (eta)); + + // install an energy source on each node + for (NodeContainer::Iterator n = c.Begin(); n != c.End(); n++) + { + eSources.Add (basicSourceHelper.Install (*n)); + + Ptr wnd; + + for (uint32_t i = 0; i < (*n)->GetNDevices (); ++i) + { + wnd = (*n)->GetDevice (i)->GetObject (); + // if it is a WifiNetDevice + if (wnd != 0) + { + // this device draws power from the last created energy source + radioEnergyHelper.Install (wnd, eSources.Get (eSources.GetN()-1)); + } + } + } + + // Tracing + eSources.Get (0)->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback(&RemainingEnergyTrace<0>)); + eSources.Get (1)->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback(&RemainingEnergyTrace<1>)); + + Config::Connect ("/NodeList/0/DeviceList/*/Phy/State/State", MakeCallback (&PhyStateTrace<0>)); + Config::Connect ("/NodeList/1/DeviceList/*/Phy/State/State", MakeCallback (&PhyStateTrace<1>)); + +// wifiPhy.EnablePcap ("wifi-sleep", devices); + + Simulator::Stop (Seconds(duration+1)); + + Simulator::Run (); + Simulator::Destroy (); + + return 0; +} + diff -Naur ns-3.20/RELEASE_NOTES ns-3.21/RELEASE_NOTES --- ns-3.20/RELEASE_NOTES 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/RELEASE_NOTES 2014-09-17 20:03:14.000000000 -0700 @@ -9,6 +9,94 @@ Consult the file CHANGES.html for more detailed information about changed API and behavior across ns-3 releases. +Release 3.21 +============ + +Availability +------------ +This release is available from: +http://www.nsnam.org/release/ns-allinone-3.21.tar.bz2 + +Supported platforms +------------------- +- Fedora Core 20 (32/64 bit) with g++-4.8.2 +- Ubuntu 14.04 (32/64 bit) with g++-4.8.2 +- Ubuntu 12.04.4 (64 bit) with g++-4.6.3 +- Ubuntu 10.04.4 LTS (64 bit) with g++-4.4.3 +- CentOS/RHEL 6.5 (64-bit) with g++-4.4.7 +- OS X Mavericks 10.9 with Xcode 5.1.1 and clang-503.0.40 +- FreeBSD 9.2-RELEASE (64 bit) with clang-3.3 + +New user-visible features +------------------------- + +- The LTE module now supports the transport of the S1-U, X2-U and X2-C + interfaces over emulated links via the new helper class EmuEpcHelper. +- CommandLine can now provide a shorthand argument name for any + Attribute. +- Implemented support for Frequency Reuse algorithms in LTE module, as the + outcome of GSoC 2014 project. + The project also includes several sub-features, such as: + - implementation of Downlink Power Control + - implementation of Uplink Power Control + - new DL-CQI generation approach, which increases throughput if FR algorithms + are used + - seven options of Frequency Reuse algorithms: LteFrNoOpAlgorithm, + LteFrHardAlgorithm, LteFrStrictAlgorithm, LteFrSoftAlgorithm, + LteFfrSoftAlgorithm, LteFfrEnhancedAlgorithm, LteFfrDistributedAlgorithm + - updated RadioEnvironmentMapHelper. Now RadioEnvironmentMap can be generated + for Data or Control channel and for specified RbId, what is helpful when + using FR algorithms +- Added a CoDel queue model. CoDel queues measure and control the queue + traversal delay. The ns-3 implementation is a port of the Linux + implementation. +- Added support for TCP timestamp and window scale options, and added + ability to trace the TCP slow start threshold value. +- SimpleNetDevice and SimpleChannel (used for adding basic link effects + for testing of higher-layer protocols) have been extended to support + the option of broadcast or PointToPoint link semantics. The bandwidth + and link delay can be constrained, and it uses an output queue. +- SimpleNetDevice and SimpleChannel can be installed in a node through + a new helper: SimpleNetDeviceHelper. +- Implemented new PacketSocketServer and PacketSocketClient applications. + The primary use is in tests, to avoid using the ones from the + application module that also bring in a dependency on the internet module. + +Bugs fixed +---------- + +- Bug 1673 - Config::Set/Connect does not search for attributes in parent class +- Bug 1762 - UE stuck in IDLE_CONNECTING because RRC CONN REQ is not transmitted +- Bug 1811 - basic traffic generator for network module +- Bug 1824 - L4 protocol sockets should support BindToNetDevice over IPv6 +- Bug 1831 - TcpSocket SlowStartThreshold is not a TraceSource +- Bug 1851 - WifiRadioEnergyModel energy consumption values are taken from a 802.15.4 chip +- Bug 1854 - std::out_of_range Problem +- Bug 1858 - wireless examples not correctly recording packet reception +- Bug 1860 - TCP needs the Window Scale option +- Bug 1893 - issue in DoSchedUlTriggerReq with harq +- Bug 1911 - AODV cannot work on nodes with more than one netdevice +- Bug 1921 - Icmpv6L4Protocol::ForgeEchoRequest returns a malformed packet +- Bug 1930 - Use of invalid reference in OLSR RemoveLinkTuple +- Bug 1932 - NdiscCache entry is not failsafe on double neighbor probing. +- Bug 1937 - FlowMonitor fails to track multiplexed packets +- Bug 1942 - refactoring of lte-sinr-chunk-processor -> lte-chunk-processor +- Bug 1943 - Waveform generator signal duration calc error +- Bug 1951 - AODV does not update nexthop for 1-hop nodes +- Bug 1955 - The IPv4 identification field should be unique per (source, destination, protocol) tuple +- Bug 1960 - Wrong information on index range, about Node::GetDevice +- Bug 1961 - planetlab-tap-creator "variable set but not used" +- Bug 1963 - AODV can tag the same packet twice (and raise an assert) +- Bug 1964 - Integer overflow on UniformRandomVariable::GetInteger() +- Bug 1967 - LL Multicast is not compressed in the right way in IPHC +- Bug 1981 - PyViz shell not compatible with ipython >= 0.11 + +Known issues +------------ +- Bug 1770 - The mesh module will crash if used for g++ version >= 4.8.1 +in optimized mode, on a 32-bit Linux machine. Lowering the optimization +level to -O1 in this case can be used as a workaround. + Release 3.20 ============= diff -Naur ns-3.20/src/aodv/bindings/modulegen__gcc_ILP32.py ns-3.21/src/aodv/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/aodv/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -3998,10 +3998,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -4012,25 +4012,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -4147,20 +4147,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/aodv/bindings/modulegen__gcc_LP64.py ns-3.21/src/aodv/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/aodv/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -3998,10 +3998,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -4012,25 +4012,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -4147,20 +4147,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/aodv/examples/wscript ns-3.21/src/aodv/examples/wscript --- ns-3.20/src/aodv/examples/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/examples/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -2,5 +2,5 @@ def build(bld): obj = bld.create_ns3_program('aodv', - ['wifi', 'internet', 'aodv']) + ['wifi', 'internet', 'aodv', 'applications']) obj.source = 'aodv.cc' diff -Naur ns-3.20/src/aodv/model/aodv-routing-protocol.cc ns-3.21/src/aodv/model/aodv-routing-protocol.cc --- ns-3.20/src/aodv/model/aodv-routing-protocol.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/model/aodv-routing-protocol.cc 2014-09-17 20:03:14.000000000 -0700 @@ -283,6 +283,12 @@ iter->first->Close (); } m_socketAddresses.clear (); + for (std::map, Ipv4InterfaceAddress>::iterator iter = + m_socketSubnetBroadcastAddresses.begin (); iter != m_socketSubnetBroadcastAddresses.end (); iter++) + { + iter->first->Close (); + } + m_socketSubnetBroadcastAddresses.clear (); Ipv4RoutingProtocol::DoDispose (); } @@ -613,18 +619,34 @@ UdpSocketFactory::GetTypeId ()); NS_ASSERT (socket != 0); socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this)); - socket->BindToNetDevice (l3->GetNetDevice (i)); socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), AODV_PORT)); + socket->BindToNetDevice (l3->GetNetDevice (i)); socket->SetAllowBroadcast (true); socket->SetAttribute ("IpTtl", UintegerValue (1)); m_socketAddresses.insert (std::make_pair (socket, iface)); + // create also a subnet broadcast socket + socket = Socket::CreateSocket (GetObject (), + UdpSocketFactory::GetTypeId ()); + NS_ASSERT (socket != 0); + socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this)); + socket->Bind (InetSocketAddress (iface.GetBroadcast (), AODV_PORT)); + socket->BindToNetDevice (l3->GetNetDevice (i)); + socket->SetAllowBroadcast (true); + socket->SetAttribute ("IpTtl", UintegerValue (1)); + m_socketSubnetBroadcastAddresses.insert (std::make_pair (socket, iface)); + // Add local broadcast record to the routing table Ptr dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (iface.GetLocal ())); RoutingTableEntry rt (/*device=*/ dev, /*dst=*/ iface.GetBroadcast (), /*know seqno=*/ true, /*seqno=*/ 0, /*iface=*/ iface, /*hops=*/ 1, /*next hop=*/ iface.GetBroadcast (), /*lifetime=*/ Simulator::GetMaximumSimulationTime ()); m_routingTable.AddRoute (rt); + if (l3->GetInterface (i)->GetArpCache ()) + { + m_nb.AddArpCache (l3->GetInterface (i)->GetArpCache ()); + } + // Allow neighbor manager use this interface for layer 2 feedback if possible Ptr wifi = dev->GetObject (); if (wifi == 0) @@ -634,7 +656,6 @@ return; mac->TraceConnectWithoutContext ("TxErrHeader", m_nb.GetTxErrorCallback ()); - m_nb.AddArpCache (l3->GetInterface (i)->GetArpCache ()); } void @@ -662,6 +683,13 @@ NS_ASSERT (socket); socket->Close (); m_socketAddresses.erase (socket); + + // Close socket + socket = FindSubnetBroadcastSocketWithInterfaceAddress (m_ipv4->GetAddress (i, 0)); + NS_ASSERT (socket); + socket->Close (); + m_socketSubnetBroadcastAddresses.erase (socket); + if (m_socketAddresses.empty ()) { NS_LOG_LOGIC ("No aodv interfaces"); @@ -693,12 +721,22 @@ UdpSocketFactory::GetTypeId ()); NS_ASSERT (socket != 0); socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv,this)); + socket->Bind (InetSocketAddress (iface.GetLocal (), AODV_PORT)); socket->BindToNetDevice (l3->GetNetDevice (i)); - // Bind to any IP address so that broadcasts can be received - socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), AODV_PORT)); socket->SetAllowBroadcast (true); m_socketAddresses.insert (std::make_pair (socket, iface)); + // create also a subnet directed broadcast socket + socket = Socket::CreateSocket (GetObject (), + UdpSocketFactory::GetTypeId ()); + NS_ASSERT (socket != 0); + socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this)); + socket->Bind (InetSocketAddress (iface.GetBroadcast (), AODV_PORT)); + socket->BindToNetDevice (l3->GetNetDevice (i)); + socket->SetAllowBroadcast (true); + socket->SetAttribute ("IpTtl", UintegerValue (1)); + m_socketSubnetBroadcastAddresses.insert (std::make_pair (socket, iface)); + // Add local broadcast record to the routing table Ptr dev = m_ipv4->GetNetDevice ( m_ipv4->GetInterfaceForAddress (iface.GetLocal ())); @@ -722,7 +760,16 @@ if (socket) { m_routingTable.DeleteAllRoutesFromInterface (address); + socket->Close (); m_socketAddresses.erase (socket); + + Ptr unicastSocket = FindSubnetBroadcastSocketWithInterfaceAddress (address); + if (unicastSocket) + { + unicastSocket->Close (); + m_socketAddresses.erase (unicastSocket); + } + Ptr l3 = m_ipv4->GetObject (); if (l3->GetNAddresses (i)) { @@ -733,10 +780,23 @@ NS_ASSERT (socket != 0); socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this)); // Bind to any IP address so that broadcasts can be received - socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), AODV_PORT)); + socket->Bind (InetSocketAddress (iface.GetLocal (), AODV_PORT)); + socket->BindToNetDevice (l3->GetNetDevice (i)); socket->SetAllowBroadcast (true); + socket->SetAttribute ("IpTtl", UintegerValue (1)); m_socketAddresses.insert (std::make_pair (socket, iface)); + // create also a unicast socket + socket = Socket::CreateSocket (GetObject (), + UdpSocketFactory::GetTypeId ()); + NS_ASSERT (socket != 0); + socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this)); + socket->Bind (InetSocketAddress (iface.GetBroadcast (), AODV_PORT)); + socket->BindToNetDevice (l3->GetNetDevice (i)); + socket->SetAllowBroadcast (true); + socket->SetAttribute ("IpTtl", UintegerValue (1)); + m_socketSubnetBroadcastAddresses.insert (std::make_pair (socket, iface)); + // Add local broadcast record to the routing table Ptr dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (iface.GetLocal ())); RoutingTableEntry rt (/*device=*/ dev, /*dst=*/ iface.GetBroadcast (), /*know seqno=*/ true, /*seqno=*/ 0, /*iface=*/ iface, @@ -937,7 +997,20 @@ Ptr packet = socket->RecvFrom (sourceAddress); InetSocketAddress inetSourceAddr = InetSocketAddress::ConvertFrom (sourceAddress); Ipv4Address sender = inetSourceAddr.GetIpv4 (); - Ipv4Address receiver = m_socketAddresses[socket].GetLocal (); + Ipv4Address receiver; + + if (m_socketAddresses.find (socket) != m_socketAddresses.end ()) + { + receiver = m_socketAddresses[socket].GetLocal (); + } + else if(m_socketSubnetBroadcastAddresses.find (socket) != m_socketSubnetBroadcastAddresses.end ()) + { + receiver = m_socketSubnetBroadcastAddresses[socket].GetLocal (); + } + else + { + NS_ASSERT_MSG (false, "Received a packet from an unknown socket"); + } NS_LOG_DEBUG ("AODV node " << this << " received a AODV packet from " << sender << " to " << receiver); UpdateRouteToNeighbor (sender, receiver); @@ -1116,6 +1189,8 @@ toNeighbor.SetFlag (VALID); toNeighbor.SetOutputDevice (m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (receiver))); toNeighbor.SetInterface (m_ipv4->GetAddress (m_ipv4->GetInterfaceForAddress (receiver), 0)); + toNeighbor.SetHop (1); + toNeighbor.SetNextHop (src); m_routingTable.Update (toNeighbor); } m_nb.Update (src, Time (AllowedHelloLoss * HelloInterval)); @@ -1444,6 +1519,8 @@ toNeighbor.SetFlag (VALID); toNeighbor.SetOutputDevice (m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (receiver))); toNeighbor.SetInterface (m_ipv4->GetAddress (m_ipv4->GetInterfaceForAddress (receiver), 0)); + toNeighbor.SetHop (1); + toNeighbor.SetNextHop (rrepHeader.GetDst ()); m_routingTable.Update (toNeighbor); } if (EnableHello) @@ -1802,7 +1879,9 @@ Ptr socket = FindSocketWithInterfaceAddress (*i); NS_ASSERT (socket); NS_LOG_LOGIC ("Broadcast RERR message from interface " << i->GetLocal ()); + // std::cout << "Broadcast RERR message from interface " << i->GetLocal () << std::endl; // Send to all-hosts broadcast if on /32 addr, subnet-directed otherwise + Ptr p = packet->Copy (); Ipv4Address destination; if (i->GetMask () == Ipv4Mask::GetOnes ()) { @@ -1812,7 +1891,7 @@ { destination = i->GetBroadcast (); } - Simulator::Schedule (Time (MilliSeconds (m_uniformRandomVariable->GetInteger (0, 10))), &RoutingProtocol::SendTo, this, socket, packet, destination); + Simulator::Schedule (Time (MilliSeconds (m_uniformRandomVariable->GetInteger (0, 10))), &RoutingProtocol::SendTo, this, socket, p, destination); } } @@ -1825,6 +1904,22 @@ { Ptr socket = j->first; Ipv4InterfaceAddress iface = j->second; + if (iface == addr) + return socket; + } + Ptr socket; + return socket; +} + +Ptr +RoutingProtocol::FindSubnetBroadcastSocketWithInterfaceAddress (Ipv4InterfaceAddress addr ) const +{ + NS_LOG_FUNCTION (this << addr); + for (std::map, Ipv4InterfaceAddress>::const_iterator j = + m_socketSubnetBroadcastAddresses.begin (); j != m_socketSubnetBroadcastAddresses.end (); ++j) + { + Ptr socket = j->first; + Ipv4InterfaceAddress iface = j->second; if (iface == addr) return socket; } diff -Naur ns-3.20/src/aodv/model/aodv-routing-protocol.h ns-3.21/src/aodv/model/aodv-routing-protocol.h --- ns-3.20/src/aodv/model/aodv-routing-protocol.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/model/aodv-routing-protocol.h 2014-09-17 20:03:14.000000000 -0700 @@ -140,8 +140,10 @@ /// IP protocol Ptr m_ipv4; - /// Raw socket per each IP interface, map socket -> iface address (IP + mask) + /// Raw unicast socket per each IP interface, map socket -> iface address (IP + mask) std::map< Ptr, Ipv4InterfaceAddress > m_socketAddresses; + /// Raw subnet directed broadcast socket per each IP interface, map socket -> iface address (IP + mask) + std::map< Ptr, Ipv4InterfaceAddress > m_socketSubnetBroadcastAddresses; /// Loopback device used to defer RREQ until packet will be fully formed Ptr m_lo; @@ -191,8 +193,10 @@ void UpdateRouteToNeighbor (Ipv4Address sender, Ipv4Address receiver); /// Check that packet is send from own interface bool IsMyOwnAddress (Ipv4Address src); - /// Find socket with local interface address iface + /// Find unicast socket with local interface address iface Ptr FindSocketWithInterfaceAddress (Ipv4InterfaceAddress iface) const; + /// Find subnet directed broadcast socket with local interface address iface + Ptr FindSubnetBroadcastSocketWithInterfaceAddress (Ipv4InterfaceAddress iface) const; /// Process hello message void ProcessHello (RrepHeader const & rrepHeader, Ipv4Address receiverIfaceAddr); /// Create loopback route for given header diff -Naur ns-3.20/src/aodv/test/aodv-chain-regression-test-0-0.pcap ns-3.21/src/aodv/test/aodv-chain-regression-test-0-0.pcap --- ns-3.20/src/aodv/test/aodv-chain-regression-test-0-0.pcap 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/test/aodv-chain-regression-test-0-0.pcap 2014-09-17 20:03:14.000000000 -0700 @@ -6,44 +6,43 @@   (  -L@@< ++@@<  -ۑԀ@@  +Ԁ@@   -ѡ@@< +@@<  -~Ԁ^TT<0E0 +]Ԁ=TT<0E0    -+nԀ@@  ++MԀe@@   -@@<@ +h@@<@  -ԀAxx<0ET@ +xԀ xx<0ET@  -6Ԁ -@@P +Ԁ@@P  -Ԁ xx<`ET? +Ԁxx<`ET?  -HTT@E0 +Ԁxx<pET= + +ԀSTT@E0    -Ԁxx<pET= - -Ԁxx<PET@ +xx<PET@  Ԁxx<ET?  Ԁpxx<ET=  -Ԁ((TTE0 +Ԁ((TTE0    -TT`E0 +HkTT`E0    @@ -51,13 +50,13 @@  Ԁxx<ET?  -Ԁpxx<ET= +Ԁxx<ET=  -ԀTTE0 +ԀTTE0    - TTE0 +0oTTE0    @@ -65,13 +64,13 @@  Ԁxx<ET?  -Ԁxx<ET= +Ԁxx<ET=  -ԀTTE0 +ԀTTE0    -TTE0 +[TTE0    @@ -91,15 +90,15 @@  *xx<ET?  -+TT E0 ++TT E0    -FTT<0E0 +FTT<0E0    -FԀ TTE0 +FԀ0oTTE0    @@ -107,11 +106,11 @@      -/TT@E0 +/TT@E0    -3XXPE4 +3XXPE4      @@ -119,7 +118,7 @@    -;TT`E0  +;TT`E0    @@ -127,8 +126,7 @@    -;TTpE0 - +;TTpE0    @@ -136,7 +134,7 @@      -X XXE4  +X XXE4       @@ -145,7 +143,8 @@    -a TTE0  +a TTE0 +    @@ -153,7 +152,7 @@    - h| TTE0  + h| TTE0     diff -Naur ns-3.20/src/aodv/test/aodv-chain-regression-test-1-0.pcap ns-3.21/src/aodv/test/aodv-chain-regression-test-1-0.pcap --- ns-3.20/src/aodv/test/aodv-chain-regression-test-1-0.pcap 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/test/aodv-chain-regression-test-1-0.pcap 2014-09-17 20:03:14.000000000 -0700 @@ -10,43 +10,49 @@   (  -N@@< +@@<  -Ԁ@@  +}Ԁ@@   -܏@@< +@@<  -ԀTT<0E0 +hԀ~TT<0E0    -+Ԁ?@@  ++Ԁ@@   -B@@< +!@@<  -RԀ֢TT<0E0 +1ԀTT<0E0    -+Ԁ@@  ++yԀ@@   -@@<@ +@@<@  -Ԁxx<0ET@ +Ԁxx<0ET@  - Ԁ@@P +Ԁx@@P  -@@<@ +{@@<@  -ԀTxx<`ET? +Ԁ3xx<`ET?  -IԀԀ#xx<`ET> +(Ԁ@@P + +Ԁxx<`ET>  -Ԁxx<pET> +Ԁyxx<pET>  -Ԁxx<pET= +Ԁxx<pET=  -Ԁxx<PET@ +Ԁ`TTT@E0 + + + +xx<PET@  Ԁxx<ET?  @@ -56,15 +62,15 @@  iԀxx<ET=  -Ԁ'TTE0 +Ԁ'TTE0    -0TTE0 +0TTE0    -@TT`E0 +kTT`E0    @@ -74,20 +80,19 @@   Ԁxx<ET>  -ԀYxx<ET> +Ԁxx<ET>  -iԀxx<ET= +Ԁxx<ET=  -ԀTTE0 + ԀTTE0    - TTE0 + TTE0    -( -TTE0 +oTTE0    @@ -97,19 +102,19 @@   Ԁxx<ET>  -Ԁxx<ET> +Ԁtxx<ET>  -Ԁxx<ET= +Ԁxx<ET=  - ԀTTE0 +ԀTTE0    -DTTE0 +DTTE0    -TTE0 +0\TTE0    @@ -129,16 +134,15 @@  )xx<ET?  -N+TT E0 +N+TT E0    -3FTT<0E0 +3FTT<0E0    -FԀ( -TTE0 +FԀoTTE0    @@ -146,11 +150,11 @@      -p/TT@E0 +p/TT@E0    -X3XXPE4 +X3XXPE4      @@ -158,7 +162,7 @@    -(;TT`E0  +(;TT`E0    @@ -166,8 +170,7 @@    -(;TTpE0 - +(;TTpE0    @@ -175,7 +178,7 @@      - XXE4  + XXE4       @@ -184,7 +187,8 @@    -` TTE0  +` TTE0 +    @@ -192,7 +196,7 @@    - { TTE0  + { TTE0     diff -Naur ns-3.20/src/aodv/test/aodv-chain-regression-test-2-0.pcap ns-3.21/src/aodv/test/aodv-chain-regression-test-2-0.pcap --- ns-3.20/src/aodv/test/aodv-chain-regression-test-2-0.pcap 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/test/aodv-chain-regression-test-2-0.pcap 2014-09-17 20:03:14.000000000 -0700 @@ -6,84 +6,79 @@   (  -aPXXE4 +`XXE4   (  -H^TTE0 - - - -t@@<  +,@@<  -vԀ@@0 +Ԁ\@@   -މ@@< +~@@<  -ԀbTT<@E0 ++ԀATT<0E0    -+rԀJ@@  ++QԀ)@@   -L@@< ++@@<  -\ԀTT<0E0 +;ԀTT<0E0    -+ۑԀ@@  ++Ԁ@@   -~Ԁ^TT<0E0 +]Ԁ=TT<0E0    -+@@<@ ++h@@<@  -6Ԁ -@@P +Ԁ@@P  -,@@<@ + @@<@  -Ԁ xx<`ET? +Ԁxx<`ET?  -Ԁ@@P +Ԁs@@P  -@@<P +v@@<@  -Ԁjxx<`ET> +ԀIxx<`ET>  -_Ԁ@@` +>Ԁ@@P  -Ԁxx<pET= +Ԁxx<`ET=  -PԀxx<ET? +&Ԁcxx<pET?  -Ԁxx<pET> +sԀxx<pET>  -Ԁxx<pET= +Ԁxx<pET=  Ԁxx<ET?  Ԁ,xx<ET>  -!Ԁxx<ET= +!Ԁxx<ET=  -NԀCxx<ET? +NԀCxx<ET?  SԀxx<ET>  Ԁpxx<ET=  -((TTE0 +((TTE0    -0TTE0 +0TTE0    -@TTE0 +YPTTE0    @@ -91,23 +86,23 @@  Ԁ,xx<ET>  -!Ԁxx<ET= +!Ԁxx<ET=  -NԀCxx<ET? +NԀxx<ET?  -SԀxx<ET> +Ԁxx<ET>  -Ԁpxx<ET= +Ԁxx<ET=  -TTE0 +TTE0    -` TTE0 +` TTE0    -HTTE0 +@TTE0    @@ -115,48 +110,47 @@  Ԁ,xx<ET>  -!Ԁxx<ET= +!Ԁxx<ET=  -NԀxx<ET? +NԀ^xx<ET?  -Ԁxx<ET> +nԀxx<ET>  -Ԁxx<ET= +Ԁxx<ET=  -TTE0 +TTE0    -CTTE0 +CTTE0    -ATTTE0 +HTTE0    -xTTE0 +xTTE0    -` TT E0 +` TT E0    -7TT0E0 +7TT0E0    -` TT@E0 +` TT@E0    -CTTPE0  +CTTPE0    - 7TT`E0 - + 7TT`E0     diff -Naur ns-3.20/src/aodv/test/aodv-chain-regression-test-3-0.pcap ns-3.21/src/aodv/test/aodv-chain-regression-test-3-0.pcap --- ns-3.20/src/aodv/test/aodv-chain-regression-test-3-0.pcap 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/test/aodv-chain-regression-test-3-0.pcap 2014-09-17 20:03:14.000000000 -0700 @@ -2,177 +2,173 @@   (  -OXXE4 +q_XXE4   (  -]TTE0 - - - -s@@ +@@  -t@@<  +@@<  -tԀuTT<E0 +hԀcTT<E0    -+uԀK@@0 ++sԀ@@   -N@@< +@@<  -^ԀيTT<@E0 +ԀTT<0E0    -+Ԁ@@  ++}Ԁ@@   -ԀTT<0E0 +hԀ~TT<0E0    -+@@<@ ++{@@<@  -IԀ@@P +(Ԁ@@P  -'@@<P +@@<@  -Ԁ#xx<`ET> +Ԁxx<`ET>  -3Ԁ@@` +Ԁ`@@P  -@@<  +b@@<   -ԀDxx<pET= +rԀxx<`ET=  -9Ԁxx<0ET@ +Ԁxx<0ET@  -#Ԁxx<ET? +Ԁxx<pET?  -Ԁxx<pET> +Ԁyxx<pET>  -TT@E0 +( +TT@E0     Ԁxx<ET>  -ԀCxx<ET= +ԀCxx<ET=  8Ԁxx<PET@  -"Ԁxx<ET? +"Ԁxx<ET?  ԀYxx<ET>  -0TTE0 +0TTE0    -1@TTE0 +OTTE0    -XTT`E0 +TT`E0     Ԁxx<ET>  -ԀCxx<ET= +ԀCxx<ET=  8Ԁxx<pET@  -"Ԁxx<ET? +"Ԁxx<ET?  -ԀYxx<ET> +Ԁxx<ET>  - TTE0 + TTE0    -HTTE0 +1@TTE0    -TTE0 +TTE0     Ԁxx<ET>  -ԀCxx<ET= +ԀCxx<ET=  8Ԁxx<ET@  -"Ԁxx<ET? +"Ԁxx<ET?  -Ԁxx<ET> +Ԁtxx<ET>  -DTTE0 +DTTE0    -STTE0 +HTTE0    -TTE0 +XTTE0    -q_TT E0 +STTE0    -TTE0 +XTTE0    -STT0E0 +q_TT E0    -TTE0 +TTE0    -HTT@E0 +STT0E0    -{ TT<PE0  + TT<@E0    -? ԀTTE0 +~ Ԁ(TTE0    -[TT`E0 - +WTTPE0    -TTE0 +( +TTE0    -I<TTpE0  +[TT`E0    -TTE0  +TTE0    - YcTTE0  + I<TTpE0     - XTTE0 - + TTE0     diff -Naur ns-3.20/src/aodv/test/aodv-chain-regression-test-4-0.pcap ns-3.21/src/aodv/test/aodv-chain-regression-test-4-0.pcap --- ns-3.20/src/aodv/test/aodv-chain-regression-test-4-0.pcap 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/test/aodv-chain-regression-test-4-0.pcap 2014-09-17 20:03:14.000000000 -0700 @@ -1,134 +1,128 @@ -òiaPXXE4 +òi`XXE4   (  -H^TTE0 - - - -s@@ +)@@  -t@@<  +,@@<  -tԀ;uTT<E0 +<ԀۄTT<E0    -+vԀ@@0 ++Ԁ\@@   -ԀbTT<@E0 ++ԀATT<0E0    -+@@<P ++v@@<@  -_Ԁ@@` +>Ԁ@@P  -@@<  +@@<   -Ԁxx<pET= +Ԁxx<`ET=  - Ԁ[xx<0ET@ +Ԁ1xx<0ET@  -PԀxx<ET? +&Ԁcxx<pET?  -XTT@E0 + TT@E0    -!Ԁxx<ET= +!Ԁxx<ET=   ԀYxx<PET@  -NԀCxx<ET? +NԀCxx<ET?  -@TTE0 +YPTTE0    -TT`E0 +TT`E0    -!Ԁxx<ET= +!Ԁxx<ET=   ԀYxx<pET@  -NԀCxx<ET? +NԀxx<ET?  -HTTE0 +@TTE0    -TTE0 +`TTE0    -!Ԁxx<ET= +!Ԁxx<ET=   ԀYxx<ET@  -NԀxx<ET? +NԀ^xx<ET?  -ATTTE0 +HTTE0    - TTE0 +TTE0    -_TT E0 +ATTTE0    - TTE0 +TTE0    -ATTT0E0 +_TT E0    -TTE0 +HTTE0    -HTT@E0 +ATTT0E0    - TT<PE0  +B TT<@E0    - Ԁ@TTE0 +R Ԁ TTE0    -\TT`E0 - +)XTTPE0    -XTTE0 + TTE0    -<TTpE0  +\TT`E0    -TTE0  +HTTE0    - cTTE0  + <TTpE0     - TTE0 - + TTE0     diff -Naur ns-3.20/src/aodv/test/bug-606-test-0-0.pcap ns-3.21/src/aodv/test/bug-606-test-0-0.pcap --- ns-3.20/src/aodv/test/bug-606-test-0-0.pcap 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/test/bug-606-test-0-0.pcap 2014-09-17 20:03:14.000000000 -0700 @@ -8,119 +8,127 @@  3)@@<  -V*ԀI@@  +*ԀHJ@@   -I@@< +jJ@@<  -JԀyKTT<0E0 +KԀKTT<0E0    -+KԀ1W@@  ++LԀW@@   -4X@@<@ +X@@<@  -DXԀXxx<0ET@ +XԀjYxx<0ET@  -YԀHqTT@E0 - - - -Ty@@P +^ZԀy@@P  -#zԀW{xx<`ET? +zԀ{xx<`ET?  -|Ԁ}xx<pET? +(}Ԁ\~xx<pET?  -}Ԁxx<PET@ +l~ԀSTT@E0 + + + +xx<PET@  Ԁxx<ET?  !Ԁ1xx<ET?  -AԀTTE0 +AԀTTE0    -HqTT`E0 +STT`E0    (#@@p  -*$@@< +/TTE0 + + + +4TTE0 + + + +@@ + +@@<  -:$Ԁ$xx<ET@ +Ԁxx<ET@  -%Ԁ/TTE0 +Ԁxx<ET@ + +ԀTTE0    -fE@@ +P"@@  -5FԀGxx<ET? +#Ԁ$xx<ET?  -RTTE0 +%xx<ET?  - - -\@@< +8@@<  -]Ԁ|@@ +9Ԁ;ԀfY@@   -}@@< +Y@@<  -}Ԁ~xx<ET? +4ZԀ[xx<0ET?  -~Ԁxx<ET@ - -Ԁxx< ET? - -!Ԁxx<0ET? +'[Ԁv\xx<@ET?  -ԀTT@E0 - - - -eTTE0 +\Ԁ HTTE0    -(#@@ - -0uTTE0 +xx<ET@  - - -@@ - -UTTE0 +Ixx<ET@  - - -@@ - -HqTT E0 +9xx<ET@ + + xx<ET@ + +C xx<ET@ + +xx<ET@ + +/xx<ET@ + +WTTE0    -@@0 - -XX@E4 +XXE4      -'TTPE0  +@TTE0    - (#TT`E0 - +TT E0    - @ XXpE4  +\ XX0E4       - \ No newline at end of file +'X TT@E0 + + + + + @ TTPE0  + + + + \ No newline at end of file diff -Naur ns-3.20/src/aodv/test/bug-606-test-1-0.pcap ns-3.21/src/aodv/test/bug-606-test-1-0.pcap --- ns-3.20/src/aodv/test/bug-606-test-1-0.pcap 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/test/bug-606-test-1-0.pcap 2014-09-17 20:03:14.000000000 -0700 @@ -6,47 +6,47 @@   (  -(@@ +TTE0 + + + +(@@  (@@<  -p)Ԁ*TT<E0 +p)Ԁ*TT< E0    -+**ԀZI@@  ++*ԀI@@   -\J@@< +J@@<  -lJԀJTT<0E0 +JԀnKTT<0E0    -+KԀW@@  ++3LԀX@@   -W@@<@ +AX@@<@  -pXԀYxx<0ET@ +XԀ"Zxx<0ET@  -YԀqTT@E0 - - - -x@@P +2ZԀby@@P  -y@@<  +ez@@<0  -yԀzxx<`ET? +uzԀ{xx<`ET?  -{Ԁ|xx<0ET@ - -|Ԁ&}xx<pET? +|Ԁ|xx<@ET@  -~Ԁ(TT@E0 +|Ԁ}xx<pET?  +~Ԁ`TTT@E0 +  - -xx<PET@ + +xx<PET@  Ԁxx<ET?  @@ -54,96 +54,91 @@  Ԁyxx<ET?  -nԀ0TTE0 +nԀ0TTE0    -qTT`E0 +FTT`E0 + + + +`TTT`E0    -8TT`E0 - +p/TTE0 +  - -#@@p + + 5TTE0 + + + +p@@  -#@@< +@@<  -g$Ԁ%xx<ET@ +?Ԁxx<ET@ + +Ԁxx<ET@  -%Ԁp/TTE0 +Ԁ0TTE0    -D@@ +!@@  -E@@<p +"@@<  - FԀFxx<ET? +"Ԁ\#xx<ET?  -GԀRTTE0 +P$Ԁ$xx<ET?  +%Ԁ'TTE0 +  - -[@@ + + 8@@  -[@@< +.8@@<  -T\ԀI]xx<ET@ +8Ԁ9xx<ET@  -Y]Ԁ|@@ +9ԀS;xx<ET@ + +c;ԀX@@   -}@@< +Y@@<  -}Ԁ2~xx<ET? - -'ԀTTE0 - - - -xx<ET@ - -Ԁxx< ET? - - Ԁxx<ET@ +ZԀ_Zxx<0ET?  -ԀLxx<0ET? +T[Ԁ[xx<@ET?  -AԀ0TT@E0 - - - -fTTE0 +\ԀHTTE0    -TTE0 - - - -0TTPE0 +0TTPE0    -'TT`E0 +'TT`E0    -'TTpE0 +'TTpE0    -TTE0 +TTE0    -p/TTE0  +p/TTE0    - +TTE0 - + +TTE0     diff -Naur ns-3.20/src/aodv/test/bug-606-test-2-0.pcap ns-3.21/src/aodv/test/bug-606-test-2-0.pcap --- ns-3.20/src/aodv/test/bug-606-test-2-0.pcap 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/test/bug-606-test-2-0.pcap 2014-09-17 20:03:14.000000000 -0700 @@ -2,112 +2,111 @@   (  -0(@@ +@TTE0 + + + +0(@@  3)@@<  -C)Ԁ)TT<E0 +C)Ԁ*TT< E0    -+V*ԀI@@  ++*ԀHJ@@   -JԀyKTT<0E0 +KԀKTT<0E0    -+4X@@<@ ++X@@<@  -YԀTy@@P +^ZԀy@@P  -vy@@<  +y@@<0  -#zԀW{xx<`ET? +zԀ{xx<`ET?  -g{Ԁ{xx<0ET@ - -|Ԁ}xx<pET? +{Ԁ3|xx<@ET@  -TT@E0 +(}Ԁ\~xx<pET?  - - -Ԁxx<ET? +Ԁxx<ET?  Ԁ,xx<PET@  !Ԁ1xx<ET?  -TTE0 +TTE0    -TT`E0 +PFTT`E0 + + + +(#TTpE0    -*$@@< +/TTE0 + + + +@@<  -%Ԁ/TTE0 +ԀԀTTE0    -fE@@ +P"@@  -E@@<p +r"@@<  -5FԀGxx<ET? +#Ԁ$xx<ET?  -GԀ[@@ - -\@@< - -(\Ԁ\xx<ET@ - -]Ԁ|@@ - -}Ԁ~xx<ET? - -TTE0 +$$Ԁ%xx<ET? + +%Ԁ'TTE0    -Ԁxx< ET? - -Ԁ,xx<ET@ +7@@ + +8@@< + +8Ԁ8xx<ET@  -!Ԁxx<0ET? +9Ԁ:xx<ET@  -TT@E0 - - - -pTTE0 +;ԀfY@@  + +4ZԀ[xx<0ET?  - - -ȯTTE0 +v\xx<@ET? + +hBTTE0    -@TTE0 +.TTE0    -TTE0 +@TTE0    -TTE0 +PFTTE0    -XTTE0  +*TTE0    - @TT E0 - + .TT E0     diff -Naur ns-3.20/src/aodv/test/tcp-chain-test-0-0.pcap ns-3.21/src/aodv/test/tcp-chain-test-0-0.pcap --- ns-3.20/src/aodv/test/tcp-chain-test-0-0.pcap 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/test/tcp-chain-test-0-0.pcap 2014-09-17 20:03:14.000000000 -0700 @@ -1,12 +1,12 @@ -òiXTTE0 - - - -TTE0 +òiTTE0    -@XXE4 +@TTE0 + + + +@XXE4   (  @@ -16,322 +16,438 @@  (  -G(@@<  +@@<   -)Ԁ-@@0 +kԀ'@@0  --@@<  +I@@<   -.Ԁ/TT<@E0 +Ԁ'TT<@E0    - /ԀR@@0 +7Ԁ@@0  -S@@<P +@@<P  -TԀVTLL<@E(@ +Ԁ.\\<@E8@   - PUԀ/Y@@` +  +Ԁr$@@`  -YԀZLL<pE(? +A%ԀQ&\\<pE8?   - PԀ+LL<E(8 +  +SԀ \\<E88  - P;ԀLL<PE(@ +  +QԀgXX<PE4@   - PFԀLL<E(? +  +ZQ4ԀXX<E4?   - PHdd<`E@@ +  +ZQHpp<`EL@   - PԀ6dd<E@? +  +eQԀVpp<EL?   - PԀLL<E(8 +  +eQ9ԀXX<E48  - PԀ<pE@ + z +meԀI((<pE@   - P<Ԁj<E? +  +om~Ԁ((<E?   - Pdd<E@@ +  +ompp<EL@   - PԀ~dd<E@? +  +m$Ԁpp<EL?   - PԀ%LL<E(8 +  +moԀ!XX<E48  - P5Ԁ<E@ + z +1Ԁ((<E@   - PԀ<E? +  +Ԁ((<E?   - Pظdd<E@@ +  +ظpp<EL@   - P\Ԁ~<E@ +  +_lԀ((<E@   - PB<E@ +  +_b((<E@   - PB<E@ +  +_r((<E@   - PgԀq<E? +  +_Ԁ((<E?   - P -ԀLL< E(8 +  +_ԀXX< E48  -  PԀ dd<E@@ +  z +g_Ԁ pp<EL@   - PԀdd<0E@? +  +gԀ.pp<0EL?   - P~<E @ +  +g((<E @   - P<E @ +  +g((<E @   - PٯԀ<@E ? +  +gԀ3((<@E ?   - PԀLL<PE(8 +  +gԀXX<PE48  -  PԀh dd<E@ +  рz +Ԁh pp<EL @   - P ԀV dd<`E@ +  +Y Ԁv pp<`EL ?   - P <E @ +  +Y. ((<E @   - P) <E @ +  +YY ((<E @   - PN ԀX <pE ? +  +Y Ԁ ((<pE ?   - Pa Ԁ LL<E(8 +  +Y ԀN XX<E48  - P Ԁq dd<E@ @ + z +aY^ Ԁq pp<EL @   - P4u Ԁx dd<E@ ? +  +aDu Ԁx pp<EL ?   - P)y <E @ +  +aIy ((<E @   - PD} <E @ +  +at} ((<E @   - Pi Ԁs <E ? +  +a ԀÃ ((<E ?   - P- Ԁϟ LL<E(8 +  +a ԀW XX<E48  - Pߟ ԀY dd< E@@ + z +g ԀY pp< EL@   - qP|] Ԁ` dd<E@? + q +S] Ԁa pp<EL?   - qPa <0E@ + q +Sa ((<0E@   - Pe <0E@ +  +S f ((<0E@   - Pi Ԁ l <E? +  +SBi Ԁ\l ((<E?   - P ԀB LL<E(8 +  +SD Ԁ XX<E48  - PR Ԁdd<@E@@ + z +[S Ԁpp<@EL@   - YPԀ<PE@ + Y +[Ԁ((<PE@   - qP<PE@ + q +[0((<PE@   - qP -<PE@ + q +[ + ((<PE@   - qP ԀH<E? + q +[?Ԁ((<E?   - qPTT`E0 + q +[TT`E0    -;Ԁ3<LL<E(8 +1Ԁ2XX<E48  - qPC<Ԁ?TT E0 + qz +2Ԁ?TT E0    -@@p +@@p  -@@<0 +@@<0  -Ԁdd<E@@ +*Ԁpp<EL@   - AP Ԁ<E@ + A +M1Ԁ((<E@   - !YPԀ @@@ + !Y +MԀ@@@  -ԀOdd<PE@? +Ԁopp<PEL?   - AP <`E? + A +M2 ((<`E?   - !YP@@<p + !Y +M+@@<p  -EԀa@@ +-ԀZ=@@  -@@< +|=@@<  -0ԀYLL<E( 8 +)>Ԁb?XX<E4 8  - !YPiԀdd<E@@ + !Yz +pMr?Ԁpp<EL@   - #)PԀ~dd<E@? + #) +p$Ԁpp<EL?   - #)P-<E@ + #) +pM((<E@   - %AP$<E@ + %A +pT((<E@   - %APIԀS<E? + %A +pԀ((<E?   - %AP Ԁ% LL<E( + %A +pKԀXX<E4 8  - %AP5 Ԁظdd<E@@ + %Az + Ԁظpp<EL@   - 'P\Ԁƿdd<E@? + ' + GlԀpp<EL?   - 'PH<E@ + ' + Gh((<E@   - ))P<E@ + )) + G((<E@   - ))PԀ<E? + )) + GԀ((<E?   - ))PwԀLL<E( 8 + )) + G*ԀXX<E4 8  - ))P)Ԁ dd<E@@ + ))z + O GԀ pp<EL@   - *PԀdd<E@? + * + OԀ.pp<EL?   - *PϨ<E@ + * + O((<E@   - -P)<E@ + - + OY((<E@   - -PNԀX<E? + - + OԀ((<E?   - -PԀqLL< E( 8 + - + OԀMXX< E4 8  - -PԀh dd<E@@ + -z + ]Ԁh pp<EL@   - .P ԀV dd<0E@? + . + +A  Ԁv pp<0EL?   - .P < E@ + . + +A  + ((< E@   - 0PD < E@ + 0 + +A t ((< E@   - 0Pi Ԁs <@E? + 0 + +A  ԀÛ ((<@E?   - 0Pk Ԁ LL<PE( 8 + 0 + +A 0 Ԁ XX<PE4 8  - 0P Ԁq dd<0E@@ + 0z + +I +A Ԁq pp<0EL@   - 2P4u Ԁx dd<`E@? + 2 + + +IDu Ԁx pp<`EL?   - 2P)y <@E@ + 2 + + +IIy ((<@E@   - 4Pq} <@E@ + 4 + + +I} ((<@E@   - 4P Ԁ <pE? + 4 + + +Iր Ԁ ((<pE?   - 4P" ԀĨ LL<E(8 + 4 + + +I Ԁ7 XX<E48  - 4PԨ ԀY dd<PE@@ + 4z + + +G ԀY pp<PEL@   - 6P|] Ԁ` dd<E@? + 6 + ; +] Ԁa pp<EL?   - 6Pa <`E@ + 6 + ; +a ((<`E@   - 8Pe <`E@ + 8 + ; +e ((<`E@   - 8Ph Ԁk <E? + 8 + ; +i Ԁ8l ((<E?   - 8P Ԁ+ LL<E(8 + 8 + ; +0 Ԁ XX<E48  - 8P; Ԁ \ No newline at end of file + 8ɀz + C ; Ԁ \ No newline at end of file diff -Naur ns-3.20/src/aodv/test/tcp-chain-test-9-0.pcap ns-3.21/src/aodv/test/tcp-chain-test-9-0.pcap --- ns-3.20/src/aodv/test/tcp-chain-test-9-0.pcap 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/test/tcp-chain-test-9-0.pcap 2014-09-17 20:03:14.000000000 -0700 @@ -1,370 +1,443 @@ -òidTTE0 +òi}TTE0    - pTTE0 + TTE0     -@@ +H^TTE0 + + + + ə@@   -ԀNTT< E0 +ԀTT<0E0  @  - w@@0 +@TTE0 + + + + + + +@@@   -@@< + +@@<    - FԀ8TT<@E0 + ԀՠTT<PE0      -_HԀ!@@<P +_ԀW@@<`   -5ԀDTT`E0 - - - - 0oTT E0 - - - - - - -9Ԁ۵LL<pE(8 +ԀRԀ\\<pE88   - PԀ3@@0 +  +Ԁx@@0  - 5@@< + {@@<    -EԀLL<@E(@ +Ԁٵ\\<@E8@  - PPԀLL<E(? +  +QԀi\\<E8?  - PԀ3LL<E(8 +  +QԀXX<E48   - PCԀYԀdd<E@8 +  +ZQԀԀS pp<EL8   - PԀ! LL<PE(@ +  +eQc Ԁ XX<PE4@  - P Ԁ -LL<E(? + z +me~ +Ԁf XX<E4?  - PL+ԀV.<E8 + z +me,Ԁ0((<E8   - Pf.ԀԀ dd<E@8 +  +om(0Ԁ!Ԁpp<EL8   - PԀiLL<`E(@ +  +mԀXX<`E4@  - P&ԀLL<E(? + z +ԀXX<E4?  - PԀ<E8 + z ++ԀE((<E8   - PԀԀSdd<E@8 +  +UԀiԀpp<EL8   - PcԀLL<pE(@ - - -  PnԀsLL< E(? +  +_ԀAXX<pE4@  -  PLL< E(? +  z +g_ԀXX< E4?  -  PLL< E(? +  z +g_XX< E4?  -  PLL< E(? +  z +g_Ԁ((<0E8 +  - -  PNLL< E(? +  +_ԀԀ+pp<@EL8 +  - -  PLL< E(? +  +g;ԀXX<E4@  -  PԀLL< E(? +  рz +VԀ#XX<PE4?  -  P<0E8 - - - PԀ1Ԁdd<@E@8 - - - PԀLL<E(@ +  рz +VXX<PE4?  -  PԀ|LL<PE(? +  рz +4XX<PE4?  -  PLL<PE(? +  рz +XX<PE4?  -  PLL<PE(? +  рz +"XX<PE4?  -  PԀLL<PE(? +  рz +XX<PE4?  -  P<`E 8 +  рz +Ԁ-((<`E 8   - P)Ԁy Ԁ dd<pE@ +  +g=Ԁ Ԁs pp<pEL 8   - P ԀA LL<E(@ +  +Y ԀѪ XX<E4@  - P Ԁ LL<E(? + z +aY Ԁ XX<E4?  - P Ԁ <E 8 + z +aY Ԁ7 ((<E 8   - P# Ԁ Ԁ+ dd<E@ 8 +  +YG ԀA Ԁ pp<EL 8   - P; Ԁ LL<E(@ +  +a˒ Ԁ XX<E4@  - PF Ԁ LL<E(? + z + Ԁ XX<E4?  - P LL<E(? + z +I XX<E4?  - P Ԁ <E 8 - - - P. Ԁ w Ԁsz dd<E@8 - - - qPz Ԁz LL<E(@ + z +O XX<E4?  - P{ ԀK| LL<E(? + z + ԀƦ ((<E 8 +  - - P8} LL<E(? +  +a֦ Ԁw Ԁ{ pp<EL8 +  - - P~ LL<E(? + q +S{ Ԁa{ XX<E4@  - Pn LL<E(? + z +[S.| ԀU} XX<E4?  - P LL<E(? + z +[S~ XX<E4?  - Pp Ԁ- LL<E(? + z +[S XX<E4?  - PǛ <E8 + z +[S Ԁ ((<E8   - Pכ ԀԀ{ dd<E@8 +  +S ԀԀ !pp<EL8   - YP Ԁ LL<E(@ - - - qP!ԀA"LL<E(? - - - qP@#LL<E(? - - - qPz%LL<E(? - - - qP*LL<E(? + Y +[!Ԁi!XX<E4@  - qP+LL<E(? + qz +6"Ԁ'#XX<E4?  - qP/LL<E(? + qz +$XX<E4?  - qP 7Ԁ:< E8 + qz +-Ԁ0((< E8   - qP&:Ԁ`TT0E0 + q +[+0ԀyTT0E0    - `gTTE0 + pTTE0     -Ɨ@@<@ +V@@<@   -Ԁ@@P +ZԀ^Ԁn@@P   -@@< +n@@<   - QԀQdd<`E@8 + oԀNspp<`EL8   - APaԀԀ<pE8 + A +M^sԀ,w((<pE8   - !YPԀ@@ + !Y +M@@ @  -hU@@< +h?@@< `  -xUԀ -U((< - PE@ +x?Ԁ +?((< + PE@   - [Ԁ _@@ + EԀ  i@@ p  -`Ԁ rf((< +iԀ o((< -E? +E?   - ((< - `E@ + ((< + `E@   - pԀ 6((< + pԀ 6((< -E? +E?   - ظ((< - pE@ + ظ((< + pE@   - Ԁ ~((< + Ԁ ~((< -E? +E?   -  ((< - E@ +  ((< + E@   - Ԁ Ƭ((< + Ԁ Ƭ((< -E? +E?   - h ((< - E@ + h ((< + E@   - H Ԁ  ((< + H Ԁ  ((< -E? +E?   - q ((< - E@ + q ((< + E@   - w Ԁ V} ((< + w Ԁ V} ((< -E? +E?   - Y ((< - E @ + Y ((< + E@   - _ Ԁ e ((< + _ Ԁ e ((< -E ? +E?   - ((< - E -@ + ((< + E@   - Ԁ  ((< + Ԁ  ((< -E -? +E?   - H((< - E @ + H((< + E@   - (Ԁ ((< + (Ԁ ((< -E ? +E?   - TT E0  + TT E0    TT -E0 +E0    -x@@  +@@   -z@@< +@@<   -Ԁ -D((< - E @ +Ԁ +((< + E @   - %Ԁ @@ + Ԁ i@@ 0  -Ԁ ((< +8Ԁ F +((< -@E ? +@E ?   - ظ((< - E@ + ظ((< + E +@   - Ԁ ~((< + Ԁ ~((< -PE? +PE +?   -  ((< - E@ +  ((< + E @   - Ԁ Ƭ((< + Ԁ Ƭ((< -`E? +`E ?   - h ((< - 0E@ + h ((< + 0E @   - H Ԁ  ((< + H Ԁ  ((< -pE? +pE ?   - q ((< - @E@ + q ((< + @E @   - w Ԁ V} ((< + w Ԁ V} ((< -E? +E ?   - Y ((< - PE@ + Y ((< + PE@   - _ Ԁ e ((< + _ Ԁ e ((< -E? +E?   -  \ No newline at end of file +  \ No newline at end of file diff -Naur ns-3.20/src/aodv/test/udp-chain-test-9-0.pcap ns-3.21/src/aodv/test/udp-chain-test-9-0.pcap --- ns-3.20/src/aodv/test/udp-chain-test-9-0.pcap 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/test/udp-chain-test-9-0.pcap 2014-09-17 20:03:14.000000000 -0700 @@ -1,109 +1,109 @@ -òiyTTE0 +òiuTTE0    - _TTE0 + TTE0     -`ZTTE0 +xVTTE0    - P@TTE0 + `mTTE0     -@@  +C@@    -ݨ@@<  +e@@<    - ԀTT<0E0 + ԀTT<0E0      -_Ԁ[@@@ +_&Ԁ+@@@  -*ԀTT<PE0 +ԀTT<PE0  @  - ^Y@@<` + (@@<`   - ԀԀ((<pE8 +ԀԀ((<pE8   - ԀԀ((<E8 + ԀԀG((<E8   - ԀԀ((<E8 + WԀԀ((<E8   - ԀԀ((<E8 + ԀԀ((<E8   - ԀY Ԁ ((<E8 + ԀY Ԁ ((<E8   - / Ԁ Ԁg ((<E8 + / Ԁ Ԁg ((<E8   - w Ԁ Ԁ ((<E 8 + w Ԁ Ԁ ((<E8   -  Ԁ/Ԁ5((<E -8 +  Ԁ/Ԁ5((<E8   - 5ԀuTTE0 - - - - 8TT0E0 + 5ԀeTT0E0     -9Ԁ((<E 8 +qTTE0 + + + + 9Ԁ((<E8   - Ԁ@@< + Ԁ|@@<   -gԀ@@  +ͯԀ)@@    -@@<@ +K@@<@   - Ԁ((<0E 8 + Ԁ((<0E 8   - ԀԀ((<@E8 + ԀԀ((<@E +8   - ԀԀ((<PE8 + ԀԀ((<PE 8   - ԀY Ԁ ((<`E8 + ԀY Ԁ ((<`E 8   - / Ԁ Ԁg ((<pE8 + / Ԁ Ԁg ((<pE 8   - w Ԁ Ԁ ((<E8 + w Ԁ Ԁ ((<E8   -  Ԁ \ No newline at end of file +  Ԁ \ No newline at end of file diff -Naur ns-3.20/src/aodv/wscript ns-3.21/src/aodv/wscript --- ns-3.20/src/aodv/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/aodv/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -1,7 +1,7 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - module = bld.create_ns3_module('aodv', ['internet', 'wifi', 'applications', 'mesh', 'point-to-point', 'virtual-net-device']) + module = bld.create_ns3_module('aodv', ['internet', 'wifi', 'applications']) module.includes = '.' module.source = [ 'model/aodv-id-cache.cc', diff -Naur ns-3.20/src/applications/bindings/modulegen__gcc_ILP32.py ns-3.21/src/applications/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/applications/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/applications/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -162,6 +162,8 @@ module.add_class('Ping6Helper') ## radvd-helper.h (module 'applications'): ns3::RadvdHelper [class] module.add_class('RadvdHelper') + ## simple-net-device-helper.h (module 'network'): ns3::SimpleNetDeviceHelper [class] + module.add_class('SimpleNetDeviceHelper', import_from_module='ns.network') ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Object', 'ns3::ObjectBase', 'ns3::ObjectDeleter'], parent=root_module['ns3::ObjectBase'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simulator.h (module 'core'): ns3::Simulator [class] @@ -442,8 +444,12 @@ module.add_class('PacketSizeMinMaxAvgTotalCalculator', import_from_module='ns.network', parent=root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >']) ## packet-socket.h (module 'network'): ns3::PacketSocket [class] module.add_class('PacketSocket', import_from_module='ns.network', parent=root_module['ns3::Socket']) + ## packet-socket-client.h (module 'network'): ns3::PacketSocketClient [class] + module.add_class('PacketSocketClient', import_from_module='ns.network', parent=root_module['ns3::Application']) ## packet-socket-factory.h (module 'network'): ns3::PacketSocketFactory [class] module.add_class('PacketSocketFactory', import_from_module='ns.network', parent=root_module['ns3::SocketFactory']) + ## packet-socket-server.h (module 'network'): ns3::PacketSocketServer [class] + module.add_class('PacketSocketServer', import_from_module='ns.network', parent=root_module['ns3::Application']) ## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable [class] module.add_class('ParetoRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## packetbb.h (module 'network'): ns3::PbbAddressBlock [class] @@ -672,6 +678,7 @@ register_Ns3PcapHelperForDevice_methods(root_module, root_module['ns3::PcapHelperForDevice']) register_Ns3Ping6Helper_methods(root_module, root_module['ns3::Ping6Helper']) register_Ns3RadvdHelper_methods(root_module, root_module['ns3::RadvdHelper']) + register_Ns3SimpleNetDeviceHelper_methods(root_module, root_module['ns3::SimpleNetDeviceHelper']) register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >']) register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator']) register_Ns3StatisticalSummary_methods(root_module, root_module['ns3::StatisticalSummary']) @@ -801,7 +808,9 @@ register_Ns3PacketSink_methods(root_module, root_module['ns3::PacketSink']) register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, root_module['ns3::PacketSizeMinMaxAvgTotalCalculator']) register_Ns3PacketSocket_methods(root_module, root_module['ns3::PacketSocket']) + register_Ns3PacketSocketClient_methods(root_module, root_module['ns3::PacketSocketClient']) register_Ns3PacketSocketFactory_methods(root_module, root_module['ns3::PacketSocketFactory']) + register_Ns3PacketSocketServer_methods(root_module, root_module['ns3::PacketSocketServer']) register_Ns3ParetoRandomVariable_methods(root_module, root_module['ns3::ParetoRandomVariable']) register_Ns3PbbAddressBlock_methods(root_module, root_module['ns3::PbbAddressBlock']) register_Ns3PbbAddressBlockIpv4_methods(root_module, root_module['ns3::PbbAddressBlockIpv4']) @@ -3497,6 +3506,53 @@ [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) return +def register_Ns3SimpleNetDeviceHelper_methods(root_module, cls): + ## simple-net-device-helper.h (module 'network'): ns3::SimpleNetDeviceHelper::SimpleNetDeviceHelper(ns3::SimpleNetDeviceHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SimpleNetDeviceHelper const &', 'arg0')]) + ## simple-net-device-helper.h (module 'network'): ns3::SimpleNetDeviceHelper::SimpleNetDeviceHelper() [constructor] + cls.add_constructor([]) + ## simple-net-device-helper.h (module 'network'): ns3::NetDeviceContainer ns3::SimpleNetDeviceHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## simple-net-device-helper.h (module 'network'): ns3::NetDeviceContainer ns3::SimpleNetDeviceHelper::Install(ns3::Ptr node, ns3::Ptr channel) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::SimpleChannel >', 'channel')], + is_const=True) + ## simple-net-device-helper.h (module 'network'): ns3::NetDeviceContainer ns3::SimpleNetDeviceHelper::Install(ns3::NodeContainer const & c) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c')], + is_const=True) + ## simple-net-device-helper.h (module 'network'): ns3::NetDeviceContainer ns3::SimpleNetDeviceHelper::Install(ns3::NodeContainer const & c, ns3::Ptr channel) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c'), param('ns3::Ptr< ns3::SimpleChannel >', 'channel')], + is_const=True) + ## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetChannel(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetChannel', + 'void', + [param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()')]) + ## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetChannelAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetChannelAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + ## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetDeviceAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetDeviceAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + ## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode(bool pointToPointMode) [member function] + cls.add_method('SetNetDevicePointToPointMode', + 'void', + [param('bool', 'pointToPointMode')]) + ## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetQueue(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetQueue', + 'void', + [param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()')]) + return + def register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount::SimpleRefCount() [constructor] cls.add_constructor([]) @@ -5874,10 +5930,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -5888,25 +5944,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -6023,20 +6079,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return @@ -8609,6 +8665,37 @@ visibility='private', is_virtual=True) return +def register_Ns3PacketSocketClient_methods(root_module, cls): + ## packet-socket-client.h (module 'network'): ns3::PacketSocketClient::PacketSocketClient(ns3::PacketSocketClient const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketSocketClient const &', 'arg0')]) + ## packet-socket-client.h (module 'network'): ns3::PacketSocketClient::PacketSocketClient() [constructor] + cls.add_constructor([]) + ## packet-socket-client.h (module 'network'): static ns3::TypeId ns3::PacketSocketClient::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## packet-socket-client.h (module 'network'): void ns3::PacketSocketClient::SetRemote(ns3::PacketSocketAddress addr) [member function] + cls.add_method('SetRemote', + 'void', + [param('ns3::PacketSocketAddress', 'addr')]) + ## packet-socket-client.h (module 'network'): void ns3::PacketSocketClient::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## packet-socket-client.h (module 'network'): void ns3::PacketSocketClient::StartApplication() [member function] + cls.add_method('StartApplication', + 'void', + [], + visibility='private', is_virtual=True) + ## packet-socket-client.h (module 'network'): void ns3::PacketSocketClient::StopApplication() [member function] + cls.add_method('StopApplication', + 'void', + [], + visibility='private', is_virtual=True) + return + def register_Ns3PacketSocketFactory_methods(root_module, cls): ## packet-socket-factory.h (module 'network'): ns3::PacketSocketFactory::PacketSocketFactory(ns3::PacketSocketFactory const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketSocketFactory const &', 'arg0')]) @@ -8626,6 +8713,37 @@ is_static=True) return +def register_Ns3PacketSocketServer_methods(root_module, cls): + ## packet-socket-server.h (module 'network'): ns3::PacketSocketServer::PacketSocketServer(ns3::PacketSocketServer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketSocketServer const &', 'arg0')]) + ## packet-socket-server.h (module 'network'): ns3::PacketSocketServer::PacketSocketServer() [constructor] + cls.add_constructor([]) + ## packet-socket-server.h (module 'network'): static ns3::TypeId ns3::PacketSocketServer::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## packet-socket-server.h (module 'network'): void ns3::PacketSocketServer::SetLocal(ns3::PacketSocketAddress addr) [member function] + cls.add_method('SetLocal', + 'void', + [param('ns3::PacketSocketAddress', 'addr')]) + ## packet-socket-server.h (module 'network'): void ns3::PacketSocketServer::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## packet-socket-server.h (module 'network'): void ns3::PacketSocketServer::StartApplication() [member function] + cls.add_method('StartApplication', + 'void', + [], + visibility='private', is_virtual=True) + ## packet-socket-server.h (module 'network'): void ns3::PacketSocketServer::StopApplication() [member function] + cls.add_method('StopApplication', + 'void', + [], + visibility='private', is_virtual=True) + return + def register_Ns3ParetoRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ParetoRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', @@ -10201,6 +10319,11 @@ 'ns3::Ptr< ns3::Node >', [], is_const=True, is_virtual=True) + ## simple-net-device.h (module 'network'): ns3::Ptr ns3::SimpleNetDevice::GetQueue() const [member function] + cls.add_method('GetQueue', + 'ns3::Ptr< ns3::Queue >', + [], + is_const=True) ## simple-net-device.h (module 'network'): static ns3::TypeId ns3::SimpleNetDevice::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -10279,6 +10402,10 @@ 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_virtual=True) + ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetQueue(ns3::Ptr queue) [member function] + cls.add_method('SetQueue', + 'void', + [param('ns3::Ptr< ns3::Queue >', 'queue')]) ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetReceiveCallback', 'void', diff -Naur ns-3.20/src/applications/bindings/modulegen__gcc_LP64.py ns-3.21/src/applications/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/applications/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/applications/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -162,6 +162,8 @@ module.add_class('Ping6Helper') ## radvd-helper.h (module 'applications'): ns3::RadvdHelper [class] module.add_class('RadvdHelper') + ## simple-net-device-helper.h (module 'network'): ns3::SimpleNetDeviceHelper [class] + module.add_class('SimpleNetDeviceHelper', import_from_module='ns.network') ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Object', 'ns3::ObjectBase', 'ns3::ObjectDeleter'], parent=root_module['ns3::ObjectBase'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simulator.h (module 'core'): ns3::Simulator [class] @@ -442,8 +444,12 @@ module.add_class('PacketSizeMinMaxAvgTotalCalculator', import_from_module='ns.network', parent=root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >']) ## packet-socket.h (module 'network'): ns3::PacketSocket [class] module.add_class('PacketSocket', import_from_module='ns.network', parent=root_module['ns3::Socket']) + ## packet-socket-client.h (module 'network'): ns3::PacketSocketClient [class] + module.add_class('PacketSocketClient', import_from_module='ns.network', parent=root_module['ns3::Application']) ## packet-socket-factory.h (module 'network'): ns3::PacketSocketFactory [class] module.add_class('PacketSocketFactory', import_from_module='ns.network', parent=root_module['ns3::SocketFactory']) + ## packet-socket-server.h (module 'network'): ns3::PacketSocketServer [class] + module.add_class('PacketSocketServer', import_from_module='ns.network', parent=root_module['ns3::Application']) ## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable [class] module.add_class('ParetoRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## packetbb.h (module 'network'): ns3::PbbAddressBlock [class] @@ -672,6 +678,7 @@ register_Ns3PcapHelperForDevice_methods(root_module, root_module['ns3::PcapHelperForDevice']) register_Ns3Ping6Helper_methods(root_module, root_module['ns3::Ping6Helper']) register_Ns3RadvdHelper_methods(root_module, root_module['ns3::RadvdHelper']) + register_Ns3SimpleNetDeviceHelper_methods(root_module, root_module['ns3::SimpleNetDeviceHelper']) register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >']) register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator']) register_Ns3StatisticalSummary_methods(root_module, root_module['ns3::StatisticalSummary']) @@ -801,7 +808,9 @@ register_Ns3PacketSink_methods(root_module, root_module['ns3::PacketSink']) register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, root_module['ns3::PacketSizeMinMaxAvgTotalCalculator']) register_Ns3PacketSocket_methods(root_module, root_module['ns3::PacketSocket']) + register_Ns3PacketSocketClient_methods(root_module, root_module['ns3::PacketSocketClient']) register_Ns3PacketSocketFactory_methods(root_module, root_module['ns3::PacketSocketFactory']) + register_Ns3PacketSocketServer_methods(root_module, root_module['ns3::PacketSocketServer']) register_Ns3ParetoRandomVariable_methods(root_module, root_module['ns3::ParetoRandomVariable']) register_Ns3PbbAddressBlock_methods(root_module, root_module['ns3::PbbAddressBlock']) register_Ns3PbbAddressBlockIpv4_methods(root_module, root_module['ns3::PbbAddressBlockIpv4']) @@ -3497,6 +3506,53 @@ [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) return +def register_Ns3SimpleNetDeviceHelper_methods(root_module, cls): + ## simple-net-device-helper.h (module 'network'): ns3::SimpleNetDeviceHelper::SimpleNetDeviceHelper(ns3::SimpleNetDeviceHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::SimpleNetDeviceHelper const &', 'arg0')]) + ## simple-net-device-helper.h (module 'network'): ns3::SimpleNetDeviceHelper::SimpleNetDeviceHelper() [constructor] + cls.add_constructor([]) + ## simple-net-device-helper.h (module 'network'): ns3::NetDeviceContainer ns3::SimpleNetDeviceHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## simple-net-device-helper.h (module 'network'): ns3::NetDeviceContainer ns3::SimpleNetDeviceHelper::Install(ns3::Ptr node, ns3::Ptr channel) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::SimpleChannel >', 'channel')], + is_const=True) + ## simple-net-device-helper.h (module 'network'): ns3::NetDeviceContainer ns3::SimpleNetDeviceHelper::Install(ns3::NodeContainer const & c) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c')], + is_const=True) + ## simple-net-device-helper.h (module 'network'): ns3::NetDeviceContainer ns3::SimpleNetDeviceHelper::Install(ns3::NodeContainer const & c, ns3::Ptr channel) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c'), param('ns3::Ptr< ns3::SimpleChannel >', 'channel')], + is_const=True) + ## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetChannel(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetChannel', + 'void', + [param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()')]) + ## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetChannelAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetChannelAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + ## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetDeviceAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetDeviceAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + ## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode(bool pointToPointMode) [member function] + cls.add_method('SetNetDevicePointToPointMode', + 'void', + [param('bool', 'pointToPointMode')]) + ## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetQueue(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetQueue', + 'void', + [param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()')]) + return + def register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount::SimpleRefCount() [constructor] cls.add_constructor([]) @@ -5874,10 +5930,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -5888,25 +5944,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -6023,20 +6079,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return @@ -8609,6 +8665,37 @@ visibility='private', is_virtual=True) return +def register_Ns3PacketSocketClient_methods(root_module, cls): + ## packet-socket-client.h (module 'network'): ns3::PacketSocketClient::PacketSocketClient(ns3::PacketSocketClient const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketSocketClient const &', 'arg0')]) + ## packet-socket-client.h (module 'network'): ns3::PacketSocketClient::PacketSocketClient() [constructor] + cls.add_constructor([]) + ## packet-socket-client.h (module 'network'): static ns3::TypeId ns3::PacketSocketClient::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## packet-socket-client.h (module 'network'): void ns3::PacketSocketClient::SetRemote(ns3::PacketSocketAddress addr) [member function] + cls.add_method('SetRemote', + 'void', + [param('ns3::PacketSocketAddress', 'addr')]) + ## packet-socket-client.h (module 'network'): void ns3::PacketSocketClient::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## packet-socket-client.h (module 'network'): void ns3::PacketSocketClient::StartApplication() [member function] + cls.add_method('StartApplication', + 'void', + [], + visibility='private', is_virtual=True) + ## packet-socket-client.h (module 'network'): void ns3::PacketSocketClient::StopApplication() [member function] + cls.add_method('StopApplication', + 'void', + [], + visibility='private', is_virtual=True) + return + def register_Ns3PacketSocketFactory_methods(root_module, cls): ## packet-socket-factory.h (module 'network'): ns3::PacketSocketFactory::PacketSocketFactory(ns3::PacketSocketFactory const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketSocketFactory const &', 'arg0')]) @@ -8626,6 +8713,37 @@ is_static=True) return +def register_Ns3PacketSocketServer_methods(root_module, cls): + ## packet-socket-server.h (module 'network'): ns3::PacketSocketServer::PacketSocketServer(ns3::PacketSocketServer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PacketSocketServer const &', 'arg0')]) + ## packet-socket-server.h (module 'network'): ns3::PacketSocketServer::PacketSocketServer() [constructor] + cls.add_constructor([]) + ## packet-socket-server.h (module 'network'): static ns3::TypeId ns3::PacketSocketServer::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## packet-socket-server.h (module 'network'): void ns3::PacketSocketServer::SetLocal(ns3::PacketSocketAddress addr) [member function] + cls.add_method('SetLocal', + 'void', + [param('ns3::PacketSocketAddress', 'addr')]) + ## packet-socket-server.h (module 'network'): void ns3::PacketSocketServer::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='protected', is_virtual=True) + ## packet-socket-server.h (module 'network'): void ns3::PacketSocketServer::StartApplication() [member function] + cls.add_method('StartApplication', + 'void', + [], + visibility='private', is_virtual=True) + ## packet-socket-server.h (module 'network'): void ns3::PacketSocketServer::StopApplication() [member function] + cls.add_method('StopApplication', + 'void', + [], + visibility='private', is_virtual=True) + return + def register_Ns3ParetoRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ParetoRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', @@ -10201,6 +10319,11 @@ 'ns3::Ptr< ns3::Node >', [], is_const=True, is_virtual=True) + ## simple-net-device.h (module 'network'): ns3::Ptr ns3::SimpleNetDevice::GetQueue() const [member function] + cls.add_method('GetQueue', + 'ns3::Ptr< ns3::Queue >', + [], + is_const=True) ## simple-net-device.h (module 'network'): static ns3::TypeId ns3::SimpleNetDevice::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -10279,6 +10402,10 @@ 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_virtual=True) + ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetQueue(ns3::Ptr queue) [member function] + cls.add_method('SetQueue', + 'void', + [param('ns3::Ptr< ns3::Queue >', 'queue')]) ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetReceiveCallback(ns3::Callback, ns3::Ptr, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetReceiveCallback', 'void', diff -Naur ns-3.20/src/bridge/bindings/modulegen__gcc_ILP32.py ns-3.21/src/bridge/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/bridge/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/bridge/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -1623,10 +1623,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -1637,25 +1637,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -1772,20 +1772,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/bridge/bindings/modulegen__gcc_LP64.py ns-3.21/src/bridge/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/bridge/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/bridge/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -1623,10 +1623,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -1637,25 +1637,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -1772,20 +1772,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/bridge/examples/wscript ns-3.21/src/bridge/examples/wscript --- ns-3.20/src/bridge/examples/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/bridge/examples/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -2,11 +2,11 @@ def build(bld): - obj = bld.create_ns3_program('csma-bridge', ['bridge', 'csma', 'internet']) + obj = bld.create_ns3_program('csma-bridge', ['bridge', 'csma', 'internet', 'applications']) obj.source = 'csma-bridge.cc' - bld.register_ns3_script('csma-bridge.py', ['bridge', 'csma', 'internet']) + bld.register_ns3_script('csma-bridge.py', ['bridge', 'csma', 'internet', 'applications']) - obj = bld.create_ns3_program('csma-bridge-one-hop', ['bridge', 'csma', 'internet']) + obj = bld.create_ns3_program('csma-bridge-one-hop', ['bridge', 'csma', 'internet', 'applications']) obj.source = 'csma-bridge-one-hop.cc' diff -Naur ns-3.20/src/buildings/bindings/modulegen__gcc_ILP32.py ns-3.21/src/buildings/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/buildings/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/buildings/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -2328,10 +2328,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -2342,25 +2342,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -2477,20 +2477,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/buildings/bindings/modulegen__gcc_LP64.py ns-3.21/src/buildings/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/buildings/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/buildings/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -2328,10 +2328,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -2342,25 +2342,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -2477,20 +2477,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/core/bindings/modulegen__gcc_ILP32.py ns-3.21/src/core/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/core/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/core/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -658,6 +658,10 @@ cls.add_method('AddValue', 'void', [param('std::string const &', 'name'), param('std::string const &', 'help'), param('ns3::Callback< bool, std::string, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## command-line.h (module 'core'): void ns3::CommandLine::AddValue(std::string const & name, std::string const & attributePath) [member function] + cls.add_method('AddValue', + 'void', + [param('std::string const &', 'name'), param('std::string const &', 'attributePath')]) ## command-line.h (module 'core'): std::string ns3::CommandLine::GetName() const [member function] cls.add_method('GetName', 'std::string', @@ -2516,10 +2520,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -2530,25 +2534,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -2665,20 +2669,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return @@ -4768,22 +4772,22 @@ 'ns3::Ptr< ns3::PointerValue >', [], template_parameters=['ns3::PointerValue']) - ## nstime.h (module 'core'): ns3::Time ns3::Days(ns3::int64x64_t days) [free function] + ## nstime.h (module 'core'): ns3::Time ns3::Days(ns3::int64x64_t value) [free function] module.add_function('Days', 'ns3::Time', - [param('ns3::int64x64_t', 'days')]) - ## nstime.h (module 'core'): ns3::Time ns3::Days(double days) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::Days(double value) [free function] module.add_function('Days', 'ns3::Time', - [param('double', 'days')]) - ## nstime.h (module 'core'): ns3::Time ns3::FemtoSeconds(ns3::int64x64_t fs) [free function] + [param('double', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::FemtoSeconds(ns3::int64x64_t value) [free function] module.add_function('FemtoSeconds', 'ns3::Time', - [param('ns3::int64x64_t', 'fs')]) - ## nstime.h (module 'core'): ns3::Time ns3::FemtoSeconds(uint64_t fs) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::FemtoSeconds(uint64_t value) [free function] module.add_function('FemtoSeconds', 'ns3::Time', - [param('uint64_t', 'fs')]) + [param('uint64_t', 'value')]) ## hash.h (module 'core'): uint32_t ns3::Hash32(std::string const s) [free function] module.add_function('Hash32', 'uint32_t', @@ -4800,14 +4804,14 @@ module.add_function('Hash64', 'uint64_t', [param('char const *', 'buffer'), param('size_t const', 'size')]) - ## nstime.h (module 'core'): ns3::Time ns3::Hours(ns3::int64x64_t hours) [free function] + ## nstime.h (module 'core'): ns3::Time ns3::Hours(ns3::int64x64_t value) [free function] module.add_function('Hours', 'ns3::Time', - [param('ns3::int64x64_t', 'hours')]) - ## nstime.h (module 'core'): ns3::Time ns3::Hours(double hours) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::Hours(double value) [free function] module.add_function('Hours', 'ns3::Time', - [param('double', 'hours')]) + [param('double', 'value')]) ## log.h (module 'core'): extern void ns3::LogComponentDisable(char const * name, ns3::LogLevel level) [free function] module.add_function('LogComponentDisable', 'void', @@ -4908,22 +4912,22 @@ module.add_function('Max', 'ns3::int64x64_t', [param('ns3::int64x64_t const &', 'a'), param('ns3::int64x64_t const &', 'b')]) - ## nstime.h (module 'core'): ns3::Time ns3::MicroSeconds(ns3::int64x64_t us) [free function] + ## nstime.h (module 'core'): ns3::Time ns3::MicroSeconds(ns3::int64x64_t value) [free function] module.add_function('MicroSeconds', 'ns3::Time', - [param('ns3::int64x64_t', 'us')]) - ## nstime.h (module 'core'): ns3::Time ns3::MicroSeconds(uint64_t us) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::MicroSeconds(uint64_t value) [free function] module.add_function('MicroSeconds', 'ns3::Time', - [param('uint64_t', 'us')]) - ## nstime.h (module 'core'): ns3::Time ns3::MilliSeconds(ns3::int64x64_t ms) [free function] + [param('uint64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::MilliSeconds(ns3::int64x64_t value) [free function] module.add_function('MilliSeconds', 'ns3::Time', - [param('ns3::int64x64_t', 'ms')]) - ## nstime.h (module 'core'): ns3::Time ns3::MilliSeconds(uint64_t ms) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::MilliSeconds(uint64_t value) [free function] module.add_function('MilliSeconds', 'ns3::Time', - [param('uint64_t', 'ms')]) + [param('uint64_t', 'value')]) ## nstime.h (module 'core'): ns3::Time ns3::Min(ns3::Time const & ta, ns3::Time const & tb) [free function] module.add_function('Min', 'ns3::Time', @@ -4932,42 +4936,42 @@ module.add_function('Min', 'ns3::int64x64_t', [param('ns3::int64x64_t const &', 'a'), param('ns3::int64x64_t const &', 'b')]) - ## nstime.h (module 'core'): ns3::Time ns3::Minutes(ns3::int64x64_t minutes) [free function] + ## nstime.h (module 'core'): ns3::Time ns3::Minutes(ns3::int64x64_t value) [free function] module.add_function('Minutes', 'ns3::Time', - [param('ns3::int64x64_t', 'minutes')]) - ## nstime.h (module 'core'): ns3::Time ns3::Minutes(double minutes) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::Minutes(double value) [free function] module.add_function('Minutes', 'ns3::Time', - [param('double', 'minutes')]) - ## nstime.h (module 'core'): ns3::Time ns3::NanoSeconds(ns3::int64x64_t ns) [free function] + [param('double', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::NanoSeconds(ns3::int64x64_t value) [free function] module.add_function('NanoSeconds', 'ns3::Time', - [param('ns3::int64x64_t', 'ns')]) - ## nstime.h (module 'core'): ns3::Time ns3::NanoSeconds(uint64_t ns) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::NanoSeconds(uint64_t value) [free function] module.add_function('NanoSeconds', 'ns3::Time', - [param('uint64_t', 'ns')]) + [param('uint64_t', 'value')]) ## simulator.h (module 'core'): extern ns3::Time ns3::Now() [free function] module.add_function('Now', 'ns3::Time', []) - ## nstime.h (module 'core'): ns3::Time ns3::PicoSeconds(ns3::int64x64_t ps) [free function] + ## nstime.h (module 'core'): ns3::Time ns3::PicoSeconds(ns3::int64x64_t value) [free function] module.add_function('PicoSeconds', 'ns3::Time', - [param('ns3::int64x64_t', 'ps')]) - ## nstime.h (module 'core'): ns3::Time ns3::PicoSeconds(uint64_t ps) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::PicoSeconds(uint64_t value) [free function] module.add_function('PicoSeconds', 'ns3::Time', - [param('uint64_t', 'ps')]) - ## nstime.h (module 'core'): ns3::Time ns3::Seconds(ns3::int64x64_t seconds) [free function] + [param('uint64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::Seconds(ns3::int64x64_t value) [free function] module.add_function('Seconds', 'ns3::Time', - [param('ns3::int64x64_t', 'seconds')]) - ## nstime.h (module 'core'): ns3::Time ns3::Seconds(double seconds) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::Seconds(double value) [free function] module.add_function('Seconds', 'ns3::Time', - [param('double', 'seconds')]) + [param('double', 'value')]) ## test.h (module 'core'): extern bool ns3::TestDoubleIsEqual(double const a, double const b, double const epsilon=std::numeric_limits::epsilon()) [free function] module.add_function('TestDoubleIsEqual', 'bool', @@ -5026,14 +5030,14 @@ 'std::string', [], template_parameters=['unsigned char']) - ## nstime.h (module 'core'): ns3::Time ns3::Years(ns3::int64x64_t years) [free function] + ## nstime.h (module 'core'): ns3::Time ns3::Years(ns3::int64x64_t value) [free function] module.add_function('Years', 'ns3::Time', - [param('ns3::int64x64_t', 'years')]) - ## nstime.h (module 'core'): ns3::Time ns3::Years(double years) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::Years(double value) [free function] module.add_function('Years', 'ns3::Time', - [param('double', 'years')]) + [param('double', 'value')]) register_functions_ns3_CommandLineHelper(module.get_submodule('CommandLineHelper'), root_module) register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_FatalImpl(module.get_submodule('FatalImpl'), root_module) diff -Naur ns-3.20/src/core/bindings/modulegen__gcc_LP64.py ns-3.21/src/core/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/core/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/core/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -658,6 +658,10 @@ cls.add_method('AddValue', 'void', [param('std::string const &', 'name'), param('std::string const &', 'help'), param('ns3::Callback< bool, std::string, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## command-line.h (module 'core'): void ns3::CommandLine::AddValue(std::string const & name, std::string const & attributePath) [member function] + cls.add_method('AddValue', + 'void', + [param('std::string const &', 'name'), param('std::string const &', 'attributePath')]) ## command-line.h (module 'core'): std::string ns3::CommandLine::GetName() const [member function] cls.add_method('GetName', 'std::string', @@ -2516,10 +2520,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -2530,25 +2534,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -2665,20 +2669,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return @@ -4768,22 +4772,22 @@ 'ns3::Ptr< ns3::PointerValue >', [], template_parameters=['ns3::PointerValue']) - ## nstime.h (module 'core'): ns3::Time ns3::Days(ns3::int64x64_t days) [free function] + ## nstime.h (module 'core'): ns3::Time ns3::Days(ns3::int64x64_t value) [free function] module.add_function('Days', 'ns3::Time', - [param('ns3::int64x64_t', 'days')]) - ## nstime.h (module 'core'): ns3::Time ns3::Days(double days) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::Days(double value) [free function] module.add_function('Days', 'ns3::Time', - [param('double', 'days')]) - ## nstime.h (module 'core'): ns3::Time ns3::FemtoSeconds(ns3::int64x64_t fs) [free function] + [param('double', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::FemtoSeconds(ns3::int64x64_t value) [free function] module.add_function('FemtoSeconds', 'ns3::Time', - [param('ns3::int64x64_t', 'fs')]) - ## nstime.h (module 'core'): ns3::Time ns3::FemtoSeconds(uint64_t fs) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::FemtoSeconds(uint64_t value) [free function] module.add_function('FemtoSeconds', 'ns3::Time', - [param('uint64_t', 'fs')]) + [param('uint64_t', 'value')]) ## hash.h (module 'core'): uint32_t ns3::Hash32(std::string const s) [free function] module.add_function('Hash32', 'uint32_t', @@ -4800,14 +4804,14 @@ module.add_function('Hash64', 'uint64_t', [param('char const *', 'buffer'), param('size_t const', 'size')]) - ## nstime.h (module 'core'): ns3::Time ns3::Hours(ns3::int64x64_t hours) [free function] + ## nstime.h (module 'core'): ns3::Time ns3::Hours(ns3::int64x64_t value) [free function] module.add_function('Hours', 'ns3::Time', - [param('ns3::int64x64_t', 'hours')]) - ## nstime.h (module 'core'): ns3::Time ns3::Hours(double hours) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::Hours(double value) [free function] module.add_function('Hours', 'ns3::Time', - [param('double', 'hours')]) + [param('double', 'value')]) ## log.h (module 'core'): extern void ns3::LogComponentDisable(char const * name, ns3::LogLevel level) [free function] module.add_function('LogComponentDisable', 'void', @@ -4908,22 +4912,22 @@ module.add_function('Max', 'ns3::int64x64_t', [param('ns3::int64x64_t const &', 'a'), param('ns3::int64x64_t const &', 'b')]) - ## nstime.h (module 'core'): ns3::Time ns3::MicroSeconds(ns3::int64x64_t us) [free function] + ## nstime.h (module 'core'): ns3::Time ns3::MicroSeconds(ns3::int64x64_t value) [free function] module.add_function('MicroSeconds', 'ns3::Time', - [param('ns3::int64x64_t', 'us')]) - ## nstime.h (module 'core'): ns3::Time ns3::MicroSeconds(uint64_t us) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::MicroSeconds(uint64_t value) [free function] module.add_function('MicroSeconds', 'ns3::Time', - [param('uint64_t', 'us')]) - ## nstime.h (module 'core'): ns3::Time ns3::MilliSeconds(ns3::int64x64_t ms) [free function] + [param('uint64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::MilliSeconds(ns3::int64x64_t value) [free function] module.add_function('MilliSeconds', 'ns3::Time', - [param('ns3::int64x64_t', 'ms')]) - ## nstime.h (module 'core'): ns3::Time ns3::MilliSeconds(uint64_t ms) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::MilliSeconds(uint64_t value) [free function] module.add_function('MilliSeconds', 'ns3::Time', - [param('uint64_t', 'ms')]) + [param('uint64_t', 'value')]) ## nstime.h (module 'core'): ns3::Time ns3::Min(ns3::Time const & ta, ns3::Time const & tb) [free function] module.add_function('Min', 'ns3::Time', @@ -4932,42 +4936,42 @@ module.add_function('Min', 'ns3::int64x64_t', [param('ns3::int64x64_t const &', 'a'), param('ns3::int64x64_t const &', 'b')]) - ## nstime.h (module 'core'): ns3::Time ns3::Minutes(ns3::int64x64_t minutes) [free function] + ## nstime.h (module 'core'): ns3::Time ns3::Minutes(ns3::int64x64_t value) [free function] module.add_function('Minutes', 'ns3::Time', - [param('ns3::int64x64_t', 'minutes')]) - ## nstime.h (module 'core'): ns3::Time ns3::Minutes(double minutes) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::Minutes(double value) [free function] module.add_function('Minutes', 'ns3::Time', - [param('double', 'minutes')]) - ## nstime.h (module 'core'): ns3::Time ns3::NanoSeconds(ns3::int64x64_t ns) [free function] + [param('double', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::NanoSeconds(ns3::int64x64_t value) [free function] module.add_function('NanoSeconds', 'ns3::Time', - [param('ns3::int64x64_t', 'ns')]) - ## nstime.h (module 'core'): ns3::Time ns3::NanoSeconds(uint64_t ns) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::NanoSeconds(uint64_t value) [free function] module.add_function('NanoSeconds', 'ns3::Time', - [param('uint64_t', 'ns')]) + [param('uint64_t', 'value')]) ## simulator.h (module 'core'): extern ns3::Time ns3::Now() [free function] module.add_function('Now', 'ns3::Time', []) - ## nstime.h (module 'core'): ns3::Time ns3::PicoSeconds(ns3::int64x64_t ps) [free function] + ## nstime.h (module 'core'): ns3::Time ns3::PicoSeconds(ns3::int64x64_t value) [free function] module.add_function('PicoSeconds', 'ns3::Time', - [param('ns3::int64x64_t', 'ps')]) - ## nstime.h (module 'core'): ns3::Time ns3::PicoSeconds(uint64_t ps) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::PicoSeconds(uint64_t value) [free function] module.add_function('PicoSeconds', 'ns3::Time', - [param('uint64_t', 'ps')]) - ## nstime.h (module 'core'): ns3::Time ns3::Seconds(ns3::int64x64_t seconds) [free function] + [param('uint64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::Seconds(ns3::int64x64_t value) [free function] module.add_function('Seconds', 'ns3::Time', - [param('ns3::int64x64_t', 'seconds')]) - ## nstime.h (module 'core'): ns3::Time ns3::Seconds(double seconds) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::Seconds(double value) [free function] module.add_function('Seconds', 'ns3::Time', - [param('double', 'seconds')]) + [param('double', 'value')]) ## test.h (module 'core'): extern bool ns3::TestDoubleIsEqual(double const a, double const b, double const epsilon=std::numeric_limits::epsilon()) [free function] module.add_function('TestDoubleIsEqual', 'bool', @@ -5026,14 +5030,14 @@ 'std::string', [], template_parameters=['unsigned char']) - ## nstime.h (module 'core'): ns3::Time ns3::Years(ns3::int64x64_t years) [free function] + ## nstime.h (module 'core'): ns3::Time ns3::Years(ns3::int64x64_t value) [free function] module.add_function('Years', 'ns3::Time', - [param('ns3::int64x64_t', 'years')]) - ## nstime.h (module 'core'): ns3::Time ns3::Years(double years) [free function] + [param('ns3::int64x64_t', 'value')]) + ## nstime.h (module 'core'): ns3::Time ns3::Years(double value) [free function] module.add_function('Years', 'ns3::Time', - [param('double', 'years')]) + [param('double', 'value')]) register_functions_ns3_CommandLineHelper(module.get_submodule('CommandLineHelper'), root_module) register_functions_ns3_Config(module.get_submodule('Config'), root_module) register_functions_ns3_FatalImpl(module.get_submodule('FatalImpl'), root_module) diff -Naur ns-3.20/src/core/examples/command-line-example.cc ns-3.21/src/core/examples/command-line-example.cc --- ns-3.20/src/core/examples/command-line-example.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/core/examples/command-line-example.cc 2014-09-17 20:03:14.000000000 -0700 @@ -28,7 +28,7 @@ using namespace ns3; -std::string g_cbArg="cbArg default"; +std::string g_cbArg = "cbArg default"; bool SetCbArg (std::string val) { @@ -43,6 +43,26 @@ int intArg = 1; bool boolArg = false; std::string strArg = "strArg default"; + // Attribute path + const std::string attrClass = "ns3::RandomVariableStream"; + const std::string attrName = "Antithetic"; + const std::string attrPath = attrClass + "::" + attrName; + + // Cache the initial values. Normally one wouldn't do this, + // but we want to demonstrate that CommandLine has changed them. + const int intDef = intArg; + const bool boolDef = boolArg; + const std::string strDef = strArg; + const std::string cbDef = g_cbArg; + // Look up default value for attribute + const TypeId tid = TypeId::LookupByName (attrClass); + std::string attrDef; + { + struct TypeId::AttributeInformation info; + tid.LookupAttributeByName (attrName, &info); + attrDef = info.originalInitialValue->SerializeToString (info.checker); + } + CommandLine cmd; cmd.Usage ("CommandLine example program.\n" @@ -51,17 +71,62 @@ cmd.AddValue ("intArg", "an int argument", intArg); cmd.AddValue ("boolArg", "a bool argument", boolArg); cmd.AddValue ("strArg", "a string argument", strArg); + cmd.AddValue ("anti", attrPath); cmd.AddValue ("cbArg", "a string via callback", MakeCallback (SetCbArg)); cmd.Parse (argc, argv); - std::cout << std::left - << std::setw (10) << "intArg:" << intArg << std::endl; - std::cout << std::setw (10) << "boolArg:" - << std::boolalpha << boolArg - << std::noboolalpha << std::endl; + // Show initial values: + std::cout << std::endl; + std::cout << cmd.GetName () << ":" << std::endl; + std::cout << "Initial values:" << std::endl; + + std::cout << std::left << std::setw (10) << "intArg:" + << intDef + << std::endl; + std::cout << std::setw (10) << "boolArg:" + << std::boolalpha << boolDef << std::noboolalpha + << std::endl; + + std::cout << std::setw (10) << "strArg:" + << "\"" << strDef << "\"" + << std::endl; + std::cout << std::setw (10) << "anti:" + << "\"" << attrDef << "\"" + << std::endl; + std::cout << std::setw (10) << "cbArg:" + << "\"" << cbDef << "\"" + << std::endl; + std::cout << std::endl; + + + // Show final values + std::cout << "Final values:" << std::endl; + std::cout << std::left << std::setw (10) << "intArg:" + << intArg + << std::endl; + std::cout << std::setw (10) << "boolArg:" + << std::boolalpha << boolArg + << std::noboolalpha + << std::endl; + + std::cout << std::setw (10) << "strArg:" + << "\"" << strArg << "\"" + << std::endl; + + // Look up new default value for attribute + { + struct TypeId::AttributeInformation info; + tid.LookupAttributeByName (attrName, &info); - std::cout << std::setw (10) << "strArg:" << "\"" << strArg << "\"" << std::endl; - std::cout << std::setw (10) << "cbArg:" << "\"" << g_cbArg << "\"" << std::endl; + std::cout << std::setw (10) << "anti:" + << "\"" + << info.initialValue->SerializeToString (info.checker) + << "\"" + << std::endl; + } + std::cout << std::setw (10) << "cbArg:" + << "\"" << g_cbArg << "\"" + << std::endl; return 0; } diff -Naur ns-3.20/src/core/model/callback.h ns-3.21/src/core/model/callback.h --- ns-3.20/src/core/model/callback.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/core/model/callback.h 2014-09-17 20:03:14.000000000 -0700 @@ -32,6 +32,9 @@ namespace ns3 { +// Define the doxygen subgroups all at once, +// since the implementations are interleaved. + /** * \ingroup core * \defgroup callback Callbacks @@ -42,20 +45,69 @@ */ /** * \ingroup callback + * \defgroup callbackimpl Callback Implementation + * Callback implementation classes */ -/**@{*/ /** - * Trait class to convert a pointer into a reference, - * used by MemPtrCallBackImpl + * \ingroup callback + * \defgroup makecallbackmemptr MakeCallback from member function pointer + * + * Build Callbacks for class method members which take varying numbers + * of arguments and potentially returning a value. + * + * Generally the \c MakeCallback functions are invoked with the + * method function address first, followed by the \c this pointer: + * \code + * MakeCallback ( & MyClass::Handler, this); + * \endcode + * + * There is not a version with bound arguments. You may be able to + * get the same result by using \c MakeBoundCallback with a \c static + * member function, as in: + * \code + * MakeBoundCallback ( & MyClass::StaticHandler, this); + * \endcode + * This still leaves two argument slots available for binding. + */ +/** + * \ingroup callback + * \defgroup makecallbackfnptr MakeCallback from function pointers + * + * Build Callbacks for functions which take varying numbers of arguments + * and potentially returning a value. + */ +/** + * \ingroup callback + * \defgroup makenullcallback MakeCallback with no arguments + * + * Define empty (Null) callbacks as placeholders for unset callback variables. + */ +/** + * \ingroup callback + * \defgroup makeboundcallback MakeBoundCallback from functions bound with up to three arguments. + * + * Build bound Callbacks which take varying numbers of arguments, + * and potentially returning a value. + * + * \internal + * + * The following is experimental code. It works but we have + * not yet determined whether or not it is really useful and whether + * or not we really want to use it. */ -template -struct CallbackTraits; + /** + * \ingroup makecallbackmemptr + * * Trait class to convert a pointer into a reference, * used by MemPtrCallBackImpl + * @{ */ template +struct CallbackTraits; + +template struct CallbackTraits { /** @@ -70,11 +122,6 @@ /**@}*/ /** - * \ingroup callback - * \defgroup callbackimpl Callback Implementation - * Callback implementation classes - */ -/** * \ingroup callbackimpl * Abstract base class for CallbackImpl * Provides reference counting and equality test. @@ -103,8 +150,9 @@ /** * \ingroup callbackimpl * CallbackImpl classes with varying numbers of argument types + * + * @{ */ -/**@{*/ /** CallbackImpl class with no arguments. */ template class CallbackImpl : public CallbackImplBase { @@ -179,7 +227,7 @@ /** - * \ingroup callback + * \ingroup callbackimpl * CallbackImpl with functors */ template @@ -325,7 +373,7 @@ }; /** - * \ingroup callback + * \ingroup makecallbackmemptr * CallbackImpl for pointer to member functions */ template @@ -474,7 +522,7 @@ }; /** - * \ingroup callback + * \ingroup callbackimpl * CallbackImpl for functors with first argument bound at construction */ template @@ -608,7 +656,7 @@ }; /** - * \ingroup callback + * \ingroup callbackimpl * CallbackImpl for functors with first two arguments bound at construction */ template @@ -730,7 +778,7 @@ }; /** - * \ingroup callback + * \ingroup callbackimpl * CallbackImpl for functors with first three arguments bound at construction */ template @@ -841,7 +889,7 @@ }; /** - * \ingroup callback + * \ingroup callbackimpl * Base class for Callback class. * Provides pimpl abstraction. */ @@ -1220,13 +1268,6 @@ } /** - * \ingroup callback - * \defgroup makecallbackmemptr MakeCallback from member function pointer - * - * Build Callbacks for class method members which take varying numbers of arguments - * and potentially returning a value. - */ -/** * \ingroup makecallbackmemptr * @{ */ @@ -1321,13 +1362,6 @@ /**@}*/ /** - * \ingroup callback - * \defgroup makecallbackfnptr MakeCallback from function pointers - * - * Build Callbacks for functions which take varying numbers of arguments - * and potentially returning a value. - */ -/** * \ingroup makecallbackfnptr * @{ */ @@ -1381,10 +1415,6 @@ /**@}*/ /** - * \ingroup callback - * \defgroup makenullcallback MakeCallback with no arguments - */ -/** * \ingroup makenullcallback * @{ */ @@ -1439,26 +1469,9 @@ /** - * \ingroup callback - * \defgroup makeboundcallback MakeBoundCallback from functions bound with up to three arguments. - */ - -/** * \ingroup makeboundcallback - * - * Build bound Callbacks which take varying numbers of arguments, - * and potentially returning a value. - * - * \internal - * - * The following is experimental code. It works but we have - * not yet determined whether or not it is really useful and whether - * or not we really want to use it. - * - * @{ - */ -/** * @{ + * Make Callbacks with one bound argument. * \param fnPtr function pointer * \param a1 first bound argument * \return a bound Callback @@ -1528,11 +1541,13 @@ /**@}*/ /** + * \ingroup makeboundcallback + * @{ + * Make Callbacks with two bound arguments. * \param fnPtr function pointer * \param a1 first bound argument * \param a2 second bound argument * \return a bound Callback - * @{ */ template Callback MakeBoundCallback (R (*fnPtr)(TX1,TX2), ARG1 a1, ARG2 a2) { @@ -1592,12 +1607,14 @@ /**@}*/ /** + * \ingroup makeboundcallback + * @{ + * Make Callbacks with three bound arguments. * \param a1 first bound argument * \param a2 second bound argument * \param a3 third bound argument * \param fnPtr function pointer * \return a bound Callback - * @{ */ template Callback MakeBoundCallback (R (*fnPtr)(TX1,TX2,TX3), ARG1 a1, ARG2 a2, ARG3 a3) { @@ -1649,7 +1666,6 @@ } /**@}*/ -/**@}*/ } // namespace ns3 diff -Naur ns-3.20/src/core/model/command-line.cc ns-3.21/src/core/model/command-line.cc --- ns-3.20/src/core/model/command-line.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/core/model/command-line.cc 2014-09-17 20:03:14.000000000 -0700 @@ -22,6 +22,8 @@ #include // for tolower #include // for exit #include // for setw, boolalpha +#include +#include #include "command-line.h" #include "log.h" @@ -204,17 +206,29 @@ NS_LOG_FUNCTION (this); os << "Global values:" << std::endl; + + // Sort output + std::vector globals; for (GlobalValue::Iterator i = GlobalValue::Begin (); i != GlobalValue::End (); ++i) { - os << " --" << (*i)->GetName () << "=["; + std::stringstream ss; + ss << " --" << (*i)->GetName () << "=["; Ptr checker = (*i)->GetChecker (); StringValue v; (*i)->GetValue (v); - os << v.Get () << "]" << std::endl; - os << " " << (*i)->GetHelp () << std::endl; + ss << v.Get () << "]" << std::endl; + ss << " " << (*i)->GetHelp () << std::endl; + globals.push_back (ss.str ()); + } + std::sort (globals.begin (), globals.end ()); + for (std::vector::const_iterator it = globals.begin (); + it < globals.end (); + ++it) + { + os << *it; } } @@ -231,13 +245,25 @@ os << "Attributes for TypeId " << tid.GetName () << std::endl; + // Sort output + std::vector attributes; + for (uint32_t i = 0; i < tid.GetAttributeN (); ++i) { - os << " --" << tid.GetAttributeFullName (i) << "=["; + std::stringstream ss; + ss << " --" << tid.GetAttributeFullName (i) << "=["; struct TypeId::AttributeInformation info = tid.GetAttribute (i); - os << info.initialValue->SerializeToString (info.checker) << "]" + ss << info.initialValue->SerializeToString (info.checker) << "]" << std::endl; - os << " " << info.help << std::endl; + ss << " " << info.help << std::endl; + attributes.push_back (ss.str ()); + } + std::sort (attributes.begin (), attributes.end ()); + for (std::vector::const_iterator it = attributes.begin (); + it < attributes.end (); + ++it) + { + os << *it; } } @@ -249,13 +275,25 @@ os << "TypeIds in group " << group << ":" << std::endl; + // Sort output + std::vector groupTypes; + for (uint32_t i = 0; i < TypeId::GetRegisteredN (); ++i) { + std::stringstream ss; TypeId tid = TypeId::GetRegistered (i); if (tid.GetGroupName () == group) { - os << " " <::const_iterator it = groupTypes.begin (); + it < groupTypes.end (); + ++it) + { + os << *it; } } @@ -264,10 +302,23 @@ { NS_LOG_FUNCTION (this); os << "Registered TypeIds:" << std::endl; + + // Sort output + std::vector types; + for (uint32_t i = 0; i < TypeId::GetRegisteredN (); ++i) { + std::stringstream ss; TypeId tid = TypeId::GetRegistered (i); - os << " " << tid.GetName () << std::endl; + ss << " " << tid.GetName () << std::endl; + types.push_back (ss.str ()); + } + std::sort (types.begin (), types.end ()); + for (std::vector::const_iterator it = types.begin (); + it < types.end (); + ++it) + { + os << *it; } } @@ -276,35 +327,16 @@ { NS_LOG_FUNCTION (this); - std::list groups; + std::set groups; for (uint32_t i = 0; i < TypeId::GetRegisteredN (); ++i) { TypeId tid = TypeId::GetRegistered (i); - std::string group = tid.GetGroupName (); - if (group == "") - { - continue; - } - bool found = false; - for (std::list::const_iterator j = groups.begin (); - j != groups.end (); - ++j) - { - if (*j == group) - { - found = true; - break; - } - } - if (!found) - { - groups.push_back (group); - } + groups.insert (tid.GetGroupName ()); } os << "Registered TypeId groups:" << std::endl; - - for (std::list::const_iterator k = groups.begin (); + // Sets are already sorted + for (std::set::const_iterator k = groups.begin (); k != groups.end (); ++k) { @@ -404,6 +436,53 @@ m_items.push_back (item); } +void +CommandLine::AddValue (const std::string &name, + const std::string &attributePath) +{ + NS_LOG_FUNCTION (this << name << attributePath); + // Attribute name is last token + size_t colon = attributePath.rfind ("::"); + const std::string typeName = attributePath.substr (0, colon); + NS_LOG_DEBUG ("typeName: '" << typeName << "', colon: " << colon); + + TypeId tid; + if (!TypeId::LookupByNameFailSafe (typeName, &tid)) + { + NS_FATAL_ERROR ("Unknown type=" << typeName); + } + + const std::string attrName = attributePath.substr (colon + 2); + struct TypeId::AttributeInformation info; + if (!tid.LookupAttributeByName (attrName, &info)) + { + NS_FATAL_ERROR ("Attribute not found: " << attributePath); + } + + std::stringstream ss; + ss << info.help + << " (" << attributePath << ") [" + << info.initialValue->SerializeToString (info.checker) << "]"; + + AddValue (name, ss.str (), + MakeBoundCallback (CommandLine::HandleAttribute, attributePath)) ; +} + + +/* static */ +bool +CommandLine::HandleAttribute (const std::string name, + const std::string value) +{ + bool success = true; + if (!Config::SetGlobalFailSafe (name, StringValue (value)) + && !Config::SetDefaultFailSafe (name, StringValue (value))) + { + success = false; + } + return success; +} + bool CommandLine::Item::HasDefault () const diff -Naur ns-3.20/src/core/model/command-line.h ns-3.21/src/core/model/command-line.h --- ns-3.20/src/core/model/command-line.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/core/model/command-line.h 2014-09-17 20:03:14.000000000 -0700 @@ -50,48 +50,66 @@ * can be processed via a Callback. * * CommandLine also provides handlers for these standard arguments: - * \code - * --PrintGlobals: Print the list of globals. - * --PrintGroups: Print the list of groups. - * --PrintGroup=[group]: Print all TypeIds of group. - * --PrintTypeIds: Print all TypeIds. - * --PrintAttributes=[typeid]: Print all attributes of typeid. - * --PrintHelp: Print this help message. - * \endcode + * \verbatim + --PrintGlobals: Print the list of globals. + --PrintGroups: Print the list of groups. + --PrintGroup=[group]: Print all TypeIds of group. + --PrintTypeIds: Print all TypeIds. + --PrintAttributes=[typeid]: Print all attributes of typeid. + --PrintHelp: Print this help message. \endverbatim * * The more common \c --help is a synonym for \c --PrintHelp; an example * is given below. * * Finally, CommandLine processes Attribute and GlobalValue arguments. + * Default values for chosen attributes can be set using a shorthand + * argument name. * * In use, arguments are given in the form - * \code - * --arg=value --toggle - * \endcode + * \verbatim + --arg=value --toggle \endverbatim * Most arguments expect a value, as in the first form, \c --arg=value. * Toggles, corresponding to boolean arguments, can be given in any of * the forms - * \code - * --toggle1 --toggle2=1 --toggle3=t --toggle4=true - * \endcode + * \verbatim + --toggle1 --toggle2=1 --toggle3=t --toggle4=true \endverbatim * The first form changes the state of toggle1 from its default; * all the rest set the corresponding boolean variable to true. * \c 0, \c f and \c false are accepted to set the variable to false. * + * Arguments can be repeated on the command line; the last value given + * will be the final value used. For example, + * \verbatim + --arg=one --toggle=f --arg=another --toggle \endverbatim + * The variable set by \c --arg will end up with the value \c "another"; + * the boolean set by \c --toggle will end up as \c true. + * + * Because arguments can be repeated it can be hard to decipher what + * value each variable ended up with, especially when using boolean toggles. + * Suggested best practice is for scripts to report the values of all items + * settable throught CommandLine, as done by the example below. + * + * * CommandLine can set the initial value of every attribute in the system * with the * \c --TypeIdName::AttributeName=value syntax, for example - * \code - * --Application::StartTime=3s - * \endcode + * \verbatim + --Application::StartTime=3s \endverbatim + * In some cases you may want to highlight the use of a particular + * attribute for a simulation script. For example, you might want + * to make it easy to set the \c Application::StartTime using + * the argument \c --start, and have its help string show as part + * of the help message. This can be done using the + * \link AddValue(const std::string, const std::string) + * AddValue (name, attributePath) \endlink + * method. * * CommandLine can also set the value of every GlobalValue * in the system with the \c --GlobalValueName=value syntax, for example - * \code - * --SchedulerType=HeapScheduler - * \endcode + * \verbatim + --SchedulerType=HeapScheduler \endverbatim * - * A simple example is in `src/core/example/ command-line-example.cc` + * A simple example is in `src/core/example/``command-line-example.cc` * The heart of that example is this code: * * \code @@ -99,55 +117,56 @@ * bool boolArg = false; * std::string strArg = "strArg default"; * - * CommandLine cmd; - * cmd.Usage ("CommandLine example program.\n" - * "\n" - * "This little program demonstrates how to use CommandLine."); + * CommandLine cmd; + * cmd.Usage ("CommandLine example program.\n" + * "\n" + * "This little program demonstrates how to use CommandLine."); * cmd.AddValue ("intArg", "an int argument", intArg); * cmd.AddValue ("boolArg", "a bool argument", boolArg); * cmd.AddValue ("strArg", "a string argument", strArg); + * cmd.AddValue ("anti", "ns3::RandomVariableStream::Antithetic"); * cmd.AddValue ("cbArg", "a string via callback", MakeCallback (SetCbArg)); - * cmd.Parse (argc, argv); + * cmd.Parse (argc, argv); * \endcode * after which it prints the values of each variable. (The \c SetCbArg function - * is not shown here; see `src/core/example/ command-line-example.cc`) + * is not shown here; see `src/core/example/``command-line-example.cc`) * * Here is the output from a few runs of that program: * - * \code - * $ ./waf --run="command-line-example" - * intArg: 1 - * boolArg: false - * strArg: "strArg default" - * cbArg: "cbArg default" - * - * $ ./waf --run="command-line-example --intArg=2 --boolArg --strArg=Hello --cbArg=World" - * intArg: 2 - * boolArg: true - * strArg: "Hello" - * cbArg: "World" - * - * $ ./waf --run="command-line-example --help" - * ns3-dev-command-line-example-debug [Program Arguments] [General Arguments] - * - * CommandLine example program. - * - * This little program demonstrates how to use CommandLine. - * - * Program Arguments: - * --intArg: an int argument [1] - * --boolArg: a bool argument [false] - * --strArg: a string argument [strArg default] - * --cbArg: a string via callback - * - * General Arguments: - * --PrintGlobals: Print the list of globals. - * --PrintGroups: Print the list of groups. - * --PrintGroup=[group]: Print all TypeIds of group. - * --PrintTypeIds: Print all TypeIds. - * --PrintAttributes=[typeid]: Print all attributes of typeid. - * --PrintHelp: Print this help message. - * \endcode + * \verbatim + $ ./waf --run="command-line-example" + intArg: 1 + boolArg: false + strArg: "strArg default" + cbArg: "cbArg default" + + $ ./waf --run="command-line-example --intArg=2 --boolArg --strArg=Hello --cbArg=World" + intArg: 2 + boolArg: true + strArg: "Hello" + cbArg: "World" + + $ ./waf --run="command-line-example --help" + ns3-dev-command-line-example-debug [Program Arguments] [General Arguments] + + CommandLine example program. + + This little program demonstrates how to use CommandLine. + + Program Arguments: + --intArg: an int argument [1] + --boolArg: a bool argument [false] + --strArg: a string argument [strArg default] + --anti: Set this RNG stream to generate antithetic values (ns3::RandomVariableStream::Antithetic) [false] + --cbArg: a string via callback + + General Arguments: + --PrintGlobals: Print the list of globals. + --PrintGroups: Print the list of groups. + --PrintGroup=[group]: Print all TypeIds of group. + --PrintTypeIds: Print all TypeIds. + --PrintAttributes=[typeid]: Print all attributes of typeid. + --PrintHelp: Print this help message. \endverbatim * * Having parsed the arguments, some programs will need to perform * some additional validation of the received values. A common issue at this @@ -216,7 +235,6 @@ const std::string &help, T &value); - /** * Add a program argument, using a Callback to parse the value * @@ -233,6 +251,15 @@ Callback callback); /** + * Add a program argument as a shorthand for an Attribute. + * + * \param name the name of the program-supplied argument. + * \param attributePath the fully-qualified name of the Attribute + */ + void AddValue (const std::string &name, + const std::string &attributePath); + + /** * Parse the program arguments * * \param argc the 'argc' variable: number of arguments (including the @@ -348,6 +375,15 @@ * \param value the command line value */ void HandleArgument (const std::string &name, const std::string &value) const; + /** + * Callback function to handle attributes. + * + * \param name The full name of the Attribute. + * \param value The value to assign to \p name. + * \return true if the value was set successfully, false otherwise. + */ + static bool HandleAttribute (const std::string name, const std::string value); + /** Handler for \c \-\-PrintGlobals: print all global variables and values */ void PrintGlobals (std::ostream &os) const; /** diff -Naur ns-3.20/src/core/model/config.cc ns-3.21/src/core/model/config.cc --- ns-3.20/src/core/model/config.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/core/model/config.cc 2014-09-17 20:03:14.000000000 -0700 @@ -403,52 +403,62 @@ else { // this is a normal attribute. - TypeId tid = root->GetInstanceTypeId (); + TypeId tid; + TypeId nextTid = root->GetInstanceTypeId (); bool foundMatch = false; - for (uint32_t i = 0; i < tid.GetAttributeN(); i++) + + do { - struct TypeId::AttributeInformation info; - info = tid.GetAttribute(i); - if (info.name != item && item != "*") + tid = nextTid; + + for (uint32_t i = 0; i < tid.GetAttributeN(); i++) { - continue; - } - // attempt to cast to a pointer checker. - const PointerChecker *ptr = dynamic_cast (PeekPointer (info.checker)); - if (ptr != 0) - { - NS_LOG_DEBUG ("GetAttribute(ptr)="< (PeekPointer (info.checker)); - if (vectorChecker != 0) - { - NS_LOG_DEBUG ("GetAttribute(vector)="< (PeekPointer (info.checker)); + if (vectorChecker != 0) + { + NS_LOG_DEBUG ("GetAttribute(vector)="<GetObject ()->GetId () << "] "; * } * \endcode - * - * \internal - * Logging implementation macro; should not be called directly. - * */ #define NS_LOG_APPEND_CONTEXT #endif /* NS_LOG_APPEND_CONTEXT */ +#ifndef NS_LOG_CONDITION +/** + * \ingroup logging + * Limit logging output based on some file-local condition, + * such as MPI rank. + * + * This is implemented locally in `.cc` files because + * the relevant condition variable is only known there. + * + * Since this appears immediately before the `do { ... } while false` + * construct of \c NS_LOG(level, msg), it must have the form + * \code + * #define NS_LOG_CONDITION if (condition) + * \endcode + */ +#define NS_LOG_CONDITION +#endif + /** * \ingroup logging * @@ -129,6 +144,7 @@ * Logging implementation macro; should not be called directly. */ #define NS_LOG(level, msg) \ + NS_LOG_CONDITION \ do \ { \ if (g_log.IsEnabled (level)) \ @@ -152,6 +168,7 @@ * should instead use NS_LOG_FUNCTION(). */ #define NS_LOG_FUNCTION_NOARGS() \ + NS_LOG_CONDITION \ do \ { \ if (g_log.IsEnabled (ns3::LOG_FUNCTION)) \ @@ -188,6 +205,7 @@ * \param parameters the parameters to output. */ #define NS_LOG_FUNCTION(parameters) \ + NS_LOG_CONDITION \ do \ { \ if (g_log.IsEnabled (ns3::LOG_FUNCTION)) \ @@ -212,6 +230,7 @@ * \param msg the message to log */ #define NS_LOG_UNCOND(msg) \ + NS_LOG_CONDITION \ do \ { \ std::clog << msg << std::endl; \ diff -Naur ns-3.20/src/core/model/nstime.h ns-3.21/src/core/model/nstime.h --- ns-3.20/src/core/model/nstime.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/core/model/nstime.h 2014-09-17 20:03:14.000000000 -0700 @@ -37,6 +37,22 @@ /** * \ingroup core + * \defgroup time Virtual Time + * \brief Management of virtual time in real world units. + * + * The underlying simulator is unit agnostic, just dealing with + * dimensionless virtual time. Models usually need to handle + * time in real world units, such as seconds, and conversions/scaling + * between different units, between minutes and seconds, for example. + * + * The convenience constructors in the \ref timecivil "Standard Units" module + * make it easy to create Times in specific units. + * + * The Time::SetResolution() function allows a one-time change of the + * base resolution, before Simulator::Run(). + */ +/** + * \ingroup time * \brief Simulation virtual time values and global simulation resolution. * * This class defines all the classic C++ addition/subtraction @@ -97,11 +113,17 @@ LAST = 10 }; + /** + * Assignment operator + * \param [in] o Time to assign. + * \return the Time. + */ inline Time & operator = (const Time & o) { m_data = o.m_data; return *this; } + /** Default constructor, with value 0. */ inline Time () : m_data () { @@ -110,6 +132,11 @@ Mark (this); } } + /** + * Copy constructor + * + * \param [in] o Time to copy + */ inline Time(const Time & o) : m_data (o.m_data) { @@ -118,6 +145,13 @@ Mark (this); } } + /** + * Construct from a numeric value. + * + * The current time resolution will be assumed as the unit. + * \param [in] v The value. + * @{ + */ explicit inline Time (double v) : m_data (lround (v)) { @@ -174,6 +208,16 @@ Mark (this); } } + explicit inline Time (const int64x64_t & v) + : m_data (v.GetHigh ()) + { + if (g_markingTimes) + { + Mark (this); + } + } + /**@}*/ + /** * \brief Construct Time object from common time expressions like "1ms" * @@ -196,24 +240,18 @@ */ explicit Time (const std::string & s); - /** - * \brief Minimum representable Time - */ + /** Minimum representable Time */ static Time Min () { return Time (std::numeric_limits::min ()); } - /** - * \brief Maximum representable Time - */ + /** Maximum representable Time */ static Time Max () { return Time (std::numeric_limits::max ()); } - /** - * Destructor - */ + /** Destructor */ ~Time () { if (g_markingTimes) @@ -222,42 +260,35 @@ } } - /** - * \return true if the time is zero, false otherwise. - */ + /** \return true if the time is zero, false otherwise. */ inline bool IsZero (void) const { return m_data == 0; } - /** - * \return true if the time is negative or zero, false otherwise. - */ + /** \return true if the time is negative or zero, false otherwise. */ inline bool IsNegative (void) const { return m_data <= 0; } - /** - * \return true if the time is positive or zero, false otherwise. - */ + /** \return true if the time is positive or zero, false otherwise. */ inline bool IsPositive (void) const { return m_data >= 0; } - /** - * \return true if the time is strictly negative, false otherwise. - */ + /** \return true if the time is strictly negative, false otherwise. */ inline bool IsStrictlyNegative (void) const { return m_data < 0; } - /** - * \return true if the time is strictly positive, false otherwise. - */ + /** \return true if the time is strictly positive, false otherwise. */ inline bool IsStrictlyPositive (void) const { return m_data > 0; } /** + * Compare \p this to another Time + * + * \param [in] o The other Time * \return -1,0,+1 if `this < o`, `this == o`, or `this > o` */ inline int Compare (const Time & o) const @@ -266,90 +297,57 @@ } /** - * \returns an approximation in seconds of the time stored in this - * instance. + * Get an approximation of the time stored in this instance + * in the indicated unit. + * + * \return An approximate value in the indicated unit. + * @{ */ + inline double GetYears (void) const + { + return ToDouble (Time::Y); + } + inline double GetDays (void) const + { + return ToDouble (Time::D); + } + inline double GetHours (void) const + { + return ToDouble (Time::H); + } + inline double GetMinutes (void) const + { + return ToDouble (Time::MIN); + } inline double GetSeconds (void) const { return ToDouble (Time::S); } - - /** - * \returns an approximation in milliseconds of the time stored in this - * instance. - */ inline int64_t GetMilliSeconds (void) const { return ToInteger (Time::MS); } - /** - * \returns an approximation in microseconds of the time stored in this - * instance. - */ inline int64_t GetMicroSeconds (void) const { return ToInteger (Time::US); } - /** - * \returns an approximation in nanoseconds of the time stored in this - * instance. - */ inline int64_t GetNanoSeconds (void) const { return ToInteger (Time::NS); } - /** - * \returns an approximation in picoseconds of the time stored in this - * instance. - */ inline int64_t GetPicoSeconds (void) const { return ToInteger (Time::PS); } - /** - * \returns an approximation in femtoseconds of the time stored in this - * instance. - */ inline int64_t GetFemtoSeconds (void) const { return ToInteger (Time::FS); } + /**@}*/ /** - * \returns an approximation in minutes of the time stored in this - * instance. - */ - inline double GetMinutes (void) const - { - return ToDouble (Time::MIN); - } - /** - * \returns an approximation in hours of the time stored in this - * instance. - */ - inline double GetHours (void) const - { - return ToDouble (Time::H); - } - /** - * \returns an approximation in days of the time stored in this - * instance. - */ - inline double GetDays (void) const - { - return ToDouble (Time::D); - } - /** - * \returns an approximation in years of the time stored in this - * instance. - */ - inline double GetYears (void) const - { - return ToDouble (Time::Y); - } - - /** - * \returns the raw time value, in the current units + * \returns the raw time value, in the current unit + * @{ */ inline int64_t GetTimeStep (void) const { @@ -363,6 +361,7 @@ { return GetTimeStep (); } + /**@}*/ /** @@ -377,19 +376,29 @@ * \returns the current global resolution. */ static enum Unit GetResolution (void); + + /** - * \param value to convert into a Time object - * \param timeUnit the unit of the value to convert - * \return a new Time object + * Create a Time in the current unit. * - * This method interprets the input value according to the input - * unit and constructs a matching Time object. + * \param [in] value The value of the new Time. + * \return A Time with \p value in the current time unit. + */ + inline static Time From (const int64x64_t & value) + { + return Time (value); + } + /** + * Create a Time equal to \p value in unit \c unit * - * \sa FromDouble, ToDouble, ToInteger + * \param [in] value The new Time value, expressed in \c unit + * \param [in] unit The unit of \p value + * \return The Time representing \p value in \c unit + * @{ */ - inline static Time FromInteger (uint64_t value, enum Unit timeUnit) + inline static Time FromInteger (uint64_t value, enum Unit unit) { - struct Information *info = PeekInformation (timeUnit); + struct Information *info = PeekInformation (unit); if (info->fromMul) { value *= info->factor; @@ -400,68 +409,57 @@ } return Time (value); } - /** - * \param timeUnit the unit of the value to return - * \return int64_t time value - * - * Convert the input time into an integer value according to the requested - * time unit. - */ - inline int64_t ToInteger (enum Unit timeUnit) const + inline static Time FromDouble (double value, enum Unit unit) { - struct Information *info = PeekInformation (timeUnit); - int64_t v = m_data; - if (info->toMul) + return From (int64x64_t (value), unit); + } + inline static Time From (const int64x64_t & value, enum Unit unit) + { + struct Information *info = PeekInformation (unit); + // DO NOT REMOVE this temporary variable. It's here + // to work around a compiler bug in gcc 3.4 + int64x64_t retval = value; + if (info->fromMul) { - v *= info->factor; + retval *= info->timeFrom; } else { - v /= info->factor; + retval.MulByInvert (info->timeFrom); } - return v; - } - /** - * \param value to convert into a Time object - * \param timeUnit the unit of the value to convert - * \return a new Time object - * - * \sa FromInteger, ToInteger, ToDouble - */ - inline static Time FromDouble (double value, enum Unit timeUnit) - { - return From (int64x64_t (value), timeUnit); + return Time (retval); } + /**@}*/ + + /** - * \param timeUnit the unit of the value to return - * \return double time value + * Get the Time value expressed in a particular unit. * - * Convert the input time into a floating point value according to the requested - * time unit. + * \param [in] unit The desired unit + * \return The Time expressed in \p unit + * @{ */ - inline double ToDouble (enum Unit timeUnit) const - { - return To (timeUnit).GetDouble (); - } - static inline Time From (const int64x64_t & from, enum Unit timeUnit) + inline int64_t ToInteger (enum Unit unit) const { - struct Information *info = PeekInformation (timeUnit); - // DO NOT REMOVE this temporary variable. It's here - // to work around a compiler bug in gcc 3.4 - int64x64_t retval = from; - if (info->fromMul) + struct Information *info = PeekInformation (unit); + int64_t v = m_data; + if (info->toMul) { - retval *= info->timeFrom; + v *= info->factor; } else { - retval.MulByInvert (info->timeFrom); + v /= info->factor; } - return Time (retval); + return v; + } + inline double ToDouble (enum Unit unit) const + { + return To (unit).GetDouble (); } - inline int64x64_t To (enum Unit timeUnit) const + inline int64x64_t To (enum Unit unit) const { - struct Information *info = PeekInformation (timeUnit); + struct Information *info = PeekInformation (unit); int64x64_t retval = int64x64_t (m_data); if (info->toMul) { @@ -473,23 +471,16 @@ } return retval; } + /**@}*/ + + + /** Cast to int64x64_t */ inline operator int64x64_t () const { return int64x64_t (m_data); } - explicit inline Time (const int64x64_t & value) - : m_data (value.GetHigh ()) - { - if (g_markingTimes) - { - Mark (this); - } - } - inline static Time From (const int64x64_t & value) - { - return Time (value); - } + /** * Attach a unit to a Time, to facilitate output in a specific unit. * @@ -501,13 +492,12 @@ * will print ``+3140.0ms`` * * \param unit [in] The unit to use. + * \return The Time with embedded unit. */ TimeWithUnit As (const enum Unit unit) const; private: - /** - * How to convert between other units and the current unit - */ + /** How to convert between other units and the current unit. */ struct Information { bool toMul; //!< Multiply when converting To, otherwise divide @@ -516,26 +506,47 @@ int64x64_t timeTo; //!< Multiplier to convert to this unit int64x64_t timeFrom; //!< Multiplier to convert from this unit }; - /** - * Current time unit, and conversion info. - */ + /** Current time unit, and conversion info. */ struct Resolution { struct Information info[LAST]; //!< Conversion info from current unit enum Time::Unit unit; //!< Current time unit }; + /** + * Get the current Resolution + * + * \return A pointer to the current Resolution + */ static inline struct Resolution *PeekResolution (void) { static struct Time::Resolution resolution = SetDefaultNsResolution (); return & resolution; } + /** + * Get the Information record for \p timeUnit for the current Resolution + * + * \param [in] timeUnit The Unit to get Information for + * \return the Information for \p timeUnit + */ static inline struct Information *PeekInformation (enum Unit timeUnit) { return & (PeekResolution ()->info[timeUnit]); } + /** + * Set the default resolution + * + * \return The Resolution object for the default resolution. + */ static struct Resolution SetDefaultNsResolution (void); + /** + * Set the current Resolution. + * + * \param [in] unit The unit to use as the new resolution. + * \param [in,out] resolution The Resolution record to update. + * \param [in] convert Whether to convert existing Time objects to the new resolution. + */ static void SetResolution (enum Unit unit, struct Resolution *resolution, const bool convert = true); @@ -576,7 +587,9 @@ static MarkedTimes * g_markingTimes; public: /** - * Function to force static initialization of Time + * Function to force static initialization of Time. + * + * \return true on the first call */ static bool StaticInit (); private: @@ -593,18 +606,28 @@ */ static void ClearMarkedTimes (); /** - * Record a Time instance with the MarkedTimes + * Record a Time instance with the MarkedTimes. + * \param [in] time The Time instance to record. */ static void Mark (Time * const time); /** - * Remove a Time instance from the MarkedTimes, called by ~Time() + * Remove a Time instance from the MarkedTimes, called by ~Time(). + * \param [in] time The Time instance to remove. */ static void Clear (Time * const time); /** * Convert existing Times to the new unit. + * \param [in] unit The Unit to convert existing Times to. */ static void ConvertTimes (const enum Unit unit); + /** + * @{ + * Arithmetic operator. + * \param [in] lhs Left hand argument + * \param [in] rhs Righ hand argument + * \return The result of the operator. + */ friend bool operator == (const Time & lhs, const Time & rhs); friend bool operator != (const Time & lhs, const Time & rhs); friend bool operator <= (const Time & lhs, const Time & rhs); @@ -619,12 +642,30 @@ friend Time operator / (const Time & lhs, const int64_t & rhs); friend Time & operator += (Time & lhs, const Time & rhs); friend Time & operator -= (Time & lhs, const Time & rhs); + /**@}*/ + + /** + * Absolute value function for Time + * \param time the input value + * \returns the absolute value of the input value. + */ friend Time Abs (const Time & time); + /** + * Max function for Time. + * \param ta the first value + * \param tb the seconds value + * \returns the max of the two input values. + */ friend Time Max (const Time & ta, const Time & tb); + /** + * Min function for Time. + * \param ta the first value + * \param tb the seconds value + * \returns the min of the two input values. + */ friend Time Min (const Time & ta, const Time & tb); - - int64_t m_data; //!< Virtual time value, in the current unit. + int64_t m_data; //!< Virtual time value, in the current unit. }; // class Time @@ -708,38 +749,22 @@ return lhs; } -/** - * Max function for Time. - * \param ta the first value - * \param tb the seconds value - * \returns the max of the two input values. - */ + +inline Time Abs (const Time & time) +{ + return Time ((time.m_data < 0) ? -time.m_data : time.m_data); +} inline Time Max (const Time & ta, const Time & tb) { return Time ((ta.m_data < tb.m_data) ? tb : ta); } -/** - * Min function for Time. - * \param ta the first value - * \param tb the seconds value - * \returns the min of the two input values. - */ inline Time Min (const Time & ta, const Time & tb) { return Time ((ta.m_data > tb.m_data) ? tb : ta); } /** - * Absolute value function for Time - * \param time the input value - * \returns the absolute value of the input value. - */ -inline Time Abs (const Time & time) -{ - return Time ((time.m_data < 0) ? -time.m_data : time.m_data); -} - -/** + * \ingroup time * \brief Time output streamer. * * Generates output such as "3.96ns". Times are printed with the @@ -749,274 +774,163 @@ * - `left` * The stream `width` and `precision` are ignored; Time output always * includes ".0". - * \relates Time + * + * \param [in] os The output stream. + * \param [in] time The Time to put on the stream. + * \return The stream. */ -std::ostream & operator<< (std::ostream & os, const Time & time); +std::ostream & operator << (std::ostream & os, const Time & time); /** + * \ingroup time * \brief Time input streamer * * Uses the Time::Time (const std::string &) constructor - * \relates Time + * + * \param [in] is The input stream. + * \param [out] time The Time variable to set from the stream data. + * \return The stream. */ -std::istream & operator>> (std::istream & is, Time & time); +std::istream & operator >> (std::istream & is, Time & time); /** - * \brief create ns3::Time instances in units of seconds. + * \ingroup time + * \defgroup timecivil Standard time units. + * \brief Convenience constructors in standard units. * * For example: * \code - * Time t = Seconds (2.0); - * Simulator::Schedule (Seconds (5.0), ...); + * Time t = Seconds (2.0); + * Simulator::Schedule (Seconds (5.0), ...); * \endcode - * \param seconds seconds value - * \relates Time */ -inline Time Seconds (double seconds) -{ - return Time::FromDouble (seconds, Time::S); -} - /** - * \brief create ns3::Time instances in units of milliseconds. - * - * For example: - * \code - * Time t = MilliSeconds (2); - * Simulator::Schedule (MilliSeconds (5), ...); - * \endcode - * \param ms milliseconds value - * \relates Time + * \ingroup timecivil + * Construct a Time in the indicated unit. + * \param value The value + * \return The Time + * @{ */ -inline Time MilliSeconds (uint64_t ms) +inline Time Years (double value) { - return Time::FromInteger (ms, Time::MS); + return Time::FromDouble (value, Time::Y); } -/** - * \brief create ns3::Time instances in units of microseconds. - * - * For example: - * \code - * Time t = MicroSeconds (2); - * Simulator::Schedule (MicroSeconds (5), ...); - * \endcode - * \param us microseconds value - * \relates Time - */ -inline Time MicroSeconds (uint64_t us) +inline Time Years (int64x64_t value) { - return Time::FromInteger (us, Time::US); + return Time::From (value, Time::Y); } -/** - * \brief create ns3::Time instances in units of nanoseconds. - * - * For example: - * \code - * Time t = NanoSeconds (2); - * Simulator::Schedule (NanoSeconds (5), ...); - * \endcode - * \param ns nanoseconds value - * \relates Time - */ -inline Time NanoSeconds (uint64_t ns) +inline Time Days (double value) { - return Time::FromInteger (ns, Time::NS); + return Time::FromDouble (value, Time::D); } -/** - * \brief create ns3::Time instances in units of picoseconds. - * - * For example: - * \code - * Time t = PicoSeconds (2); - * Simulator::Schedule (PicoSeconds (5), ...); - * \endcode - * \param ps picoseconds value - * \relates Time - */ -inline Time PicoSeconds (uint64_t ps) +inline Time Days (int64x64_t value) { - return Time::FromInteger (ps, Time::PS); + return Time::From (value, Time::D); } -/** - * \brief create ns3::Time instances in units of femtoseconds. - * - * For example: - * \code - * Time t = FemtoSeconds (2); - * Simulator::Schedule (FemtoSeconds (5), ...); - * \endcode - * \param fs femtoseconds value - * \relates Time - */ -inline Time FemtoSeconds (uint64_t fs) +inline Time Hours (double value) { - return Time::FromInteger (fs, Time::FS); + return Time::FromDouble (value, Time::H); } -/** - * \brief create ns3::Time instances in units of minutes (equal to 60 seconds). - * - * For example: - * \code - * Time t = Minutes (2.0); - * Simulator::Schedule (Minutes (5.0), ...); - * \endcode - * \param minutes mintues value - * \relates Time - */ -inline Time Minutes (double minutes) +inline Time Hours (int64x64_t value) { - return Time::FromDouble (minutes, Time::MIN); + return Time::From (value, Time::H); } -/** - * \brief create ns3::Time instances in units of hours (equal to 60 minutes). - * - * For example: - * \code - * Time t = Hours (2.0); - * Simulator::Schedule (Hours (5.0), ...); - * \endcode - * \param hours hours value - * \relates Time - */ -inline Time Hours (double hours) +inline Time Minutes (double value) { - return Time::FromDouble (hours, Time::H); + return Time::FromDouble (value, Time::MIN); } -/** - * \brief create ns3::Time instances in units of days (equal to 24 hours). - * - * For example: - * \code - * Time t = Days (2.0); - * Simulator::Schedule (Days (5.0), ...); - * \endcode - * \param days days value - * \relates Time - */ -inline Time Days (double days) +inline Time Minutes (int64x64_t value) { - return Time::FromDouble (days, Time::D); + return Time::From (value, Time::MIN); } -/** - * \brief create ns3::Time instances in units of years (equal to 365 days). - * - * For example: - * \code - * Time t = Years (2.0); - * Simulator::Schedule (Years (5.0), ...); - * \endcode - * \param years years value - * \relates Time - */ -inline Time Years (double years) +inline Time Seconds (double value) { - return Time::FromDouble (years, Time::Y); + return Time::FromDouble (value, Time::S); } - -/** - * \see Seconds(double) - * \relates Time - */ -inline Time Seconds (int64x64_t seconds) +inline Time Seconds (int64x64_t value) { - return Time::From (seconds, Time::S); + return Time::From (value, Time::S); } -/** - * \see MilliSeconds(uint64_t) - * \relates Time - */ -inline Time MilliSeconds (int64x64_t ms) +inline Time MilliSeconds (uint64_t value) { - return Time::From (ms, Time::MS); + return Time::FromInteger (value, Time::MS); } -/** - * \see MicroSeconds(uint64_t) - * \relates Time - */ -inline Time MicroSeconds (int64x64_t us) +inline Time MilliSeconds (int64x64_t value) { - return Time::From (us, Time::US); + return Time::From (value, Time::MS); } -/** - * \see NanoSeconds(uint64_t) - * \relates Time - */ -inline Time NanoSeconds (int64x64_t ns) +inline Time MicroSeconds (uint64_t value) { - return Time::From (ns, Time::NS); + return Time::FromInteger (value, Time::US); } -/** - * \see PicoSeconds(uint64_t) - * \relates Time - */ -inline Time PicoSeconds (int64x64_t ps) +inline Time MicroSeconds (int64x64_t value) { - return Time::From (ps, Time::PS); + return Time::From (value, Time::US); } -/** - * \see FemtoSeconds(uint64_t) - * \relates Time - */ -inline Time FemtoSeconds (int64x64_t fs) +inline Time NanoSeconds (uint64_t value) { - return Time::From (fs, Time::FS); + return Time::FromInteger (value, Time::NS); } -/** - * \see Minutes(uint64_t) - * \relates Time - */ -inline Time Minutes (int64x64_t minutes) +inline Time NanoSeconds (int64x64_t value) { - return Time::From (minutes, Time::MIN); + return Time::From (value, Time::NS); } -/** - * \see Minutes(uint64_t) - * \relates Time - */ -inline Time Hours (int64x64_t hours) +inline Time PicoSeconds (uint64_t value) { - return Time::From (hours, Time::H); + return Time::FromInteger (value, Time::PS); } -/** - * \see Minutes(uint64_t) - * \relates Time - */ -inline Time Days (int64x64_t days) +inline Time PicoSeconds (int64x64_t value) { - return Time::From (days, Time::D); + return Time::From (value, Time::PS); } -/** - * \see Minutes(uint64_t) - * \relates Time - */ -inline Time Years (int64x64_t years) +inline Time FemtoSeconds (uint64_t value) { - return Time::From (years, Time::Y); + return Time::FromInteger (value, Time::FS); } +inline Time FemtoSeconds (int64x64_t value) +{ + return Time::From (value, Time::FS); +} +/**@}*/ + -// internal function not publicly documented +/** + * \ingroup time + * \internal Scheduler interface + * \param [in] ts The time value, in the current unit. + * \return A Time. + */ inline Time TimeStep (uint64_t ts) { return Time (ts); } /** + * \ingroup time * \class ns3::TimeValue - * \brief hold objects of type ns3::Time + * \brief Attribute for objects of type ns3::Time */ - - ATTRIBUTE_VALUE_DEFINE (Time); + +/** + * Attribute accessor function for Time + * @{ + */ ATTRIBUTE_ACCESSOR_DEFINE (Time); +/**@}*/ /** - * \brief Helper to make a Time checker with bounded range. - * Both limits are inclusive + * \ingroup time + * \brief Helper to make a Time checker with bounded range. + * Both limits are inclusive * - * \return the AttributeChecker + * \param [in] min Minimum allowed value. + * \param [in] max Maximum allowed value. + * \return the AttributeChecker */ Ptr MakeTimeChecker (const Time min, const Time max); /** + * \ingroup time * \brief Helper to make an unbounded Time checker. * * \return the AttributeChecker @@ -1028,8 +942,10 @@ } /** + * \ingroup time * \brief Helper to make a Time checker with a lower bound. * + * \param [in] min Minimum allowed value. * \return the AttributeChecker */ inline @@ -1060,8 +976,13 @@ Time m_time; //!< The time Time::Unit m_unit; //!< The unit to use in output - /// Output streamer - friend std::ostream & operator << (std::ostream & os, const TimeWithUnit & time); + /** + * Output streamer + * \param [in] os The stream. + * \param [in] timeU The Time with desired unit + * \returns The stream. + */ + friend std::ostream & operator << (std::ostream & os, const TimeWithUnit & timeU); }; // class TimeWithUnit diff -Naur ns-3.20/src/core/model/random-variable-stream.cc ns-3.21/src/core/model/random-variable-stream.cc --- ns-3.20/src/core/model/random-variable-stream.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/core/model/random-variable-stream.cc 2014-09-17 20:03:14.000000000 -0700 @@ -184,7 +184,7 @@ { NS_LOG_FUNCTION (this << min << max); NS_ASSERT (min <= max); - return static_cast ( GetValue (min, max + 1) ); + return static_cast ( GetValue ((double) (min), (double) (max) + 1.0) ); } double diff -Naur ns-3.20/src/core/model/test.h ns-3.21/src/core/model/test.h --- ns-3.20/src/core/model/test.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/core/model/test.h 2014-09-17 20:03:14.000000000 -0700 @@ -735,6 +735,31 @@ /** * \ingroup testing + * \brief Test that an actual value is less than or equal to a limit and report + * and abort if not. + * \internal + */ +#define NS_TEST_ASSERT_MSG_LT_OR_EQ_INTERNAL(actual, limit, msg, file, line) \ + do { \ + if (!((actual) <= (limit))) \ + { \ + ASSERT_ON_FAILURE; \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit; \ + ReportTestFailure (std::string (#actual) + " (actual) < " + \ + std::string (#limit) + " (limit)", \ + actualStream.str (), limitStream.str (), \ + msgStream.str (), file, line); \ + CONTINUE_ON_FAILURE; \ + } \ + } while (false) + +/** + * \ingroup testing * * \brief Test that an actual value is less than a limit and report and abort * if not. @@ -755,6 +780,26 @@ /** * \ingroup testing + * + * \brief Test that an actual value is less than or equal to a limit and + * report and abort if not. + * + * Check to see if the actual value found in a test case is less than or equal + * to the limit value. If the actual value is lesser or equal nothing happens, + * but if the check fails, an error is reported in a consistent way and the + * execution of the current test case is aborted. + * + * The message is interpreted as a stream. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the limit value of the test. + * \param msg Message that is output if the test does not pass. + */ +#define NS_TEST_ASSERT_MSG_LT_OR_EQ(actual, limit, msg) \ + NS_TEST_ASSERT_MSG_LT_OR_EQ_INTERNAL (actual, limit, msg, __FILE__, __LINE__) + +/** + * \ingroup testing * \brief Test that an actual value is less than a limit and report if not. * * Required to avoid use of return statement which allows use in methods @@ -781,6 +826,33 @@ /** * \ingroup testing + * \brief Test that an actual value is less than or equal to a limit and report + * if not. + * + * Required to avoid use of return statement which allows use in methods + * (callbacks) returning void. + * \internal + */ +#define NS_TEST_EXPECT_MSG_LT_OR_EQ_INTERNAL(actual, limit, msg, file, line) \ + do { \ + if (!((actual) <= (limit))) \ + { \ + ASSERT_ON_FAILURE; \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit; \ + ReportTestFailure (std::string (#actual) + " (actual) < " + \ + std::string (#limit) + " (limit)", \ + actualStream.str (), limitStream.str (), \ + msgStream.str (), file, line); \ + } \ + } while (false) + +/** + * \ingroup testing * * \brief Test that an actual value is less than a limit and report if not. * @@ -798,6 +870,26 @@ #define NS_TEST_EXPECT_MSG_LT(actual, limit, msg) \ NS_TEST_EXPECT_MSG_LT_INTERNAL (actual, limit, msg, __FILE__, __LINE__) +/** + * \ingroup testing + * + * \brief Test that an actual value is less than or equal to a limit and report + * if not. + * + * Check to see if the actual value found in a test case is less than or equal to + * the limit value. If the actual value is lesser or equal nothing happens, but + * if the check fails, an error is reported in a consistent way. EXPECT* macros + * do not return if an error is detected. + * + * The message is interpreted as a stream. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the limit value of the test. + * \param msg Message that is output if the test does not pass. + */ +#define NS_TEST_EXPECT_MSG_LT_OR_EQ(actual, limit, msg) \ + NS_TEST_EXPECT_MSG_LT_OR_EQ_INTERNAL (actual, limit, msg, __FILE__, __LINE__) + // =========================================================================== // Test for greater than relation // =========================================================================== @@ -829,6 +921,31 @@ /** * \ingroup testing + * \brief Test that an actual value is greater than or equal to a limit and + * report and abort if not. + * \internal + */ +#define NS_TEST_ASSERT_MSG_GT_OR_EQ_INTERNAL(actual, limit, msg, file, line) \ + do { \ + if (!((actual) >= (limit))) \ + { \ + ASSERT_ON_FAILURE; \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit; \ + ReportTestFailure (std::string (#actual) + " (actual) > " + \ + std::string (#limit) + " (limit)", \ + actualStream.str (), limitStream.str (), \ + msgStream.str (), file, line); \ + CONTINUE_ON_FAILURE; \ + } \ + } while (false) + +/** + * \ingroup testing * * \brief Test that an actual value is greater than a limit and report and abort * if not. @@ -849,6 +966,26 @@ /** * \ingroup testing + * + * \brief Test that an actual value is greater than or equal to a limit and + * report and abort if not. + * + * Check to see if the actual value found in a test case is greater than or + * equal to the limit value. If the actual value is greater nothing happens, but + * if the check fails, an error is reported in a consistent way and the execution + * of the current test case is aborted. + * + * The message is interpreted as a stream. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the limit value of the test. + * \param msg Message that is output if the test does not pass. + */ +#define NS_TEST_ASSERT_MSG_GT_OR_EQ(actual, limit, msg) \ + NS_TEST_ASSERT_MSG_GT_OR_EQ_INTERNAL (actual, limit, msg, __FILE__, __LINE__) + +/** + * \ingroup testing * \brief Test that an actual value is greater than a limit and report if not. * * Required to avoid use of return statement which allows use in methods @@ -875,6 +1012,33 @@ /** * \ingroup testing + * \brief Test that an actual value is greater than a or equal to limit and + * report if not. + * + * Required to avoid use of return statement which allows use in methods + * (callbacks) returning void. + * \internal + */ +#define NS_TEST_EXPECT_MSG_GT_OR_EQ_INTERNAL(actual, limit, msg, file, line) \ + do { \ + if (!((actual) >= (limit))) \ + { \ + ASSERT_ON_FAILURE; \ + std::ostringstream msgStream; \ + msgStream << msg; \ + std::ostringstream actualStream; \ + actualStream << actual; \ + std::ostringstream limitStream; \ + limitStream << limit; \ + ReportTestFailure (std::string (#actual) + " (actual) > " + \ + std::string (#limit) + " (limit)", \ + actualStream.str (), limitStream.str (), \ + msgStream.str (), file, line); \ + } \ + } while (false) + +/** + * \ingroup testing * * \brief Test that an actual value is greater than a limit and report if not. * @@ -892,6 +1056,26 @@ #define NS_TEST_EXPECT_MSG_GT(actual, limit, msg) \ NS_TEST_EXPECT_MSG_GT_INTERNAL (actual, limit, msg, __FILE__, __LINE__) +/** + * \ingroup testing + * + * \brief Test that an actual value is greater than or equal to limit and report + * if not. + * + * Check to see if the actual value found in a test case is greater than or + * equal to the limit value. If the actual value is greater nothing happens, + * but if the check fails, an error is reported in a consistent way. EXPECT* macros do + * not return if an error is detected. + * + * The message is interpreted as a stream. + * + * \param actual Expression for the actual value found during the test. + * \param limit Expression for the limit value of the test. + * \param msg Message that is output if the test does not pass. + */ +#define NS_TEST_EXPECT_MSG_GT_OR_EQ(actual, limit, msg) \ + NS_TEST_EXPECT_MSG_GT_OR_EQ_INTERNAL (actual, limit, msg, __FILE__, __LINE__) + namespace ns3 { /** diff -Naur ns-3.20/src/core/model/time.cc ns-3.21/src/core/model/time.cc --- ns-3.20/src/core/model/time.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/core/model/time.cc 2014-09-17 20:03:14.000000000 -0700 @@ -44,6 +44,8 @@ * \internal * Get mutex for critical sections around modification of Time::g_markingTimes * + * \returns The static mutex to control access to Time::g_markingTimes. + * * \relates Time */ SystemMutex & @@ -387,8 +389,8 @@ } -std::ostream& -operator<< (std::ostream& os, const Time & time) +std::ostream & +operator << (std::ostream & os, const Time & time) { os << time.As (Time::GetResolution ()); return os; @@ -427,7 +429,8 @@ } -std::istream& operator>> (std::istream& is, Time & time) +std::istream & +operator >> (std::istream & is, Time & time) { std::string value; is >> value; diff -Naur ns-3.20/src/core/test/config-test-suite.cc ns-3.21/src/core/test/config-test-suite.cc --- ns-3.20/src/core/test/config-test-suite.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/core/test/config-test-suite.cc 2014-09-17 20:03:14.000000000 -0700 @@ -138,6 +138,68 @@ return m_b; } +// Other test objects +// + +class DerivedConfigTestObject : public ConfigTestObject +{ +public: + static TypeId GetTypeId (void); + DerivedConfigTestObject (void) {} + virtual ~DerivedConfigTestObject (void) {} +}; + +TypeId +DerivedConfigTestObject::GetTypeId (void) +{ + static TypeId tid = TypeId ("DerivedConfigTestObject") + .SetParent () + ; + return tid; +} + +class BaseConfigObject : public Object +{ +public: + static TypeId GetTypeId (void); + BaseConfigObject (void) : m_x(15) {} + virtual ~BaseConfigObject (void) {} +private: + int8_t m_x; + void Increment (void) { m_x++; } // silence unused variable warning +}; + +TypeId +BaseConfigObject::GetTypeId (void) +{ + static TypeId tid = TypeId ("BaseConfigObject") + .SetParent () + .AddAttribute ("X", "", + IntegerValue (10), + MakeIntegerAccessor (&BaseConfigObject::m_x), + MakeIntegerChecker ()) + ; + return tid; +} + +class DerivedConfigObject : public BaseConfigObject +{ +public: + static TypeId GetTypeId (void); + DerivedConfigObject (void) {} + virtual ~DerivedConfigObject (void) {} +}; + +TypeId +DerivedConfigObject::GetTypeId (void) +{ + static TypeId tid = TypeId ("DerivedConfigObject") + .SetParent () + ; + return tid; +} + + // =========================================================================== // Test for the ability to register and use a root namespace // =========================================================================== @@ -607,6 +669,58 @@ } // =========================================================================== +// Test for the ability to search attributes of parent classes +// when Resolver searches for attributes in a derived class object. +// This test passes with the patch found in +// https://www.nsnam.org/bugzilla/show_bug.cgi?id=1673 +// (also reported in https://www.nsnam.org/bugzilla/show_bug.cgi?id=1959) +// =========================================================================== +class SearchAttributesOfParentObjectsTestCase : public TestCase +{ +public: + SearchAttributesOfParentObjectsTestCase (); + virtual ~SearchAttributesOfParentObjectsTestCase () {} + +private: + virtual void DoRun (void); + +}; + +SearchAttributesOfParentObjectsTestCase::SearchAttributesOfParentObjectsTestCase () + : TestCase ("Check that attributes of base class are searchable from paths including objects of derived class") +{ +} + +void +SearchAttributesOfParentObjectsTestCase::DoRun (void) +{ + IntegerValue iv; + // + // Create a root namespace object that doesn't have attributes but + // whose parent class has 'NodeA' attribute + // + Ptr root = CreateObject (); + Config::RegisterRootNamespaceObject (root); + + // + // Instantiate /NodeA + // + Ptr a = CreateObject (); + root->SetNodeA (a); + + // + // BaseConfigObject has attribute X, but we aggregate DerivedConfigObject + // instead + // + Ptr derived = CreateObject (); + a->AggregateObject (derived); + Config::Set ("/NodeA/$DerivedConfigObject/X", IntegerValue (42)); + derived->GetAttribute ("X", iv); + NS_TEST_ASSERT_MSG_EQ (iv.Get (), 42, "Object Attribute \"X\" not settable in derived class"); + +} + +// =========================================================================== // The Test Suite that glues all of the Test Cases together. // =========================================================================== class ConfigTestSuite : public TestSuite @@ -621,6 +735,7 @@ AddTestCase (new RootNamespaceConfigTestCase, TestCase::QUICK); AddTestCase (new UnderRootNamespaceConfigTestCase, TestCase::QUICK); AddTestCase (new ObjectVectorConfigTestCase, TestCase::QUICK); + AddTestCase (new SearchAttributesOfParentObjectsTestCase, TestCase::QUICK); } static ConfigTestSuite configTestSuite; diff -Naur ns-3.20/src/core/test/random-variable-stream-test-suite.cc ns-3.21/src/core/test/random-variable-stream-test-suite.cc --- ns-3.20/src/core/test/random-variable-stream-test-suite.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/core/test/random-variable-stream-test-suite.cc 2014-09-17 20:03:14.000000000 -0700 @@ -162,6 +162,40 @@ NS_TEST_ASSERT_MSG_LT (value, max, "Value greater than or equal to maximum."); } + // Boundary checking on GetInteger; should be [min,max]; from bug 1964 + static const uint32_t UNIFORM_INTEGER_MIN = 0; + static const uint32_t UNIFORM_INTEGER_MAX = 4294967295U; + // [0,0] should return 0 + uint32_t intValue; + intValue = x->GetInteger (UNIFORM_INTEGER_MIN, UNIFORM_INTEGER_MIN); + NS_TEST_ASSERT_MSG_EQ (intValue, UNIFORM_INTEGER_MIN, "Uniform RV GetInteger boundary testing"); + // [UNIFORM_INTEGER_MAX, UNIFORM_INTEGER_MAX] should return UNIFORM_INTEGER_MAX + intValue = x->GetInteger (UNIFORM_INTEGER_MAX, UNIFORM_INTEGER_MAX); + NS_TEST_ASSERT_MSG_EQ (intValue, UNIFORM_INTEGER_MAX, "Uniform RV GetInteger boundary testing"); + // [0,1] should return mix of 0 or 1 + intValue = 0; + for (int i = 0; i < 20; i++) + { + intValue += x->GetInteger (UNIFORM_INTEGER_MIN, UNIFORM_INTEGER_MIN + 1); + } + NS_TEST_ASSERT_MSG_GT (intValue, 0, "Uniform RV GetInteger boundary testing"); + NS_TEST_ASSERT_MSG_LT (intValue, 20, "Uniform RV GetInteger boundary testing"); + // [MAX-1,MAX] should return mix of MAX-1 or MAX + uint32_t count = 0; + for (int i = 0; i < 20; i++) + { + intValue = x->GetInteger (UNIFORM_INTEGER_MAX - 1, UNIFORM_INTEGER_MAX); + if (intValue == UNIFORM_INTEGER_MAX) + { + count++; + } + } + NS_TEST_ASSERT_MSG_GT (count, 0, "Uniform RV GetInteger boundary testing"); + NS_TEST_ASSERT_MSG_LT (count, 20, "Uniform RV GetInteger boundary testing"); + // multiple [0,UNIFORM_INTEGER_MAX] should return non-zero + intValue = x->GetInteger (UNIFORM_INTEGER_MIN, UNIFORM_INTEGER_MAX); + uint32_t intValue2 = x->GetInteger (UNIFORM_INTEGER_MIN, UNIFORM_INTEGER_MAX); + NS_TEST_ASSERT_MSG_GT (intValue + intValue2, 0, "Uniform RV GetInteger boundary testing"); } diff -Naur ns-3.20/src/csma/bindings/modulegen__gcc_ILP32.py ns-3.21/src/csma/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/csma/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/csma/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -3351,10 +3351,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -3365,25 +3365,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -3500,20 +3500,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/csma/bindings/modulegen__gcc_LP64.py ns-3.21/src/csma/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/csma/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/csma/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -3351,10 +3351,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -3365,25 +3365,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -3500,20 +3500,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/csma/examples/wscript ns-3.21/src/csma/examples/wscript --- ns-3.20/src/csma/examples/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/csma/examples/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -1,19 +1,19 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - obj = bld.create_ns3_program('csma-one-subnet', ['csma', 'internet']) + obj = bld.create_ns3_program('csma-one-subnet', ['csma', 'internet', 'applications']) obj.source = 'csma-one-subnet.cc' - obj = bld.create_ns3_program('csma-broadcast', ['csma', 'internet']) + obj = bld.create_ns3_program('csma-broadcast', ['csma', 'internet', 'applications']) obj.source = 'csma-broadcast.cc' - obj = bld.create_ns3_program('csma-packet-socket', ['csma', 'internet']) + obj = bld.create_ns3_program('csma-packet-socket', ['csma', 'internet', 'applications']) obj.source = 'csma-packet-socket.cc' - obj = bld.create_ns3_program('csma-multicast', ['csma', 'internet']) + obj = bld.create_ns3_program('csma-multicast', ['csma', 'internet', 'applications']) obj.source = 'csma-multicast.cc' - obj = bld.create_ns3_program('csma-raw-ip-socket', ['csma', 'internet']) + obj = bld.create_ns3_program('csma-raw-ip-socket', ['csma', 'internet', 'applications']) obj.source = 'csma-raw-ip-socket.cc' obj = bld.create_ns3_program('csma-ping', ['csma', 'internet', 'applications']) diff -Naur ns-3.20/src/csma/wscript ns-3.21/src/csma/wscript --- ns-3.20/src/csma/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/csma/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -1,7 +1,7 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - obj = bld.create_ns3_module('csma', ['network', 'applications']) + obj = bld.create_ns3_module('csma', ['network']) obj.source = [ 'model/backoff.cc', 'model/csma-net-device.cc', diff -Naur ns-3.20/src/csma-layout/bindings/modulegen__gcc_ILP32.py ns-3.21/src/csma-layout/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/csma-layout/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/csma-layout/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -4812,10 +4812,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -4826,25 +4826,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -4961,20 +4961,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/csma-layout/bindings/modulegen__gcc_LP64.py ns-3.21/src/csma-layout/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/csma-layout/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/csma-layout/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -4812,10 +4812,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -4826,25 +4826,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -4961,20 +4961,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/csma-layout/wscript ns-3.21/src/csma-layout/wscript --- ns-3.20/src/csma-layout/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/csma-layout/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -1,7 +1,7 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - obj = bld.create_ns3_module('csma-layout', ['csma', 'network', 'applications', 'netanim', 'point-to-point']) + obj = bld.create_ns3_module('csma-layout', ['csma', 'network', 'internet']) obj.source = [ 'model/csma-star-helper.cc', ] diff -Naur ns-3.20/src/dsdv/bindings/modulegen__gcc_ILP32.py ns-3.21/src/dsdv/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/dsdv/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/dsdv/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -3862,10 +3862,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -3876,25 +3876,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -4011,20 +4011,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/dsdv/bindings/modulegen__gcc_LP64.py ns-3.21/src/dsdv/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/dsdv/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/dsdv/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -3862,10 +3862,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -3876,25 +3876,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -4011,20 +4011,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/dsdv/examples/wscript ns-3.21/src/dsdv/examples/wscript --- ns-3.20/src/dsdv/examples/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/dsdv/examples/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -1,6 +1,6 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - obj = bld.create_ns3_program('dsdv-manet', ['wifi', 'internet', 'dsdv']) + obj = bld.create_ns3_program('dsdv-manet', ['wifi', 'internet', 'dsdv', 'applications']) obj.source = 'dsdv-manet.cc' diff -Naur ns-3.20/src/dsdv/model/dsdv-routing-protocol.cc ns-3.21/src/dsdv/model/dsdv-routing-protocol.cc --- ns-3.20/src/dsdv/model/dsdv-routing-protocol.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/dsdv/model/dsdv-routing-protocol.cc 2014-09-17 20:03:14.000000000 -0700 @@ -956,8 +956,8 @@ Ptr socket = Socket::CreateSocket (GetObject (),UdpSocketFactory::GetTypeId ()); NS_ASSERT (socket != 0); socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvDsdv,this)); - socket->BindToNetDevice (l3->GetNetDevice (i)); socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), DSDV_PORT)); + socket->BindToNetDevice (l3->GetNetDevice (i)); socket->SetAllowBroadcast (true); socket->SetAttribute ("IpTtl",UintegerValue (1)); m_socketAddresses.insert (std::make_pair (socket,iface)); @@ -1013,9 +1013,9 @@ Ptr socket = Socket::CreateSocket (GetObject (),UdpSocketFactory::GetTypeId ()); NS_ASSERT (socket != 0); socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvDsdv,this)); - socket->BindToNetDevice (l3->GetNetDevice (i)); // Bind to any IP address so that broadcasts can be received socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), DSDV_PORT)); + socket->BindToNetDevice (l3->GetNetDevice (i)); socket->SetAllowBroadcast (true); m_socketAddresses.insert (std::make_pair (socket,iface)); Ptr dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (iface.GetLocal ())); diff -Naur ns-3.20/src/dsdv/wscript ns-3.21/src/dsdv/wscript --- ns-3.20/src/dsdv/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/dsdv/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -1,7 +1,7 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - module = bld.create_ns3_module('dsdv', ['internet', 'wifi', 'mesh', 'applications']) + module = bld.create_ns3_module('dsdv', ['internet']) module.includes = '.' module.source = [ 'model/dsdv-rtable.cc', diff -Naur ns-3.20/src/dsr/bindings/modulegen__gcc_ILP32.py ns-3.21/src/dsr/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/dsr/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/dsr/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -313,7 +313,7 @@ ## wifi-phy.h (module 'wifi'): ns3::WifiPhy [class] module.add_class('WifiPhy', import_from_module='ns.wifi', parent=root_module['ns3::Object']) ## wifi-phy.h (module 'wifi'): ns3::WifiPhy::State [enumeration] - module.add_enum('State', ['IDLE', 'CCA_BUSY', 'TX', 'RX', 'SWITCHING'], outer_class=root_module['ns3::WifiPhy'], import_from_module='ns.wifi') + module.add_enum('State', ['IDLE', 'CCA_BUSY', 'TX', 'RX', 'SWITCHING', 'SLEEP'], outer_class=root_module['ns3::WifiPhy'], import_from_module='ns.wifi') ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationManager [class] module.add_class('WifiRemoteStationManager', import_from_module='ns.wifi', parent=root_module['ns3::Object']) ## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable [class] @@ -3199,15 +3199,25 @@ 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifySleep() [member function] + cls.add_method('NotifySleep', + 'void', + [], + is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifySwitchingStart(ns3::Time duration) [member function] cls.add_method('NotifySwitchingStart', 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) - ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyTxStart(ns3::Time duration) [member function] + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyTxStart(ns3::Time duration, double txPowerDbm) [member function] cls.add_method('NotifyTxStart', 'void', - [param('ns3::Time', 'duration')], + [param('ns3::Time', 'duration'), param('double', 'txPowerDbm')], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyWakeup() [member function] + cls.add_method('NotifyWakeup', + 'void', + [], is_pure_virtual=True, is_virtual=True) return @@ -4940,10 +4950,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -4954,25 +4964,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -5089,20 +5099,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return @@ -6534,6 +6544,11 @@ 'bool', [], is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateSleep() [member function] + cls.add_method('IsStateSleep', + 'bool', + [], + is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateSwitching() [member function] cls.add_method('IsStateSwitching', 'bool', @@ -6586,10 +6601,15 @@ 'void', [param('ns3::WifiPhyListener *', 'listener')], is_pure_virtual=True, is_virtual=True) - ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SendPacket(ns3::Ptr packet, ns3::WifiMode mode, ns3::WifiPreamble preamble, ns3::WifiTxVector txvector) [member function] + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::ResumeFromSleep() [member function] + cls.add_method('ResumeFromSleep', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SendPacket(ns3::Ptr packet, ns3::WifiTxVector txvector, ns3::WifiPreamble preamble) [member function] cls.add_method('SendPacket', 'void', - [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble'), param('ns3::WifiTxVector', 'txvector')], + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiTxVector', 'txvector'), param('ns3::WifiPreamble', 'preamble')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetChannelBonding(bool channelbonding) [member function] cls.add_method('SetChannelBonding', @@ -6641,6 +6661,11 @@ 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, double, ns3::WifiMode, ns3::WifiPreamble, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetSleepMode() [member function] + cls.add_method('SetSleepMode', + 'void', + [], + is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetStbc(bool stbc) [member function] cls.add_method('SetStbc', 'void', diff -Naur ns-3.20/src/dsr/bindings/modulegen__gcc_LP64.py ns-3.21/src/dsr/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/dsr/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/dsr/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -313,7 +313,7 @@ ## wifi-phy.h (module 'wifi'): ns3::WifiPhy [class] module.add_class('WifiPhy', import_from_module='ns.wifi', parent=root_module['ns3::Object']) ## wifi-phy.h (module 'wifi'): ns3::WifiPhy::State [enumeration] - module.add_enum('State', ['IDLE', 'CCA_BUSY', 'TX', 'RX', 'SWITCHING'], outer_class=root_module['ns3::WifiPhy'], import_from_module='ns.wifi') + module.add_enum('State', ['IDLE', 'CCA_BUSY', 'TX', 'RX', 'SWITCHING', 'SLEEP'], outer_class=root_module['ns3::WifiPhy'], import_from_module='ns.wifi') ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationManager [class] module.add_class('WifiRemoteStationManager', import_from_module='ns.wifi', parent=root_module['ns3::Object']) ## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable [class] @@ -3199,15 +3199,25 @@ 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifySleep() [member function] + cls.add_method('NotifySleep', + 'void', + [], + is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifySwitchingStart(ns3::Time duration) [member function] cls.add_method('NotifySwitchingStart', 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) - ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyTxStart(ns3::Time duration) [member function] + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyTxStart(ns3::Time duration, double txPowerDbm) [member function] cls.add_method('NotifyTxStart', 'void', - [param('ns3::Time', 'duration')], + [param('ns3::Time', 'duration'), param('double', 'txPowerDbm')], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyWakeup() [member function] + cls.add_method('NotifyWakeup', + 'void', + [], is_pure_virtual=True, is_virtual=True) return @@ -4940,10 +4950,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -4954,25 +4964,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -5089,20 +5099,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return @@ -6534,6 +6544,11 @@ 'bool', [], is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateSleep() [member function] + cls.add_method('IsStateSleep', + 'bool', + [], + is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateSwitching() [member function] cls.add_method('IsStateSwitching', 'bool', @@ -6586,10 +6601,15 @@ 'void', [param('ns3::WifiPhyListener *', 'listener')], is_pure_virtual=True, is_virtual=True) - ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SendPacket(ns3::Ptr packet, ns3::WifiMode mode, ns3::WifiPreamble preamble, ns3::WifiTxVector txvector) [member function] + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::ResumeFromSleep() [member function] + cls.add_method('ResumeFromSleep', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SendPacket(ns3::Ptr packet, ns3::WifiTxVector txvector, ns3::WifiPreamble preamble) [member function] cls.add_method('SendPacket', 'void', - [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble'), param('ns3::WifiTxVector', 'txvector')], + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiTxVector', 'txvector'), param('ns3::WifiPreamble', 'preamble')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetChannelBonding(bool channelbonding) [member function] cls.add_method('SetChannelBonding', @@ -6641,6 +6661,11 @@ 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, double, ns3::WifiMode, ns3::WifiPreamble, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetSleepMode() [member function] + cls.add_method('SetSleepMode', + 'void', + [], + is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetStbc(bool stbc) [member function] cls.add_method('SetStbc', 'void', diff -Naur ns-3.20/src/dsr/wscript ns-3.21/src/dsr/wscript --- ns-3.20/src/dsr/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/dsr/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -1,7 +1,7 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - module = bld.create_ns3_module('dsr', ['internet', 'wifi', 'mesh', 'applications']) + module = bld.create_ns3_module('dsr', ['internet', 'wifi']) module.includes = '.' module.source = [ 'model/dsr-routing.cc', diff -Naur ns-3.20/src/emu/bindings/modulegen__gcc_ILP32.py ns-3.21/src/emu/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/emu/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/emu/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -3072,10 +3072,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -3086,25 +3086,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -3221,20 +3221,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/emu/bindings/modulegen__gcc_LP64.py ns-3.21/src/emu/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/emu/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/emu/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -3072,10 +3072,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -3086,25 +3086,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -3221,20 +3221,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/energy/bindings/callbacks_list.py ns-3.21/src/energy/bindings/callbacks_list.py --- ns-3.20/src/energy/bindings/callbacks_list.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/bindings/callbacks_list.py 2014-09-17 20:03:14.000000000 -0700 @@ -1,5 +1,6 @@ callback_classes = [ ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], + ['void', 'double', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr', 'ns3::Ptr', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ] diff -Naur ns-3.20/src/energy/bindings/modulegen__gcc_ILP32.py ns-3.21/src/energy/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/energy/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -56,6 +56,8 @@ module.add_class('DeviceEnergyModelContainer') ## energy-model-helper.h (module 'energy'): ns3::DeviceEnergyModelHelper [class] module.add_class('DeviceEnergyModelHelper', allow_subclassing=True) + ## energy-harvester-helper.h (module 'energy'): ns3::EnergyHarvesterHelper [class] + module.add_class('EnergyHarvesterHelper', allow_subclassing=True) ## energy-model-helper.h (module 'energy'): ns3::EnergySourceHelper [class] module.add_class('EnergySourceHelper', allow_subclassing=True) ## event-id.h (module 'core'): ns3::EventId [class] @@ -140,6 +142,8 @@ module.add_class('int64x64_t', import_from_module='ns.core') ## int64x64-double.h (module 'core'): ns3::int64x64_t::impl_type [enumeration] module.add_enum('impl_type', ['int128_impl', 'cairo_impl', 'ld_impl'], outer_class=root_module['ns3::int64x64_t'], import_from_module='ns.core') + ## basic-energy-harvester-helper.h (module 'energy'): ns3::BasicEnergyHarvesterHelper [class] + module.add_class('BasicEnergyHarvesterHelper', parent=root_module['ns3::EnergyHarvesterHelper']) ## basic-energy-source-helper.h (module 'energy'): ns3::BasicEnergySourceHelper [class] module.add_class('BasicEnergySourceHelper', parent=root_module['ns3::EnergySourceHelper']) ## chunk.h (module 'network'): ns3::Chunk [class] @@ -150,6 +154,10 @@ module.add_class('Object', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >']) ## object.h (module 'core'): ns3::Object::AggregateIterator [class] module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object']) + ## random-variable-stream.h (module 'core'): ns3::RandomVariableStream [class] + module.add_class('RandomVariableStream', import_from_module='ns.core', parent=root_module['ns3::Object']) + ## random-variable-stream.h (module 'core'): ns3::SequentialRandomVariable [class] + module.add_class('SequentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount > [class] @@ -182,10 +190,22 @@ root_module['ns3::TracedValue< ns3::Time >'].implicitly_converts_to(root_module['ns3::Time']) ## trailer.h (module 'network'): ns3::Trailer [class] module.add_class('Trailer', import_from_module='ns.network', parent=root_module['ns3::Chunk']) + ## random-variable-stream.h (module 'core'): ns3::TriangularRandomVariable [class] + module.add_class('TriangularRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) + ## random-variable-stream.h (module 'core'): ns3::UniformRandomVariable [class] + module.add_class('UniformRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) + ## random-variable-stream.h (module 'core'): ns3::WeibullRandomVariable [class] + module.add_class('WeibullRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## wifi-phy.h (module 'wifi'): ns3::WifiPhy [class] module.add_class('WifiPhy', import_from_module='ns.wifi', parent=root_module['ns3::Object']) ## wifi-phy.h (module 'wifi'): ns3::WifiPhy::State [enumeration] - module.add_enum('State', ['IDLE', 'CCA_BUSY', 'TX', 'RX', 'SWITCHING'], outer_class=root_module['ns3::WifiPhy'], import_from_module='ns.wifi') + module.add_enum('State', ['IDLE', 'CCA_BUSY', 'TX', 'RX', 'SWITCHING', 'SLEEP'], outer_class=root_module['ns3::WifiPhy'], import_from_module='ns.wifi') + ## wifi-tx-current-model.h (module 'energy'): ns3::WifiTxCurrentModel [class] + module.add_class('WifiTxCurrentModel', parent=root_module['ns3::Object']) + ## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable [class] + module.add_class('ZetaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) + ## random-variable-stream.h (module 'core'): ns3::ZipfRandomVariable [class] + module.add_class('ZipfRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## attribute.h (module 'core'): ns3::AttributeAccessor [class] module.add_class('AttributeAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter >']) ## attribute.h (module 'core'): ns3::AttributeChecker [class] @@ -202,12 +222,22 @@ module.add_class('CallbackImplBase', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter >']) ## callback.h (module 'core'): ns3::CallbackValue [class] module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) + ## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable [class] + module.add_class('ConstantRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) + ## random-variable-stream.h (module 'core'): ns3::DeterministicRandomVariable [class] + module.add_class('DeterministicRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## device-energy-model.h (module 'energy'): ns3::DeviceEnergyModel [class] module.add_class('DeviceEnergyModel', parent=root_module['ns3::Object']) ## double.h (module 'core'): ns3::DoubleValue [class] module.add_class('DoubleValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) + ## random-variable-stream.h (module 'core'): ns3::EmpiricalRandomVariable [class] + module.add_class('EmpiricalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## attribute.h (module 'core'): ns3::EmptyAttributeValue [class] module.add_class('EmptyAttributeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) + ## energy-harvester.h (module 'energy'): ns3::EnergyHarvester [class] + module.add_class('EnergyHarvester', parent=root_module['ns3::Object']) + ## energy-harvester-container.h (module 'energy'): ns3::EnergyHarvesterContainer [class] + module.add_class('EnergyHarvesterContainer', parent=root_module['ns3::Object']) ## energy-source.h (module 'energy'): ns3::EnergySource [class] module.add_class('EnergySource', parent=root_module['ns3::Object']) ## energy-source-container.h (module 'energy'): ns3::EnergySourceContainer [class] @@ -216,8 +246,14 @@ module.add_class('EnumChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## enum.h (module 'core'): ns3::EnumValue [class] module.add_class('EnumValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) + ## random-variable-stream.h (module 'core'): ns3::ErlangRandomVariable [class] + module.add_class('ErlangRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## event-impl.h (module 'core'): ns3::EventImpl [class] module.add_class('EventImpl', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter >']) + ## random-variable-stream.h (module 'core'): ns3::ExponentialRandomVariable [class] + module.add_class('ExponentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) + ## random-variable-stream.h (module 'core'): ns3::GammaRandomVariable [class] + module.add_class('GammaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## integer.h (module 'core'): ns3::IntegerValue [class] module.add_class('IntegerValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker [class] @@ -238,6 +274,10 @@ module.add_class('Ipv6PrefixValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) ## li-ion-energy-source.h (module 'energy'): ns3::LiIonEnergySource [class] module.add_class('LiIonEnergySource', parent=root_module['ns3::EnergySource']) + ## wifi-tx-current-model.h (module 'energy'): ns3::LinearWifiTxCurrentModel [class] + module.add_class('LinearWifiTxCurrentModel', parent=root_module['ns3::WifiTxCurrentModel']) + ## random-variable-stream.h (module 'core'): ns3::LogNormalRandomVariable [class] + module.add_class('LogNormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## net-device.h (module 'network'): ns3::NetDevice [class] module.add_class('NetDevice', import_from_module='ns.network', parent=root_module['ns3::Object']) ## net-device.h (module 'network'): ns3::NetDevice::PacketType [enumeration] @@ -246,12 +286,16 @@ module.add_class('NixVector', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter >']) ## node.h (module 'network'): ns3::Node [class] module.add_class('Node', import_from_module='ns.network', parent=root_module['ns3::Object']) + ## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable [class] + module.add_class('NormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## object-factory.h (module 'core'): ns3::ObjectFactoryChecker [class] module.add_class('ObjectFactoryChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## object-factory.h (module 'core'): ns3::ObjectFactoryValue [class] module.add_class('ObjectFactoryValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## packet.h (module 'network'): ns3::Packet [class] module.add_class('Packet', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter >']) + ## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable [class] + module.add_class('ParetoRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## rv-battery-model.h (module 'energy'): ns3::RvBatteryModel [class] module.add_class('RvBatteryModel', parent=root_module['ns3::EnergySource']) ## simple-device-energy-model.h (module 'energy'): ns3::SimpleDeviceEnergyModel [class] @@ -274,6 +318,8 @@ module.add_class('AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) ## address.h (module 'network'): ns3::AddressValue [class] module.add_class('AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) + ## basic-energy-harvester.h (module 'energy'): ns3::BasicEnergyHarvester [class] + module.add_class('BasicEnergyHarvester', parent=root_module['ns3::EnergyHarvester']) ## basic-energy-source.h (module 'energy'): ns3::BasicEnergySource [class] module.add_class('BasicEnergySource', parent=root_module['ns3::EnergySource']) module.add_container('ns3::WifiModeList', 'ns3::WifiMode', container_type=u'vector') @@ -360,6 +406,7 @@ register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase']) register_Ns3DeviceEnergyModelContainer_methods(root_module, root_module['ns3::DeviceEnergyModelContainer']) register_Ns3DeviceEnergyModelHelper_methods(root_module, root_module['ns3::DeviceEnergyModelHelper']) + register_Ns3EnergyHarvesterHelper_methods(root_module, root_module['ns3::EnergyHarvesterHelper']) register_Ns3EnergySourceHelper_methods(root_module, root_module['ns3::EnergySourceHelper']) register_Ns3EventId_methods(root_module, root_module['ns3::EventId']) register_Ns3Hasher_methods(root_module, root_module['ns3::Hasher']) @@ -396,11 +443,14 @@ register_Ns3WifiTxVector_methods(root_module, root_module['ns3::WifiTxVector']) register_Ns3Empty_methods(root_module, root_module['ns3::empty']) register_Ns3Int64x64_t_methods(root_module, root_module['ns3::int64x64_t']) + register_Ns3BasicEnergyHarvesterHelper_methods(root_module, root_module['ns3::BasicEnergyHarvesterHelper']) register_Ns3BasicEnergySourceHelper_methods(root_module, root_module['ns3::BasicEnergySourceHelper']) register_Ns3Chunk_methods(root_module, root_module['ns3::Chunk']) register_Ns3Header_methods(root_module, root_module['ns3::Header']) register_Ns3Object_methods(root_module, root_module['ns3::Object']) register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator']) + register_Ns3RandomVariableStream_methods(root_module, root_module['ns3::RandomVariableStream']) + register_Ns3SequentialRandomVariable_methods(root_module, root_module['ns3::SequentialRandomVariable']) register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter >']) register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter >']) register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter >']) @@ -414,7 +464,13 @@ register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor']) register_Ns3TracedValue__Ns3Time_methods(root_module, root_module['ns3::TracedValue< ns3::Time >']) register_Ns3Trailer_methods(root_module, root_module['ns3::Trailer']) + register_Ns3TriangularRandomVariable_methods(root_module, root_module['ns3::TriangularRandomVariable']) + register_Ns3UniformRandomVariable_methods(root_module, root_module['ns3::UniformRandomVariable']) + register_Ns3WeibullRandomVariable_methods(root_module, root_module['ns3::WeibullRandomVariable']) register_Ns3WifiPhy_methods(root_module, root_module['ns3::WifiPhy']) + register_Ns3WifiTxCurrentModel_methods(root_module, root_module['ns3::WifiTxCurrentModel']) + register_Ns3ZetaRandomVariable_methods(root_module, root_module['ns3::ZetaRandomVariable']) + register_Ns3ZipfRandomVariable_methods(root_module, root_module['ns3::ZipfRandomVariable']) register_Ns3AttributeAccessor_methods(root_module, root_module['ns3::AttributeAccessor']) register_Ns3AttributeChecker_methods(root_module, root_module['ns3::AttributeChecker']) register_Ns3AttributeValue_methods(root_module, root_module['ns3::AttributeValue']) @@ -423,14 +479,22 @@ register_Ns3CallbackChecker_methods(root_module, root_module['ns3::CallbackChecker']) register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase']) register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue']) + register_Ns3ConstantRandomVariable_methods(root_module, root_module['ns3::ConstantRandomVariable']) + register_Ns3DeterministicRandomVariable_methods(root_module, root_module['ns3::DeterministicRandomVariable']) register_Ns3DeviceEnergyModel_methods(root_module, root_module['ns3::DeviceEnergyModel']) register_Ns3DoubleValue_methods(root_module, root_module['ns3::DoubleValue']) + register_Ns3EmpiricalRandomVariable_methods(root_module, root_module['ns3::EmpiricalRandomVariable']) register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue']) + register_Ns3EnergyHarvester_methods(root_module, root_module['ns3::EnergyHarvester']) + register_Ns3EnergyHarvesterContainer_methods(root_module, root_module['ns3::EnergyHarvesterContainer']) register_Ns3EnergySource_methods(root_module, root_module['ns3::EnergySource']) register_Ns3EnergySourceContainer_methods(root_module, root_module['ns3::EnergySourceContainer']) register_Ns3EnumChecker_methods(root_module, root_module['ns3::EnumChecker']) register_Ns3EnumValue_methods(root_module, root_module['ns3::EnumValue']) + register_Ns3ErlangRandomVariable_methods(root_module, root_module['ns3::ErlangRandomVariable']) register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl']) + register_Ns3ExponentialRandomVariable_methods(root_module, root_module['ns3::ExponentialRandomVariable']) + register_Ns3GammaRandomVariable_methods(root_module, root_module['ns3::GammaRandomVariable']) register_Ns3IntegerValue_methods(root_module, root_module['ns3::IntegerValue']) register_Ns3Ipv4AddressChecker_methods(root_module, root_module['ns3::Ipv4AddressChecker']) register_Ns3Ipv4AddressValue_methods(root_module, root_module['ns3::Ipv4AddressValue']) @@ -441,12 +505,16 @@ register_Ns3Ipv6PrefixChecker_methods(root_module, root_module['ns3::Ipv6PrefixChecker']) register_Ns3Ipv6PrefixValue_methods(root_module, root_module['ns3::Ipv6PrefixValue']) register_Ns3LiIonEnergySource_methods(root_module, root_module['ns3::LiIonEnergySource']) + register_Ns3LinearWifiTxCurrentModel_methods(root_module, root_module['ns3::LinearWifiTxCurrentModel']) + register_Ns3LogNormalRandomVariable_methods(root_module, root_module['ns3::LogNormalRandomVariable']) register_Ns3NetDevice_methods(root_module, root_module['ns3::NetDevice']) register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector']) register_Ns3Node_methods(root_module, root_module['ns3::Node']) + register_Ns3NormalRandomVariable_methods(root_module, root_module['ns3::NormalRandomVariable']) register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker']) register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue']) register_Ns3Packet_methods(root_module, root_module['ns3::Packet']) + register_Ns3ParetoRandomVariable_methods(root_module, root_module['ns3::ParetoRandomVariable']) register_Ns3RvBatteryModel_methods(root_module, root_module['ns3::RvBatteryModel']) register_Ns3SimpleDeviceEnergyModel_methods(root_module, root_module['ns3::SimpleDeviceEnergyModel']) register_Ns3TimeValue_methods(root_module, root_module['ns3::TimeValue']) @@ -458,6 +526,7 @@ register_Ns3WifiRadioEnergyModel_methods(root_module, root_module['ns3::WifiRadioEnergyModel']) register_Ns3AddressChecker_methods(root_module, root_module['ns3::AddressChecker']) register_Ns3AddressValue_methods(root_module, root_module['ns3::AddressValue']) + register_Ns3BasicEnergyHarvester_methods(root_module, root_module['ns3::BasicEnergyHarvester']) register_Ns3BasicEnergySource_methods(root_module, root_module['ns3::BasicEnergySource']) register_Ns3HashImplementation_methods(root_module, root_module['ns3::Hash::Implementation']) register_Ns3HashFunctionFnv1a_methods(root_module, root_module['ns3::Hash::Function::Fnv1a']) @@ -1028,6 +1097,38 @@ is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) return +def register_Ns3EnergyHarvesterHelper_methods(root_module, cls): + ## energy-harvester-helper.h (module 'energy'): ns3::EnergyHarvesterHelper::EnergyHarvesterHelper() [constructor] + cls.add_constructor([]) + ## energy-harvester-helper.h (module 'energy'): ns3::EnergyHarvesterHelper::EnergyHarvesterHelper(ns3::EnergyHarvesterHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EnergyHarvesterHelper const &', 'arg0')]) + ## energy-harvester-helper.h (module 'energy'): ns3::EnergyHarvesterContainer ns3::EnergyHarvesterHelper::Install(ns3::Ptr source) const [member function] + cls.add_method('Install', + 'ns3::EnergyHarvesterContainer', + [param('ns3::Ptr< ns3::EnergySource >', 'source')], + is_const=True) + ## energy-harvester-helper.h (module 'energy'): ns3::EnergyHarvesterContainer ns3::EnergyHarvesterHelper::Install(ns3::EnergySourceContainer sourceContainer) const [member function] + cls.add_method('Install', + 'ns3::EnergyHarvesterContainer', + [param('ns3::EnergySourceContainer', 'sourceContainer')], + is_const=True) + ## energy-harvester-helper.h (module 'energy'): ns3::EnergyHarvesterContainer ns3::EnergyHarvesterHelper::Install(std::string sourceName) const [member function] + cls.add_method('Install', + 'ns3::EnergyHarvesterContainer', + [param('std::string', 'sourceName')], + is_const=True) + ## energy-harvester-helper.h (module 'energy'): void ns3::EnergyHarvesterHelper::Set(std::string name, ns3::AttributeValue const & v) [member function] + cls.add_method('Set', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'v')], + is_pure_virtual=True, is_virtual=True) + ## energy-harvester-helper.h (module 'energy'): ns3::Ptr ns3::EnergyHarvesterHelper::DoInstall(ns3::Ptr source) const [member function] + cls.add_method('DoInstall', + 'ns3::Ptr< ns3::EnergyHarvester >', + [param('ns3::Ptr< ns3::EnergySource >', 'source')], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + return + def register_Ns3EnergySourceHelper_methods(root_module, cls): ## energy-model-helper.h (module 'energy'): ns3::EnergySourceHelper::EnergySourceHelper() [constructor] cls.add_constructor([]) @@ -2422,15 +2523,25 @@ 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifySleep() [member function] + cls.add_method('NotifySleep', + 'void', + [], + is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifySwitchingStart(ns3::Time duration) [member function] cls.add_method('NotifySwitchingStart', 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) - ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyTxStart(ns3::Time duration) [member function] + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyTxStart(ns3::Time duration, double txPowerDbm) [member function] cls.add_method('NotifyTxStart', 'void', - [param('ns3::Time', 'duration')], + [param('ns3::Time', 'duration'), param('double', 'txPowerDbm')], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyWakeup() [member function] + cls.add_method('NotifyWakeup', + 'void', + [], is_pure_virtual=True, is_virtual=True) return @@ -2448,6 +2559,14 @@ cls.add_method('SetDepletionCallback', 'void', [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## wifi-radio-energy-model-helper.h (module 'energy'): void ns3::WifiRadioEnergyModelHelper::SetRechargedCallback(ns3::Callback callback) [member function] + cls.add_method('SetRechargedCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## wifi-radio-energy-model-helper.h (module 'energy'): void ns3::WifiRadioEnergyModelHelper::SetTxCurrentModel(std::string name, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetTxCurrentModel', + 'void', + [param('std::string', 'name'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) ## wifi-radio-energy-model-helper.h (module 'energy'): ns3::Ptr ns3::WifiRadioEnergyModelHelper::DoInstall(ns3::Ptr device, ns3::Ptr source) const [member function] cls.add_method('DoInstall', 'ns3::Ptr< ns3::DeviceEnergyModel >', @@ -2480,20 +2599,34 @@ 'void', [param('ns3::Time', 'duration')], is_virtual=True) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::NotifySleep() [member function] + cls.add_method('NotifySleep', + 'void', + [], + is_virtual=True) ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::NotifySwitchingStart(ns3::Time duration) [member function] cls.add_method('NotifySwitchingStart', 'void', [param('ns3::Time', 'duration')], is_virtual=True) - ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::NotifyTxStart(ns3::Time duration) [member function] + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::NotifyTxStart(ns3::Time duration, double txPowerDbm) [member function] cls.add_method('NotifyTxStart', 'void', - [param('ns3::Time', 'duration')], + [param('ns3::Time', 'duration'), param('double', 'txPowerDbm')], + is_virtual=True) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::NotifyWakeup() [member function] + cls.add_method('NotifyWakeup', + 'void', + [], is_virtual=True) ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::SetChangeStateCallback(ns3::Callback callback) [member function] cls.add_method('SetChangeStateCallback', 'void', [param('ns3::Callback< void, int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::SetUpdateTxCurrentCallback(ns3::Callback callback) [member function] + cls.add_method('SetUpdateTxCurrentCallback', + 'void', + [param('ns3::Callback< void, double, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) return def register_Ns3WifiTxVector_methods(root_module, cls): @@ -2643,6 +2776,23 @@ cls.add_static_attribute('implementation', 'ns3::int64x64_t::impl_type const', is_const=True) return +def register_Ns3BasicEnergyHarvesterHelper_methods(root_module, cls): + ## basic-energy-harvester-helper.h (module 'energy'): ns3::BasicEnergyHarvesterHelper::BasicEnergyHarvesterHelper(ns3::BasicEnergyHarvesterHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::BasicEnergyHarvesterHelper const &', 'arg0')]) + ## basic-energy-harvester-helper.h (module 'energy'): ns3::BasicEnergyHarvesterHelper::BasicEnergyHarvesterHelper() [constructor] + cls.add_constructor([]) + ## basic-energy-harvester-helper.h (module 'energy'): void ns3::BasicEnergyHarvesterHelper::Set(std::string name, ns3::AttributeValue const & v) [member function] + cls.add_method('Set', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'v')], + is_virtual=True) + ## basic-energy-harvester-helper.h (module 'energy'): ns3::Ptr ns3::BasicEnergyHarvesterHelper::DoInstall(ns3::Ptr source) const [member function] + cls.add_method('DoInstall', + 'ns3::Ptr< ns3::EnergyHarvester >', + [param('ns3::Ptr< ns3::EnergySource >', 'source')], + is_const=True, visibility='private', is_virtual=True) + return + def register_Ns3BasicEnergySourceHelper_methods(root_module, cls): ## basic-energy-source-helper.h (module 'energy'): ns3::BasicEnergySourceHelper::BasicEnergySourceHelper(ns3::BasicEnergySourceHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::BasicEnergySourceHelper const &', 'arg0')]) @@ -2781,6 +2931,89 @@ []) return +def register_Ns3RandomVariableStream_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::RandomVariableStream::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::RandomVariableStream::RandomVariableStream() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): void ns3::RandomVariableStream::SetStream(int64_t stream) [member function] + cls.add_method('SetStream', + 'void', + [param('int64_t', 'stream')]) + ## random-variable-stream.h (module 'core'): int64_t ns3::RandomVariableStream::GetStream() const [member function] + cls.add_method('GetStream', + 'int64_t', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): void ns3::RandomVariableStream::SetAntithetic(bool isAntithetic) [member function] + cls.add_method('SetAntithetic', + 'void', + [param('bool', 'isAntithetic')]) + ## random-variable-stream.h (module 'core'): bool ns3::RandomVariableStream::IsAntithetic() const [member function] + cls.add_method('IsAntithetic', + 'bool', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::RandomVariableStream::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_pure_virtual=True, is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::RandomVariableStream::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_pure_virtual=True, is_virtual=True) + ## random-variable-stream.h (module 'core'): ns3::RngStream * ns3::RandomVariableStream::Peek() const [member function] + cls.add_method('Peek', + 'ns3::RngStream *', + [], + is_const=True, visibility='protected') + return + +def register_Ns3SequentialRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::SequentialRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::SequentialRandomVariable::SequentialRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetMin() const [member function] + cls.add_method('GetMin', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetMax() const [member function] + cls.add_method('GetMax', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): ns3::Ptr ns3::SequentialRandomVariable::GetIncrement() const [member function] + cls.add_method('GetIncrement', + 'ns3::Ptr< ns3::RandomVariableStream >', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::SequentialRandomVariable::GetConsecutive() const [member function] + cls.add_method('GetConsecutive', + 'uint32_t', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::SequentialRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount >::SimpleRefCount() [constructor] cls.add_constructor([]) @@ -2921,10 +3154,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -2935,25 +3168,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -3070,20 +3303,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return @@ -3181,6 +3414,130 @@ is_pure_virtual=True, is_const=True, is_virtual=True) return +def register_Ns3TriangularRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::TriangularRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::TriangularRandomVariable::TriangularRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMean() const [member function] + cls.add_method('GetMean', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMin() const [member function] + cls.add_method('GetMin', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMax() const [member function] + cls.add_method('GetMax', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetValue(double mean, double min, double max) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'mean'), param('double', 'min'), param('double', 'max')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::TriangularRandomVariable::GetInteger(uint32_t mean, uint32_t min, uint32_t max) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'mean'), param('uint32_t', 'min'), param('uint32_t', 'max')]) + ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::TriangularRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + +def register_Ns3UniformRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::UniformRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::UniformRandomVariable::UniformRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetMin() const [member function] + cls.add_method('GetMin', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetMax() const [member function] + cls.add_method('GetMax', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetValue(double min, double max) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'min'), param('double', 'max')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::UniformRandomVariable::GetInteger(uint32_t min, uint32_t max) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'min'), param('uint32_t', 'max')]) + ## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::UniformRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + +def register_Ns3WeibullRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::WeibullRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::WeibullRandomVariable::WeibullRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetScale() const [member function] + cls.add_method('GetScale', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetShape() const [member function] + cls.add_method('GetShape', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetBound() const [member function] + cls.add_method('GetBound', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetValue(double scale, double shape, double bound) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'scale'), param('double', 'shape'), param('double', 'bound')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::WeibullRandomVariable::GetInteger(uint32_t scale, uint32_t shape, uint32_t bound) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'scale'), param('uint32_t', 'shape'), param('uint32_t', 'bound')]) + ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::WeibullRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3WifiPhy_methods(root_module, cls): ## wifi-phy.h (module 'wifi'): ns3::WifiPhy::WifiPhy(ns3::WifiPhy const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiPhy const &', 'arg0')]) @@ -3726,6 +4083,11 @@ 'bool', [], is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateSleep() [member function] + cls.add_method('IsStateSleep', + 'bool', + [], + is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateSwitching() [member function] cls.add_method('IsStateSwitching', 'bool', @@ -3778,10 +4140,15 @@ 'void', [param('ns3::WifiPhyListener *', 'listener')], is_pure_virtual=True, is_virtual=True) - ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SendPacket(ns3::Ptr packet, ns3::WifiMode mode, ns3::WifiPreamble preamble, ns3::WifiTxVector txvector) [member function] + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::ResumeFromSleep() [member function] + cls.add_method('ResumeFromSleep', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SendPacket(ns3::Ptr packet, ns3::WifiTxVector txvector, ns3::WifiPreamble preamble) [member function] cls.add_method('SendPacket', 'void', - [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble'), param('ns3::WifiTxVector', 'txvector')], + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiTxVector', 'txvector'), param('ns3::WifiPreamble', 'preamble')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetChannelBonding(bool channelbonding) [member function] cls.add_method('SetChannelBonding', @@ -3833,6 +4200,11 @@ 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, double, ns3::WifiMode, ns3::WifiPreamble, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetSleepMode() [member function] + cls.add_method('SetSleepMode', + 'void', + [], + is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetStbc(bool stbc) [member function] cls.add_method('SetStbc', 'void', @@ -3845,6 +4217,99 @@ is_pure_virtual=True, is_virtual=True) return +def register_Ns3WifiTxCurrentModel_methods(root_module, cls): + ## wifi-tx-current-model.h (module 'energy'): ns3::WifiTxCurrentModel::WifiTxCurrentModel(ns3::WifiTxCurrentModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiTxCurrentModel const &', 'arg0')]) + ## wifi-tx-current-model.h (module 'energy'): ns3::WifiTxCurrentModel::WifiTxCurrentModel() [constructor] + cls.add_constructor([]) + ## wifi-tx-current-model.h (module 'energy'): double ns3::WifiTxCurrentModel::CalcTxCurrent(double txPowerDbm) const [member function] + cls.add_method('CalcTxCurrent', + 'double', + [param('double', 'txPowerDbm')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-tx-current-model.h (module 'energy'): static double ns3::WifiTxCurrentModel::DbmToW(double dbm) [member function] + cls.add_method('DbmToW', + 'double', + [param('double', 'dbm')], + is_static=True) + ## wifi-tx-current-model.h (module 'energy'): static ns3::TypeId ns3::WifiTxCurrentModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3ZetaRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ZetaRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable::ZetaRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetAlpha() const [member function] + cls.add_method('GetAlpha', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetValue(double alpha) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'alpha')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ZetaRandomVariable::GetInteger(uint32_t alpha) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'alpha')]) + ## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ZetaRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + +def register_Ns3ZipfRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ZipfRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::ZipfRandomVariable::ZipfRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetN() const [member function] + cls.add_method('GetN', + 'uint32_t', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetAlpha() const [member function] + cls.add_method('GetAlpha', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetValue(uint32_t n, double alpha) [member function] + cls.add_method('GetValue', + 'double', + [param('uint32_t', 'n'), param('double', 'alpha')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetInteger(uint32_t n, uint32_t alpha) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'n'), param('uint32_t', 'alpha')]) + ## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3AttributeAccessor_methods(root_module, cls): ## attribute.h (module 'core'): ns3::AttributeAccessor::AttributeAccessor(ns3::AttributeAccessor const & arg0) [copy constructor] cls.add_constructor([param('ns3::AttributeAccessor const &', 'arg0')]) @@ -4024,22 +4489,79 @@ [param('ns3::CallbackBase', 'base')]) return -def register_Ns3DeviceEnergyModel_methods(root_module, cls): - ## device-energy-model.h (module 'energy'): ns3::DeviceEnergyModel::DeviceEnergyModel(ns3::DeviceEnergyModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::DeviceEnergyModel const &', 'arg0')]) - ## device-energy-model.h (module 'energy'): ns3::DeviceEnergyModel::DeviceEnergyModel() [constructor] +def register_Ns3ConstantRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ConstantRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable::ConstantRandomVariable() [constructor] cls.add_constructor([]) - ## device-energy-model.h (module 'energy'): void ns3::DeviceEnergyModel::ChangeState(int newState) [member function] - cls.add_method('ChangeState', - 'void', - [param('int', 'newState')], - is_pure_virtual=True, is_virtual=True) - ## device-energy-model.h (module 'energy'): double ns3::DeviceEnergyModel::GetCurrentA() const [member function] - cls.add_method('GetCurrentA', + ## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetConstant() const [member function] + cls.add_method('GetConstant', 'double', [], is_const=True) - ## device-energy-model.h (module 'energy'): double ns3::DeviceEnergyModel::GetTotalEnergyConsumption() const [member function] + ## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetValue(double constant) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'constant')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ConstantRandomVariable::GetInteger(uint32_t constant) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'constant')]) + ## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ConstantRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + +def register_Ns3DeterministicRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::DeterministicRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::DeterministicRandomVariable::DeterministicRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): void ns3::DeterministicRandomVariable::SetValueArray(double * values, uint64_t length) [member function] + cls.add_method('SetValueArray', + 'void', + [param('double *', 'values'), param('uint64_t', 'length')]) + ## random-variable-stream.h (module 'core'): double ns3::DeterministicRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::DeterministicRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + +def register_Ns3DeviceEnergyModel_methods(root_module, cls): + ## device-energy-model.h (module 'energy'): ns3::DeviceEnergyModel::DeviceEnergyModel(ns3::DeviceEnergyModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DeviceEnergyModel const &', 'arg0')]) + ## device-energy-model.h (module 'energy'): ns3::DeviceEnergyModel::DeviceEnergyModel() [constructor] + cls.add_constructor([]) + ## device-energy-model.h (module 'energy'): void ns3::DeviceEnergyModel::ChangeState(int newState) [member function] + cls.add_method('ChangeState', + 'void', + [param('int', 'newState')], + is_pure_virtual=True, is_virtual=True) + ## device-energy-model.h (module 'energy'): double ns3::DeviceEnergyModel::GetCurrentA() const [member function] + cls.add_method('GetCurrentA', + 'double', + [], + is_const=True) + ## device-energy-model.h (module 'energy'): double ns3::DeviceEnergyModel::GetTotalEnergyConsumption() const [member function] cls.add_method('GetTotalEnergyConsumption', 'double', [], @@ -4054,6 +4576,11 @@ 'void', [], is_pure_virtual=True, is_virtual=True) + ## device-energy-model.h (module 'energy'): void ns3::DeviceEnergyModel::HandleEnergyRecharged() [member function] + cls.add_method('HandleEnergyRecharged', + 'void', + [], + is_pure_virtual=True, is_virtual=True) ## device-energy-model.h (module 'energy'): void ns3::DeviceEnergyModel::SetEnergySource(ns3::Ptr source) [member function] cls.add_method('SetEnergySource', 'void', @@ -4099,6 +4626,40 @@ [param('double const &', 'value')]) return +def register_Ns3EmpiricalRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): ns3::EmpiricalRandomVariable::EmpiricalRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): void ns3::EmpiricalRandomVariable::CDF(double v, double c) [member function] + cls.add_method('CDF', + 'void', + [param('double', 'v'), param('double', 'c')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::EmpiricalRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::EmpiricalRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): double ns3::EmpiricalRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): double ns3::EmpiricalRandomVariable::Interpolate(double arg0, double arg1, double arg2, double arg3, double arg4) [member function] + cls.add_method('Interpolate', + 'double', + [param('double', 'arg0'), param('double', 'arg1'), param('double', 'arg2'), param('double', 'arg3'), param('double', 'arg4')], + visibility='private', is_virtual=True) + ## random-variable-stream.h (module 'core'): void ns3::EmpiricalRandomVariable::Validate() [member function] + cls.add_method('Validate', + 'void', + [], + visibility='private', is_virtual=True) + return + def register_Ns3EmptyAttributeValue_methods(root_module, cls): ## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue(ns3::EmptyAttributeValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::EmptyAttributeValue const &', 'arg0')]) @@ -4121,6 +4682,115 @@ is_const=True, visibility='private', is_virtual=True) return +def register_Ns3EnergyHarvester_methods(root_module, cls): + ## energy-harvester.h (module 'energy'): ns3::EnergyHarvester::EnergyHarvester(ns3::EnergyHarvester const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EnergyHarvester const &', 'arg0')]) + ## energy-harvester.h (module 'energy'): ns3::EnergyHarvester::EnergyHarvester() [constructor] + cls.add_constructor([]) + ## energy-harvester.h (module 'energy'): ns3::Ptr ns3::EnergyHarvester::GetEnergySource() const [member function] + cls.add_method('GetEnergySource', + 'ns3::Ptr< ns3::EnergySource >', + [], + is_const=True) + ## energy-harvester.h (module 'energy'): ns3::Ptr ns3::EnergyHarvester::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True) + ## energy-harvester.h (module 'energy'): double ns3::EnergyHarvester::GetPower() const [member function] + cls.add_method('GetPower', + 'double', + [], + is_const=True) + ## energy-harvester.h (module 'energy'): static ns3::TypeId ns3::EnergyHarvester::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## energy-harvester.h (module 'energy'): void ns3::EnergyHarvester::SetEnergySource(ns3::Ptr source) [member function] + cls.add_method('SetEnergySource', + 'void', + [param('ns3::Ptr< ns3::EnergySource >', 'source')]) + ## energy-harvester.h (module 'energy'): void ns3::EnergyHarvester::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## energy-harvester.h (module 'energy'): void ns3::EnergyHarvester::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## energy-harvester.h (module 'energy'): double ns3::EnergyHarvester::DoGetPower() const [member function] + cls.add_method('DoGetPower', + 'double', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3EnergyHarvesterContainer_methods(root_module, cls): + ## energy-harvester-container.h (module 'energy'): ns3::EnergyHarvesterContainer::EnergyHarvesterContainer(ns3::EnergyHarvesterContainer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EnergyHarvesterContainer const &', 'arg0')]) + ## energy-harvester-container.h (module 'energy'): ns3::EnergyHarvesterContainer::EnergyHarvesterContainer() [constructor] + cls.add_constructor([]) + ## energy-harvester-container.h (module 'energy'): ns3::EnergyHarvesterContainer::EnergyHarvesterContainer(ns3::Ptr harvester) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::EnergyHarvester >', 'harvester')]) + ## energy-harvester-container.h (module 'energy'): ns3::EnergyHarvesterContainer::EnergyHarvesterContainer(std::string harvesterName) [constructor] + cls.add_constructor([param('std::string', 'harvesterName')]) + ## energy-harvester-container.h (module 'energy'): ns3::EnergyHarvesterContainer::EnergyHarvesterContainer(ns3::EnergyHarvesterContainer const & a, ns3::EnergyHarvesterContainer const & b) [constructor] + cls.add_constructor([param('ns3::EnergyHarvesterContainer const &', 'a'), param('ns3::EnergyHarvesterContainer const &', 'b')]) + ## energy-harvester-container.h (module 'energy'): void ns3::EnergyHarvesterContainer::Add(ns3::EnergyHarvesterContainer container) [member function] + cls.add_method('Add', + 'void', + [param('ns3::EnergyHarvesterContainer', 'container')]) + ## energy-harvester-container.h (module 'energy'): void ns3::EnergyHarvesterContainer::Add(ns3::Ptr harvester) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ptr< ns3::EnergyHarvester >', 'harvester')]) + ## energy-harvester-container.h (module 'energy'): void ns3::EnergyHarvesterContainer::Add(std::string harvesterName) [member function] + cls.add_method('Add', + 'void', + [param('std::string', 'harvesterName')]) + ## energy-harvester-container.h (module 'energy'): __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::EnergyHarvesterContainer::Begin() const [member function] + cls.add_method('Begin', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::EnergyHarvester > const, std::vector< ns3::Ptr< ns3::EnergyHarvester > > >', + [], + is_const=True) + ## energy-harvester-container.h (module 'energy'): void ns3::EnergyHarvesterContainer::Clear() [member function] + cls.add_method('Clear', + 'void', + []) + ## energy-harvester-container.h (module 'energy'): __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::EnergyHarvesterContainer::End() const [member function] + cls.add_method('End', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::EnergyHarvester > const, std::vector< ns3::Ptr< ns3::EnergyHarvester > > >', + [], + is_const=True) + ## energy-harvester-container.h (module 'energy'): ns3::Ptr ns3::EnergyHarvesterContainer::Get(uint32_t i) const [member function] + cls.add_method('Get', + 'ns3::Ptr< ns3::EnergyHarvester >', + [param('uint32_t', 'i')], + is_const=True) + ## energy-harvester-container.h (module 'energy'): uint32_t ns3::EnergyHarvesterContainer::GetN() const [member function] + cls.add_method('GetN', + 'uint32_t', + [], + is_const=True) + ## energy-harvester-container.h (module 'energy'): static ns3::TypeId ns3::EnergyHarvesterContainer::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## energy-harvester-container.h (module 'energy'): void ns3::EnergyHarvesterContainer::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## energy-harvester-container.h (module 'energy'): void ns3::EnergyHarvesterContainer::DoInitialize() [member function] + cls.add_method('DoInitialize', + 'void', + [], + visibility='private', is_virtual=True) + return + def register_Ns3EnergySource_methods(root_module, cls): ## energy-source.h (module 'energy'): ns3::EnergySource::EnergySource(ns3::EnergySource const & arg0) [copy constructor] cls.add_constructor([param('ns3::EnergySource const &', 'arg0')]) @@ -4130,6 +4800,10 @@ cls.add_method('AppendDeviceEnergyModel', 'void', [param('ns3::Ptr< ns3::DeviceEnergyModel >', 'deviceEnergyModelPtr')]) + ## energy-source.h (module 'energy'): void ns3::EnergySource::ConnectEnergyHarvester(ns3::Ptr energyHarvesterPtr) [member function] + cls.add_method('ConnectEnergyHarvester', + 'void', + [param('ns3::Ptr< ns3::EnergyHarvester >', 'energyHarvesterPtr')]) ## energy-source.h (module 'energy'): void ns3::EnergySource::DisposeDeviceModels() [member function] cls.add_method('DisposeDeviceModels', 'void', @@ -4200,6 +4874,11 @@ 'void', [], visibility='protected') + ## energy-source.h (module 'energy'): void ns3::EnergySource::NotifyEnergyRecharged() [member function] + cls.add_method('NotifyEnergyRecharged', + 'void', + [], + visibility='protected') ## energy-source.h (module 'energy'): void ns3::EnergySource::DoDispose() [member function] cls.add_method('DoDispose', 'void', @@ -4345,6 +5024,44 @@ [param('int', 'v')]) return +def register_Ns3ErlangRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ErlangRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::ErlangRandomVariable::ErlangRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetK() const [member function] + cls.add_method('GetK', + 'uint32_t', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetLambda() const [member function] + cls.add_method('GetLambda', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetValue(uint32_t k, double lambda) [member function] + cls.add_method('GetValue', + 'double', + [param('uint32_t', 'k'), param('double', 'lambda')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetInteger(uint32_t k, uint32_t lambda) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'k'), param('uint32_t', 'lambda')]) + ## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3EventImpl_methods(root_module, cls): ## event-impl.h (module 'core'): ns3::EventImpl::EventImpl(ns3::EventImpl const & arg0) [copy constructor] cls.add_constructor([param('ns3::EventImpl const &', 'arg0')]) @@ -4369,6 +5086,82 @@ is_pure_virtual=True, visibility='protected', is_virtual=True) return +def register_Ns3ExponentialRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ExponentialRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::ExponentialRandomVariable::ExponentialRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetMean() const [member function] + cls.add_method('GetMean', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetBound() const [member function] + cls.add_method('GetBound', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetValue(double mean, double bound) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'mean'), param('double', 'bound')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ExponentialRandomVariable::GetInteger(uint32_t mean, uint32_t bound) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'mean'), param('uint32_t', 'bound')]) + ## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ExponentialRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + +def register_Ns3GammaRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::GammaRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::GammaRandomVariable::GammaRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetAlpha() const [member function] + cls.add_method('GetAlpha', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetBeta() const [member function] + cls.add_method('GetBeta', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetValue(double alpha, double beta) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'alpha'), param('double', 'beta')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::GammaRandomVariable::GetInteger(uint32_t alpha, uint32_t beta) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'alpha'), param('uint32_t', 'beta')]) + ## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::GammaRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3IntegerValue_methods(root_module, cls): ## integer.h (module 'core'): ns3::IntegerValue::IntegerValue() [constructor] cls.add_constructor([]) @@ -4636,6 +5429,88 @@ visibility='private', is_virtual=True) return +def register_Ns3LinearWifiTxCurrentModel_methods(root_module, cls): + ## wifi-tx-current-model.h (module 'energy'): ns3::LinearWifiTxCurrentModel::LinearWifiTxCurrentModel(ns3::LinearWifiTxCurrentModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::LinearWifiTxCurrentModel const &', 'arg0')]) + ## wifi-tx-current-model.h (module 'energy'): ns3::LinearWifiTxCurrentModel::LinearWifiTxCurrentModel() [constructor] + cls.add_constructor([]) + ## wifi-tx-current-model.h (module 'energy'): double ns3::LinearWifiTxCurrentModel::CalcTxCurrent(double txPowerDbm) const [member function] + cls.add_method('CalcTxCurrent', + 'double', + [param('double', 'txPowerDbm')], + is_const=True, is_virtual=True) + ## wifi-tx-current-model.h (module 'energy'): double ns3::LinearWifiTxCurrentModel::GetEta() const [member function] + cls.add_method('GetEta', + 'double', + [], + is_const=True) + ## wifi-tx-current-model.h (module 'energy'): double ns3::LinearWifiTxCurrentModel::GetIdleCurrent() const [member function] + cls.add_method('GetIdleCurrent', + 'double', + [], + is_const=True) + ## wifi-tx-current-model.h (module 'energy'): static ns3::TypeId ns3::LinearWifiTxCurrentModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## wifi-tx-current-model.h (module 'energy'): double ns3::LinearWifiTxCurrentModel::GetVoltage() const [member function] + cls.add_method('GetVoltage', + 'double', + [], + is_const=True) + ## wifi-tx-current-model.h (module 'energy'): void ns3::LinearWifiTxCurrentModel::SetEta(double eta) [member function] + cls.add_method('SetEta', + 'void', + [param('double', 'eta')]) + ## wifi-tx-current-model.h (module 'energy'): void ns3::LinearWifiTxCurrentModel::SetIdleCurrent(double idleCurrent) [member function] + cls.add_method('SetIdleCurrent', + 'void', + [param('double', 'idleCurrent')]) + ## wifi-tx-current-model.h (module 'energy'): void ns3::LinearWifiTxCurrentModel::SetVoltage(double voltage) [member function] + cls.add_method('SetVoltage', + 'void', + [param('double', 'voltage')]) + return + +def register_Ns3LogNormalRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::LogNormalRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::LogNormalRandomVariable::LogNormalRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetMu() const [member function] + cls.add_method('GetMu', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetSigma() const [member function] + cls.add_method('GetSigma', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetValue(double mu, double sigma) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'mu'), param('double', 'sigma')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::LogNormalRandomVariable::GetInteger(uint32_t mu, uint32_t sigma) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'mu'), param('uint32_t', 'sigma')]) + ## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::LogNormalRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3NetDevice_methods(root_module, cls): ## net-device.h (module 'network'): ns3::NetDevice::NetDevice() [constructor] cls.add_constructor([]) @@ -4895,6 +5770,51 @@ visibility='protected', is_virtual=True) return +def register_Ns3NormalRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable::INFINITE_VALUE [variable] + cls.add_static_attribute('INFINITE_VALUE', 'double const', is_const=True) + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::NormalRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable::NormalRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetMean() const [member function] + cls.add_method('GetMean', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetVariance() const [member function] + cls.add_method('GetVariance', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetBound() const [member function] + cls.add_method('GetBound', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetValue(double mean, double variance, double bound=ns3::NormalRandomVariable::INFINITE_VALUE) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'mean'), param('double', 'variance'), param('double', 'bound', default_value='ns3::NormalRandomVariable::INFINITE_VALUE')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::NormalRandomVariable::GetInteger(uint32_t mean, uint32_t variance, uint32_t bound) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'mean'), param('uint32_t', 'variance'), param('uint32_t', 'bound')]) + ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::NormalRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3ObjectFactoryChecker_methods(root_module, cls): ## object-factory.h (module 'core'): ns3::ObjectFactoryChecker::ObjectFactoryChecker() [constructor] cls.add_constructor([]) @@ -5120,6 +6040,49 @@ [param('ns3::Ptr< ns3::NixVector >', 'nixVector')]) return +def register_Ns3ParetoRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ParetoRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable::ParetoRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetMean() const [member function] + cls.add_method('GetMean', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetShape() const [member function] + cls.add_method('GetShape', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetBound() const [member function] + cls.add_method('GetBound', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetValue(double mean, double shape, double bound) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'mean'), param('double', 'shape'), param('double', 'bound')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ParetoRandomVariable::GetInteger(uint32_t mean, uint32_t shape, uint32_t bound) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'mean'), param('uint32_t', 'shape'), param('uint32_t', 'bound')]) + ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ParetoRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3RvBatteryModel_methods(root_module, cls): ## rv-battery-model.h (module 'energy'): ns3::RvBatteryModel::RvBatteryModel(ns3::RvBatteryModel const & arg0) [copy constructor] cls.add_constructor([param('ns3::RvBatteryModel const &', 'arg0')]) @@ -5260,6 +6223,11 @@ 'void', [], is_virtual=True) + ## simple-device-energy-model.h (module 'energy'): void ns3::SimpleDeviceEnergyModel::HandleEnergyRecharged() [member function] + cls.add_method('HandleEnergyRecharged', + 'void', + [], + is_virtual=True) ## simple-device-energy-model.h (module 'energy'): void ns3::SimpleDeviceEnergyModel::SetCurrentA(double current) [member function] cls.add_method('SetCurrentA', 'void', @@ -5466,6 +6434,11 @@ 'double', [], is_const=True) + ## wifi-radio-energy-model.h (module 'energy'): double ns3::WifiRadioEnergyModel::GetSleepCurrentA() const [member function] + cls.add_method('GetSleepCurrentA', + 'double', + [], + is_const=True) ## wifi-radio-energy-model.h (module 'energy'): double ns3::WifiRadioEnergyModel::GetSwitchingCurrentA() const [member function] cls.add_method('GetSwitchingCurrentA', 'double', @@ -5491,6 +6464,11 @@ 'void', [], is_virtual=True) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::HandleEnergyRecharged() [member function] + cls.add_method('HandleEnergyRecharged', + 'void', + [], + is_virtual=True) ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetCcaBusyCurrentA(double ccaBusyCurrentA) [member function] cls.add_method('SetCcaBusyCurrentA', 'void', @@ -5499,6 +6477,10 @@ cls.add_method('SetEnergyDepletionCallback', 'void', [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetEnergyRechargedCallback(ns3::Callback callback) [member function] + cls.add_method('SetEnergyRechargedCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetEnergySource(ns3::Ptr source) [member function] cls.add_method('SetEnergySource', 'void', @@ -5512,6 +6494,10 @@ cls.add_method('SetRxCurrentA', 'void', [param('double', 'rxCurrentA')]) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetSleepCurrentA(double sleepCurrentA) [member function] + cls.add_method('SetSleepCurrentA', + 'void', + [param('double', 'sleepCurrentA')]) ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetSwitchingCurrentA(double switchingCurrentA) [member function] cls.add_method('SetSwitchingCurrentA', 'void', @@ -5520,6 +6506,14 @@ cls.add_method('SetTxCurrentA', 'void', [param('double', 'txCurrentA')]) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetTxCurrentFromModel(double txPowerDbm) [member function] + cls.add_method('SetTxCurrentFromModel', + 'void', + [param('double', 'txPowerDbm')]) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetTxCurrentModel(ns3::Ptr model) [member function] + cls.add_method('SetTxCurrentModel', + 'void', + [param('ns3::Ptr< ns3::WifiTxCurrentModel >', 'model')]) ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::DoDispose() [member function] cls.add_method('DoDispose', 'void', @@ -5572,6 +6566,48 @@ [param('ns3::Address const &', 'value')]) return +def register_Ns3BasicEnergyHarvester_methods(root_module, cls): + ## basic-energy-harvester.h (module 'energy'): ns3::BasicEnergyHarvester::BasicEnergyHarvester(ns3::BasicEnergyHarvester const & arg0) [copy constructor] + cls.add_constructor([param('ns3::BasicEnergyHarvester const &', 'arg0')]) + ## basic-energy-harvester.h (module 'energy'): ns3::BasicEnergyHarvester::BasicEnergyHarvester() [constructor] + cls.add_constructor([]) + ## basic-energy-harvester.h (module 'energy'): ns3::BasicEnergyHarvester::BasicEnergyHarvester(ns3::Time updateInterval) [constructor] + cls.add_constructor([param('ns3::Time', 'updateInterval')]) + ## basic-energy-harvester.h (module 'energy'): int64_t ns3::BasicEnergyHarvester::AssignStreams(int64_t stream) [member function] + cls.add_method('AssignStreams', + 'int64_t', + [param('int64_t', 'stream')]) + ## basic-energy-harvester.h (module 'energy'): ns3::Time ns3::BasicEnergyHarvester::GetHarvestedPowerUpdateInterval() const [member function] + cls.add_method('GetHarvestedPowerUpdateInterval', + 'ns3::Time', + [], + is_const=True) + ## basic-energy-harvester.h (module 'energy'): static ns3::TypeId ns3::BasicEnergyHarvester::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## basic-energy-harvester.h (module 'energy'): void ns3::BasicEnergyHarvester::SetHarvestedPowerUpdateInterval(ns3::Time updateInterval) [member function] + cls.add_method('SetHarvestedPowerUpdateInterval', + 'void', + [param('ns3::Time', 'updateInterval')]) + ## basic-energy-harvester.h (module 'energy'): void ns3::BasicEnergyHarvester::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## basic-energy-harvester.h (module 'energy'): double ns3::BasicEnergyHarvester::DoGetPower() const [member function] + cls.add_method('DoGetPower', + 'double', + [], + is_const=True, visibility='private', is_virtual=True) + ## basic-energy-harvester.h (module 'energy'): void ns3::BasicEnergyHarvester::DoInitialize() [member function] + cls.add_method('DoInitialize', + 'void', + [], + visibility='private', is_virtual=True) + return + def register_Ns3BasicEnergySource_methods(root_module, cls): ## basic-energy-source.h (module 'energy'): ns3::BasicEnergySource::BasicEnergySource(ns3::BasicEnergySource const & arg0) [copy constructor] cls.add_constructor([param('ns3::BasicEnergySource const &', 'arg0')]) diff -Naur ns-3.20/src/energy/bindings/modulegen__gcc_LP64.py ns-3.21/src/energy/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/energy/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -56,6 +56,8 @@ module.add_class('DeviceEnergyModelContainer') ## energy-model-helper.h (module 'energy'): ns3::DeviceEnergyModelHelper [class] module.add_class('DeviceEnergyModelHelper', allow_subclassing=True) + ## energy-harvester-helper.h (module 'energy'): ns3::EnergyHarvesterHelper [class] + module.add_class('EnergyHarvesterHelper', allow_subclassing=True) ## energy-model-helper.h (module 'energy'): ns3::EnergySourceHelper [class] module.add_class('EnergySourceHelper', allow_subclassing=True) ## event-id.h (module 'core'): ns3::EventId [class] @@ -140,6 +142,8 @@ module.add_class('int64x64_t', import_from_module='ns.core') ## int64x64-double.h (module 'core'): ns3::int64x64_t::impl_type [enumeration] module.add_enum('impl_type', ['int128_impl', 'cairo_impl', 'ld_impl'], outer_class=root_module['ns3::int64x64_t'], import_from_module='ns.core') + ## basic-energy-harvester-helper.h (module 'energy'): ns3::BasicEnergyHarvesterHelper [class] + module.add_class('BasicEnergyHarvesterHelper', parent=root_module['ns3::EnergyHarvesterHelper']) ## basic-energy-source-helper.h (module 'energy'): ns3::BasicEnergySourceHelper [class] module.add_class('BasicEnergySourceHelper', parent=root_module['ns3::EnergySourceHelper']) ## chunk.h (module 'network'): ns3::Chunk [class] @@ -150,6 +154,10 @@ module.add_class('Object', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >']) ## object.h (module 'core'): ns3::Object::AggregateIterator [class] module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object']) + ## random-variable-stream.h (module 'core'): ns3::RandomVariableStream [class] + module.add_class('RandomVariableStream', import_from_module='ns.core', parent=root_module['ns3::Object']) + ## random-variable-stream.h (module 'core'): ns3::SequentialRandomVariable [class] + module.add_class('SequentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount > [class] @@ -182,10 +190,22 @@ root_module['ns3::TracedValue< ns3::Time >'].implicitly_converts_to(root_module['ns3::Time']) ## trailer.h (module 'network'): ns3::Trailer [class] module.add_class('Trailer', import_from_module='ns.network', parent=root_module['ns3::Chunk']) + ## random-variable-stream.h (module 'core'): ns3::TriangularRandomVariable [class] + module.add_class('TriangularRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) + ## random-variable-stream.h (module 'core'): ns3::UniformRandomVariable [class] + module.add_class('UniformRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) + ## random-variable-stream.h (module 'core'): ns3::WeibullRandomVariable [class] + module.add_class('WeibullRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## wifi-phy.h (module 'wifi'): ns3::WifiPhy [class] module.add_class('WifiPhy', import_from_module='ns.wifi', parent=root_module['ns3::Object']) ## wifi-phy.h (module 'wifi'): ns3::WifiPhy::State [enumeration] - module.add_enum('State', ['IDLE', 'CCA_BUSY', 'TX', 'RX', 'SWITCHING'], outer_class=root_module['ns3::WifiPhy'], import_from_module='ns.wifi') + module.add_enum('State', ['IDLE', 'CCA_BUSY', 'TX', 'RX', 'SWITCHING', 'SLEEP'], outer_class=root_module['ns3::WifiPhy'], import_from_module='ns.wifi') + ## wifi-tx-current-model.h (module 'energy'): ns3::WifiTxCurrentModel [class] + module.add_class('WifiTxCurrentModel', parent=root_module['ns3::Object']) + ## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable [class] + module.add_class('ZetaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) + ## random-variable-stream.h (module 'core'): ns3::ZipfRandomVariable [class] + module.add_class('ZipfRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## attribute.h (module 'core'): ns3::AttributeAccessor [class] module.add_class('AttributeAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter >']) ## attribute.h (module 'core'): ns3::AttributeChecker [class] @@ -202,12 +222,22 @@ module.add_class('CallbackImplBase', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter >']) ## callback.h (module 'core'): ns3::CallbackValue [class] module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) + ## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable [class] + module.add_class('ConstantRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) + ## random-variable-stream.h (module 'core'): ns3::DeterministicRandomVariable [class] + module.add_class('DeterministicRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## device-energy-model.h (module 'energy'): ns3::DeviceEnergyModel [class] module.add_class('DeviceEnergyModel', parent=root_module['ns3::Object']) ## double.h (module 'core'): ns3::DoubleValue [class] module.add_class('DoubleValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) + ## random-variable-stream.h (module 'core'): ns3::EmpiricalRandomVariable [class] + module.add_class('EmpiricalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## attribute.h (module 'core'): ns3::EmptyAttributeValue [class] module.add_class('EmptyAttributeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) + ## energy-harvester.h (module 'energy'): ns3::EnergyHarvester [class] + module.add_class('EnergyHarvester', parent=root_module['ns3::Object']) + ## energy-harvester-container.h (module 'energy'): ns3::EnergyHarvesterContainer [class] + module.add_class('EnergyHarvesterContainer', parent=root_module['ns3::Object']) ## energy-source.h (module 'energy'): ns3::EnergySource [class] module.add_class('EnergySource', parent=root_module['ns3::Object']) ## energy-source-container.h (module 'energy'): ns3::EnergySourceContainer [class] @@ -216,8 +246,14 @@ module.add_class('EnumChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## enum.h (module 'core'): ns3::EnumValue [class] module.add_class('EnumValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) + ## random-variable-stream.h (module 'core'): ns3::ErlangRandomVariable [class] + module.add_class('ErlangRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## event-impl.h (module 'core'): ns3::EventImpl [class] module.add_class('EventImpl', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter >']) + ## random-variable-stream.h (module 'core'): ns3::ExponentialRandomVariable [class] + module.add_class('ExponentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) + ## random-variable-stream.h (module 'core'): ns3::GammaRandomVariable [class] + module.add_class('GammaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## integer.h (module 'core'): ns3::IntegerValue [class] module.add_class('IntegerValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker [class] @@ -238,6 +274,10 @@ module.add_class('Ipv6PrefixValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) ## li-ion-energy-source.h (module 'energy'): ns3::LiIonEnergySource [class] module.add_class('LiIonEnergySource', parent=root_module['ns3::EnergySource']) + ## wifi-tx-current-model.h (module 'energy'): ns3::LinearWifiTxCurrentModel [class] + module.add_class('LinearWifiTxCurrentModel', parent=root_module['ns3::WifiTxCurrentModel']) + ## random-variable-stream.h (module 'core'): ns3::LogNormalRandomVariable [class] + module.add_class('LogNormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## net-device.h (module 'network'): ns3::NetDevice [class] module.add_class('NetDevice', import_from_module='ns.network', parent=root_module['ns3::Object']) ## net-device.h (module 'network'): ns3::NetDevice::PacketType [enumeration] @@ -246,12 +286,16 @@ module.add_class('NixVector', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter >']) ## node.h (module 'network'): ns3::Node [class] module.add_class('Node', import_from_module='ns.network', parent=root_module['ns3::Object']) + ## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable [class] + module.add_class('NormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## object-factory.h (module 'core'): ns3::ObjectFactoryChecker [class] module.add_class('ObjectFactoryChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## object-factory.h (module 'core'): ns3::ObjectFactoryValue [class] module.add_class('ObjectFactoryValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## packet.h (module 'network'): ns3::Packet [class] module.add_class('Packet', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter >']) + ## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable [class] + module.add_class('ParetoRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## rv-battery-model.h (module 'energy'): ns3::RvBatteryModel [class] module.add_class('RvBatteryModel', parent=root_module['ns3::EnergySource']) ## simple-device-energy-model.h (module 'energy'): ns3::SimpleDeviceEnergyModel [class] @@ -274,6 +318,8 @@ module.add_class('AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) ## address.h (module 'network'): ns3::AddressValue [class] module.add_class('AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) + ## basic-energy-harvester.h (module 'energy'): ns3::BasicEnergyHarvester [class] + module.add_class('BasicEnergyHarvester', parent=root_module['ns3::EnergyHarvester']) ## basic-energy-source.h (module 'energy'): ns3::BasicEnergySource [class] module.add_class('BasicEnergySource', parent=root_module['ns3::EnergySource']) module.add_container('ns3::WifiModeList', 'ns3::WifiMode', container_type=u'vector') @@ -360,6 +406,7 @@ register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase']) register_Ns3DeviceEnergyModelContainer_methods(root_module, root_module['ns3::DeviceEnergyModelContainer']) register_Ns3DeviceEnergyModelHelper_methods(root_module, root_module['ns3::DeviceEnergyModelHelper']) + register_Ns3EnergyHarvesterHelper_methods(root_module, root_module['ns3::EnergyHarvesterHelper']) register_Ns3EnergySourceHelper_methods(root_module, root_module['ns3::EnergySourceHelper']) register_Ns3EventId_methods(root_module, root_module['ns3::EventId']) register_Ns3Hasher_methods(root_module, root_module['ns3::Hasher']) @@ -396,11 +443,14 @@ register_Ns3WifiTxVector_methods(root_module, root_module['ns3::WifiTxVector']) register_Ns3Empty_methods(root_module, root_module['ns3::empty']) register_Ns3Int64x64_t_methods(root_module, root_module['ns3::int64x64_t']) + register_Ns3BasicEnergyHarvesterHelper_methods(root_module, root_module['ns3::BasicEnergyHarvesterHelper']) register_Ns3BasicEnergySourceHelper_methods(root_module, root_module['ns3::BasicEnergySourceHelper']) register_Ns3Chunk_methods(root_module, root_module['ns3::Chunk']) register_Ns3Header_methods(root_module, root_module['ns3::Header']) register_Ns3Object_methods(root_module, root_module['ns3::Object']) register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator']) + register_Ns3RandomVariableStream_methods(root_module, root_module['ns3::RandomVariableStream']) + register_Ns3SequentialRandomVariable_methods(root_module, root_module['ns3::SequentialRandomVariable']) register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter >']) register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter >']) register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter >']) @@ -414,7 +464,13 @@ register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor']) register_Ns3TracedValue__Ns3Time_methods(root_module, root_module['ns3::TracedValue< ns3::Time >']) register_Ns3Trailer_methods(root_module, root_module['ns3::Trailer']) + register_Ns3TriangularRandomVariable_methods(root_module, root_module['ns3::TriangularRandomVariable']) + register_Ns3UniformRandomVariable_methods(root_module, root_module['ns3::UniformRandomVariable']) + register_Ns3WeibullRandomVariable_methods(root_module, root_module['ns3::WeibullRandomVariable']) register_Ns3WifiPhy_methods(root_module, root_module['ns3::WifiPhy']) + register_Ns3WifiTxCurrentModel_methods(root_module, root_module['ns3::WifiTxCurrentModel']) + register_Ns3ZetaRandomVariable_methods(root_module, root_module['ns3::ZetaRandomVariable']) + register_Ns3ZipfRandomVariable_methods(root_module, root_module['ns3::ZipfRandomVariable']) register_Ns3AttributeAccessor_methods(root_module, root_module['ns3::AttributeAccessor']) register_Ns3AttributeChecker_methods(root_module, root_module['ns3::AttributeChecker']) register_Ns3AttributeValue_methods(root_module, root_module['ns3::AttributeValue']) @@ -423,14 +479,22 @@ register_Ns3CallbackChecker_methods(root_module, root_module['ns3::CallbackChecker']) register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase']) register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue']) + register_Ns3ConstantRandomVariable_methods(root_module, root_module['ns3::ConstantRandomVariable']) + register_Ns3DeterministicRandomVariable_methods(root_module, root_module['ns3::DeterministicRandomVariable']) register_Ns3DeviceEnergyModel_methods(root_module, root_module['ns3::DeviceEnergyModel']) register_Ns3DoubleValue_methods(root_module, root_module['ns3::DoubleValue']) + register_Ns3EmpiricalRandomVariable_methods(root_module, root_module['ns3::EmpiricalRandomVariable']) register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue']) + register_Ns3EnergyHarvester_methods(root_module, root_module['ns3::EnergyHarvester']) + register_Ns3EnergyHarvesterContainer_methods(root_module, root_module['ns3::EnergyHarvesterContainer']) register_Ns3EnergySource_methods(root_module, root_module['ns3::EnergySource']) register_Ns3EnergySourceContainer_methods(root_module, root_module['ns3::EnergySourceContainer']) register_Ns3EnumChecker_methods(root_module, root_module['ns3::EnumChecker']) register_Ns3EnumValue_methods(root_module, root_module['ns3::EnumValue']) + register_Ns3ErlangRandomVariable_methods(root_module, root_module['ns3::ErlangRandomVariable']) register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl']) + register_Ns3ExponentialRandomVariable_methods(root_module, root_module['ns3::ExponentialRandomVariable']) + register_Ns3GammaRandomVariable_methods(root_module, root_module['ns3::GammaRandomVariable']) register_Ns3IntegerValue_methods(root_module, root_module['ns3::IntegerValue']) register_Ns3Ipv4AddressChecker_methods(root_module, root_module['ns3::Ipv4AddressChecker']) register_Ns3Ipv4AddressValue_methods(root_module, root_module['ns3::Ipv4AddressValue']) @@ -441,12 +505,16 @@ register_Ns3Ipv6PrefixChecker_methods(root_module, root_module['ns3::Ipv6PrefixChecker']) register_Ns3Ipv6PrefixValue_methods(root_module, root_module['ns3::Ipv6PrefixValue']) register_Ns3LiIonEnergySource_methods(root_module, root_module['ns3::LiIonEnergySource']) + register_Ns3LinearWifiTxCurrentModel_methods(root_module, root_module['ns3::LinearWifiTxCurrentModel']) + register_Ns3LogNormalRandomVariable_methods(root_module, root_module['ns3::LogNormalRandomVariable']) register_Ns3NetDevice_methods(root_module, root_module['ns3::NetDevice']) register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector']) register_Ns3Node_methods(root_module, root_module['ns3::Node']) + register_Ns3NormalRandomVariable_methods(root_module, root_module['ns3::NormalRandomVariable']) register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker']) register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue']) register_Ns3Packet_methods(root_module, root_module['ns3::Packet']) + register_Ns3ParetoRandomVariable_methods(root_module, root_module['ns3::ParetoRandomVariable']) register_Ns3RvBatteryModel_methods(root_module, root_module['ns3::RvBatteryModel']) register_Ns3SimpleDeviceEnergyModel_methods(root_module, root_module['ns3::SimpleDeviceEnergyModel']) register_Ns3TimeValue_methods(root_module, root_module['ns3::TimeValue']) @@ -458,6 +526,7 @@ register_Ns3WifiRadioEnergyModel_methods(root_module, root_module['ns3::WifiRadioEnergyModel']) register_Ns3AddressChecker_methods(root_module, root_module['ns3::AddressChecker']) register_Ns3AddressValue_methods(root_module, root_module['ns3::AddressValue']) + register_Ns3BasicEnergyHarvester_methods(root_module, root_module['ns3::BasicEnergyHarvester']) register_Ns3BasicEnergySource_methods(root_module, root_module['ns3::BasicEnergySource']) register_Ns3HashImplementation_methods(root_module, root_module['ns3::Hash::Implementation']) register_Ns3HashFunctionFnv1a_methods(root_module, root_module['ns3::Hash::Function::Fnv1a']) @@ -1028,6 +1097,38 @@ is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) return +def register_Ns3EnergyHarvesterHelper_methods(root_module, cls): + ## energy-harvester-helper.h (module 'energy'): ns3::EnergyHarvesterHelper::EnergyHarvesterHelper() [constructor] + cls.add_constructor([]) + ## energy-harvester-helper.h (module 'energy'): ns3::EnergyHarvesterHelper::EnergyHarvesterHelper(ns3::EnergyHarvesterHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EnergyHarvesterHelper const &', 'arg0')]) + ## energy-harvester-helper.h (module 'energy'): ns3::EnergyHarvesterContainer ns3::EnergyHarvesterHelper::Install(ns3::Ptr source) const [member function] + cls.add_method('Install', + 'ns3::EnergyHarvesterContainer', + [param('ns3::Ptr< ns3::EnergySource >', 'source')], + is_const=True) + ## energy-harvester-helper.h (module 'energy'): ns3::EnergyHarvesterContainer ns3::EnergyHarvesterHelper::Install(ns3::EnergySourceContainer sourceContainer) const [member function] + cls.add_method('Install', + 'ns3::EnergyHarvesterContainer', + [param('ns3::EnergySourceContainer', 'sourceContainer')], + is_const=True) + ## energy-harvester-helper.h (module 'energy'): ns3::EnergyHarvesterContainer ns3::EnergyHarvesterHelper::Install(std::string sourceName) const [member function] + cls.add_method('Install', + 'ns3::EnergyHarvesterContainer', + [param('std::string', 'sourceName')], + is_const=True) + ## energy-harvester-helper.h (module 'energy'): void ns3::EnergyHarvesterHelper::Set(std::string name, ns3::AttributeValue const & v) [member function] + cls.add_method('Set', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'v')], + is_pure_virtual=True, is_virtual=True) + ## energy-harvester-helper.h (module 'energy'): ns3::Ptr ns3::EnergyHarvesterHelper::DoInstall(ns3::Ptr source) const [member function] + cls.add_method('DoInstall', + 'ns3::Ptr< ns3::EnergyHarvester >', + [param('ns3::Ptr< ns3::EnergySource >', 'source')], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + return + def register_Ns3EnergySourceHelper_methods(root_module, cls): ## energy-model-helper.h (module 'energy'): ns3::EnergySourceHelper::EnergySourceHelper() [constructor] cls.add_constructor([]) @@ -2422,15 +2523,25 @@ 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifySleep() [member function] + cls.add_method('NotifySleep', + 'void', + [], + is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifySwitchingStart(ns3::Time duration) [member function] cls.add_method('NotifySwitchingStart', 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) - ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyTxStart(ns3::Time duration) [member function] + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyTxStart(ns3::Time duration, double txPowerDbm) [member function] cls.add_method('NotifyTxStart', 'void', - [param('ns3::Time', 'duration')], + [param('ns3::Time', 'duration'), param('double', 'txPowerDbm')], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyWakeup() [member function] + cls.add_method('NotifyWakeup', + 'void', + [], is_pure_virtual=True, is_virtual=True) return @@ -2448,6 +2559,14 @@ cls.add_method('SetDepletionCallback', 'void', [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## wifi-radio-energy-model-helper.h (module 'energy'): void ns3::WifiRadioEnergyModelHelper::SetRechargedCallback(ns3::Callback callback) [member function] + cls.add_method('SetRechargedCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## wifi-radio-energy-model-helper.h (module 'energy'): void ns3::WifiRadioEnergyModelHelper::SetTxCurrentModel(std::string name, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetTxCurrentModel', + 'void', + [param('std::string', 'name'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) ## wifi-radio-energy-model-helper.h (module 'energy'): ns3::Ptr ns3::WifiRadioEnergyModelHelper::DoInstall(ns3::Ptr device, ns3::Ptr source) const [member function] cls.add_method('DoInstall', 'ns3::Ptr< ns3::DeviceEnergyModel >', @@ -2480,20 +2599,34 @@ 'void', [param('ns3::Time', 'duration')], is_virtual=True) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::NotifySleep() [member function] + cls.add_method('NotifySleep', + 'void', + [], + is_virtual=True) ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::NotifySwitchingStart(ns3::Time duration) [member function] cls.add_method('NotifySwitchingStart', 'void', [param('ns3::Time', 'duration')], is_virtual=True) - ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::NotifyTxStart(ns3::Time duration) [member function] + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::NotifyTxStart(ns3::Time duration, double txPowerDbm) [member function] cls.add_method('NotifyTxStart', 'void', - [param('ns3::Time', 'duration')], + [param('ns3::Time', 'duration'), param('double', 'txPowerDbm')], + is_virtual=True) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::NotifyWakeup() [member function] + cls.add_method('NotifyWakeup', + 'void', + [], is_virtual=True) ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::SetChangeStateCallback(ns3::Callback callback) [member function] cls.add_method('SetChangeStateCallback', 'void', [param('ns3::Callback< void, int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModelPhyListener::SetUpdateTxCurrentCallback(ns3::Callback callback) [member function] + cls.add_method('SetUpdateTxCurrentCallback', + 'void', + [param('ns3::Callback< void, double, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) return def register_Ns3WifiTxVector_methods(root_module, cls): @@ -2643,6 +2776,23 @@ cls.add_static_attribute('implementation', 'ns3::int64x64_t::impl_type const', is_const=True) return +def register_Ns3BasicEnergyHarvesterHelper_methods(root_module, cls): + ## basic-energy-harvester-helper.h (module 'energy'): ns3::BasicEnergyHarvesterHelper::BasicEnergyHarvesterHelper(ns3::BasicEnergyHarvesterHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::BasicEnergyHarvesterHelper const &', 'arg0')]) + ## basic-energy-harvester-helper.h (module 'energy'): ns3::BasicEnergyHarvesterHelper::BasicEnergyHarvesterHelper() [constructor] + cls.add_constructor([]) + ## basic-energy-harvester-helper.h (module 'energy'): void ns3::BasicEnergyHarvesterHelper::Set(std::string name, ns3::AttributeValue const & v) [member function] + cls.add_method('Set', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue const &', 'v')], + is_virtual=True) + ## basic-energy-harvester-helper.h (module 'energy'): ns3::Ptr ns3::BasicEnergyHarvesterHelper::DoInstall(ns3::Ptr source) const [member function] + cls.add_method('DoInstall', + 'ns3::Ptr< ns3::EnergyHarvester >', + [param('ns3::Ptr< ns3::EnergySource >', 'source')], + is_const=True, visibility='private', is_virtual=True) + return + def register_Ns3BasicEnergySourceHelper_methods(root_module, cls): ## basic-energy-source-helper.h (module 'energy'): ns3::BasicEnergySourceHelper::BasicEnergySourceHelper(ns3::BasicEnergySourceHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::BasicEnergySourceHelper const &', 'arg0')]) @@ -2781,6 +2931,89 @@ []) return +def register_Ns3RandomVariableStream_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::RandomVariableStream::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::RandomVariableStream::RandomVariableStream() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): void ns3::RandomVariableStream::SetStream(int64_t stream) [member function] + cls.add_method('SetStream', + 'void', + [param('int64_t', 'stream')]) + ## random-variable-stream.h (module 'core'): int64_t ns3::RandomVariableStream::GetStream() const [member function] + cls.add_method('GetStream', + 'int64_t', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): void ns3::RandomVariableStream::SetAntithetic(bool isAntithetic) [member function] + cls.add_method('SetAntithetic', + 'void', + [param('bool', 'isAntithetic')]) + ## random-variable-stream.h (module 'core'): bool ns3::RandomVariableStream::IsAntithetic() const [member function] + cls.add_method('IsAntithetic', + 'bool', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::RandomVariableStream::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_pure_virtual=True, is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::RandomVariableStream::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_pure_virtual=True, is_virtual=True) + ## random-variable-stream.h (module 'core'): ns3::RngStream * ns3::RandomVariableStream::Peek() const [member function] + cls.add_method('Peek', + 'ns3::RngStream *', + [], + is_const=True, visibility='protected') + return + +def register_Ns3SequentialRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::SequentialRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::SequentialRandomVariable::SequentialRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetMin() const [member function] + cls.add_method('GetMin', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetMax() const [member function] + cls.add_method('GetMax', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): ns3::Ptr ns3::SequentialRandomVariable::GetIncrement() const [member function] + cls.add_method('GetIncrement', + 'ns3::Ptr< ns3::RandomVariableStream >', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::SequentialRandomVariable::GetConsecutive() const [member function] + cls.add_method('GetConsecutive', + 'uint32_t', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::SequentialRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount >::SimpleRefCount() [constructor] cls.add_constructor([]) @@ -2921,10 +3154,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -2935,25 +3168,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -3070,20 +3303,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return @@ -3181,6 +3414,130 @@ is_pure_virtual=True, is_const=True, is_virtual=True) return +def register_Ns3TriangularRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::TriangularRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::TriangularRandomVariable::TriangularRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMean() const [member function] + cls.add_method('GetMean', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMin() const [member function] + cls.add_method('GetMin', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMax() const [member function] + cls.add_method('GetMax', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetValue(double mean, double min, double max) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'mean'), param('double', 'min'), param('double', 'max')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::TriangularRandomVariable::GetInteger(uint32_t mean, uint32_t min, uint32_t max) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'mean'), param('uint32_t', 'min'), param('uint32_t', 'max')]) + ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::TriangularRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + +def register_Ns3UniformRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::UniformRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::UniformRandomVariable::UniformRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetMin() const [member function] + cls.add_method('GetMin', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetMax() const [member function] + cls.add_method('GetMax', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetValue(double min, double max) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'min'), param('double', 'max')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::UniformRandomVariable::GetInteger(uint32_t min, uint32_t max) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'min'), param('uint32_t', 'max')]) + ## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::UniformRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + +def register_Ns3WeibullRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::WeibullRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::WeibullRandomVariable::WeibullRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetScale() const [member function] + cls.add_method('GetScale', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetShape() const [member function] + cls.add_method('GetShape', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetBound() const [member function] + cls.add_method('GetBound', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetValue(double scale, double shape, double bound) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'scale'), param('double', 'shape'), param('double', 'bound')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::WeibullRandomVariable::GetInteger(uint32_t scale, uint32_t shape, uint32_t bound) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'scale'), param('uint32_t', 'shape'), param('uint32_t', 'bound')]) + ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::WeibullRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3WifiPhy_methods(root_module, cls): ## wifi-phy.h (module 'wifi'): ns3::WifiPhy::WifiPhy(ns3::WifiPhy const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiPhy const &', 'arg0')]) @@ -3726,6 +4083,11 @@ 'bool', [], is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateSleep() [member function] + cls.add_method('IsStateSleep', + 'bool', + [], + is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateSwitching() [member function] cls.add_method('IsStateSwitching', 'bool', @@ -3778,10 +4140,15 @@ 'void', [param('ns3::WifiPhyListener *', 'listener')], is_pure_virtual=True, is_virtual=True) - ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SendPacket(ns3::Ptr packet, ns3::WifiMode mode, ns3::WifiPreamble preamble, ns3::WifiTxVector txvector) [member function] + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::ResumeFromSleep() [member function] + cls.add_method('ResumeFromSleep', + 'void', + [], + is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SendPacket(ns3::Ptr packet, ns3::WifiTxVector txvector, ns3::WifiPreamble preamble) [member function] cls.add_method('SendPacket', 'void', - [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble'), param('ns3::WifiTxVector', 'txvector')], + [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiTxVector', 'txvector'), param('ns3::WifiPreamble', 'preamble')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetChannelBonding(bool channelbonding) [member function] cls.add_method('SetChannelBonding', @@ -3833,6 +4200,11 @@ 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, double, ns3::WifiMode, ns3::WifiPreamble, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_pure_virtual=True, is_virtual=True) + ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetSleepMode() [member function] + cls.add_method('SetSleepMode', + 'void', + [], + is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetStbc(bool stbc) [member function] cls.add_method('SetStbc', 'void', @@ -3845,6 +4217,99 @@ is_pure_virtual=True, is_virtual=True) return +def register_Ns3WifiTxCurrentModel_methods(root_module, cls): + ## wifi-tx-current-model.h (module 'energy'): ns3::WifiTxCurrentModel::WifiTxCurrentModel(ns3::WifiTxCurrentModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::WifiTxCurrentModel const &', 'arg0')]) + ## wifi-tx-current-model.h (module 'energy'): ns3::WifiTxCurrentModel::WifiTxCurrentModel() [constructor] + cls.add_constructor([]) + ## wifi-tx-current-model.h (module 'energy'): double ns3::WifiTxCurrentModel::CalcTxCurrent(double txPowerDbm) const [member function] + cls.add_method('CalcTxCurrent', + 'double', + [param('double', 'txPowerDbm')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## wifi-tx-current-model.h (module 'energy'): static double ns3::WifiTxCurrentModel::DbmToW(double dbm) [member function] + cls.add_method('DbmToW', + 'double', + [param('double', 'dbm')], + is_static=True) + ## wifi-tx-current-model.h (module 'energy'): static ns3::TypeId ns3::WifiTxCurrentModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + return + +def register_Ns3ZetaRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ZetaRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable::ZetaRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetAlpha() const [member function] + cls.add_method('GetAlpha', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetValue(double alpha) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'alpha')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ZetaRandomVariable::GetInteger(uint32_t alpha) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'alpha')]) + ## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ZetaRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + +def register_Ns3ZipfRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ZipfRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::ZipfRandomVariable::ZipfRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetN() const [member function] + cls.add_method('GetN', + 'uint32_t', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetAlpha() const [member function] + cls.add_method('GetAlpha', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetValue(uint32_t n, double alpha) [member function] + cls.add_method('GetValue', + 'double', + [param('uint32_t', 'n'), param('double', 'alpha')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetInteger(uint32_t n, uint32_t alpha) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'n'), param('uint32_t', 'alpha')]) + ## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3AttributeAccessor_methods(root_module, cls): ## attribute.h (module 'core'): ns3::AttributeAccessor::AttributeAccessor(ns3::AttributeAccessor const & arg0) [copy constructor] cls.add_constructor([param('ns3::AttributeAccessor const &', 'arg0')]) @@ -4024,22 +4489,79 @@ [param('ns3::CallbackBase', 'base')]) return -def register_Ns3DeviceEnergyModel_methods(root_module, cls): - ## device-energy-model.h (module 'energy'): ns3::DeviceEnergyModel::DeviceEnergyModel(ns3::DeviceEnergyModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::DeviceEnergyModel const &', 'arg0')]) - ## device-energy-model.h (module 'energy'): ns3::DeviceEnergyModel::DeviceEnergyModel() [constructor] +def register_Ns3ConstantRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ConstantRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable::ConstantRandomVariable() [constructor] cls.add_constructor([]) - ## device-energy-model.h (module 'energy'): void ns3::DeviceEnergyModel::ChangeState(int newState) [member function] - cls.add_method('ChangeState', - 'void', - [param('int', 'newState')], - is_pure_virtual=True, is_virtual=True) - ## device-energy-model.h (module 'energy'): double ns3::DeviceEnergyModel::GetCurrentA() const [member function] - cls.add_method('GetCurrentA', + ## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetConstant() const [member function] + cls.add_method('GetConstant', 'double', [], is_const=True) - ## device-energy-model.h (module 'energy'): double ns3::DeviceEnergyModel::GetTotalEnergyConsumption() const [member function] + ## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetValue(double constant) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'constant')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ConstantRandomVariable::GetInteger(uint32_t constant) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'constant')]) + ## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ConstantRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + +def register_Ns3DeterministicRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::DeterministicRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::DeterministicRandomVariable::DeterministicRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): void ns3::DeterministicRandomVariable::SetValueArray(double * values, uint64_t length) [member function] + cls.add_method('SetValueArray', + 'void', + [param('double *', 'values'), param('uint64_t', 'length')]) + ## random-variable-stream.h (module 'core'): double ns3::DeterministicRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::DeterministicRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + +def register_Ns3DeviceEnergyModel_methods(root_module, cls): + ## device-energy-model.h (module 'energy'): ns3::DeviceEnergyModel::DeviceEnergyModel(ns3::DeviceEnergyModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::DeviceEnergyModel const &', 'arg0')]) + ## device-energy-model.h (module 'energy'): ns3::DeviceEnergyModel::DeviceEnergyModel() [constructor] + cls.add_constructor([]) + ## device-energy-model.h (module 'energy'): void ns3::DeviceEnergyModel::ChangeState(int newState) [member function] + cls.add_method('ChangeState', + 'void', + [param('int', 'newState')], + is_pure_virtual=True, is_virtual=True) + ## device-energy-model.h (module 'energy'): double ns3::DeviceEnergyModel::GetCurrentA() const [member function] + cls.add_method('GetCurrentA', + 'double', + [], + is_const=True) + ## device-energy-model.h (module 'energy'): double ns3::DeviceEnergyModel::GetTotalEnergyConsumption() const [member function] cls.add_method('GetTotalEnergyConsumption', 'double', [], @@ -4054,6 +4576,11 @@ 'void', [], is_pure_virtual=True, is_virtual=True) + ## device-energy-model.h (module 'energy'): void ns3::DeviceEnergyModel::HandleEnergyRecharged() [member function] + cls.add_method('HandleEnergyRecharged', + 'void', + [], + is_pure_virtual=True, is_virtual=True) ## device-energy-model.h (module 'energy'): void ns3::DeviceEnergyModel::SetEnergySource(ns3::Ptr source) [member function] cls.add_method('SetEnergySource', 'void', @@ -4099,6 +4626,40 @@ [param('double const &', 'value')]) return +def register_Ns3EmpiricalRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): ns3::EmpiricalRandomVariable::EmpiricalRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): void ns3::EmpiricalRandomVariable::CDF(double v, double c) [member function] + cls.add_method('CDF', + 'void', + [param('double', 'v'), param('double', 'c')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::EmpiricalRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::EmpiricalRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): double ns3::EmpiricalRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): double ns3::EmpiricalRandomVariable::Interpolate(double arg0, double arg1, double arg2, double arg3, double arg4) [member function] + cls.add_method('Interpolate', + 'double', + [param('double', 'arg0'), param('double', 'arg1'), param('double', 'arg2'), param('double', 'arg3'), param('double', 'arg4')], + visibility='private', is_virtual=True) + ## random-variable-stream.h (module 'core'): void ns3::EmpiricalRandomVariable::Validate() [member function] + cls.add_method('Validate', + 'void', + [], + visibility='private', is_virtual=True) + return + def register_Ns3EmptyAttributeValue_methods(root_module, cls): ## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue(ns3::EmptyAttributeValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::EmptyAttributeValue const &', 'arg0')]) @@ -4121,6 +4682,115 @@ is_const=True, visibility='private', is_virtual=True) return +def register_Ns3EnergyHarvester_methods(root_module, cls): + ## energy-harvester.h (module 'energy'): ns3::EnergyHarvester::EnergyHarvester(ns3::EnergyHarvester const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EnergyHarvester const &', 'arg0')]) + ## energy-harvester.h (module 'energy'): ns3::EnergyHarvester::EnergyHarvester() [constructor] + cls.add_constructor([]) + ## energy-harvester.h (module 'energy'): ns3::Ptr ns3::EnergyHarvester::GetEnergySource() const [member function] + cls.add_method('GetEnergySource', + 'ns3::Ptr< ns3::EnergySource >', + [], + is_const=True) + ## energy-harvester.h (module 'energy'): ns3::Ptr ns3::EnergyHarvester::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True) + ## energy-harvester.h (module 'energy'): double ns3::EnergyHarvester::GetPower() const [member function] + cls.add_method('GetPower', + 'double', + [], + is_const=True) + ## energy-harvester.h (module 'energy'): static ns3::TypeId ns3::EnergyHarvester::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## energy-harvester.h (module 'energy'): void ns3::EnergyHarvester::SetEnergySource(ns3::Ptr source) [member function] + cls.add_method('SetEnergySource', + 'void', + [param('ns3::Ptr< ns3::EnergySource >', 'source')]) + ## energy-harvester.h (module 'energy'): void ns3::EnergyHarvester::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) + ## energy-harvester.h (module 'energy'): void ns3::EnergyHarvester::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## energy-harvester.h (module 'energy'): double ns3::EnergyHarvester::DoGetPower() const [member function] + cls.add_method('DoGetPower', + 'double', + [], + is_const=True, visibility='private', is_virtual=True) + return + +def register_Ns3EnergyHarvesterContainer_methods(root_module, cls): + ## energy-harvester-container.h (module 'energy'): ns3::EnergyHarvesterContainer::EnergyHarvesterContainer(ns3::EnergyHarvesterContainer const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EnergyHarvesterContainer const &', 'arg0')]) + ## energy-harvester-container.h (module 'energy'): ns3::EnergyHarvesterContainer::EnergyHarvesterContainer() [constructor] + cls.add_constructor([]) + ## energy-harvester-container.h (module 'energy'): ns3::EnergyHarvesterContainer::EnergyHarvesterContainer(ns3::Ptr harvester) [constructor] + cls.add_constructor([param('ns3::Ptr< ns3::EnergyHarvester >', 'harvester')]) + ## energy-harvester-container.h (module 'energy'): ns3::EnergyHarvesterContainer::EnergyHarvesterContainer(std::string harvesterName) [constructor] + cls.add_constructor([param('std::string', 'harvesterName')]) + ## energy-harvester-container.h (module 'energy'): ns3::EnergyHarvesterContainer::EnergyHarvesterContainer(ns3::EnergyHarvesterContainer const & a, ns3::EnergyHarvesterContainer const & b) [constructor] + cls.add_constructor([param('ns3::EnergyHarvesterContainer const &', 'a'), param('ns3::EnergyHarvesterContainer const &', 'b')]) + ## energy-harvester-container.h (module 'energy'): void ns3::EnergyHarvesterContainer::Add(ns3::EnergyHarvesterContainer container) [member function] + cls.add_method('Add', + 'void', + [param('ns3::EnergyHarvesterContainer', 'container')]) + ## energy-harvester-container.h (module 'energy'): void ns3::EnergyHarvesterContainer::Add(ns3::Ptr harvester) [member function] + cls.add_method('Add', + 'void', + [param('ns3::Ptr< ns3::EnergyHarvester >', 'harvester')]) + ## energy-harvester-container.h (module 'energy'): void ns3::EnergyHarvesterContainer::Add(std::string harvesterName) [member function] + cls.add_method('Add', + 'void', + [param('std::string', 'harvesterName')]) + ## energy-harvester-container.h (module 'energy'): __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::EnergyHarvesterContainer::Begin() const [member function] + cls.add_method('Begin', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::EnergyHarvester > const, std::vector< ns3::Ptr< ns3::EnergyHarvester > > >', + [], + is_const=True) + ## energy-harvester-container.h (module 'energy'): void ns3::EnergyHarvesterContainer::Clear() [member function] + cls.add_method('Clear', + 'void', + []) + ## energy-harvester-container.h (module 'energy'): __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::EnergyHarvesterContainer::End() const [member function] + cls.add_method('End', + '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::EnergyHarvester > const, std::vector< ns3::Ptr< ns3::EnergyHarvester > > >', + [], + is_const=True) + ## energy-harvester-container.h (module 'energy'): ns3::Ptr ns3::EnergyHarvesterContainer::Get(uint32_t i) const [member function] + cls.add_method('Get', + 'ns3::Ptr< ns3::EnergyHarvester >', + [param('uint32_t', 'i')], + is_const=True) + ## energy-harvester-container.h (module 'energy'): uint32_t ns3::EnergyHarvesterContainer::GetN() const [member function] + cls.add_method('GetN', + 'uint32_t', + [], + is_const=True) + ## energy-harvester-container.h (module 'energy'): static ns3::TypeId ns3::EnergyHarvesterContainer::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## energy-harvester-container.h (module 'energy'): void ns3::EnergyHarvesterContainer::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## energy-harvester-container.h (module 'energy'): void ns3::EnergyHarvesterContainer::DoInitialize() [member function] + cls.add_method('DoInitialize', + 'void', + [], + visibility='private', is_virtual=True) + return + def register_Ns3EnergySource_methods(root_module, cls): ## energy-source.h (module 'energy'): ns3::EnergySource::EnergySource(ns3::EnergySource const & arg0) [copy constructor] cls.add_constructor([param('ns3::EnergySource const &', 'arg0')]) @@ -4130,6 +4800,10 @@ cls.add_method('AppendDeviceEnergyModel', 'void', [param('ns3::Ptr< ns3::DeviceEnergyModel >', 'deviceEnergyModelPtr')]) + ## energy-source.h (module 'energy'): void ns3::EnergySource::ConnectEnergyHarvester(ns3::Ptr energyHarvesterPtr) [member function] + cls.add_method('ConnectEnergyHarvester', + 'void', + [param('ns3::Ptr< ns3::EnergyHarvester >', 'energyHarvesterPtr')]) ## energy-source.h (module 'energy'): void ns3::EnergySource::DisposeDeviceModels() [member function] cls.add_method('DisposeDeviceModels', 'void', @@ -4200,6 +4874,11 @@ 'void', [], visibility='protected') + ## energy-source.h (module 'energy'): void ns3::EnergySource::NotifyEnergyRecharged() [member function] + cls.add_method('NotifyEnergyRecharged', + 'void', + [], + visibility='protected') ## energy-source.h (module 'energy'): void ns3::EnergySource::DoDispose() [member function] cls.add_method('DoDispose', 'void', @@ -4345,6 +5024,44 @@ [param('int', 'v')]) return +def register_Ns3ErlangRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ErlangRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::ErlangRandomVariable::ErlangRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetK() const [member function] + cls.add_method('GetK', + 'uint32_t', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetLambda() const [member function] + cls.add_method('GetLambda', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetValue(uint32_t k, double lambda) [member function] + cls.add_method('GetValue', + 'double', + [param('uint32_t', 'k'), param('double', 'lambda')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetInteger(uint32_t k, uint32_t lambda) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'k'), param('uint32_t', 'lambda')]) + ## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3EventImpl_methods(root_module, cls): ## event-impl.h (module 'core'): ns3::EventImpl::EventImpl(ns3::EventImpl const & arg0) [copy constructor] cls.add_constructor([param('ns3::EventImpl const &', 'arg0')]) @@ -4369,6 +5086,82 @@ is_pure_virtual=True, visibility='protected', is_virtual=True) return +def register_Ns3ExponentialRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ExponentialRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::ExponentialRandomVariable::ExponentialRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetMean() const [member function] + cls.add_method('GetMean', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetBound() const [member function] + cls.add_method('GetBound', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetValue(double mean, double bound) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'mean'), param('double', 'bound')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ExponentialRandomVariable::GetInteger(uint32_t mean, uint32_t bound) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'mean'), param('uint32_t', 'bound')]) + ## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ExponentialRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + +def register_Ns3GammaRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::GammaRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::GammaRandomVariable::GammaRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetAlpha() const [member function] + cls.add_method('GetAlpha', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetBeta() const [member function] + cls.add_method('GetBeta', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetValue(double alpha, double beta) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'alpha'), param('double', 'beta')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::GammaRandomVariable::GetInteger(uint32_t alpha, uint32_t beta) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'alpha'), param('uint32_t', 'beta')]) + ## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::GammaRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3IntegerValue_methods(root_module, cls): ## integer.h (module 'core'): ns3::IntegerValue::IntegerValue() [constructor] cls.add_constructor([]) @@ -4636,6 +5429,88 @@ visibility='private', is_virtual=True) return +def register_Ns3LinearWifiTxCurrentModel_methods(root_module, cls): + ## wifi-tx-current-model.h (module 'energy'): ns3::LinearWifiTxCurrentModel::LinearWifiTxCurrentModel(ns3::LinearWifiTxCurrentModel const & arg0) [copy constructor] + cls.add_constructor([param('ns3::LinearWifiTxCurrentModel const &', 'arg0')]) + ## wifi-tx-current-model.h (module 'energy'): ns3::LinearWifiTxCurrentModel::LinearWifiTxCurrentModel() [constructor] + cls.add_constructor([]) + ## wifi-tx-current-model.h (module 'energy'): double ns3::LinearWifiTxCurrentModel::CalcTxCurrent(double txPowerDbm) const [member function] + cls.add_method('CalcTxCurrent', + 'double', + [param('double', 'txPowerDbm')], + is_const=True, is_virtual=True) + ## wifi-tx-current-model.h (module 'energy'): double ns3::LinearWifiTxCurrentModel::GetEta() const [member function] + cls.add_method('GetEta', + 'double', + [], + is_const=True) + ## wifi-tx-current-model.h (module 'energy'): double ns3::LinearWifiTxCurrentModel::GetIdleCurrent() const [member function] + cls.add_method('GetIdleCurrent', + 'double', + [], + is_const=True) + ## wifi-tx-current-model.h (module 'energy'): static ns3::TypeId ns3::LinearWifiTxCurrentModel::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## wifi-tx-current-model.h (module 'energy'): double ns3::LinearWifiTxCurrentModel::GetVoltage() const [member function] + cls.add_method('GetVoltage', + 'double', + [], + is_const=True) + ## wifi-tx-current-model.h (module 'energy'): void ns3::LinearWifiTxCurrentModel::SetEta(double eta) [member function] + cls.add_method('SetEta', + 'void', + [param('double', 'eta')]) + ## wifi-tx-current-model.h (module 'energy'): void ns3::LinearWifiTxCurrentModel::SetIdleCurrent(double idleCurrent) [member function] + cls.add_method('SetIdleCurrent', + 'void', + [param('double', 'idleCurrent')]) + ## wifi-tx-current-model.h (module 'energy'): void ns3::LinearWifiTxCurrentModel::SetVoltage(double voltage) [member function] + cls.add_method('SetVoltage', + 'void', + [param('double', 'voltage')]) + return + +def register_Ns3LogNormalRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::LogNormalRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::LogNormalRandomVariable::LogNormalRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetMu() const [member function] + cls.add_method('GetMu', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetSigma() const [member function] + cls.add_method('GetSigma', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetValue(double mu, double sigma) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'mu'), param('double', 'sigma')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::LogNormalRandomVariable::GetInteger(uint32_t mu, uint32_t sigma) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'mu'), param('uint32_t', 'sigma')]) + ## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::LogNormalRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3NetDevice_methods(root_module, cls): ## net-device.h (module 'network'): ns3::NetDevice::NetDevice() [constructor] cls.add_constructor([]) @@ -4895,6 +5770,51 @@ visibility='protected', is_virtual=True) return +def register_Ns3NormalRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable::INFINITE_VALUE [variable] + cls.add_static_attribute('INFINITE_VALUE', 'double const', is_const=True) + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::NormalRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable::NormalRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetMean() const [member function] + cls.add_method('GetMean', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetVariance() const [member function] + cls.add_method('GetVariance', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetBound() const [member function] + cls.add_method('GetBound', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetValue(double mean, double variance, double bound=ns3::NormalRandomVariable::INFINITE_VALUE) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'mean'), param('double', 'variance'), param('double', 'bound', default_value='ns3::NormalRandomVariable::INFINITE_VALUE')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::NormalRandomVariable::GetInteger(uint32_t mean, uint32_t variance, uint32_t bound) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'mean'), param('uint32_t', 'variance'), param('uint32_t', 'bound')]) + ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::NormalRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3ObjectFactoryChecker_methods(root_module, cls): ## object-factory.h (module 'core'): ns3::ObjectFactoryChecker::ObjectFactoryChecker() [constructor] cls.add_constructor([]) @@ -5120,6 +6040,49 @@ [param('ns3::Ptr< ns3::NixVector >', 'nixVector')]) return +def register_Ns3ParetoRandomVariable_methods(root_module, cls): + ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ParetoRandomVariable::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable::ParetoRandomVariable() [constructor] + cls.add_constructor([]) + ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetMean() const [member function] + cls.add_method('GetMean', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetShape() const [member function] + cls.add_method('GetShape', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetBound() const [member function] + cls.add_method('GetBound', + 'double', + [], + is_const=True) + ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetValue(double mean, double shape, double bound) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 'mean'), param('double', 'shape'), param('double', 'bound')]) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ParetoRandomVariable::GetInteger(uint32_t mean, uint32_t shape, uint32_t bound) [member function] + cls.add_method('GetInteger', + 'uint32_t', + [param('uint32_t', 'mean'), param('uint32_t', 'shape'), param('uint32_t', 'bound')]) + ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetValue() [member function] + cls.add_method('GetValue', + 'double', + [], + is_virtual=True) + ## random-variable-stream.h (module 'core'): uint32_t ns3::ParetoRandomVariable::GetInteger() [member function] + cls.add_method('GetInteger', + 'uint32_t', + [], + is_virtual=True) + return + def register_Ns3RvBatteryModel_methods(root_module, cls): ## rv-battery-model.h (module 'energy'): ns3::RvBatteryModel::RvBatteryModel(ns3::RvBatteryModel const & arg0) [copy constructor] cls.add_constructor([param('ns3::RvBatteryModel const &', 'arg0')]) @@ -5260,6 +6223,11 @@ 'void', [], is_virtual=True) + ## simple-device-energy-model.h (module 'energy'): void ns3::SimpleDeviceEnergyModel::HandleEnergyRecharged() [member function] + cls.add_method('HandleEnergyRecharged', + 'void', + [], + is_virtual=True) ## simple-device-energy-model.h (module 'energy'): void ns3::SimpleDeviceEnergyModel::SetCurrentA(double current) [member function] cls.add_method('SetCurrentA', 'void', @@ -5466,6 +6434,11 @@ 'double', [], is_const=True) + ## wifi-radio-energy-model.h (module 'energy'): double ns3::WifiRadioEnergyModel::GetSleepCurrentA() const [member function] + cls.add_method('GetSleepCurrentA', + 'double', + [], + is_const=True) ## wifi-radio-energy-model.h (module 'energy'): double ns3::WifiRadioEnergyModel::GetSwitchingCurrentA() const [member function] cls.add_method('GetSwitchingCurrentA', 'double', @@ -5491,6 +6464,11 @@ 'void', [], is_virtual=True) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::HandleEnergyRecharged() [member function] + cls.add_method('HandleEnergyRecharged', + 'void', + [], + is_virtual=True) ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetCcaBusyCurrentA(double ccaBusyCurrentA) [member function] cls.add_method('SetCcaBusyCurrentA', 'void', @@ -5499,6 +6477,10 @@ cls.add_method('SetEnergyDepletionCallback', 'void', [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetEnergyRechargedCallback(ns3::Callback callback) [member function] + cls.add_method('SetEnergyRechargedCallback', + 'void', + [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetEnergySource(ns3::Ptr source) [member function] cls.add_method('SetEnergySource', 'void', @@ -5512,6 +6494,10 @@ cls.add_method('SetRxCurrentA', 'void', [param('double', 'rxCurrentA')]) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetSleepCurrentA(double sleepCurrentA) [member function] + cls.add_method('SetSleepCurrentA', + 'void', + [param('double', 'sleepCurrentA')]) ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetSwitchingCurrentA(double switchingCurrentA) [member function] cls.add_method('SetSwitchingCurrentA', 'void', @@ -5520,6 +6506,14 @@ cls.add_method('SetTxCurrentA', 'void', [param('double', 'txCurrentA')]) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetTxCurrentFromModel(double txPowerDbm) [member function] + cls.add_method('SetTxCurrentFromModel', + 'void', + [param('double', 'txPowerDbm')]) + ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::SetTxCurrentModel(ns3::Ptr model) [member function] + cls.add_method('SetTxCurrentModel', + 'void', + [param('ns3::Ptr< ns3::WifiTxCurrentModel >', 'model')]) ## wifi-radio-energy-model.h (module 'energy'): void ns3::WifiRadioEnergyModel::DoDispose() [member function] cls.add_method('DoDispose', 'void', @@ -5572,6 +6566,48 @@ [param('ns3::Address const &', 'value')]) return +def register_Ns3BasicEnergyHarvester_methods(root_module, cls): + ## basic-energy-harvester.h (module 'energy'): ns3::BasicEnergyHarvester::BasicEnergyHarvester(ns3::BasicEnergyHarvester const & arg0) [copy constructor] + cls.add_constructor([param('ns3::BasicEnergyHarvester const &', 'arg0')]) + ## basic-energy-harvester.h (module 'energy'): ns3::BasicEnergyHarvester::BasicEnergyHarvester() [constructor] + cls.add_constructor([]) + ## basic-energy-harvester.h (module 'energy'): ns3::BasicEnergyHarvester::BasicEnergyHarvester(ns3::Time updateInterval) [constructor] + cls.add_constructor([param('ns3::Time', 'updateInterval')]) + ## basic-energy-harvester.h (module 'energy'): int64_t ns3::BasicEnergyHarvester::AssignStreams(int64_t stream) [member function] + cls.add_method('AssignStreams', + 'int64_t', + [param('int64_t', 'stream')]) + ## basic-energy-harvester.h (module 'energy'): ns3::Time ns3::BasicEnergyHarvester::GetHarvestedPowerUpdateInterval() const [member function] + cls.add_method('GetHarvestedPowerUpdateInterval', + 'ns3::Time', + [], + is_const=True) + ## basic-energy-harvester.h (module 'energy'): static ns3::TypeId ns3::BasicEnergyHarvester::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## basic-energy-harvester.h (module 'energy'): void ns3::BasicEnergyHarvester::SetHarvestedPowerUpdateInterval(ns3::Time updateInterval) [member function] + cls.add_method('SetHarvestedPowerUpdateInterval', + 'void', + [param('ns3::Time', 'updateInterval')]) + ## basic-energy-harvester.h (module 'energy'): void ns3::BasicEnergyHarvester::DoDispose() [member function] + cls.add_method('DoDispose', + 'void', + [], + visibility='private', is_virtual=True) + ## basic-energy-harvester.h (module 'energy'): double ns3::BasicEnergyHarvester::DoGetPower() const [member function] + cls.add_method('DoGetPower', + 'double', + [], + is_const=True, visibility='private', is_virtual=True) + ## basic-energy-harvester.h (module 'energy'): void ns3::BasicEnergyHarvester::DoInitialize() [member function] + cls.add_method('DoInitialize', + 'void', + [], + visibility='private', is_virtual=True) + return + def register_Ns3BasicEnergySource_methods(root_module, cls): ## basic-energy-source.h (module 'energy'): ns3::BasicEnergySource::BasicEnergySource(ns3::BasicEnergySource const & arg0) [copy constructor] cls.add_constructor([param('ns3::BasicEnergySource const &', 'arg0')]) diff -Naur ns-3.20/src/energy/doc/energy.rst ns-3.21/src/energy/doc/energy.rst --- ns-3.20/src/energy/doc/energy.rst 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/doc/energy.rst 2014-09-17 20:03:14.000000000 -0700 @@ -1,7 +1,7 @@ Energy Framework ---------------- -Energy consumption is a key issue for wireless devices, and wireless network researchers often need to investigate the energy consumption at a node or in the overall network while running network simulations in ns-3. This requires ns-3 to support energy consumption modeling. Further, as concepts such as fuel cells and energy scavenging are becoming viable for low power wireless devices, incorporating the effect of these emerging technologies into simulations requires support for modeling diverse energy sources in ns-3. The ns-3 Energy Framework provides the basis for energy consumption and energy source modeling. +Energy consumption is a key issue for wireless devices, and wireless network researchers often need to investigate the energy consumption at a node or in the overall network while running network simulations in ns-3. This requires ns-3 to support energy consumption modeling. Further, as concepts such as fuel cells and energy scavenging are becoming viable for low power wireless devices, incorporating the effect of these emerging technologies into simulations requires support for modeling diverse energy sources in ns-3. The ns-3 Energy Framework provides the basis for energy consumption, energy source and energy harvesting modeling. Model Description @@ -12,8 +12,8 @@ Design ****** -The ns-3 Energy Framework is composed of 2 parts: Energy Source and Device Energy Model. -The framework will be implemented into the ``src/energy/models`` folder. +The ns-3 Energy Framework is composed of 3 parts: Energy Source, Device Energy Model and Energy Harvester. +The framework is implemented into the ``src/energy/models`` folder. Energy Source ############# @@ -25,21 +25,37 @@ * Rate Capacity Effect: Decrease of battery lifetime when the current draw is higher than the rated value of the battery. * Recovery Effect: Increase of battery lifetime when the battery is alternating between discharge and idle states. -In order to incorporate the Rate Capacity Effect, the Energy Source uses current draw from all devices on the same node to calculate energy consumption. The Energy Source polls all devices on the same node periodically to calculate the total current draw and hence the energy consumption. When a device changes state, its corresponding Device Energy Model will notify the Energy Source of this change and new total current draw will be calculated. +In order to incorporate the Rate Capacity Effect, the Energy Source uses current draw from all the devices on the same node to calculate energy consumption. Moreover, multiple Energy Harvesters can be connected to the Energy Source in order to replenish its energy. The Energy Source periodically polls all the devices and energy harvesters on the same node to calculate the total current drain and hence the energy consumption. When a device changes state, its corresponding Device Energy Model will notify the Energy Source of this change and new total current draw will be calculated. Similarly, every Energy Harvester update triggers an update to the connected Energy Source. + +The Energy Source base class keeps a list of devices (Device Energy Model objects) and energy harvesters (Energy Harvester objects) that are using the particular Energy Source as power supply. When energy is completely drained, the Energy Source will notify all devices on this list. Each device can then handle this event independently, based on the desired behavior that should be followed in case of power outage. -The Energy Source base class keeps a list of devices (Device Energy Model objects) using the particular Energy Source as power supply. When energy is completely drained, the Energy Source will notify all devices on this list. Each device can then handle this event independently, based on the desired behavior when power supply is drained. Device Energy Model ################### -The Device Energy Model is the energy consumption model of a device on node. It is designed to be a state based model where each device is assumed to have a number of states, and each state is associated with a power consumption value. Whenever the state of the device changes, the corresponding Device Energy Model will notify the Energy Source of the new current draw of the device. The Energy Source will then calculate the new total current draw and update the remaining energy. +The Device Energy Model is the energy consumption model of a device installed on the node. It is designed to be a state based model where each device is assumed to have a number of states, and each state is associated with a power consumption value. Whenever the state of the device changes, the corresponding Device Energy Model will notify the Energy Source of the new current draw of the device. The Energy Source will then calculate the new total current draw and update the remaining energy. The Device Energy Model can also be used for devices that do not have finite number of states. For example, in an electric vehicle, the current draw of the motor is determined by its speed. Since the vehicle's speed can take continuous values within a certain range, it is infeasible to define a set of discrete states of operation. However, by converting the speed value into current directly, the same set of Device Energy Model APIs can still be used. +Energy Harvester +############# + +The energy harvester represents the elements that harvest energy from the environment and recharge the Energy Source to which it is connected. The energy harvester includes the complete implementation of the actual energy harvesting device (e.g., a solar panel) and the environment (e.g., the solar radiation). This means that in implementing an energy harvester, the energy contribution of the environment and the additional energy requirements of the energy harvesting device such as the conversion efficiency and the internal power consumption of the device needs to be jointly modeled. + + +WiFi Radio Energy Model +####################### + +The WiFi Radio Energy Model is the energy consumption model of a Wifi net device. It provides a state for each of the available states of the PHY layer: Idle, CcaBusy, Tx, Rx, ChannelSwitch, Sleep. Each of such states is associated with a value (in Ampere) of the current draw (see below for the corresponding attribute names). A Wifi Radio Energy Model PHY Listener is registered to the Wifi PHY in order to be notified of every Wifi PHY state transition. At every transition, the energy consumed in the previous state is computed and the energy source is notified in order to update its remaining energy. + +The Wifi Tx Current Model gives the possibility to compute the current draw in the transmit state as a function of the nominal tx power (in dBm), as observed in several experimental measurements. To this purpose, the Wifi Radio Energy Model PHY Listener is notified of the nominal tx power used to transmit the current frame and passes such a value to the Wifi Tx Current Model which takes care of updating the current draw in the Tx state. Hence, the energy consumption is correctly computed even if the Wifi Remote Station Manager performs per-frame power control. Currently, a Linear Wifi Tx Current Model is implemented which computes the tx current as a linear function (according to parameters that can be specified by the user) of the nominal tx power in dBm. + +The Wifi Radio Energy Model offers the possibility to specify a callback that is invoked when the energy source is depleted. If such a callback is not specified when the Wifi Radio Energy Model Helper is used to install the model on a device, a callback is implicitly made so that the Wifi PHY is put in the SLEEP mode (hence no frame is transmitted nor received afterwards) when the energy source is depleted. Likewise, it is possible to specify a callback that is invoked when the energy source is recharged (which might occur in case an energy harvester is connected to the energy source). If such a callback is not specified when the Wifi Radio Energy Model Helper is used to install the model on a device, a callback is implicitly made so that the Wifi PHY is resumed from the SLEEP mode when the energy source is recharged. + Future Work *********** -For Device Energy Models, we are planning to include support for other PHY layer models provided in ns-3 such as WiMAX. For Energy Sources, we are planning to included new types of Energy Sources such as energy scavenging. +For Device Energy Models, we are planning to include support for other PHY layer models provided in ns-3 such as WiMAX, and to model the energy consumptions of other non communicating devices, like a generic sensor and a CPU. For Energy Sources, we are planning to included new types of Energy Sources such as Supercapacitor and NickelMetal Hydride (Ni-MH) battery. For the Energy Harvesters, we are planning to implement an energy harvester that recharges the energy sources according to the power levels defined in a user customizable dataset of real measurements. References ********** @@ -51,19 +67,21 @@ (ASM), 2003. .. [4] D. N. Rakhmatov and S. B. Vrudhula. An analytical high-level battery model for use in energy management of portable electronic systems. In Proc. of IEEE/ACM International Conference on - Computer Aided Design (ICCAD’01), pages 488–493, November 2001. + Computer Aided Design (ICCAD'01), pages 488-493, November 2001. .. [5] D. N. Rakhmatov, S. B. Vrudhula, and D. A. Wallach. Battery lifetime prediction for energy-aware computing. In Proc. of the 2002 International Symposium on Low Power - Electronics and Design (ISLPED’02), pages 154–159, 2002. + Electronics and Design (ISLPED'02), pages 154-159, 2002. +.. [6] C. Tapparello, H. Ayatollahi and W. Heinzelman. Extending the Energy Framework for Network + Simulator 3 (ns-3). Workshop on ns-3 (WNS3), Poster Session, Atlanta, GA, USA. May, 2014. Usage ===== The main way that ns-3 users will typically interact with the Energy Framework is through the helper API and through the publicly visible attributes of the framework. The helper API is defined in ``src/energy/helper/*.h``. -In order to use the energy framework, the user must install an Energy Source for the node of interest and the corresponding Device Energy Model for the network devices. Energy Source (objects) are aggregated onto each node by the Energy Source Helper. In order to allow multiple energy sources per node, we aggregate an Energy Source Container rather than directly aggregating a source object. +In order to use the energy framework, the user must install an Energy Source for the node of interest, the corresponding Device Energy Model for the network devices and, if necessary, the one or more Energy Harvester. Energy Source (objects) are aggregated onto each node by the Energy Source Helper. In order to allow multiple energy sources per node, we aggregate an Energy Source Container rather than directly aggregating a source object. -The Energy Source object also keeps a list of Device Energy Model objects using the source as power supply. Device Energy Model objects are installed onto the Energy Source by the Device Energy Model Helper. User can access the Device Energy Model objects through the Energy Source object to obtain energy consumption information of individual devices. +The Energy Source object keeps a list of Device Energy Model and Energy Harvester objects using the source as power supply. Device Energy Model objects are installed onto the Energy Source by the Device Energy Model Helper, while Energy Harvester object are installed by the Energy Harvester Helper. User can access the Device Energy Model objects through the Energy Source object to obtain energy consumption information of individual devices. Moreover, the user can access to the Energy Harvester objects in order to gather information regarding the current harvestable power and the total energy harvested by the harvester. Examples @@ -86,10 +104,16 @@ Base helper class for Device Energy Model objects, this helper attaches Device Energy Model objects onto Energy Source objects. Child implementation of this class creates the actual Device Energy Model object. +Energy Harvesting Helper +########################## + +Base helper class for Energy Harvester objects, this helper attaches Energy Harvester objects onto Energy Source objects. Child implementation of this class creates the actual Energy Harvester object. + + Attributes ********** -Attributes differ between Energy Sources and Devices Energy Models implementations, please look at the specific child class for details. +Attributes differ between Energy Sources, Devices Energy Models and Energy Harvesters implementations, please look at the specific child class for details. Basic Energy Source ################### @@ -116,11 +140,19 @@ * ``TxCurrentA``: The radio Tx current in Ampere. * ``RxCurrentA``: The radio Rx current in Ampere. * ``SwitchingCurrentA``: The default radio Channel Switch current in Ampere. +* ``SleepCurrentA``: The radio Sleep current in Ampere. +* ``TxCurrentModel``: A pointer to the attached tx current model. + +Basic Energy Harvester +####################### + +* ``PeriodicHarvestedPowerUpdateInterval``: Time between two consecutive periodic updates of the harvested power. +* ``HarvestablePower``: Random variables that represents the amount of power that is provided by the energy harvester. Tracing ******* -Traced values differ between Energy Sources and Devices Energy Models implementations, please look at the specific child class for details. +Traced values differ between Energy Sources, Devices Energy Models and Energy Harvesters implementations, please look at the specific child class for details. Basic Energy Source ################### @@ -138,6 +170,13 @@ * ``TotalEnergyConsumption``: Total energy consumption of the radio device. +Basic Energy Harvester +####################### + +* ``HarvestedPower``: Current power provided by the BasicEnergyHarvester. +* ``TotalEnergyHarvested``: Total energy harvested by the BasicEnergyHarvester. + + Validation ********** diff -Naur ns-3.20/src/energy/helper/basic-energy-harvester-helper.cc ns-3.21/src/energy/helper/basic-energy-harvester-helper.cc --- ns-3.20/src/energy/helper/basic-energy-harvester-helper.cc 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/energy/helper/basic-energy-harvester-helper.cc 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,59 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * 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 + * + * Author: Cristiano Tapparello + */ + +#include "basic-energy-harvester-helper.h" +#include "ns3/energy-harvester.h" + +namespace ns3 { + +BasicEnergyHarvesterHelper::BasicEnergyHarvesterHelper () +{ + m_basicEnergyHarvester.SetTypeId ("ns3::BasicEnergyHarvester"); +} + +BasicEnergyHarvesterHelper::~BasicEnergyHarvesterHelper () +{ +} + +void +BasicEnergyHarvesterHelper::Set (std::string name, const AttributeValue &v) +{ + m_basicEnergyHarvester.Set (name, v); +} + +Ptr +BasicEnergyHarvesterHelper::DoInstall (Ptr source) const +{ + NS_ASSERT (source != 0); + Ptr node = source->GetNode (); + + // Create a new Basic Energy Harvester + Ptr harvester = m_basicEnergyHarvester.Create (); + NS_ASSERT (harvester != 0); + + // Connect the Basic Energy Harvester to the Energy Source + source->ConnectEnergyHarvester (harvester); + harvester->SetNode (node); + harvester->SetEnergySource (source); + return harvester; +} + +} // namespace ns3 diff -Naur ns-3.20/src/energy/helper/basic-energy-harvester-helper.h ns-3.21/src/energy/helper/basic-energy-harvester-helper.h --- ns-3.20/src/energy/helper/basic-energy-harvester-helper.h 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/energy/helper/basic-energy-harvester-helper.h 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,53 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * 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 + * + * Author: Cristiano Tapparello + */ + +#ifndef BASIC_ENERGY_HARVESTER_HELPER_H +#define BASIC_ENERGY_HARVESTER_HELPER_H + +#include "energy-harvester-helper.h" +#include "ns3/energy-source.h" +#include "ns3/node.h" + +namespace ns3 { + +/** + * \ingroup energy + * \brief Creates a BasicEnergyHarvester object. + */ +class BasicEnergyHarvesterHelper : public EnergyHarvesterHelper +{ +public: + BasicEnergyHarvesterHelper (); + ~BasicEnergyHarvesterHelper (); + + void Set (std::string name, const AttributeValue &v); + +private: + virtual Ptr DoInstall (Ptr source) const; + +private: + ObjectFactory m_basicEnergyHarvester; + +}; + +} // namespace ns3 + +#endif /* defined(BASIC_ENERGY_HARVESTER_HELPER_H) */ diff -Naur ns-3.20/src/energy/helper/energy-harvester-container.cc ns-3.21/src/energy/helper/energy-harvester-container.cc --- ns-3.20/src/energy/helper/energy-harvester-container.cc 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/energy/helper/energy-harvester-container.cc 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,164 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * 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 + * + * Author: Cristiano Tapparello + */ + +#include "energy-harvester-container.h" + +#include "ns3/names.h" +#include "ns3/log.h" + +NS_LOG_COMPONENT_DEFINE ("EnergyHarvesterContainer"); + +namespace ns3 { + +TypeId +EnergyHarvesterContainer::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::EnergyHarvesterContainer") + .SetParent () + .AddConstructor () + ; + return tid; +} + +EnergyHarvesterContainer::EnergyHarvesterContainer () +{ + NS_LOG_FUNCTION (this); +} + +EnergyHarvesterContainer::~EnergyHarvesterContainer () +{ + NS_LOG_FUNCTION (this); +} + +EnergyHarvesterContainer::EnergyHarvesterContainer (Ptr harvester) +{ + NS_LOG_FUNCTION (this << harvester); + NS_ASSERT (harvester != 0); + m_harvesters.push_back (harvester); +} + +EnergyHarvesterContainer::EnergyHarvesterContainer (std::string harvesterName) +{ + NS_LOG_FUNCTION (this << harvesterName); + Ptr harvester = Names::Find (harvesterName); + NS_ASSERT (harvester != 0); + m_harvesters.push_back (harvester); +} + +EnergyHarvesterContainer::EnergyHarvesterContainer (const EnergyHarvesterContainer &a, + const EnergyHarvesterContainer &b) +{ + NS_LOG_FUNCTION (this << &a << &b); + *this = a; + Add (b); +} + +EnergyHarvesterContainer::Iterator +EnergyHarvesterContainer::Begin (void) const +{ + NS_LOG_FUNCTION (this); + return m_harvesters.begin (); +} + +EnergyHarvesterContainer::Iterator +EnergyHarvesterContainer::End (void) const +{ + NS_LOG_FUNCTION (this); + return m_harvesters.end (); +} + +uint32_t +EnergyHarvesterContainer::GetN (void) const +{ + NS_LOG_FUNCTION (this); + return m_harvesters.size (); +} + +Ptr +EnergyHarvesterContainer::Get (uint32_t i) const +{ + NS_LOG_FUNCTION (this << i); + return m_harvesters[i]; +} + +void +EnergyHarvesterContainer::Add (EnergyHarvesterContainer container) +{ + NS_LOG_FUNCTION (this << &container); + for (Iterator i = container.Begin (); i != container.End (); i++) + { + m_harvesters.push_back (*i); + } +} + +void +EnergyHarvesterContainer::Add (Ptr harvester) +{ + NS_LOG_FUNCTION (this << harvester); + NS_ASSERT (harvester != 0); + m_harvesters.push_back (harvester); +} + +void +EnergyHarvesterContainer::Add (std::string harvesterName) +{ + NS_LOG_FUNCTION (this << harvesterName); + Ptr harvester = Names::Find (harvesterName); + NS_ASSERT (harvester != 0); + m_harvesters.push_back (harvester); +} + +void +EnergyHarvesterContainer::Clear (void) +{ + NS_LOG_FUNCTION (this); + m_harvesters.clear (); +} + + +/* + * Private functions start here. + */ + +void +EnergyHarvesterContainer::DoDispose (void) +{ + // call Object::Dispose for all EnergyHarvester objects + for (std::vector< Ptr >::iterator i = m_harvesters.begin (); + i != m_harvesters.end (); i++) + { + (*i)->Dispose (); + } + m_harvesters.clear (); +} + +void +EnergyHarvesterContainer::DoInitialize (void) +{ + // call Object::Initialize for all EnergyHarvester objects + for (std::vector< Ptr >::iterator i = m_harvesters.begin (); + i != m_harvesters.end (); i++) + { + (*i)->Initialize (); + } +} + +} // namespace ns3 diff -Naur ns-3.20/src/energy/helper/energy-harvester-container.h ns-3.21/src/energy/helper/energy-harvester-container.h --- ns-3.20/src/energy/helper/energy-harvester-container.h 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/energy/helper/energy-harvester-container.h 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,190 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * 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 + * + * Author: Cristiano Tapparello + */ + +#ifndef ENERGY_HARVESTER_CONTAINER_H +#define ENERGY_HARVESTER_CONTAINER_H + +#include "ns3/energy-harvester.h" +#include "ns3/object.h" +#include +#include + +namespace ns3 { + +class EnergyHarvester; + +/** + * \ingroup energy + * \brief Holds a vector of ns3::EnergyHarvester pointers. + * + * EnergyHarvesterContainer returns a list of EnergyHarvester pointers + * installed on a node. Users can use this list to access EnergyHarvester + * objects to obtain the total energy harvested on a node easily. + * + * \see NetDeviceContainer + * + */ +class EnergyHarvesterContainer : public Object +{ +public: + typedef std::vector< Ptr >::const_iterator Iterator; + +public: + static TypeId GetTypeId (void); + /** + * Creates an empty EnergyHarvesterContainer. + */ + EnergyHarvesterContainer (); + ~EnergyHarvesterContainer (); + + /** + * \param harvester Pointer to an EnergyHarvester. + * + * Creates a EnergyHarvesterContainer with exactly one EnergyHarvester + * previously instantiated. + */ + EnergyHarvesterContainer (Ptr harvester); + + /** + * \param harvesterName Name of EnergyHarvester. + * + * Creates an EnergyHarvesterContainer with exactly one EnergyHarvester + * previously instantiated and assigned a name using the Object name service. + * This EnergyHarvester is specified by its assigned name. + */ + EnergyHarvesterContainer (std::string harvesterName); + + /** + * \param a A EnergyHarvesterContainer. + * \param b Another EnergyHarvesterContainer. + * + * Creates a EnergyHarvesterContainer by concatenating EnergyHarvesterContainer b + * to EnergyHarvesterContainer a. + * + * \note Can be used to concatenate 2 Ptr directly. C++ + * will be calling EnergyHarvesterContainer constructor with Ptr + * first. + */ + EnergyHarvesterContainer (const EnergyHarvesterContainer &a, + const EnergyHarvesterContainer &b); + + /** + * \brief Get an iterator which refers to the first EnergyHarvester pointer + * in the container. + * + * \returns An iterator which refers to the first EnergyHarvester in container. + * + * EnergyHarvesters can be retrieved from the container in two ways. First, + * directly by an index into the container, and second, using an iterator. + * This method is used in the iterator method and is typically used in a + * for-loop to run through the EnergyHarvesters. + * + * \code + * EnergyHarvesterContainer::Iterator i; + * for (i = container.Begin (); i != container.End (); ++i) + * { + * (*i)->method (); // some EnergyHarvester method + * } + * \endcode + */ + Iterator Begin (void) const; + + /** + * \brief Get an iterator which refers to the last EnergyHarvester pointer + * in the container. + * + * \returns An iterator which refers to the last EnergyHarvester in container. + * + * EnergyHarvesters can be retrieved from the container in two ways. First, + * directly by an index into the container, and second, using an iterator. + * This method is used in the iterator method and is typically used in a + * for-loop to run through the EnergyHarvesters. + * + * \code + * EnergyHarvesterContainer::Iterator i; + * for (i = container.Begin (); i != container.End (); ++i) + * { + * (*i)->method (); // some EnergyHarvester method + * } + * \endcode + */ + Iterator End (void) const; + + /** + * \brief Get the number of Ptr stored in this container. + * + * \returns The number of Ptr stored in this container. + */ + uint32_t GetN (void) const; + + /** + * \brief Get the i-th Ptr stored in this container. + * + * \param i Index of the requested Ptr. + * \returns The requested Ptr. + */ + Ptr Get (uint32_t i) const; + + /** + * \param container Another EnergyHarvesterContainer. + * + * Appends the contents of another EnergyHarvesterContainer to the end of + * this EnergyHarvesterContainer. + */ + void Add (EnergyHarvesterContainer container); + + /** + * \brief Append a single Ptr to the end of this container. + * + * \param harvester Pointer to an EnergyHarvester. + */ + void Add (Ptr harvester); + + /** + * \brief Append a single Ptr referred to by its object + * name to the end of this container. + * + * \param harvesterName Name of EnergyHarvester object. + */ + void Add (std::string harvesterName); + + /** + * \brief Removes all elements in the container. + */ + void Clear (void); + +private: + virtual void DoDispose (void); + + /** + * \brief Calls Object::Initialize () for all EnergySource objects. + */ + virtual void DoInitialize (void); + +private: + std::vector< Ptr > m_harvesters; + +}; + +} // namespace ns3 + + +#endif /* defined(ENERGY_HARVESTER_CONTAINER_H) */ diff -Naur ns-3.20/src/energy/helper/energy-harvester-helper.cc ns-3.21/src/energy/helper/energy-harvester-helper.cc --- ns-3.20/src/energy/helper/energy-harvester-helper.cc 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/energy/helper/energy-harvester-helper.cc 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,79 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * 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 + * + * Author: Cristiano Tapparello + */ + +#include "energy-harvester-helper.h" +#include "ns3/config.h" +#include "ns3/names.h" + +namespace ns3 { + +/* + * EnergyHarvesterHelper + */ +EnergyHarvesterHelper::~EnergyHarvesterHelper () +{ +} + +EnergyHarvesterContainer +EnergyHarvesterHelper::Install (Ptr source) const +{ + return Install (EnergySourceContainer (source)); +} + +EnergyHarvesterContainer +EnergyHarvesterHelper::Install (EnergySourceContainer sourceContainer) const +{ + EnergyHarvesterContainer container; + for (EnergySourceContainer::Iterator i = sourceContainer.Begin (); i != sourceContainer.End (); ++i) + { + Ptr harvester = DoInstall (*i); + container.Add (harvester); + Ptr node = (*i)->GetNode (); + /* + * Check if EnergyHarvesterContainer is already aggregated to target node. If + * not, create a new EnergyHarvesterContainer and aggregate it to the node. + */ + Ptr EnergyHarvesterContainerOnNode = + node->GetObject (); + if (EnergyHarvesterContainerOnNode == 0) + { + ObjectFactory fac; + fac.SetTypeId ("ns3::EnergyHarvesterContainer"); + EnergyHarvesterContainerOnNode = fac.Create (); + EnergyHarvesterContainerOnNode->Add (harvester); + node->AggregateObject (EnergyHarvesterContainerOnNode); + } + else + { + EnergyHarvesterContainerOnNode->Add (harvester); // append new EnergyHarvester + } + } + return container; +} + +EnergyHarvesterContainer +EnergyHarvesterHelper::Install (std::string sourceName) const +{ + Ptr source = Names::Find (sourceName); + return Install (source); +} + +} // namespace ns3 diff -Naur ns-3.20/src/energy/helper/energy-harvester-helper.h ns-3.21/src/energy/helper/energy-harvester-helper.h --- ns-3.20/src/energy/helper/energy-harvester-helper.h 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/energy/helper/energy-harvester-helper.h 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,98 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * 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 + * + * Author: Cristiano Tapparello + */ + +#ifndef ENERGY_HARVESTER_HELPER_H +#define ENERGY_HARVESTER_HELPER_H + +#include "ns3/attribute.h" +#include "ns3/object-factory.h" +#include "ns3/node-container.h" +#include "ns3/ptr.h" +#include "ns3/energy-harvester.h" +#include "ns3/energy-harvester-container.h" + +#include "ns3/energy-source.h" +#include "ns3/energy-source-container.h" + + +namespace ns3 { + +/** + * \ingroup energy + * \brief Creates EnergyHarvester objects. + * + * This class creates and installs energy harvesters onto network nodes. + * + */ +class EnergyHarvesterHelper +{ +public: + virtual ~EnergyHarvesterHelper (); + + /** + * \param name Name of attribute to set. + * \param v Value of the attribute. + * + * Sets one of the attributes of underlying EnergyHarvester. + */ + virtual void Set (std::string name, const AttributeValue &v) = 0; + + /** + * \param source Pointer to the energy source where EnergyHarvester will be installed. + * \returns An EnergyHarvesterContainer which contains all the EnergyHarvesters. + * + * This function installs an EnergyHarvester onto an energy source. + */ + EnergyHarvesterContainer Install (Ptr source) const; + + /** + * \param sourceContainer List of nodes where EnergyHarvester will be installed. + * \returns An EnergyHarvesterContainer which contains all the EnergyHarvester. + * + * This function installs an EnergyHarvester onto a list of energy sources. + */ + EnergyHarvesterContainer Install (EnergySourceContainer sourceContainer) const; + + /** + * \param nodeName Name of node where EnergyHarvester will be installed. + * \returns An EnergyHarvesterContainer which contains all the EnergyHarvesters. + * + * This function installs an EnergyHarvester onto a node. + */ + EnergyHarvesterContainer Install (std::string sourceName) const; + +private: + /** + * \param node Pointer to node where the energy harvester is to be installed. + * \returns Pointer to the created EnergyHarvester. + * + * Child classes of EnergyHarvesterHelper only have to implement this function, + * to create and aggregate an EnergyHarvester object onto a single node. Rest of + * the installation process (eg. installing EnergyHarvester on set of nodes) is + * implemented in the EnergyHarvesterHelper base class. + */ + virtual Ptr DoInstall (Ptr source) const = 0; + +}; + +} // namespace ns3 + +#endif /* defined(ENERGY_HARVESTER_HELPER_H) */ diff -Naur ns-3.20/src/energy/helper/wifi-radio-energy-model-helper.cc ns-3.21/src/energy/helper/wifi-radio-energy-model-helper.cc --- ns-3.20/src/energy/helper/wifi-radio-energy-model-helper.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/helper/wifi-radio-energy-model-helper.cc 2014-09-17 20:03:14.000000000 -0700 @@ -24,6 +24,7 @@ #include "ns3/wifi-net-device.h" #include "ns3/config.h" #include "ns3/names.h" +#include "ns3/wifi-tx-current-model.h" namespace ns3 { @@ -31,6 +32,7 @@ { m_radioEnergy.SetTypeId ("ns3::WifiRadioEnergyModel"); m_depletionCallback.Nullify (); + m_rechargedCallback.Nullify (); } WifiRadioEnergyModelHelper::~WifiRadioEnergyModelHelper () @@ -50,6 +52,38 @@ m_depletionCallback = callback; } +void +WifiRadioEnergyModelHelper::SetRechargedCallback ( + WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback callback) +{ + m_rechargedCallback = callback; +} + +void +WifiRadioEnergyModelHelper::SetTxCurrentModel (std::string name, + std::string n0, const AttributeValue& v0, + std::string n1, const AttributeValue& v1, + std::string n2, const AttributeValue& v2, + std::string n3, const AttributeValue& v3, + std::string n4, const AttributeValue& v4, + std::string n5, const AttributeValue& v5, + std::string n6, const AttributeValue& v6, + std::string n7, const AttributeValue& v7) +{ + ObjectFactory factory; + factory.SetTypeId (name); + factory.Set (n0, v0); + factory.Set (n1, v1); + factory.Set (n2, v2); + factory.Set (n3, v3); + factory.Set (n4, v4); + factory.Set (n5, v5); + factory.Set (n6, v6); + factory.Set (n7, v7); + m_txCurrentModel = factory; +} + + /* * Private function starts here. */ @@ -72,13 +106,37 @@ // set energy source pointer model->SetEnergySource (source); // set energy depletion callback - model->SetEnergyDepletionCallback (m_depletionCallback); + // if none is specified, make a callback to WifiPhy::SetSleepMode + Ptr wifiDevice = DynamicCast (device); + Ptr wifiPhy = wifiDevice->GetPhy (); + if (m_depletionCallback.IsNull ()) + { + model->SetEnergyDepletionCallback (MakeCallback (&WifiPhy::SetSleepMode, wifiPhy)); + } + else + { + model->SetEnergyDepletionCallback (m_depletionCallback); + } + // set energy recharged callback + // if none is specified, make a callback to WifiPhy::ResumeFromSleep + if (m_rechargedCallback.IsNull ()) + { + model->SetEnergyRechargedCallback (MakeCallback (&WifiPhy::ResumeFromSleep, wifiPhy)); + } + else + { + model->SetEnergyRechargedCallback (m_rechargedCallback); + } // add model to device model list in energy source source->AppendDeviceEnergyModel (model); // create and register energy model phy listener - Ptr wifiDevice = DynamicCast (device); - Ptr wifiPhy = wifiDevice->GetPhy (); wifiPhy->RegisterListener (model->GetPhyListener ()); + // + if (m_txCurrentModel.GetTypeId ().GetUid ()) + { + Ptr txcurrent = m_txCurrentModel.Create (); + model->SetTxCurrentModel (txcurrent); + } return model; } diff -Naur ns-3.20/src/energy/helper/wifi-radio-energy-model-helper.h ns-3.21/src/energy/helper/wifi-radio-energy-model-helper.h --- ns-3.20/src/energy/helper/wifi-radio-energy-model-helper.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/helper/wifi-radio-energy-model-helper.h 2014-09-17 20:03:14.000000000 -0700 @@ -62,6 +62,44 @@ void SetDepletionCallback ( WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback callback); + /** + * \param callback Callback function for energy recharged handling. + * + * Sets the callback to be invoked when energy is recharged. + */ + void SetRechargedCallback ( + WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback callback); + + /** + * \param name the name of the model to set + * \param n0 the name of the attribute to set + * \param v0 the value of the attribute to set + * \param n1 the name of the attribute to set + * \param v1 the value of the attribute to set + * \param n2 the name of the attribute to set + * \param v2 the value of the attribute to set + * \param n3 the name of the attribute to set + * \param v3 the value of the attribute to set + * \param n4 the name of the attribute to set + * \param v4 the value of the attribute to set + * \param n5 the name of the attribute to set + * \param v5 the value of the attribute to set + * \param n6 the name of the attribute to set + * \param v6 the value of the attribute to set + * \param n7 the name of the attribute to set + * \param v7 the value of the attribute to set + * + * Configure a propagation delay for this channel. + */ + void SetTxCurrentModel (std::string name, + std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (), + std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (), + std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (), + std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (), + std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (), + std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (), + std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (), + std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ()); private: /** @@ -76,6 +114,8 @@ private: ObjectFactory m_radioEnergy; WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback m_depletionCallback; + WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback m_rechargedCallback; + ObjectFactory m_txCurrentModel; }; diff -Naur ns-3.20/src/energy/model/basic-energy-harvester.cc ns-3.21/src/energy/model/basic-energy-harvester.cc --- ns-3.20/src/energy/model/basic-energy-harvester.cc 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/energy/model/basic-energy-harvester.cc 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,180 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * 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 + * + * Author: Cristiano Tapparello + */ + +#include "basic-energy-harvester.h" + +#include "ns3/log.h" +#include "ns3/assert.h" +#include "ns3/pointer.h" +#include "ns3/string.h" +#include "ns3/trace-source-accessor.h" +#include "ns3/simulator.h" + +NS_LOG_COMPONENT_DEFINE ("BasicEnergyHarvester"); + +namespace ns3 { + +NS_OBJECT_ENSURE_REGISTERED (BasicEnergyHarvester); + +TypeId +BasicEnergyHarvester::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::BasicEnergyHarvester") + .SetParent () + .AddConstructor () + .AddAttribute ("PeriodicHarvestedPowerUpdateInterval", + "Time between two consecutive periodic updates of the harvested power. By default, the value is updated every 1 s", + TimeValue (Seconds (1.0)), + MakeTimeAccessor (&BasicEnergyHarvester::SetHarvestedPowerUpdateInterval, + &BasicEnergyHarvester::GetHarvestedPowerUpdateInterval), + MakeTimeChecker ()) + .AddAttribute ("HarvestablePower", + "The harvestable power [Watts] that the energy harvester is allowed to harvest. By default, the model will allow to harvest an amount of power defined by a uniformly distributed random variable in 0 and 2.0 Watts", + StringValue ("ns3::UniformRandomVariable[Min=0.0|Max=2.0]"), + MakePointerAccessor (&BasicEnergyHarvester::m_harvestablePower), + MakePointerChecker ()) + .AddTraceSource ("HarvestedPower", + "Harvested power by the BasicEnergyHarvester.", + MakeTraceSourceAccessor (&BasicEnergyHarvester::m_harvestedPower)) + .AddTraceSource ("TotalEnergyHarvested", + "Total energy harvested by the harvester.", + MakeTraceSourceAccessor (&BasicEnergyHarvester::m_totalEnergyHarvestedJ)) + ; + return tid; +} + +BasicEnergyHarvester::BasicEnergyHarvester () +{ + NS_LOG_FUNCTION (this); +} + +BasicEnergyHarvester::BasicEnergyHarvester (Time updateInterval) +{ + NS_LOG_FUNCTION (this << updateInterval); + m_harvestedPowerUpdateInterval = updateInterval; +} + +BasicEnergyHarvester::~BasicEnergyHarvester () +{ + NS_LOG_FUNCTION (this); +} + +int64_t +BasicEnergyHarvester::AssignStreams (int64_t stream) +{ + NS_LOG_FUNCTION (this << stream); + m_harvestablePower->SetStream (stream); + return 1; +} + +void +BasicEnergyHarvester::SetHarvestedPowerUpdateInterval (Time updateInterval) +{ + NS_LOG_FUNCTION (this << updateInterval); + m_harvestedPowerUpdateInterval = updateInterval; +} + +Time +BasicEnergyHarvester::GetHarvestedPowerUpdateInterval (void) const +{ + NS_LOG_FUNCTION (this); + return m_harvestedPowerUpdateInterval; +} + +/* + * Private functions start here. + */ + +void +BasicEnergyHarvester::UpdateHarvestedPower (void) +{ + NS_LOG_FUNCTION (this); + NS_LOG_DEBUG (Simulator::Now ().GetSeconds () + << "s BasicEnergyHarvester(" << GetNode ()->GetId () << "): Updating harvesting power."); + + Time duration = Simulator::Now () - m_lastHarvestingUpdateTime; + + NS_ASSERT (duration.GetNanoSeconds () >= 0); // check if duration is valid + + double energyHarvested = 0.0; + + // do not update if simulation has finished + if (Simulator::IsFinished ()) + { + NS_LOG_DEBUG ("BasicEnergyHarvester: Simulation Finished."); + return; + } + + m_energyHarvestingUpdateEvent.Cancel (); + + CalculateHarvestedPower (); + + energyHarvested = duration.GetSeconds () * m_harvestedPower; + + // update total energy harvested + m_totalEnergyHarvestedJ += energyHarvested; + + // notify energy source + GetEnergySource ()->UpdateEnergySource (); + + // update last harvesting time stamp + m_lastHarvestingUpdateTime = Simulator::Now (); + + m_energyHarvestingUpdateEvent = Simulator::Schedule (m_harvestedPowerUpdateInterval, + &BasicEnergyHarvester::UpdateHarvestedPower, + this); +} + +void +BasicEnergyHarvester::DoInitialize (void) +{ + NS_LOG_FUNCTION (this); + + m_lastHarvestingUpdateTime = Simulator::Now (); + + UpdateHarvestedPower (); // start periodic harvesting update +} + +void +BasicEnergyHarvester::DoDispose (void) +{ + NS_LOG_FUNCTION (this); +} + +void +BasicEnergyHarvester::CalculateHarvestedPower (void) +{ + NS_LOG_FUNCTION (this); + + m_harvestedPower = m_harvestablePower->GetValue (); + + NS_LOG_DEBUG (Simulator::Now ().GetSeconds () + << "s BasicEnergyHarvester:Harvested energy = " << m_harvestedPower); +} + +double +BasicEnergyHarvester::DoGetPower (void) const +{ + NS_LOG_FUNCTION (this); + return m_harvestedPower; +} + +} // namespace ns3 diff -Naur ns-3.20/src/energy/model/basic-energy-harvester.h ns-3.21/src/energy/model/basic-energy-harvester.h --- ns-3.20/src/energy/model/basic-energy-harvester.h 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/energy/model/basic-energy-harvester.h 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,131 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * 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 + * + * Author: Cristiano Tapparello + */ + +#ifndef BASIC_ENERGY_HARVESTER +#define BASIC_ENERGY_HARVESTER + +#include + +// include from ns-3 +#include "ns3/traced-value.h" +#include "ns3/nstime.h" +#include "ns3/event-id.h" +#include "energy-harvester.h" +#include "ns3/random-variable-stream.h" +#include "ns3/device-energy-model.h" + +namespace ns3 { + +/** + * \ingroup energy + * BasicEnergyHarvester increases remaining energy stored in an associated + * Energy Source. The BasicEnergyHarvester implements a simple model in which + * the amount of power provided by the harvester varies over time according + * to a customizable generic random variable and time update intervals. + * + * Unit of power is chosen as Watt since energy models typically calculate + * energy as (time in seconds * power in Watt). + * + */ +class BasicEnergyHarvester: public EnergyHarvester +{ +public: + static TypeId GetTypeId (void); + + BasicEnergyHarvester (); + + /** + * \param updateInterval Energy harvesting update interval. + * + * BasicEnergyHarvester constructor function that sets the interval + * between each update of the value of the power harvested by this + * energy harvester. + */ + BasicEnergyHarvester (Time updateInterval); + + virtual ~BasicEnergyHarvester (); + + /** + * \param updateInterval Energy harvesting update interval. + * + * This function sets the interval between each update of the value of the + * power harvested by this energy harvester. + */ + void SetHarvestedPowerUpdateInterval (Time updateInterval); + + /** + * \returns The interval between each update of the harvested power. + * + * This function returns the interval between each update of the value of the + * power harvested by this energy harvester. + */ + Time GetHarvestedPowerUpdateInterval (void) const; + + /** + * \param stream Random variable stream number. + * \returns The number of stream indices assigned by this model. + * + * This function sets the stream number to be used by the random variable that + * determines the amount of power that can be harvested by this energy harvester. + */ + int64_t AssignStreams (int64_t stream); + +private: + /// Defined in ns3::Object + void DoInitialize (void); + + /// Defined in ns3::Object + void DoDispose (void); + + /** + * Calculates harvested Power. + */ + void CalculateHarvestedPower (void); + + /** + * \returns m_harvestedPower The power currently provided by the Basic Energy Harvester. + * Implements DoGetPower defined in EnergyHarvester. + */ + virtual double DoGetPower (void) const; + + /** + * This function is called every m_energyHarvestingUpdateInterval in order to + * update the amount of power that will be provided by the harvester in the + * next interval. + */ + void UpdateHarvestedPower (void); + +private: + + Ptr m_harvestablePower; // Random variable for the harvestable power + + TracedValue m_harvestedPower; // current harvested power, in Watt + TracedValue m_totalEnergyHarvestedJ; // total harvested energy, in Joule + + EventId m_energyHarvestingUpdateEvent; // energy harvesting event + Time m_lastHarvestingUpdateTime; // last harvesting time + Time m_harvestedPowerUpdateInterval; // harvestable energy update interval + +}; + +} // namespace ns3 + +#endif /* defined(BASIC_ENERGY_HARVESTER) */ diff -Naur ns-3.20/src/energy/model/basic-energy-source.cc ns-3.21/src/energy/model/basic-energy-source.cc --- ns-3.20/src/energy/model/basic-energy-source.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/model/basic-energy-source.cc 2014-09-17 20:03:14.000000000 -0700 @@ -49,6 +49,16 @@ MakeDoubleAccessor (&BasicEnergySource::SetSupplyVoltage, &BasicEnergySource::GetSupplyVoltage), MakeDoubleChecker ()) + .AddAttribute ("BasicEnergyLowBatteryThreshold", + "Low battery threshold for basic energy source.", + DoubleValue (0.10), // as a fraction of the initial energy + MakeDoubleAccessor (&BasicEnergySource::m_lowBatteryTh), + MakeDoubleChecker ()) + .AddAttribute ("BasicEnergyHighBatteryThreshold", + "High battery threshold for basic energy source.", + DoubleValue (0.15), // as a fraction of the initial energy + MakeDoubleAccessor (&BasicEnergySource::m_highBatteryTh), + MakeDoubleChecker ()) .AddAttribute ("PeriodicEnergyUpdateInterval", "Time between two consecutive periodic energy updates.", TimeValue (Seconds (1.0)), @@ -66,6 +76,7 @@ { NS_LOG_FUNCTION (this); m_lastUpdateTime = Seconds (0.0); + m_depleted = false; } BasicEnergySource::~BasicEnergySource () @@ -151,13 +162,19 @@ CalculateRemainingEnergy (); - if (m_remainingEnergyJ <= 0) + m_lastUpdateTime = Simulator::Now (); + + if (!m_depleted && m_remainingEnergyJ <= m_lowBatteryTh * m_initialEnergyJ) { + m_depleted = true; HandleEnergyDrainedEvent (); - return; // stop periodic update } - m_lastUpdateTime = Simulator::Now (); + if (m_depleted && m_remainingEnergyJ > m_highBatteryTh * m_initialEnergyJ) + { + m_depleted = false; + HandleEnergyRechargedEvent (); + } m_energyUpdateEvent = Simulator::Schedule (m_energyUpdateInterval, &BasicEnergySource::UpdateEnergySource, @@ -188,7 +205,18 @@ NS_LOG_FUNCTION (this); NS_LOG_DEBUG ("BasicEnergySource:Energy depleted!"); NotifyEnergyDrained (); // notify DeviceEnergyModel objects - m_remainingEnergyJ = 0; // energy never goes below 0 + if (m_remainingEnergyJ <= 0) + { + m_remainingEnergyJ = 0; // energy never goes below 0 + } +} + +void +BasicEnergySource::HandleEnergyRechargedEvent (void) +{ + NS_LOG_FUNCTION (this); + NS_LOG_DEBUG ("BasicEnergySource:Energy recharged!"); + NotifyEnergyRecharged (); // notify DeviceEnergyModel objects } void diff -Naur ns-3.20/src/energy/model/basic-energy-source.h ns-3.21/src/energy/model/basic-energy-source.h --- ns-3.20/src/energy/model/basic-energy-source.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/model/basic-energy-source.h 2014-09-17 20:03:14.000000000 -0700 @@ -118,6 +118,14 @@ void HandleEnergyDrainedEvent (void); /** + * Handles the remaining energy exceeding the high threshold after it went + * below the low threshold. This function notifies all the energy models + * aggregated to the node about the energy being recharged. Each energy model + * is then responsible for its own handler. + */ + void HandleEnergyRechargedEvent (void); + + /** * Calculates remaining energy. This function uses the total current from all * device models to calculate the amount of energy to decrease. The energy to * decrease is given by: @@ -130,6 +138,10 @@ private: double m_initialEnergyJ; // initial energy, in Joules double m_supplyVoltageV; // supply voltage, in Volts + double m_lowBatteryTh; // low battery threshold, as a fraction of the initial energy + double m_highBatteryTh; // high battery threshold, as a fraction of the initial energy + bool m_depleted; // set to true when the remaining energy goes below the low threshold, + // set to false again when the remaining energy exceeds the high threshold TracedValue m_remainingEnergyJ; // remaining energy, in Joules EventId m_energyUpdateEvent; // energy update event Time m_lastUpdateTime; // last update time diff -Naur ns-3.20/src/energy/model/device-energy-model.h ns-3.21/src/energy/model/device-energy-model.h --- ns-3.20/src/energy/model/device-energy-model.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/model/device-energy-model.h 2014-09-17 20:03:14.000000000 -0700 @@ -93,6 +93,12 @@ */ virtual void HandleEnergyDepletion (void) = 0; + /** + * This function is called by the EnergySource object when energy stored in + * the energy source is recharged. Should be implemented by child classes. + */ + virtual void HandleEnergyRecharged (void) = 0; + private: /** diff -Naur ns-3.20/src/energy/model/energy-harvester.cc ns-3.21/src/energy/model/energy-harvester.cc --- ns-3.20/src/energy/model/energy-harvester.cc 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/energy/model/energy-harvester.cc 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,105 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * 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 + * + * Author: Cristiano Tapparello + */ + +#include "energy-harvester.h" +#include "ns3/log.h" + +NS_LOG_COMPONENT_DEFINE ("EnergyHarvester"); + +namespace ns3 { + +NS_OBJECT_ENSURE_REGISTERED (EnergyHarvester); + +TypeId +EnergyHarvester::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::EnergyHarvester") + .SetParent () + ; + return tid; +} + +EnergyHarvester::EnergyHarvester () +{ + NS_LOG_FUNCTION (this); +} + +EnergyHarvester::~EnergyHarvester () +{ + NS_LOG_FUNCTION (this); +} + +void +EnergyHarvester::SetNode (Ptr node) +{ + NS_LOG_FUNCTION (this); + NS_ASSERT (node != 0); + m_node = node; +} + +Ptr +EnergyHarvester::GetNode (void) const +{ + NS_LOG_FUNCTION (this); + return m_node; +} + +void +EnergyHarvester::SetEnergySource (Ptr source) +{ + NS_LOG_FUNCTION (this); + NS_ASSERT (source != 0); + m_energySource = source; +} + +Ptr +EnergyHarvester::GetEnergySource (void) const +{ + NS_LOG_FUNCTION (this); + return m_energySource; +} + + +double +EnergyHarvester::GetPower (void) const +{ + NS_LOG_FUNCTION (this); + return DoGetPower (); +} + +/* + * Private function starts here. + */ + +void +EnergyHarvester::DoDispose (void) +{ + NS_LOG_FUNCTION (this); +} + +double +EnergyHarvester::DoGetPower (void) const +{ + NS_LOG_FUNCTION (this); + return 0.0; +} + +} diff -Naur ns-3.20/src/energy/model/energy-harvester.h ns-3.21/src/energy/model/energy-harvester.h --- ns-3.20/src/energy/model/energy-harvester.h 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/energy/model/energy-harvester.h 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,137 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * 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 + * + * Author: Cristiano Tapparello + */ + +#ifndef ENERGY_HARVESTER_H +#define ENERGY_HARVESTER_H + +#include + +// include from ns-3 +#include "ns3/object.h" +#include "ns3/ptr.h" +#include "ns3/type-id.h" +#include "ns3/node.h" +#include "ns3/energy-source-container.h" + +namespace ns3 { + +class EnergySource; + +/** + * \defgroup energy Energy Models + * + */ + +/** + * \ingroup energy + * + * \brief Energy harvester base class. + * + * + */ + +class EnergyHarvester : public Object +{ +public: + static TypeId GetTypeId (void); + + EnergyHarvester (); + + virtual ~EnergyHarvester (); + + /** + * \brief Sets pointer to node containing this EnergyHarvester. + * + * \param node Pointer to node containing this EnergyHarvester. + */ + void SetNode (Ptr node); + + /** + * \returns Pointer to node containing this EnergyHarvester. + * + * When a subclass needs to get access to the underlying node base class to + * print the nodeId for example, it can invoke this method. + */ + Ptr GetNode (void) const; + + /** + * \param source Pointer to energy source to which this EnergyHarvester is + * installed. + * + * This function sets the pointer to the energy source connected to the energy + * harvester. + */ + void SetEnergySource (Ptr source); + + /** + * \returns source Pointer to energy source connected to the harvester. + * + * When a subclass needs to get access to the connected energy source, + * it can invoke this method. + */ + Ptr GetEnergySource (void) const; + + /** + * \returns power Amount of power currently provided by the harvester. + * + * This method is called by the energy source connected to the harvester in order + * to determine the amount of energy that the harvester provided since last update. + */ + double GetPower (void) const; + +private: + /** + * + * Defined in ns3::Object + */ + virtual void DoDispose (void); + + /** + * This method is called by the GetPower method and it needs to be implemented by the + * subclasses of the energy harvester. It returns the actual amount of power that is + * currently provided by the energy harvester. + * + * This method should be used to connect the logic behind the particular implementation + * of the energy harvester with the energy source. + */ + virtual double DoGetPower (void) const; + +private: + /** + * Pointer to node containing this EnergyHarvester. Used by helper class to make + * sure energy harvesters are installed onto the corresponding node. + */ + Ptr m_node; + + /** + * Pointer to the Energy Source to which this EnergyHarvester is connected. Used + * by helper class to make sure energy harvesters are installed onto the + * corresponding energy source. + */ + Ptr m_energySource; + +protected: + +}; + +} // namespace ns3 + +#endif /* defined(ENERGY_HARVESTER_H) */ diff -Naur ns-3.20/src/energy/model/energy-source.cc ns-3.21/src/energy/model/energy-source.cc --- ns-3.20/src/energy/model/energy-source.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/model/energy-source.cc 2014-09-17 20:03:14.000000000 -0700 @@ -16,6 +16,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Sidharth Nabar , He Wu + * + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * Modifications made by: Cristiano Tapparello */ #include "energy-source.h" @@ -130,6 +135,14 @@ (*i)->Dispose (); } } + +void +EnergySource::ConnectEnergyHarvester (Ptr energyHarvesterPtr) +{ + NS_LOG_FUNCTION (this << energyHarvesterPtr); + NS_ASSERT (energyHarvesterPtr != 0); // energy harvester must exist + m_harvesters.push_back (energyHarvesterPtr); +} /* * Private function starts here. @@ -156,6 +169,22 @@ { totalCurrentA += (*i)->GetCurrentA (); } + + double totalHarvestedPower = 0.0; + + std::vector< Ptr >::const_iterator harvester; + for (harvester = m_harvesters.begin (); harvester != m_harvesters.end (); harvester++) + { + totalHarvestedPower += (*harvester)->GetPower (); + } + + NS_LOG_DEBUG ("EnergySource("<< GetNode ()->GetId () << "): Total harvested power = " << totalHarvestedPower); + + double currentHarvestersA = totalHarvestedPower / GetSupplyVoltage (); + NS_LOG_DEBUG ("EnergySource("<< GetNode ()->GetId () << "): Current from harvesters = " << currentHarvestersA); + + totalCurrentA -= currentHarvestersA; + return totalCurrentA; } @@ -172,10 +201,23 @@ } void +EnergySource::NotifyEnergyRecharged (void) +{ + NS_LOG_FUNCTION (this); + // notify all device energy models installed on node + DeviceEnergyModelContainer::Iterator i; + for (i = m_models.Begin (); i != m_models.End (); i++) + { + (*i)->HandleEnergyRecharged (); + } +} + +void EnergySource::BreakDeviceEnergyModelRefCycle (void) { NS_LOG_FUNCTION (this); m_models.Clear (); + m_harvesters.clear (); m_node = NULL; } diff -Naur ns-3.20/src/energy/model/energy-source.h ns-3.21/src/energy/model/energy-source.h --- ns-3.20/src/energy/model/energy-source.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/model/energy-source.h 2014-09-17 20:03:14.000000000 -0700 @@ -16,8 +16,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: Sidharth Nabar , He Wu + * + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * Modifications made by: Cristiano Tapparello */ + #ifndef ENERGY_SOURCE_H #define ENERGY_SOURCE_H @@ -26,9 +32,10 @@ #include "ns3/type-id.h" #include "ns3/node.h" #include "device-energy-model-container.h" // #include "device-energy-model.h" +#include "ns3/energy-harvester.h" namespace ns3 { - + /** * \defgroup energy Energy Models * @@ -68,6 +75,9 @@ * energy in different units (eg. kWh), a simple converter function should * suffice. */ + +class EnergyHarvester; + class EnergySource : public Object { public: @@ -158,6 +168,17 @@ * here. Called by EnergySourceContainer, which is aggregated to the node. */ void DisposeDeviceModels (void); + + /** + * \param energyHarvesterPtr Pointer to energy harvester. + * + * This function connect an energy harvester to the energy source. After the + * execution of this method, the pointer to the energy harvester is appended + * to the end of a vector of EnergyHarvester pointer. + * Note that the order in which different energy harvester are added to the + * energy source does not impact the simulation results. + */ + void ConnectEnergyHarvester (Ptr energyHarvesterPtr); private: @@ -180,6 +201,13 @@ * sure device models are installed onto the corresponding node. */ Ptr m_node; + + /** + * Vector of EnergyHarvester pointer connected to the same energy source. + * This vector is used by the CalculateTotalCurrent method to determine the + * total power provided by the energy harvesters connected to the energy source. + */ + std::vector< Ptr > m_harvesters; protected: @@ -195,6 +223,12 @@ void NotifyEnergyDrained (void); /** + * This function notifies all DeviceEnergyModel of energy recharged event. It + * is called by the child EnergySource class when energy source is recharged. + */ + void NotifyEnergyRecharged (void); + + /** * This function is called to break reference cycle between EnergySource and * DeviceEnergyModel. Child of the EnergySource base class must call this * function in their implementation of DoDispose to make sure the reference diff -Naur ns-3.20/src/energy/model/li-ion-energy-source.cc ns-3.21/src/energy/model/li-ion-energy-source.cc --- ns-3.20/src/energy/model/li-ion-energy-source.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/model/li-ion-energy-source.cc 2014-09-17 20:03:14.000000000 -0700 @@ -45,6 +45,11 @@ MakeDoubleAccessor (&LiIonEnergySource::SetInitialEnergy, &LiIonEnergySource::GetInitialEnergy), MakeDoubleChecker ()) + .AddAttribute ("LiIonEnergyLowBatteryThreshold", + "Low battery threshold for LiIon energy source.", + DoubleValue (0.10), // as a fraction of the initial energy + MakeDoubleAccessor (&LiIonEnergySource::m_lowBatteryTh), + MakeDoubleChecker ()) .AddAttribute ("InitialCellVoltage", "Initial (maximum) voltage of the cell (fully charged).", DoubleValue (4.05), // in Volts @@ -219,14 +224,14 @@ CalculateRemainingEnergy (); - if (m_remainingEnergyJ <= 0) + m_lastUpdateTime = Simulator::Now (); + + if (m_remainingEnergyJ <= m_lowBatteryTh * m_initialEnergyJ) { HandleEnergyDrainedEvent (); return; // stop periodic update } - m_lastUpdateTime = Simulator::Now (); - m_energyUpdateEvent = Simulator::Schedule (m_energyUpdateInterval, &LiIonEnergySource::UpdateEnergySource, this); @@ -259,7 +264,10 @@ NS_LOG_DEBUG ("LiIonEnergySource:Energy depleted at node #" << GetNode ()->GetId ()); NotifyEnergyDrained (); // notify DeviceEnergyModel objects - m_remainingEnergyJ = 0; // energy never goes below 0 + if (m_remainingEnergyJ <= 0) + { + m_remainingEnergyJ = 0; // energy never goes below 0 + } } diff -Naur ns-3.20/src/energy/model/li-ion-energy-source.h ns-3.21/src/energy/model/li-ion-energy-source.h --- ns-3.20/src/energy/model/li-ion-energy-source.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/model/li-ion-energy-source.h 2014-09-17 20:03:14.000000000 -0700 @@ -185,6 +185,7 @@ TracedValue m_remainingEnergyJ; // remaining energy, in Joules double m_drainedCapacity; // capacity drained from the cell, in Ah double m_supplyVoltageV; // actual voltage of the cell + double m_lowBatteryTh; // low battery threshold, as a fraction of the initial energy EventId m_energyUpdateEvent; // energy update event Time m_lastUpdateTime; // last update time Time m_energyUpdateInterval; // energy update interval diff -Naur ns-3.20/src/energy/model/rv-battery-model.cc ns-3.21/src/energy/model/rv-battery-model.cc --- ns-3.20/src/energy/model/rv-battery-model.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/model/rv-battery-model.cc 2014-09-17 20:03:14.000000000 -0700 @@ -44,6 +44,11 @@ MakeTimeAccessor (&RvBatteryModel::SetSamplingInterval, &RvBatteryModel::GetSamplingInterval), MakeTimeChecker ()) + .AddAttribute ("RvBatteryModelLowBatteryThreshold", + "Low battery threshold.", + DoubleValue (0.10), // as a fraction of the initial energy + MakeDoubleAccessor (&RvBatteryModel::m_lowBatteryTh), + MakeDoubleChecker ()) .AddAttribute ("RvBatteryModelOpenCircuitVoltage", "RV battery model open circuit voltage.", DoubleValue (4.1), @@ -164,7 +169,7 @@ } // check if battery is dead. - if (calculatedAlpha >= m_alpha) + if (m_batteryLevel <= m_lowBatteryTh) { m_lifetime = Simulator::Now (); NS_LOG_DEBUG ("RvBatteryModel:Battery is dead!"); diff -Naur ns-3.20/src/energy/model/rv-battery-model.h ns-3.21/src/energy/model/rv-battery-model.h --- ns-3.20/src/energy/model/rv-battery-model.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/model/rv-battery-model.h 2014-09-17 20:03:14.000000000 -0700 @@ -246,6 +246,8 @@ */ TracedValue m_batteryLevel; + double m_lowBatteryTh; // low battery threshold, as a fraction of the initial energy + /** * (1 / sampling interval) = sampling frequency */ diff -Naur ns-3.20/src/energy/model/simple-device-energy-model.h ns-3.21/src/energy/model/simple-device-energy-model.h --- ns-3.20/src/energy/model/simple-device-energy-model.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/model/simple-device-energy-model.h 2014-09-17 20:03:14.000000000 -0700 @@ -95,6 +95,15 @@ } /** + * \brief Handles energy recharged. + * + * Not implemented + */ + virtual void HandleEnergyRecharged (void) + { + } + + /** * \param current the current draw of device. * * Set the actual current draw of the device. diff -Naur ns-3.20/src/energy/model/wifi-radio-energy-model.cc ns-3.21/src/energy/model/wifi-radio-energy-model.cc --- ns-3.20/src/energy/model/wifi-radio-energy-model.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/model/wifi-radio-energy-model.cc 2014-09-17 20:03:14.000000000 -0700 @@ -22,8 +22,10 @@ #include "ns3/double.h" #include "ns3/simulator.h" #include "ns3/trace-source-accessor.h" +#include "ns3/pointer.h" #include "energy-source.h" #include "wifi-radio-energy-model.h" +#include "wifi-tx-current-model.h" NS_LOG_COMPONENT_DEFINE ("WifiRadioEnergyModel"); @@ -39,34 +41,44 @@ .AddConstructor () .AddAttribute ("IdleCurrentA", "The default radio Idle current in Ampere.", - DoubleValue (0.000426), // idle mode = 426uA + DoubleValue (0.273), // idle mode = 273mA MakeDoubleAccessor (&WifiRadioEnergyModel::SetIdleCurrentA, &WifiRadioEnergyModel::GetIdleCurrentA), MakeDoubleChecker ()) .AddAttribute ("CcaBusyCurrentA", "The default radio CCA Busy State current in Ampere.", - DoubleValue (0.000426), // default to be the same as idle mode + DoubleValue (0.273), // default to be the same as idle mode MakeDoubleAccessor (&WifiRadioEnergyModel::SetCcaBusyCurrentA, &WifiRadioEnergyModel::GetCcaBusyCurrentA), MakeDoubleChecker ()) .AddAttribute ("TxCurrentA", "The radio Tx current in Ampere.", - DoubleValue (0.0174), // transmit at 0dBm = 17.4mA + DoubleValue (0.380), // transmit at 0dBm = 380mA MakeDoubleAccessor (&WifiRadioEnergyModel::SetTxCurrentA, &WifiRadioEnergyModel::GetTxCurrentA), MakeDoubleChecker ()) .AddAttribute ("RxCurrentA", "The radio Rx current in Ampere.", - DoubleValue (0.0197), // receive mode = 19.7mA + DoubleValue (0.313), // receive mode = 313mA MakeDoubleAccessor (&WifiRadioEnergyModel::SetRxCurrentA, &WifiRadioEnergyModel::GetRxCurrentA), MakeDoubleChecker ()) .AddAttribute ("SwitchingCurrentA", "The default radio Channel Switch current in Ampere.", - DoubleValue (0.000426), // default to be the same as idle mode + DoubleValue (0.273), // default to be the same as idle mode MakeDoubleAccessor (&WifiRadioEnergyModel::SetSwitchingCurrentA, &WifiRadioEnergyModel::GetSwitchingCurrentA), MakeDoubleChecker ()) + .AddAttribute ("SleepCurrentA", + "The radio Sleep current in Ampere.", + DoubleValue (0.033), // sleep mode = 33mA + MakeDoubleAccessor (&WifiRadioEnergyModel::SetSleepCurrentA, + &WifiRadioEnergyModel::GetSleepCurrentA), + MakeDoubleChecker ()) + .AddAttribute ("TxCurrentModel", "A pointer to the attached tx current model.", + PointerValue (), + MakePointerAccessor (&WifiRadioEnergyModel::m_txCurrentModel), + MakePointerChecker ()) .AddTraceSource ("TotalEnergyConsumption", "Total energy consumption of the radio device.", MakeTraceSourceAccessor (&WifiRadioEnergyModel::m_totalEnergyConsumption)) @@ -79,11 +91,15 @@ NS_LOG_FUNCTION (this); m_currentState = WifiPhy::IDLE; // initially IDLE m_lastUpdateTime = Seconds (0.0); + m_nPendingChangeState = 0; + m_isSupersededChangeState = false; m_energyDepletionCallback.Nullify (); m_source = NULL; // set callback for WifiPhy listener m_listener = new WifiRadioEnergyModelPhyListener; m_listener->SetChangeStateCallback (MakeCallback (&DeviceEnergyModel::ChangeState, this)); + // set callback for updating the tx current + m_listener->SetUpdateTxCurrentCallback (MakeCallback (&WifiRadioEnergyModel::SetTxCurrentFromModel, this)); } WifiRadioEnergyModel::~WifiRadioEnergyModel () @@ -177,6 +193,19 @@ m_switchingCurrentA = switchingCurrentA; } +double +WifiRadioEnergyModel::GetSleepCurrentA (void) const +{ + NS_LOG_FUNCTION (this); + return m_sleepCurrentA; +} + +void +WifiRadioEnergyModel::SetSleepCurrentA (double sleepCurrentA) +{ + NS_LOG_FUNCTION (this << sleepCurrentA); + m_sleepCurrentA = sleepCurrentA; +} WifiPhy::State WifiRadioEnergyModel::GetCurrentState (void) const @@ -198,6 +227,33 @@ } void +WifiRadioEnergyModel::SetEnergyRechargedCallback ( + WifiRadioEnergyRechargedCallback callback) +{ + NS_LOG_FUNCTION (this); + if (callback.IsNull ()) + { + NS_LOG_DEBUG ("WifiRadioEnergyModel:Setting NULL energy recharged callback!"); + } + m_energyRechargedCallback = callback; +} + +void +WifiRadioEnergyModel::SetTxCurrentModel (Ptr model) +{ + m_txCurrentModel = model; +} + +void +WifiRadioEnergyModel::SetTxCurrentFromModel (double txPowerDbm) +{ + if (m_txCurrentModel) + { + m_txCurrentA = m_txCurrentModel->CalcTxCurrent (txPowerDbm); + } +} + +void WifiRadioEnergyModel::ChangeState (int newState) { NS_LOG_FUNCTION (this << newState); @@ -225,6 +281,9 @@ case WifiPhy::SWITCHING: energyToDecrease = duration.GetSeconds () * m_switchingCurrentA * supplyVoltage; break; + case WifiPhy::SLEEP: + energyToDecrease = duration.GetSeconds () * m_sleepCurrentA * supplyVoltage; + break; default: NS_FATAL_ERROR ("WifiRadioEnergyModel:Undefined radio state: " << m_currentState); } @@ -235,15 +294,31 @@ // update last update time stamp m_lastUpdateTime = Simulator::Now (); + m_nPendingChangeState++; + // notify energy source m_source->UpdateEnergySource (); - // update current state & last update time stamp - SetWifiRadioState ((WifiPhy::State) newState); + // in case the energy source is found to be depleted during the last update, a callback might be + // invoked that might cause a change in the Wifi PHY state (e.g., the PHY is put into SLEEP mode). + // This in turn causes a new call to this member function, with the consequence that the previous + // instance is resumed after the termination of the new instance. In particular, the state set + // by the previous instance is erroneously the final state stored in m_currentState. The check below + // ensures that previous instances do not change m_currentState. - // some debug message - NS_LOG_DEBUG ("WifiRadioEnergyModel:Total energy consumption is " << - m_totalEnergyConsumption << "J"); + if (!m_isSupersededChangeState) + { + // update current state & last update time stamp + SetWifiRadioState ((WifiPhy::State) newState); + + // some debug message + NS_LOG_DEBUG ("WifiRadioEnergyModel:Total energy consumption is " << + m_totalEnergyConsumption << "J"); + } + + m_isSupersededChangeState = (m_nPendingChangeState > 1); + + m_nPendingChangeState--; } void @@ -258,6 +333,18 @@ } } +void +WifiRadioEnergyModel::HandleEnergyRecharged (void) +{ + NS_LOG_FUNCTION (this); + NS_LOG_DEBUG ("WifiRadioEnergyModel:Energy is recharged!"); + // invoke energy recharged callback, if set. + if (!m_energyRechargedCallback.IsNull ()) + { + m_energyRechargedCallback (); + } +} + WifiRadioEnergyModelPhyListener * WifiRadioEnergyModel::GetPhyListener (void) { @@ -293,6 +380,8 @@ return m_rxCurrentA; case WifiPhy::SWITCHING: return m_switchingCurrentA; + case WifiPhy::SLEEP: + return m_sleepCurrentA; default: NS_FATAL_ERROR ("WifiRadioEnergyModel:Undefined radio state:" << m_currentState); } @@ -321,6 +410,9 @@ case WifiPhy::SWITCHING: stateName = "SWITCHING"; break; + case WifiPhy::SLEEP: + stateName = "SLEEP"; + break; } NS_LOG_DEBUG ("WifiRadioEnergyModel:Switching to state: " << stateName << " at time = " << Simulator::Now ()); @@ -332,6 +424,7 @@ { NS_LOG_FUNCTION (this); m_changeStateCallback.Nullify (); + m_updateTxCurrentCallback.Nullify (); } WifiRadioEnergyModelPhyListener::~WifiRadioEnergyModelPhyListener () @@ -348,6 +441,14 @@ } void +WifiRadioEnergyModelPhyListener::SetUpdateTxCurrentCallback (UpdateTxCurrentCallback callback) +{ + NS_LOG_FUNCTION (this << &callback); + NS_ASSERT (!callback.IsNull ()); + m_updateTxCurrentCallback = callback; +} + +void WifiRadioEnergyModelPhyListener::NotifyRxStart (Time duration) { NS_LOG_FUNCTION (this << duration); @@ -382,9 +483,14 @@ } void -WifiRadioEnergyModelPhyListener::NotifyTxStart (Time duration) +WifiRadioEnergyModelPhyListener::NotifyTxStart (Time duration, double txPowerDbm) { - NS_LOG_FUNCTION (this << duration); + NS_LOG_FUNCTION (this << duration << txPowerDbm); + if (m_updateTxCurrentCallback.IsNull ()) + { + NS_FATAL_ERROR ("WifiRadioEnergyModelPhyListener:Update tx current callback not set!"); + } + m_updateTxCurrentCallback (txPowerDbm); if (m_changeStateCallback.IsNull ()) { NS_FATAL_ERROR ("WifiRadioEnergyModelPhyListener:Change state callback not set!"); @@ -423,6 +529,29 @@ m_switchToIdleEvent = Simulator::Schedule (duration, &WifiRadioEnergyModelPhyListener::SwitchToIdle, this); } +void +WifiRadioEnergyModelPhyListener::NotifySleep (void) +{ + NS_LOG_FUNCTION (this); + if (m_changeStateCallback.IsNull ()) + { + NS_FATAL_ERROR ("WifiRadioEnergyModelPhyListener:Change state callback not set!"); + } + m_changeStateCallback (WifiPhy::SLEEP); + m_switchToIdleEvent.Cancel (); +} + +void +WifiRadioEnergyModelPhyListener::NotifyWakeup(void) +{ + NS_LOG_FUNCTION (this); + if (m_changeStateCallback.IsNull ()) + { + NS_FATAL_ERROR ("WifiRadioEnergyModelPhyListener:Change state callback not set!"); + } + m_changeStateCallback (WifiPhy::IDLE); +} + /* * Private function state here. */ diff -Naur ns-3.20/src/energy/model/wifi-radio-energy-model.h ns-3.21/src/energy/model/wifi-radio-energy-model.h --- ns-3.20/src/energy/model/wifi-radio-energy-model.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/model/wifi-radio-energy-model.h 2014-09-17 20:03:14.000000000 -0700 @@ -29,6 +29,8 @@ namespace ns3 { +class WifiTxCurrentModel; + /** * \ingroup energy * A WifiPhy listener class for notifying the WifiRadioEnergyModel of Wifi radio @@ -38,6 +40,11 @@ class WifiRadioEnergyModelPhyListener : public WifiPhyListener { public: + /** + * Callback type for updating the transmit current based on the nominal tx power. + */ + typedef Callback UpdateTxCurrentCallback; + WifiRadioEnergyModelPhyListener (); virtual ~WifiRadioEnergyModelPhyListener (); @@ -49,6 +56,13 @@ void SetChangeStateCallback (DeviceEnergyModel::ChangeStateCallback callback); /** + * \brief Sets the update tx current callback. + * + * \param callback Update tx current callback. + */ + void SetUpdateTxCurrentCallback (UpdateTxCurrentCallback callback); + + /** * \brief Switches the WifiRadioEnergyModel to RX state. * * \param duration the expected duration of the packet reception. @@ -82,10 +96,11 @@ * IDLE after TX duration. * * \param duration the expected transmission duration. + * \param txPowerDbm the nominal tx power in dBm * * Defined in ns3::WifiPhyListener */ - virtual void NotifyTxStart (Time duration); + virtual void NotifyTxStart (Time duration, double txPowerDbm); /** * \param duration the expected busy duration. @@ -101,6 +116,16 @@ */ virtual void NotifySwitchingStart (Time duration); + /** + * Defined in ns3::WifiPhyListener + */ + virtual void NotifySleep (void); + + /** + * Defined in ns3::WifiPhyListener + */ + virtual void NotifyWakeup (void); + private: /** * A helper function that makes scheduling m_changeStateCallback possible. @@ -114,6 +139,12 @@ */ DeviceEnergyModel::ChangeStateCallback m_changeStateCallback; + /** + * Callback used to update the tx current stored in WifiRadioEnergyModel based on + * the nominal tx power used to transmit the current frame. + */ + UpdateTxCurrentCallback m_updateTxCurrentCallback; + EventId m_switchToIdleEvent; }; @@ -138,9 +169,34 @@ * object. The EnergySource object will query this model for the total current. * Then the EnergySource object uses the total current to calculate energy. * - * Default values for power consumption are based on CC2420 radio chip, with - * supply voltage as 2.5V and currents as 17.4 mA (TX), 18.8 mA (RX), 20 uA - * (sleep) and 426 uA (idle). + * Default values for power consumption are based on measurements reported in: + * + * Daniel Halperin, Ben Greenstein, Anmol Sheth, David Wetherall, + * "Demystifying 802.11n power consumption", Proceedings of HotPower'10 + * + * Power consumption in Watts (single antenna): + * + * \f$ P_{tx} = 1.14 \f$ (transmit at 0dBm) + * + * \f$ P_{rx} = 0.94 \f$ + * + * \f$ P_{idle} = 0.82 \f$ + * + * \f$ P_{sleep} = 0.10 \f$ + * + * Hence, considering the default supply voltage of 3.0 V for the basic energy + * source, the default current values in Ampere are: + * + * \f$ I_{tx} = 0.380 \f$ + * + * \f$ I_{rx} = 0.313 \f$ + * + * \f$ I_{idle} = 0.273 \f$ + * + * \f$ I_{sleep} = 0.033 \f$ + * + * The dependence of the power consumption in transmission mode on the nominal + * transmit power can also be achieved through a wifi tx current model. * */ class WifiRadioEnergyModel : public DeviceEnergyModel @@ -151,6 +207,11 @@ */ typedef Callback WifiRadioEnergyDepletionCallback; + /** + * Callback type for energy recharged handling. + */ + typedef Callback WifiRadioEnergyRechargedCallback; + public: static TypeId GetTypeId (void); WifiRadioEnergyModel (); @@ -183,6 +244,8 @@ void SetRxCurrentA (double rxCurrentA); double GetSwitchingCurrentA (void) const; void SetSwitchingCurrentA (double switchingCurrentA); + double GetSleepCurrentA (void) const; + void SetSleepCurrentA (double sleepCurrentA); /** * \returns Current state. @@ -197,6 +260,26 @@ void SetEnergyDepletionCallback (WifiRadioEnergyDepletionCallback callback); /** + * \param callback Callback function. + * + * Sets callback for energy recharged handling. + */ + void SetEnergyRechargedCallback (WifiRadioEnergyRechargedCallback callback); + + /** + * \param model the model used to compute the wifi tx current. + */ + void SetTxCurrentModel (Ptr model); + + /** + * \brief Calls the CalcTxCurrent method of the tx current model to + * compute the tx current based on such model + * + * \param txPowerDbm the nominal tx power in dBm + */ + void SetTxCurrentFromModel (double txPowerDbm); + + /** * \brief Changes state of the WifiRadioEnergyMode. * * \param newState New state the wifi radio is in. @@ -213,6 +296,13 @@ virtual void HandleEnergyDepletion (void); /** + * \brief Handles energy recharged. + * + * Implements DeviceEnergyModel::HandleEnergyRecharged + */ + virtual void HandleEnergyRecharged (void); + + /** * \returns Pointer to the PHY listener. */ WifiRadioEnergyModelPhyListener * GetPhyListener (void); @@ -245,6 +335,8 @@ double m_idleCurrentA; double m_ccaBusyCurrentA; double m_switchingCurrentA; + double m_sleepCurrentA; + Ptr m_txCurrentModel; // This variable keeps track of the total energy consumed by this model. TracedValue m_totalEnergyConsumption; @@ -253,9 +345,15 @@ WifiPhy::State m_currentState; // current state the radio is in Time m_lastUpdateTime; // time stamp of previous energy update + uint8_t m_nPendingChangeState; + bool m_isSupersededChangeState; + // Energy depletion callback WifiRadioEnergyDepletionCallback m_energyDepletionCallback; + // Energy recharged callback + WifiRadioEnergyRechargedCallback m_energyRechargedCallback; + // WifiPhy listener WifiRadioEnergyModelPhyListener *m_listener; }; diff -Naur ns-3.20/src/energy/model/wifi-tx-current-model.cc ns-3.21/src/energy/model/wifi-tx-current-model.cc --- ns-3.20/src/energy/model/wifi-tx-current-model.cc 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/energy/model/wifi-tx-current-model.cc 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,142 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Universita' degli Studi di Napoli "Federico II" + * + * 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 + * + * Author: Stefano Avallone + */ + +#include "wifi-tx-current-model.h" +#include "ns3/log.h" +#include "ns3/boolean.h" +#include "ns3/double.h" +#include "ns3/string.h" +#include "ns3/pointer.h" +#include + +NS_LOG_COMPONENT_DEFINE ("WifiTxCurrentModel"); + +namespace ns3 { + +// ------------------------------------------------------------------------- // + +NS_OBJECT_ENSURE_REGISTERED (WifiTxCurrentModel); + +TypeId +WifiTxCurrentModel::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::WifiTxCurrentModel") + .SetParent () + ; + return tid; +} + +WifiTxCurrentModel::WifiTxCurrentModel() +{ +} + +WifiTxCurrentModel::~WifiTxCurrentModel() +{ +} + +double +WifiTxCurrentModel::DbmToW (double dbm) +{ + double mW = std::pow (10.0, dbm / 10.0); + return mW / 1000.0; +} + +// ------------------------------------------------------------------------- // + +NS_OBJECT_ENSURE_REGISTERED (LinearWifiTxCurrentModel); + +TypeId +LinearWifiTxCurrentModel::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::LinearWifiTxCurrentModel") + .SetParent () + .AddConstructor () + .AddAttribute ("Eta", "The efficiency of the power amplifier.", + DoubleValue (0.10), + MakeDoubleAccessor (&LinearWifiTxCurrentModel::SetEta, + &LinearWifiTxCurrentModel::GetEta), + MakeDoubleChecker ()) + .AddAttribute ("Voltage", "The supply voltage (in Volts).", + DoubleValue (3.0), + MakeDoubleAccessor (&LinearWifiTxCurrentModel::SetVoltage, + &LinearWifiTxCurrentModel::GetVoltage), + MakeDoubleChecker ()) + .AddAttribute ("IdleCurrent", "The current in the IDLE state (in Watts).", + DoubleValue (0.273333), + MakeDoubleAccessor (&LinearWifiTxCurrentModel::SetIdleCurrent, + &LinearWifiTxCurrentModel::GetIdleCurrent), + MakeDoubleChecker ()) + ; + return tid; +} + +LinearWifiTxCurrentModel::LinearWifiTxCurrentModel () +{ +} + +LinearWifiTxCurrentModel::~LinearWifiTxCurrentModel() +{ +} + +void +LinearWifiTxCurrentModel::SetEta (double eta) +{ + m_eta = eta; +} + +void +LinearWifiTxCurrentModel::SetVoltage (double voltage) +{ + m_voltage = voltage; +} + +void +LinearWifiTxCurrentModel::SetIdleCurrent (double idleCurrent) +{ + m_idleCurrent = idleCurrent; +} + +double +LinearWifiTxCurrentModel::GetEta (void) const +{ + return m_eta; +} + +double +LinearWifiTxCurrentModel::GetVoltage (void) const +{ + return m_voltage; +} + +double +LinearWifiTxCurrentModel::GetIdleCurrent (void) const +{ + return m_idleCurrent; +} + +double +LinearWifiTxCurrentModel::CalcTxCurrent (double txPowerDbm) const +{ + return DbmToW (txPowerDbm) / (m_voltage * m_eta) + m_idleCurrent; +} + +// ------------------------------------------------------------------------- // + +} // namespace ns3 diff -Naur ns-3.20/src/energy/model/wifi-tx-current-model.h ns-3.21/src/energy/model/wifi-tx-current-model.h --- ns-3.20/src/energy/model/wifi-tx-current-model.h 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/energy/model/wifi-tx-current-model.h 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,142 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Universita' degli Studi di Napoli "Federico II" + * + * 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 + * + * Author: Stefano Avallone + */ + +#ifndef WIFI_TX_CURRENT_MODEL_H +#define WIFI_TX_CURRENT_MODEL_H + +#include "ns3/object.h" + +namespace ns3 { + +/** + * \ingroup energy + * + * \brief Modelize the transmit current as a function of the transmit power and mode + * + */ +class WifiTxCurrentModel : public Object +{ +public: + static TypeId GetTypeId (void); + + WifiTxCurrentModel (); + virtual ~WifiTxCurrentModel (); + + /** + * \param txPowerDbm the nominal tx power in dBm + * \returns the transmit current (in Ampere) + */ + virtual double CalcTxCurrent (double txPowerDbm) const = 0; + + /** + * Convert from dBm to Watts. + * + * \param dbm the power in dBm + * \return the equivalent Watts for the given dBm + */ + static double DbmToW (double dbm); +}; + +/** + * \ingroup energy + * + * \brief a linear model of the Wifi transmit current + * + * This model assumes that the transmit current is a linear function + * of the nominal transmit power used to send the frame. + * In particular, the power absorbed during the transmission of a frame \f$ W_{tx} \f$ + * is given by the power absorbed by the power amplifier \f$ W_{pa} \f$ plus the power + * absorbed by the RF subsystem. The latter is assumed to be the same as the power + * absorbed in the IDLE state \f$ W_{idle} \f$. + * + * The efficiency \f$ \eta \f$ of the power amplifier is given by + * \f$ \eta = \frac{P_{tx}}{W_{pa}} \f$, where \f$ P_{tx} \f$ is the output power, i.e., + * the nominal transmit power. Hence, \f$ W_{pa} = \frac{P_{tx}}{\eta} \f$ + * + * It turns out that \f$ W_{tx} = \frac{P_{tx}}{\eta} + W_{idle} \f$. By dividing both + * sides by the supply voltage \f$ V \f$: \f$ I_{tx} = \frac{P_{tx}}{V \cdot \eta} + I_{idle} \f$, + * where \f$ I_{tx} \f$ and \f$ I_{idle} \f$ are, respectively, the transmit current and + * the idle current. + * + * For more information, refer to: + * Francesco Ivan Di Piazza, Stefano Mangione, and Ilenia Tinnirello. + * "On the Effects of Transmit Power Control on the Energy Consumption of WiFi Network Cards", + * Proceedings of ICST QShine 2009, pp. 463--475 + * + * If the tx current corresponding to a given nominal transmit power is known, the efficiency + * of the power amplifier is given by the above formula: + * \f$ \eta = \frac{P_{tx}}{(I_{tx}-I_{idle})\cdot V} \f$ + * + */ +class LinearWifiTxCurrentModel : public WifiTxCurrentModel +{ +public: + static TypeId GetTypeId (void); + + LinearWifiTxCurrentModel (); + virtual ~LinearWifiTxCurrentModel (); + + /** + * \param eta (dimension-less) + * + * Set the power amplifier efficiency. + */ + void SetEta (double eta); + + /** + * \param voltage (Volts) + * + * Set the supply voltage. + */ + void SetVoltage (double voltage); + + /** + * \param idleCurrent (Ampere) + * + * Set the current in the IDLE state. + */ + void SetIdleCurrent (double idleCurrent); + + /** + * \return the power amplifier efficiency. + */ + double GetEta (void) const; + + /** + * \return the supply voltage. + */ + double GetVoltage (void) const; + + /** + * \return the current in the IDLE state. + */ + double GetIdleCurrent (void) const; + + double CalcTxCurrent (double txPowerDbm) const; + +private: + double m_eta; + double m_voltage; + double m_idleCurrent; +}; + +} // namespace ns3 + +#endif /* WIFI_TX_CURRENT_MODEL_H */ diff -Naur ns-3.20/src/energy/test/basic-energy-harvester-test.cc ns-3.21/src/energy/test/basic-energy-harvester-test.cc --- ns-3.20/src/energy/test/basic-energy-harvester-test.cc 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/energy/test/basic-energy-harvester-test.cc 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,134 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), + * University of Rochester, Rochester, NY, USA. + * + * 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 + * + * Author: Cristiano Tapparello + */ + +#include "ns3/log.h" +#include "ns3/test.h" +#include "ns3/node.h" +#include "ns3/simulator.h" +#include "ns3/double.h" +#include "ns3/config.h" +#include "ns3/string.h" +#include "ns3/basic-energy-harvester.h" +#include "ns3/basic-energy-source.h" + +using namespace ns3; + +NS_LOG_COMPONENT_DEFINE ("BasicEnergyHarvesterTestSuite"); + +class BasicEnergyHarvesterTestCase : public TestCase +{ +public: + BasicEnergyHarvesterTestCase (); + ~BasicEnergyHarvesterTestCase (); + + void DoRun (void); + + double m_timeS; // in seconds + double m_tolerance; // tolerance for energy estimation + + ObjectFactory m_energySource; + ObjectFactory m_energyHarvester; + +}; + +BasicEnergyHarvesterTestCase::BasicEnergyHarvesterTestCase () + : TestCase ("Basic Energy Harvester test case") +{ + m_timeS = 15; // harvest energy for 15 seconds + m_tolerance = 1.0e-13; // +} + +BasicEnergyHarvesterTestCase::~BasicEnergyHarvesterTestCase () +{ +} + +void +BasicEnergyHarvesterTestCase::DoRun () +{ + // set types + m_energySource.SetTypeId ("ns3::BasicEnergySource"); + m_energyHarvester.SetTypeId ("ns3::BasicEnergyHarvester"); + // create node + Ptr node = CreateObject (); + + // create Energy Source + Ptr source = m_energySource.Create (); + // aggregate Energy Source to the node + node->AggregateObject (source); + + //create energy harvester + Ptr harvester = m_energyHarvester.Create (); + // Set the Energy Harvesting update interval to a value grater than the + // simulation duration, so that the power provided by the harvester is constant + harvester->SetHarvestedPowerUpdateInterval (Seconds (m_timeS + 1.0)); + // Connect the Basic Energy Harvester to the Energy Source + source->ConnectEnergyHarvester (harvester); + harvester->SetNode (node); + harvester->SetEnergySource (source); + + Time now = Simulator::Now (); + + /* + * The energy harvester will recharge the energy source for m_timeS seconds. + */ + + // Calculate remaining energy at simulation stop time + Simulator::Schedule (Seconds (m_timeS), + &BasicEnergySource::UpdateEnergySource, source); + + double timeDelta = 0.000000001; // 1 nanosecond + // run simulation; stop just after last scheduled event + Simulator::Stop (Seconds (m_timeS + timeDelta)); + Simulator::Run (); + + // calculate energy harvested + double estRemainingEnergy = source->GetInitialEnergy (); + // energy = power * time + estRemainingEnergy += harvester->GetPower () * m_timeS; + + // obtain remaining energy from source + double remainingEnergy = source->GetRemainingEnergy (); + NS_LOG_DEBUG ("Remaining energy is " << remainingEnergy); + NS_LOG_DEBUG ("Estimated remaining energy is " << estRemainingEnergy); + NS_LOG_DEBUG ("Difference is " << estRemainingEnergy - remainingEnergy); + + Simulator::Destroy (); + + // check remaining energy + NS_TEST_ASSERT_MSG_EQ_TOL (remainingEnergy, estRemainingEnergy, m_tolerance, + "Incorrect Remaining energy!"); + +} + +class BasicEnergyHarvesterTestSuite : public TestSuite +{ +public: + BasicEnergyHarvesterTestSuite (); +}; + +BasicEnergyHarvesterTestSuite::BasicEnergyHarvesterTestSuite () + : TestSuite ("basic-energy-harvester", UNIT) +{ + AddTestCase (new BasicEnergyHarvesterTestCase, TestCase::QUICK); +} + +// create an instance of the test suite +static BasicEnergyHarvesterTestSuite g_basicEnergyHarvesterTestSuite; diff -Naur ns-3.20/src/energy/test/basic-energy-model-test.cc ns-3.21/src/energy/test/basic-energy-model-test.cc --- ns-3.20/src/energy/test/basic-energy-model-test.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/test/basic-energy-model-test.cc 2014-09-17 20:03:14.000000000 -0700 @@ -93,6 +93,7 @@ NS_TEST_ASSERT_MSG_EQ (StateSwitchTest (WifiPhy::TX), false, "Problem with state switch test (WifiPhy tx)."); NS_TEST_ASSERT_MSG_EQ (StateSwitchTest (WifiPhy::RX), false, "Problem with state switch test (WifiPhy rx)."); NS_TEST_ASSERT_MSG_EQ (StateSwitchTest (WifiPhy::SWITCHING), false, "Problem with state switch test (WifiPhy switching)."); + NS_TEST_ASSERT_MSG_EQ (StateSwitchTest (WifiPhy::SLEEP), false, "Problem with state switch test (WifiPhy sleep)."); } bool @@ -178,6 +179,9 @@ case WifiPhy::SWITCHING: current = devModel->GetSwitchingCurrentA (); break; + case WifiPhy::SLEEP: + current = devModel->GetSleepCurrentA (); + break; default: NS_FATAL_ERROR ("Undefined radio state: " << state); break; diff -Naur ns-3.20/src/energy/test/rv-battery-model-test.cc ns-3.21/src/energy/test/rv-battery-model-test.cc --- ns-3.20/src/energy/test/rv-battery-model-test.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/test/rv-battery-model-test.cc 2014-09-17 20:03:14.000000000 -0700 @@ -740,6 +740,7 @@ // Set alpha & beta values rvModelHelper.Set ("RvBatteryModelAlphaValue", DoubleValue (m_alpha)); rvModelHelper.Set ("RvBatteryModelBetaValue", DoubleValue (m_beta)); + rvModelHelper.Set ("RvBatteryModelLowBatteryThreshold", DoubleValue (0.0)); // install source EnergySourceContainer sources = rvModelHelper.Install (c); // device energy model @@ -827,6 +828,7 @@ // Set alpha & beta values rvModelHelper.Set ("RvBatteryModelAlphaValue", DoubleValue (m_alpha)); rvModelHelper.Set ("RvBatteryModelBetaValue", DoubleValue (m_beta)); + rvModelHelper.Set ("RvBatteryModelLowBatteryThreshold", DoubleValue (0.0)); // install source EnergySourceContainer sources = rvModelHelper.Install (c); // device energy model diff -Naur ns-3.20/src/energy/wscript ns-3.21/src/energy/wscript --- ns-3.20/src/energy/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/energy/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -1,7 +1,7 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - obj = bld.create_ns3_module('energy', ['internet', 'wifi']) + obj = bld.create_ns3_module('energy', ['wifi']) obj.source = [ 'model/wifi-radio-energy-model.cc', 'model/energy-source.cc', @@ -11,11 +11,17 @@ 'model/device-energy-model.cc', 'model/device-energy-model-container.cc', 'model/simple-device-energy-model.cc', + 'model/energy-harvester.cc', + 'model/basic-energy-harvester.cc', + 'model/wifi-tx-current-model.cc', 'helper/energy-source-container.cc', 'helper/energy-model-helper.cc', 'helper/basic-energy-source-helper.cc', 'helper/wifi-radio-energy-model-helper.cc', 'helper/rv-battery-model-helper.cc', + 'helper/energy-harvester-container.cc', + 'helper/energy-harvester-helper.cc', + 'helper/basic-energy-harvester-helper.cc', ] obj_test = bld.create_ns3_module_test_library('energy') @@ -23,6 +29,7 @@ 'test/basic-energy-model-test.cc', 'test/rv-battery-model-test.cc', 'test/li-ion-energy-source-test.cc', + 'test/basic-energy-harvester-test.cc', ] headers = bld(features='ns3header') @@ -36,11 +43,17 @@ 'model/device-energy-model.h', 'model/device-energy-model-container.h', 'model/simple-device-energy-model.h', + 'model/energy-harvester.h', + 'model/basic-energy-harvester.h', + 'model/wifi-tx-current-model.h', 'helper/energy-source-container.h', 'helper/energy-model-helper.h', 'helper/basic-energy-source-helper.h', 'helper/wifi-radio-energy-model-helper.h', 'helper/rv-battery-model-helper.h', + 'helper/energy-harvester-container.h', + 'helper/energy-harvester-helper.h', + 'helper/basic-energy-harvester-helper.h', ] if (bld.env['ENABLE_EXAMPLES']): diff -Naur ns-3.20/src/fd-net-device/bindings/modulegen__gcc_ILP32.py ns-3.21/src/fd-net-device/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/fd-net-device/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/fd-net-device/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -3134,10 +3134,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -3148,25 +3148,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -3283,20 +3283,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/fd-net-device/bindings/modulegen__gcc_LP64.py ns-3.21/src/fd-net-device/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/fd-net-device/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/fd-net-device/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -3134,10 +3134,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -3148,25 +3148,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -3283,20 +3283,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/fd-net-device/helper/planetlab-tap-creator.cc ns-3.21/src/fd-net-device/helper/planetlab-tap-creator.cc --- ns-3.20/src/fd-net-device/helper/planetlab-tap-creator.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/fd-net-device/helper/planetlab-tap-creator.cc 2014-09-17 20:03:14.000000000 -0700 @@ -142,7 +142,6 @@ FILE *in; FILE *out; char errbuff[4096]; - int nbytes; memset(errbuff, 0, 4096); @@ -166,7 +165,7 @@ // close pipe to indicate end parameter passing and flush the fifo fclose (in); - nbytes = fread((void*)errbuff, 4096, 1, out); + fread((void*)errbuff, 4096, 1, out); // the error buffer will not be empty if we read an error ABORT_IF (strcmp(errbuff, "") != 0, errbuff, 0); diff -Naur ns-3.20/src/flow-monitor/bindings/modulegen__gcc_ILP32.py ns-3.21/src/flow-monitor/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/flow-monitor/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/flow-monitor/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -3793,10 +3793,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -3807,25 +3807,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -3942,20 +3942,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/flow-monitor/bindings/modulegen__gcc_LP64.py ns-3.21/src/flow-monitor/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/flow-monitor/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/flow-monitor/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -3793,10 +3793,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -3807,25 +3807,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -3942,20 +3942,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return diff -Naur ns-3.20/src/flow-monitor/model/histogram.h ns-3.21/src/flow-monitor/model/histogram.h --- ns-3.20/src/flow-monitor/model/histogram.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/flow-monitor/model/histogram.h 2014-09-17 20:03:14.000000000 -0700 @@ -38,7 +38,7 @@ * * \todo Add support for negative data. * - * \todo Add method(s) to estimate \f$N\f$, \f$\mu\f$, and \f$s^2\f$ from the histogram, + * \todo Add method(s) to estimate parameters from the histogram, * see http://www.dspguide.com/ch2/4.htm * */ diff -Naur ns-3.20/src/flow-monitor/model/ipv4-flow-probe.cc ns-3.21/src/flow-monitor/model/ipv4-flow-probe.cc --- ns-3.20/src/flow-monitor/model/ipv4-flow-probe.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/flow-monitor/model/ipv4-flow-probe.cc 2014-09-17 20:03:14.000000000 -0700 @@ -260,17 +260,15 @@ // tag the packet with the flow id and packet id, so that the packet can be identified even // when Ipv4Header is not accessible at some non-IPv4 protocol layer Ipv4FlowProbeTag fTag (flowId, packetId, size); - ipPayload->AddPacketTag (fTag); + ipPayload->AddByteTag (fTag); } } void Ipv4FlowProbe::ForwardLogger (const Ipv4Header &ipHeader, Ptr ipPayload, uint32_t interface) { - // peek the tags that are added by Ipv4FlowProbe::SendOutgoingLogger () Ipv4FlowProbeTag fTag; - - bool found = ipPayload->PeekPacketTag (fTag); + bool found = ipPayload->FindFirstMatchingByteTag (fTag); if (found) { @@ -286,11 +284,8 @@ void Ipv4FlowProbe::ForwardUpLogger (const Ipv4Header &ipHeader, Ptr ipPayload, uint32_t interface) { - // remove the tags that are added by Ipv4FlowProbe::SendOutgoingLogger () Ipv4FlowProbeTag fTag; - - // ConstCast: see http://www.nsnam.org/bugzilla/show_bug.cgi?id=904 - bool found = ConstCast (ipPayload)->RemovePacketTag (fTag); + bool found = ipPayload->FindFirstMatchingByteTag (fTag); if (found) { @@ -325,11 +320,8 @@ } #endif - // remove the tags that are added by Ipv4FlowProbe::SendOutgoingLogger () Ipv4FlowProbeTag fTag; - - // ConstCast: see http://www.nsnam.org/bugzilla/show_bug.cgi?id=904 - bool found = ConstCast (ipPayload)->RemovePacketTag (fTag); + bool found = ipPayload->FindFirstMatchingByteTag (fTag); if (found) { @@ -383,11 +375,9 @@ void Ipv4FlowProbe::QueueDropLogger (Ptr ipPayload) { - // remove the tags that are added by Ipv4FlowProbe::SendOutgoingLogger () Ipv4FlowProbeTag fTag; + bool tagFound = ipPayload->FindFirstMatchingByteTag (fTag); - // ConstCast: see http://www.nsnam.org/bugzilla/show_bug.cgi?id=904 - bool tagFound = ConstCast (ipPayload)->RemovePacketTag (fTag); if (!tagFound) { return; diff -Naur ns-3.20/src/flow-monitor/model/ipv6-flow-probe.cc ns-3.21/src/flow-monitor/model/ipv6-flow-probe.cc --- ns-3.20/src/flow-monitor/model/ipv6-flow-probe.cc 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/flow-monitor/model/ipv6-flow-probe.cc 2014-09-17 20:03:14.000000000 -0700 @@ -254,17 +254,15 @@ // tag the packet with the flow id and packet id, so that the packet can be identified even // when Ipv6Header is not accessible at some non-IPv6 protocol layer Ipv6FlowProbeTag fTag (flowId, packetId, size); - ipPayload->AddPacketTag (fTag); + ipPayload->AddByteTag (fTag); } } void Ipv6FlowProbe::ForwardLogger (const Ipv6Header &ipHeader, Ptr ipPayload, uint32_t interface) { - // peek the tags that are added by Ipv6FlowProbe::SendOutgoingLogger () Ipv6FlowProbeTag fTag; - - bool found = ipPayload->PeekPacketTag (fTag); + bool found = ipPayload->FindFirstMatchingByteTag (fTag); if (found) { @@ -280,11 +278,8 @@ void Ipv6FlowProbe::ForwardUpLogger (const Ipv6Header &ipHeader, Ptr ipPayload, uint32_t interface) { - // remove the tags that are added by Ipv6FlowProbe::SendOutgoingLogger () Ipv6FlowProbeTag fTag; - - // ConstCast: see http://www.nsnam.org/bugzilla/show_bug.cgi?id=904 - bool found = ConstCast (ipPayload)->RemovePacketTag (fTag); + bool found = ipPayload->FindFirstMatchingByteTag (fTag); if (found) { @@ -319,11 +314,8 @@ } #endif - // remove the tags that are added by Ipv6FlowProbe::SendOutgoingLogger () Ipv6FlowProbeTag fTag; - - // ConstCast: see http://www.nsnam.org/bugzilla/show_bug.cgi?id=904 - bool found = ConstCast (ipPayload)->RemovePacketTag (fTag); + bool found = ipPayload->FindFirstMatchingByteTag (fTag); if (found) { @@ -384,11 +376,9 @@ void Ipv6FlowProbe::QueueDropLogger (Ptr ipPayload) { - // remove the tags that are added by Ipv6FlowProbe::SendOutgoingLogger () Ipv6FlowProbeTag fTag; + bool tagFound = ipPayload->FindFirstMatchingByteTag (fTag); - // ConstCast: see http://www.nsnam.org/bugzilla/show_bug.cgi?id=904 - bool tagFound = ConstCast (ipPayload)->RemovePacketTag (fTag); if (!tagFound) { return; diff -Naur ns-3.20/src/internet/bindings/modulegen__gcc_ILP32.py ns-3.21/src/internet/bindings/modulegen__gcc_ILP32.py --- ns-3.20/src/internet/bindings/modulegen__gcc_ILP32.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/internet/bindings/modulegen__gcc_ILP32.py 2014-09-17 20:03:14.000000000 -0700 @@ -242,6 +242,8 @@ module.add_enum('State', ['RUNNING', 'EXPIRED', 'SUSPENDED'], outer_class=root_module['ns3::Timer'], import_from_module='ns.core') ## timer-impl.h (module 'core'): ns3::TimerImpl [class] module.add_class('TimerImpl', allow_subclassing=True, import_from_module='ns.core') + ## traced-value.h (module 'core'): ns3::TracedValue [class] + module.add_class('TracedValue', import_from_module='ns.core', template_parameters=['bool']) ## traced-value.h (module 'core'): ns3::TracedValue [class] module.add_class('TracedValue', import_from_module='ns.core', template_parameters=['double']) ## traced-value.h (module 'core'): ns3::TracedValue > [class] @@ -368,6 +370,10 @@ module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object']) ## pcap-file-wrapper.h (module 'network'): ns3::PcapFileWrapper [class] module.add_class('PcapFileWrapper', import_from_module='ns.network', parent=root_module['ns3::Object']) + ## queue.h (module 'network'): ns3::Queue [class] + module.add_class('Queue', import_from_module='ns.network', parent=root_module['ns3::Object']) + ## queue.h (module 'network'): ns3::Queue::QueueMode [enumeration] + module.add_enum('QueueMode', ['QUEUE_MODE_PACKETS', 'QUEUE_MODE_BYTES'], outer_class=root_module['ns3::Queue'], import_from_module='ns.network') ## random-variable-stream.h (module 'core'): ns3::RandomVariableStream [class] module.add_class('RandomVariableStream', import_from_module='ns.core', parent=root_module['ns3::Object']) ## ripng-header.h (module 'internet'): ns3::RipNgHeader [class] @@ -434,6 +440,12 @@ module.add_class('TcpHeader', parent=root_module['ns3::Header']) ## tcp-header.h (module 'internet'): ns3::TcpHeader::Flags_t [enumeration] module.add_enum('Flags_t', ['NONE', 'FIN', 'SYN', 'RST', 'PSH', 'ACK', 'URG', 'ECE', 'CWR'], outer_class=root_module['ns3::TcpHeader']) + ## tcp-option.h (module 'internet'): ns3::TcpOption [class] + module.add_class('TcpOption', parent=root_module['ns3::Object']) + ## tcp-option.h (module 'internet'): ns3::TcpOption::Kind [enumeration] + module.add_enum('Kind', ['END', 'NOP', 'MSS', 'WINSCALE', 'TS', 'UNKNOWN'], outer_class=root_module['ns3::TcpOption']) + ## tcp-option.h (module 'internet'): ns3::TcpOptionUnknown [class] + module.add_class('TcpOptionUnknown', parent=root_module['ns3::TcpOption']) ## tcp-rx-buffer.h (module 'internet'): ns3::TcpRxBuffer [class] module.add_class('TcpRxBuffer', parent=root_module['ns3::Object']) ## tcp-socket.h (module 'internet'): ns3::TcpSocket [class] @@ -510,6 +522,8 @@ module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## channel.h (module 'network'): ns3::Channel [class] module.add_class('Channel', import_from_module='ns.network', parent=root_module['ns3::Object']) + ## codel-queue.h (module 'internet'): ns3::CoDelQueue [class] + module.add_class('CoDelQueue', parent=root_module['ns3::Queue']) ## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable [class] module.add_class('ConstantRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## data-collection-object.h (module 'stats'): ns3::DataCollectionObject [class] @@ -666,6 +680,10 @@ module.add_class('RipNg', parent=root_module['ns3::Ipv6RoutingProtocol']) ## ripng.h (module 'internet'): ns3::RipNg::SplitHorizonType_e [enumeration] module.add_enum('SplitHorizonType_e', ['NO_SPLIT_HORIZON', 'SPLIT_HORIZON', 'POISON_REVERSE'], outer_class=root_module['ns3::RipNg']) + ## string.h (module 'core'): ns3::StringChecker [class] + module.add_class('StringChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) + ## string.h (module 'core'): ns3::StringValue [class] + module.add_class('StringValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## tcp-l4-protocol.h (module 'internet'): ns3::TcpL4Protocol [class] module.add_class('TcpL4Protocol', parent=root_module['ns3::IpL4Protocol']) ## tcp-newreno.h (module 'internet'): ns3::TcpNewReno [class] @@ -872,6 +890,7 @@ register_Ns3TimeWithUnit_methods(root_module, root_module['ns3::TimeWithUnit']) register_Ns3Timer_methods(root_module, root_module['ns3::Timer']) register_Ns3TimerImpl_methods(root_module, root_module['ns3::TimerImpl']) + register_Ns3TracedValue__Bool_methods(root_module, root_module['ns3::TracedValue< bool >']) register_Ns3TracedValue__Double_methods(root_module, root_module['ns3::TracedValue< double >']) register_Ns3TracedValue__Ns3SequenceNumber__lt__unsigned_int__int__gt___methods(root_module, root_module['ns3::TracedValue< ns3::SequenceNumber >']) register_Ns3TracedValue__Ns3TcpStates_t_methods(root_module, root_module['ns3::TracedValue< ns3::TcpStates_t >']) @@ -921,6 +940,7 @@ register_Ns3Object_methods(root_module, root_module['ns3::Object']) register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator']) register_Ns3PcapFileWrapper_methods(root_module, root_module['ns3::PcapFileWrapper']) + register_Ns3Queue_methods(root_module, root_module['ns3::Queue']) register_Ns3RandomVariableStream_methods(root_module, root_module['ns3::RandomVariableStream']) register_Ns3RipNgHeader_methods(root_module, root_module['ns3::RipNgHeader']) register_Ns3RipNgRte_methods(root_module, root_module['ns3::RipNgRte']) @@ -950,6 +970,8 @@ register_Ns3SocketIpv6TclassTag_methods(root_module, root_module['ns3::SocketIpv6TclassTag']) register_Ns3SocketSetDontFragmentTag_methods(root_module, root_module['ns3::SocketSetDontFragmentTag']) register_Ns3TcpHeader_methods(root_module, root_module['ns3::TcpHeader']) + register_Ns3TcpOption_methods(root_module, root_module['ns3::TcpOption']) + register_Ns3TcpOptionUnknown_methods(root_module, root_module['ns3::TcpOptionUnknown']) register_Ns3TcpRxBuffer_methods(root_module, root_module['ns3::TcpRxBuffer']) register_Ns3TcpSocket_methods(root_module, root_module['ns3::TcpSocket']) register_Ns3TcpSocketBase_methods(root_module, root_module['ns3::TcpSocketBase']) @@ -982,6 +1004,7 @@ register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase']) register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue']) register_Ns3Channel_methods(root_module, root_module['ns3::Channel']) + register_Ns3CoDelQueue_methods(root_module, root_module['ns3::CoDelQueue']) register_Ns3ConstantRandomVariable_methods(root_module, root_module['ns3::ConstantRandomVariable']) register_Ns3DataCollectionObject_methods(root_module, root_module['ns3::DataCollectionObject']) register_Ns3DeterministicRandomVariable_methods(root_module, root_module['ns3::DeterministicRandomVariable']) @@ -1055,6 +1078,8 @@ register_Ns3ParetoRandomVariable_methods(root_module, root_module['ns3::ParetoRandomVariable']) register_Ns3Probe_methods(root_module, root_module['ns3::Probe']) register_Ns3RipNg_methods(root_module, root_module['ns3::RipNg']) + register_Ns3StringChecker_methods(root_module, root_module['ns3::StringChecker']) + register_Ns3StringValue_methods(root_module, root_module['ns3::StringValue']) register_Ns3TcpL4Protocol_methods(root_module, root_module['ns3::TcpL4Protocol']) register_Ns3TcpNewReno_methods(root_module, root_module['ns3::TcpNewReno']) register_Ns3TcpReno_methods(root_module, root_module['ns3::TcpReno']) @@ -4884,6 +4909,40 @@ is_pure_virtual=True, is_virtual=True) return +def register_Ns3TracedValue__Bool_methods(root_module, cls): + ## traced-value.h (module 'core'): ns3::TracedValue::TracedValue() [constructor] + cls.add_constructor([]) + ## traced-value.h (module 'core'): ns3::TracedValue::TracedValue(ns3::TracedValue const & o) [copy constructor] + cls.add_constructor([param('ns3::TracedValue< bool > const &', 'o')]) + ## traced-value.h (module 'core'): ns3::TracedValue::TracedValue(bool const & v) [constructor] + cls.add_constructor([param('bool const &', 'v')]) + ## traced-value.h (module 'core'): void ns3::TracedValue::Connect(ns3::CallbackBase const & cb, std::basic_string,std::allocator > path) [member function] + cls.add_method('Connect', + 'void', + [param('ns3::CallbackBase const &', 'cb'), param('std::string', 'path')]) + ## traced-value.h (module 'core'): void ns3::TracedValue::ConnectWithoutContext(ns3::CallbackBase const & cb) [member function] + cls.add_method('ConnectWithoutContext', + 'void', + [param('ns3::CallbackBase const &', 'cb')]) + ## traced-value.h (module 'core'): void ns3::TracedValue::Disconnect(ns3::CallbackBase const & cb, std::basic_string,std::allocator > path) [member function] + cls.add_method('Disconnect', + 'void', + [param('ns3::CallbackBase const &', 'cb'), param('std::string', 'path')]) + ## traced-value.h (module 'core'): void ns3::TracedValue::DisconnectWithoutContext(ns3::CallbackBase const & cb) [member function] + cls.add_method('DisconnectWithoutContext', + 'void', + [param('ns3::CallbackBase const &', 'cb')]) + ## traced-value.h (module 'core'): bool ns3::TracedValue::Get() const [member function] + cls.add_method('Get', + 'bool', + [], + is_const=True) + ## traced-value.h (module 'core'): void ns3::TracedValue::Set(bool const & v) [member function] + cls.add_method('Set', + 'void', + [param('bool const &', 'v')]) + return + def register_Ns3TracedValue__Double_methods(root_module, cls): ## traced-value.h (module 'core'): ns3::TracedValue::TracedValue() [constructor] cls.add_constructor([]) @@ -7578,6 +7637,94 @@ []) return +def register_Ns3Queue_methods(root_module, cls): + ## queue.h (module 'network'): ns3::Queue::Queue(ns3::Queue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Queue const &', 'arg0')]) + ## queue.h (module 'network'): ns3::Queue::Queue() [constructor] + cls.add_constructor([]) + ## queue.h (module 'network'): ns3::Ptr ns3::Queue::Dequeue() [member function] + cls.add_method('Dequeue', + 'ns3::Ptr< ns3::Packet >', + []) + ## queue.h (module 'network'): void ns3::Queue::DequeueAll() [member function] + cls.add_method('DequeueAll', + 'void', + []) + ## queue.h (module 'network'): bool ns3::Queue::Enqueue(ns3::Ptr p) [member function] + cls.add_method('Enqueue', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + ## queue.h (module 'network'): uint32_t ns3::Queue::GetNBytes() const [member function] + cls.add_method('GetNBytes', + 'uint32_t', + [], + is_const=True) + ## queue.h (module 'network'): uint32_t ns3::Queue::GetNPackets() const [member function] + cls.add_method('GetNPackets', + 'uint32_t', + [], + is_const=True) + ## queue.h (module 'network'): uint32_t ns3::Queue::GetTotalDroppedBytes() const [member function] + cls.add_method('GetTotalDroppedBytes', + 'uint32_t', + [], + is_const=True) + ## queue.h (module 'network'): uint32_t ns3::Queue::GetTotalDroppedPackets() const [member function] + cls.add_method('GetTotalDroppedPackets', + 'uint32_t', + [], + is_const=True) + ## queue.h (module 'network'): uint32_t ns3::Queue::GetTotalReceivedBytes() const [member function] + cls.add_method('GetTotalReceivedBytes', + 'uint32_t', + [], + is_const=True) + ## queue.h (module 'network'): uint32_t ns3::Queue::GetTotalReceivedPackets() const [member function] + cls.add_method('GetTotalReceivedPackets', + 'uint32_t', + [], + is_const=True) + ## queue.h (module 'network'): static ns3::TypeId ns3::Queue::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## queue.h (module 'network'): bool ns3::Queue::IsEmpty() const [member function] + cls.add_method('IsEmpty', + 'bool', + [], + is_const=True) + ## queue.h (module 'network'): ns3::Ptr ns3::Queue::Peek() const [member function] + cls.add_method('Peek', + 'ns3::Ptr< ns3::Packet const >', + [], + is_const=True) + ## queue.h (module 'network'): void ns3::Queue::ResetStatistics() [member function] + cls.add_method('ResetStatistics', + 'void', + []) + ## queue.h (module 'network'): void ns3::Queue::Drop(ns3::Ptr packet) [member function] + cls.add_method('Drop', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet')], + visibility='protected') + ## queue.h (module 'network'): ns3::Ptr ns3::Queue::DoDequeue() [member function] + cls.add_method('DoDequeue', + 'ns3::Ptr< ns3::Packet >', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## queue.h (module 'network'): bool ns3::Queue::DoEnqueue(ns3::Ptr p) [member function] + cls.add_method('DoEnqueue', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## queue.h (module 'network'): ns3::Ptr ns3::Queue::DoPeek() const [member function] + cls.add_method('DoPeek', + 'ns3::Ptr< ns3::Packet const >', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + return + def register_Ns3RandomVariableStream_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::RandomVariableStream::GetTypeId() [member function] cls.add_method('GetTypeId', @@ -7622,6 +7769,7 @@ return def register_Ns3RipNgHeader_methods(root_module, cls): + cls.add_output_stream_operator() ## ripng-header.h (module 'internet'): ns3::RipNgHeader::RipNgHeader(ns3::RipNgHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::RipNgHeader const &', 'arg0')]) ## ripng-header.h (module 'internet'): ns3::RipNgHeader::RipNgHeader() [constructor] @@ -7686,6 +7834,7 @@ return def register_Ns3RipNgRte_methods(root_module, cls): + cls.add_output_stream_operator() ## ripng-header.h (module 'internet'): ns3::RipNgRte::RipNgRte(ns3::RipNgRte const & arg0) [copy constructor] cls.add_constructor([param('ns3::RipNgRte const &', 'arg0')]) ## ripng-header.h (module 'internet'): ns3::RipNgRte::RipNgRte() [constructor] @@ -7763,11 +7912,6 @@ cls.add_constructor([]) ## rtt-estimator.h (module 'internet'): ns3::RttEstimator::RttEstimator(ns3::RttEstimator const & r) [copy constructor] cls.add_constructor([param('ns3::RttEstimator const &', 'r')]) - ## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::AckSeq(ns3::SequenceNumber32 ackSeq) [member function] - cls.add_method('AckSeq', - 'ns3::Time', - [param('ns3::SequenceNumber32', 'ackSeq')], - is_virtual=True) ## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::ClearSent() [member function] cls.add_method('ClearSent', 'void', @@ -7778,6 +7922,11 @@ 'ns3::Ptr< ns3::RttEstimator >', [], is_pure_virtual=True, is_const=True, is_virtual=True) + ## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::EstimateRttFromSeq(ns3::SequenceNumber32 ackSeq) [member function] + cls.add_method('EstimateRttFromSeq', + 'ns3::Time', + [param('ns3::SequenceNumber32', 'ackSeq')], + is_virtual=True) ## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetCurrentEstimate() const [member function] cls.add_method('GetCurrentEstimate', 'ns3::Time', @@ -8716,10 +8865,15 @@ return def register_Ns3TcpHeader_methods(root_module, cls): + cls.add_binary_comparison_operator('==') ## tcp-header.h (module 'internet'): ns3::TcpHeader::TcpHeader(ns3::TcpHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::TcpHeader const &', 'arg0')]) ## tcp-header.h (module 'internet'): ns3::TcpHeader::TcpHeader() [constructor] cls.add_constructor([]) + ## tcp-header.h (module 'internet'): bool ns3::TcpHeader::AppendOption(ns3::Ptr option) [member function] + cls.add_method('AppendOption', + 'bool', + [param('ns3::Ptr< ns3::TcpOption >', 'option')]) ## tcp-header.h (module 'internet'): uint32_t ns3::TcpHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', @@ -8754,6 +8908,11 @@ 'uint8_t', [], is_const=True) + ## tcp-header.h (module 'internet'): ns3::Ptr ns3::TcpHeader::GetOption(uint8_t kind) const [member function] + cls.add_method('GetOption', + 'ns3::Ptr< ns3::TcpOption >', + [param('uint8_t', 'kind')], + is_const=True) ## tcp-header.h (module 'internet'): ns3::SequenceNumber32 ns3::TcpHeader::GetSequenceNumber() const [member function] cls.add_method('GetSequenceNumber', 'ns3::SequenceNumber32', @@ -8784,6 +8943,11 @@ 'uint16_t', [], is_const=True) + ## tcp-header.h (module 'internet'): bool ns3::TcpHeader::HasOption(uint8_t kind) const [member function] + cls.add_method('HasOption', + 'bool', + [param('uint8_t', 'kind')], + is_const=True) ## tcp-header.h (module 'internet'): void ns3::TcpHeader::InitializeChecksum(ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol) [member function] cls.add_method('InitializeChecksum', 'void', @@ -8823,10 +8987,6 @@ cls.add_method('SetFlags', 'void', [param('uint8_t', 'flags')]) - ## tcp-header.h (module 'internet'): void ns3::TcpHeader::SetLength(uint8_t length) [member function] - cls.add_method('SetLength', - 'void', - [param('uint8_t', 'length')]) ## tcp-header.h (module 'internet'): void ns3::TcpHeader::SetSequenceNumber(ns3::SequenceNumber32 sequenceNumber) [member function] cls.add_method('SetSequenceNumber', 'void', @@ -8845,6 +9005,100 @@ [param('uint16_t', 'windowSize')]) return +def register_Ns3TcpOption_methods(root_module, cls): + ## tcp-option.h (module 'internet'): ns3::TcpOption::TcpOption(ns3::TcpOption const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TcpOption const &', 'arg0')]) + ## tcp-option.h (module 'internet'): ns3::TcpOption::TcpOption() [constructor] + cls.add_constructor([]) + ## tcp-option.h (module 'internet'): static ns3::Ptr ns3::TcpOption::CreateOption(uint8_t kind) [member function] + cls.add_method('CreateOption', + 'ns3::Ptr< ns3::TcpOption >', + [param('uint8_t', 'kind')], + is_static=True) + ## tcp-option.h (module 'internet'): uint32_t ns3::TcpOption::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_pure_virtual=True, is_virtual=True) + ## tcp-option.h (module 'internet'): ns3::TypeId ns3::TcpOption::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): uint8_t ns3::TcpOption::GetKind() const [member function] + cls.add_method('GetKind', + 'uint8_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): uint32_t ns3::TcpOption::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): static ns3::TypeId ns3::TcpOption::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## tcp-option.h (module 'internet'): static bool ns3::TcpOption::IsKindKnown(uint8_t kind) [member function] + cls.add_method('IsKindKnown', + 'bool', + [param('uint8_t', 'kind')], + is_static=True) + ## tcp-option.h (module 'internet'): void ns3::TcpOption::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): void ns3::TcpOption::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3TcpOptionUnknown_methods(root_module, cls): + ## tcp-option.h (module 'internet'): ns3::TcpOptionUnknown::TcpOptionUnknown(ns3::TcpOptionUnknown const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TcpOptionUnknown const &', 'arg0')]) + ## tcp-option.h (module 'internet'): ns3::TcpOptionUnknown::TcpOptionUnknown() [constructor] + cls.add_constructor([]) + ## tcp-option.h (module 'internet'): uint32_t ns3::TcpOptionUnknown::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## tcp-option.h (module 'internet'): ns3::TypeId ns3::TcpOptionUnknown::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): uint8_t ns3::TcpOptionUnknown::GetKind() const [member function] + cls.add_method('GetKind', + 'uint8_t', + [], + is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): uint32_t ns3::TcpOptionUnknown::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): static ns3::TypeId ns3::TcpOptionUnknown::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## tcp-option.h (module 'internet'): void ns3::TcpOptionUnknown::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): void ns3::TcpOptionUnknown::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + return + def register_Ns3TcpRxBuffer_methods(root_module, cls): ## tcp-rx-buffer.h (module 'internet'): ns3::TcpRxBuffer::TcpRxBuffer(ns3::TcpRxBuffer const & arg0) [copy constructor] cls.add_constructor([param('ns3::TcpRxBuffer const &', 'arg0')]) @@ -8961,6 +9215,11 @@ 'uint32_t', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## tcp-socket.h (module 'internet'): uint32_t ns3::TcpSocket::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) ## tcp-socket.h (module 'internet'): ns3::Time ns3::TcpSocket::GetPersistTimeout() const [member function] cls.add_method('GetPersistTimeout', 'ns3::Time', @@ -8971,11 +9230,6 @@ 'uint32_t', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) - ## tcp-socket.h (module 'internet'): uint32_t ns3::TcpSocket::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', - 'uint32_t', - [], - is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) ## tcp-socket.h (module 'internet'): uint32_t ns3::TcpSocket::GetSegSize() const [member function] cls.add_method('GetSegSize', 'uint32_t', @@ -9016,6 +9270,11 @@ 'void', [param('uint32_t', 'cwnd')], is_pure_virtual=True, visibility='private', is_virtual=True) + ## tcp-socket.h (module 'internet'): void ns3::TcpSocket::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', + 'void', + [param('uint32_t', 'threshold')], + is_pure_virtual=True, visibility='private', is_virtual=True) ## tcp-socket.h (module 'internet'): void ns3::TcpSocket::SetPersistTimeout(ns3::Time timeout) [member function] cls.add_method('SetPersistTimeout', 'void', @@ -9026,11 +9285,6 @@ 'void', [param('uint32_t', 'size')], is_pure_virtual=True, visibility='private', is_virtual=True) - ## tcp-socket.h (module 'internet'): void ns3::TcpSocket::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', - 'void', - [param('uint32_t', 'threshold')], - is_pure_virtual=True, visibility='private', is_virtual=True) ## tcp-socket.h (module 'internet'): void ns3::TcpSocket::SetSegSize(uint32_t size) [member function] cls.add_method('SetSegSize', 'void', @@ -9168,6 +9422,16 @@ 'int', [], is_virtual=True) + ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::AddOptionTimestamp(ns3::TcpHeader & header) [member function] + cls.add_method('AddOptionTimestamp', + 'void', + [param('ns3::TcpHeader &', 'header')], + visibility='protected') + ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::AddOptionWScale(ns3::TcpHeader & header) [member function] + cls.add_method('AddOptionWScale', + 'void', + [param('ns3::TcpHeader &', 'header')], + visibility='protected') ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::AddOptions(ns3::TcpHeader & tcpHeader) [member function] cls.add_method('AddOptions', 'void', @@ -9188,6 +9452,11 @@ 'uint32_t', [], visibility='protected', is_virtual=True) + ## tcp-socket-base.h (module 'internet'): uint8_t ns3::TcpSocketBase::CalculateWScale() const [member function] + cls.add_method('CalculateWScale', + 'uint8_t', + [], + is_const=True, visibility='protected') ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::CancelAllTimers() [member function] cls.add_method('CancelAllTimers', 'void', @@ -9323,6 +9592,11 @@ 'uint32_t', [], is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## tcp-socket-base.h (module 'internet'): uint32_t ns3::TcpSocketBase::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) ## tcp-socket-base.h (module 'internet'): ns3::Time ns3::TcpSocketBase::GetPersistTimeout() const [member function] cls.add_method('GetPersistTimeout', 'ns3::Time', @@ -9333,11 +9607,6 @@ 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) - ## tcp-socket-base.h (module 'internet'): uint32_t ns3::TcpSocketBase::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', - 'uint32_t', - [], - is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) ## tcp-socket-base.h (module 'internet'): uint32_t ns3::TcpSocketBase::GetSegSize() const [member function] cls.add_method('GetSegSize', 'uint32_t', @@ -9398,6 +9667,16 @@ 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::TcpHeader const &', 'tcpHeader'), param('ns3::Address const &', 'fromAddress'), param('ns3::Address const &', 'toAddress')], visibility='protected') + ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::ProcessOptionTimestamp(ns3::Ptr const option) [member function] + cls.add_method('ProcessOptionTimestamp', + 'void', + [param('ns3::Ptr< ns3::TcpOption const > const', 'option')], + visibility='protected') + ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::ProcessOptionWScale(ns3::Ptr const option) [member function] + cls.add_method('ProcessOptionWScale', + 'void', + [param('ns3::Ptr< ns3::TcpOption const > const', 'option')], + visibility='protected') ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::ProcessSynRcvd(ns3::Ptr packet, ns3::TcpHeader const & tcpHeader, ns3::Address const & fromAddress, ns3::Address const & toAddress) [member function] cls.add_method('ProcessSynRcvd', 'void', @@ -9488,6 +9767,11 @@ 'void', [param('uint32_t', 'cwnd')], is_pure_virtual=True, visibility='protected', is_virtual=True) + ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', + 'void', + [param('uint32_t', 'threshold')], + is_pure_virtual=True, visibility='protected', is_virtual=True) ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::SetPersistTimeout(ns3::Time timeout) [member function] cls.add_method('SetPersistTimeout', 'void', @@ -9498,11 +9782,6 @@ 'void', [param('uint32_t', 'size')], visibility='protected', is_virtual=True) - ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', - 'void', - [param('uint32_t', 'threshold')], - is_pure_virtual=True, visibility='protected', is_virtual=True) ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::SetSegSize(uint32_t size) [member function] cls.add_method('SetSegSize', 'void', @@ -9597,8 +9876,8 @@ 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) - ## tcp-tahoe.h (module 'internet'): uint32_t ns3::TcpTahoe::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', + ## tcp-tahoe.h (module 'internet'): uint32_t ns3::TcpTahoe::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) @@ -9617,8 +9896,8 @@ 'void', [param('uint32_t', 'cwnd')], visibility='protected', is_virtual=True) - ## tcp-tahoe.h (module 'internet'): void ns3::TcpTahoe::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', + ## tcp-tahoe.h (module 'internet'): void ns3::TcpTahoe::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', 'void', [param('uint32_t', 'threshold')], visibility='protected', is_virtual=True) @@ -9736,8 +10015,8 @@ 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) - ## tcp-westwood.h (module 'internet'): uint32_t ns3::TcpWestwood::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', + ## tcp-westwood.h (module 'internet'): uint32_t ns3::TcpWestwood::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) @@ -9761,8 +10040,8 @@ 'void', [param('uint32_t', 'cwnd')], visibility='protected', is_virtual=True) - ## tcp-westwood.h (module 'internet'): void ns3::TcpWestwood::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', + ## tcp-westwood.h (module 'internet'): void ns3::TcpWestwood::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', 'void', [param('uint32_t', 'threshold')], visibility='protected', is_virtual=True) @@ -9810,10 +10089,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -9824,25 +10103,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -9959,20 +10238,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return @@ -10913,6 +11192,65 @@ is_static=True) return +def register_Ns3CoDelQueue_methods(root_module, cls): + ## codel-queue.h (module 'internet'): ns3::CoDelQueue::CoDelQueue(ns3::CoDelQueue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CoDelQueue const &', 'arg0')]) + ## codel-queue.h (module 'internet'): ns3::CoDelQueue::CoDelQueue() [constructor] + cls.add_constructor([]) + ## codel-queue.h (module 'internet'): uint32_t ns3::CoDelQueue::GetDropCount() [member function] + cls.add_method('GetDropCount', + 'uint32_t', + []) + ## codel-queue.h (module 'internet'): uint32_t ns3::CoDelQueue::GetDropNext() [member function] + cls.add_method('GetDropNext', + 'uint32_t', + []) + ## codel-queue.h (module 'internet'): uint32_t ns3::CoDelQueue::GetDropOverLimit() [member function] + cls.add_method('GetDropOverLimit', + 'uint32_t', + []) + ## codel-queue.h (module 'internet'): ns3::Time ns3::CoDelQueue::GetInterval() [member function] + cls.add_method('GetInterval', + 'ns3::Time', + []) + ## codel-queue.h (module 'internet'): ns3::Queue::QueueMode ns3::CoDelQueue::GetMode() [member function] + cls.add_method('GetMode', + 'ns3::Queue::QueueMode', + []) + ## codel-queue.h (module 'internet'): uint32_t ns3::CoDelQueue::GetQueueSize() [member function] + cls.add_method('GetQueueSize', + 'uint32_t', + []) + ## codel-queue.h (module 'internet'): ns3::Time ns3::CoDelQueue::GetTarget() [member function] + cls.add_method('GetTarget', + 'ns3::Time', + []) + ## codel-queue.h (module 'internet'): static ns3::TypeId ns3::CoDelQueue::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## codel-queue.h (module 'internet'): void ns3::CoDelQueue::SetMode(ns3::Queue::QueueMode mode) [member function] + cls.add_method('SetMode', + 'void', + [param('ns3::Queue::QueueMode', 'mode')]) + ## codel-queue.h (module 'internet'): ns3::Ptr ns3::CoDelQueue::DoDequeue() [member function] + cls.add_method('DoDequeue', + 'ns3::Ptr< ns3::Packet >', + [], + visibility='private', is_virtual=True) + ## codel-queue.h (module 'internet'): bool ns3::CoDelQueue::DoEnqueue(ns3::Ptr p) [member function] + cls.add_method('DoEnqueue', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')], + visibility='private', is_virtual=True) + ## codel-queue.h (module 'internet'): ns3::Ptr ns3::CoDelQueue::DoPeek() const [member function] + cls.add_method('DoPeek', + 'ns3::Ptr< ns3::Packet const >', + [], + is_const=True, visibility='private', is_virtual=True) + return + def register_Ns3ConstantRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ConstantRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', @@ -15036,6 +15374,46 @@ visibility='protected', is_virtual=True) return +def register_Ns3StringChecker_methods(root_module, cls): + ## string.h (module 'core'): ns3::StringChecker::StringChecker() [constructor] + cls.add_constructor([]) + ## string.h (module 'core'): ns3::StringChecker::StringChecker(ns3::StringChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::StringChecker const &', 'arg0')]) + return + +def register_Ns3StringValue_methods(root_module, cls): + ## string.h (module 'core'): ns3::StringValue::StringValue() [constructor] + cls.add_constructor([]) + ## string.h (module 'core'): ns3::StringValue::StringValue(ns3::StringValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::StringValue const &', 'arg0')]) + ## string.h (module 'core'): ns3::StringValue::StringValue(std::string const & value) [constructor] + cls.add_constructor([param('std::string const &', 'value')]) + ## string.h (module 'core'): ns3::Ptr ns3::StringValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## string.h (module 'core'): bool ns3::StringValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## string.h (module 'core'): std::string ns3::StringValue::Get() const [member function] + cls.add_method('Get', + 'std::string', + [], + is_const=True) + ## string.h (module 'core'): std::string ns3::StringValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## string.h (module 'core'): void ns3::StringValue::Set(std::string const & value) [member function] + cls.add_method('Set', + 'void', + [param('std::string const &', 'value')]) + return + def register_Ns3TcpL4Protocol_methods(root_module, cls): ## tcp-l4-protocol.h (module 'internet'): ns3::TcpL4Protocol::PROT_NUMBER [variable] cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True) @@ -15206,8 +15584,8 @@ 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) - ## tcp-newreno.h (module 'internet'): uint32_t ns3::TcpNewReno::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', + ## tcp-newreno.h (module 'internet'): uint32_t ns3::TcpNewReno::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) @@ -15226,8 +15604,8 @@ 'void', [param('uint32_t', 'cwnd')], visibility='protected', is_virtual=True) - ## tcp-newreno.h (module 'internet'): void ns3::TcpNewReno::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', + ## tcp-newreno.h (module 'internet'): void ns3::TcpNewReno::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', 'void', [param('uint32_t', 'threshold')], visibility='protected', is_virtual=True) @@ -15278,8 +15656,8 @@ 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) - ## tcp-reno.h (module 'internet'): uint32_t ns3::TcpReno::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', + ## tcp-reno.h (module 'internet'): uint32_t ns3::TcpReno::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) @@ -15298,8 +15676,8 @@ 'void', [param('uint32_t', 'cwnd')], visibility='protected', is_virtual=True) - ## tcp-reno.h (module 'internet'): void ns3::TcpReno::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', + ## tcp-reno.h (module 'internet'): void ns3::TcpReno::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', 'void', [param('uint32_t', 'threshold')], visibility='protected', is_virtual=True) @@ -15340,8 +15718,8 @@ 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) - ## tcp-rfc793.h (module 'internet'): uint32_t ns3::TcpRfc793::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', + ## tcp-rfc793.h (module 'internet'): uint32_t ns3::TcpRfc793::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) @@ -15350,8 +15728,8 @@ 'void', [param('uint32_t', 'cwnd')], visibility='protected', is_virtual=True) - ## tcp-rfc793.h (module 'internet'): void ns3::TcpRfc793::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', + ## tcp-rfc793.h (module 'internet'): void ns3::TcpRfc793::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', 'void', [param('uint32_t', 'threshold')], visibility='protected', is_virtual=True) diff -Naur ns-3.20/src/internet/bindings/modulegen__gcc_LP64.py ns-3.21/src/internet/bindings/modulegen__gcc_LP64.py --- ns-3.20/src/internet/bindings/modulegen__gcc_LP64.py 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/internet/bindings/modulegen__gcc_LP64.py 2014-09-17 20:03:14.000000000 -0700 @@ -242,6 +242,8 @@ module.add_enum('State', ['RUNNING', 'EXPIRED', 'SUSPENDED'], outer_class=root_module['ns3::Timer'], import_from_module='ns.core') ## timer-impl.h (module 'core'): ns3::TimerImpl [class] module.add_class('TimerImpl', allow_subclassing=True, import_from_module='ns.core') + ## traced-value.h (module 'core'): ns3::TracedValue [class] + module.add_class('TracedValue', import_from_module='ns.core', template_parameters=['bool']) ## traced-value.h (module 'core'): ns3::TracedValue [class] module.add_class('TracedValue', import_from_module='ns.core', template_parameters=['double']) ## traced-value.h (module 'core'): ns3::TracedValue > [class] @@ -368,6 +370,10 @@ module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object']) ## pcap-file-wrapper.h (module 'network'): ns3::PcapFileWrapper [class] module.add_class('PcapFileWrapper', import_from_module='ns.network', parent=root_module['ns3::Object']) + ## queue.h (module 'network'): ns3::Queue [class] + module.add_class('Queue', import_from_module='ns.network', parent=root_module['ns3::Object']) + ## queue.h (module 'network'): ns3::Queue::QueueMode [enumeration] + module.add_enum('QueueMode', ['QUEUE_MODE_PACKETS', 'QUEUE_MODE_BYTES'], outer_class=root_module['ns3::Queue'], import_from_module='ns.network') ## random-variable-stream.h (module 'core'): ns3::RandomVariableStream [class] module.add_class('RandomVariableStream', import_from_module='ns.core', parent=root_module['ns3::Object']) ## ripng-header.h (module 'internet'): ns3::RipNgHeader [class] @@ -434,6 +440,12 @@ module.add_class('TcpHeader', parent=root_module['ns3::Header']) ## tcp-header.h (module 'internet'): ns3::TcpHeader::Flags_t [enumeration] module.add_enum('Flags_t', ['NONE', 'FIN', 'SYN', 'RST', 'PSH', 'ACK', 'URG', 'ECE', 'CWR'], outer_class=root_module['ns3::TcpHeader']) + ## tcp-option.h (module 'internet'): ns3::TcpOption [class] + module.add_class('TcpOption', parent=root_module['ns3::Object']) + ## tcp-option.h (module 'internet'): ns3::TcpOption::Kind [enumeration] + module.add_enum('Kind', ['END', 'NOP', 'MSS', 'WINSCALE', 'TS', 'UNKNOWN'], outer_class=root_module['ns3::TcpOption']) + ## tcp-option.h (module 'internet'): ns3::TcpOptionUnknown [class] + module.add_class('TcpOptionUnknown', parent=root_module['ns3::TcpOption']) ## tcp-rx-buffer.h (module 'internet'): ns3::TcpRxBuffer [class] module.add_class('TcpRxBuffer', parent=root_module['ns3::Object']) ## tcp-socket.h (module 'internet'): ns3::TcpSocket [class] @@ -510,6 +522,8 @@ module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## channel.h (module 'network'): ns3::Channel [class] module.add_class('Channel', import_from_module='ns.network', parent=root_module['ns3::Object']) + ## codel-queue.h (module 'internet'): ns3::CoDelQueue [class] + module.add_class('CoDelQueue', parent=root_module['ns3::Queue']) ## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable [class] module.add_class('ConstantRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## data-collection-object.h (module 'stats'): ns3::DataCollectionObject [class] @@ -666,6 +680,10 @@ module.add_class('RipNg', parent=root_module['ns3::Ipv6RoutingProtocol']) ## ripng.h (module 'internet'): ns3::RipNg::SplitHorizonType_e [enumeration] module.add_enum('SplitHorizonType_e', ['NO_SPLIT_HORIZON', 'SPLIT_HORIZON', 'POISON_REVERSE'], outer_class=root_module['ns3::RipNg']) + ## string.h (module 'core'): ns3::StringChecker [class] + module.add_class('StringChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) + ## string.h (module 'core'): ns3::StringValue [class] + module.add_class('StringValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## tcp-l4-protocol.h (module 'internet'): ns3::TcpL4Protocol [class] module.add_class('TcpL4Protocol', parent=root_module['ns3::IpL4Protocol']) ## tcp-newreno.h (module 'internet'): ns3::TcpNewReno [class] @@ -872,6 +890,7 @@ register_Ns3TimeWithUnit_methods(root_module, root_module['ns3::TimeWithUnit']) register_Ns3Timer_methods(root_module, root_module['ns3::Timer']) register_Ns3TimerImpl_methods(root_module, root_module['ns3::TimerImpl']) + register_Ns3TracedValue__Bool_methods(root_module, root_module['ns3::TracedValue< bool >']) register_Ns3TracedValue__Double_methods(root_module, root_module['ns3::TracedValue< double >']) register_Ns3TracedValue__Ns3SequenceNumber__lt__unsigned_int__int__gt___methods(root_module, root_module['ns3::TracedValue< ns3::SequenceNumber >']) register_Ns3TracedValue__Ns3TcpStates_t_methods(root_module, root_module['ns3::TracedValue< ns3::TcpStates_t >']) @@ -921,6 +940,7 @@ register_Ns3Object_methods(root_module, root_module['ns3::Object']) register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator']) register_Ns3PcapFileWrapper_methods(root_module, root_module['ns3::PcapFileWrapper']) + register_Ns3Queue_methods(root_module, root_module['ns3::Queue']) register_Ns3RandomVariableStream_methods(root_module, root_module['ns3::RandomVariableStream']) register_Ns3RipNgHeader_methods(root_module, root_module['ns3::RipNgHeader']) register_Ns3RipNgRte_methods(root_module, root_module['ns3::RipNgRte']) @@ -950,6 +970,8 @@ register_Ns3SocketIpv6TclassTag_methods(root_module, root_module['ns3::SocketIpv6TclassTag']) register_Ns3SocketSetDontFragmentTag_methods(root_module, root_module['ns3::SocketSetDontFragmentTag']) register_Ns3TcpHeader_methods(root_module, root_module['ns3::TcpHeader']) + register_Ns3TcpOption_methods(root_module, root_module['ns3::TcpOption']) + register_Ns3TcpOptionUnknown_methods(root_module, root_module['ns3::TcpOptionUnknown']) register_Ns3TcpRxBuffer_methods(root_module, root_module['ns3::TcpRxBuffer']) register_Ns3TcpSocket_methods(root_module, root_module['ns3::TcpSocket']) register_Ns3TcpSocketBase_methods(root_module, root_module['ns3::TcpSocketBase']) @@ -982,6 +1004,7 @@ register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase']) register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue']) register_Ns3Channel_methods(root_module, root_module['ns3::Channel']) + register_Ns3CoDelQueue_methods(root_module, root_module['ns3::CoDelQueue']) register_Ns3ConstantRandomVariable_methods(root_module, root_module['ns3::ConstantRandomVariable']) register_Ns3DataCollectionObject_methods(root_module, root_module['ns3::DataCollectionObject']) register_Ns3DeterministicRandomVariable_methods(root_module, root_module['ns3::DeterministicRandomVariable']) @@ -1055,6 +1078,8 @@ register_Ns3ParetoRandomVariable_methods(root_module, root_module['ns3::ParetoRandomVariable']) register_Ns3Probe_methods(root_module, root_module['ns3::Probe']) register_Ns3RipNg_methods(root_module, root_module['ns3::RipNg']) + register_Ns3StringChecker_methods(root_module, root_module['ns3::StringChecker']) + register_Ns3StringValue_methods(root_module, root_module['ns3::StringValue']) register_Ns3TcpL4Protocol_methods(root_module, root_module['ns3::TcpL4Protocol']) register_Ns3TcpNewReno_methods(root_module, root_module['ns3::TcpNewReno']) register_Ns3TcpReno_methods(root_module, root_module['ns3::TcpReno']) @@ -4884,6 +4909,40 @@ is_pure_virtual=True, is_virtual=True) return +def register_Ns3TracedValue__Bool_methods(root_module, cls): + ## traced-value.h (module 'core'): ns3::TracedValue::TracedValue() [constructor] + cls.add_constructor([]) + ## traced-value.h (module 'core'): ns3::TracedValue::TracedValue(ns3::TracedValue const & o) [copy constructor] + cls.add_constructor([param('ns3::TracedValue< bool > const &', 'o')]) + ## traced-value.h (module 'core'): ns3::TracedValue::TracedValue(bool const & v) [constructor] + cls.add_constructor([param('bool const &', 'v')]) + ## traced-value.h (module 'core'): void ns3::TracedValue::Connect(ns3::CallbackBase const & cb, std::basic_string,std::allocator > path) [member function] + cls.add_method('Connect', + 'void', + [param('ns3::CallbackBase const &', 'cb'), param('std::string', 'path')]) + ## traced-value.h (module 'core'): void ns3::TracedValue::ConnectWithoutContext(ns3::CallbackBase const & cb) [member function] + cls.add_method('ConnectWithoutContext', + 'void', + [param('ns3::CallbackBase const &', 'cb')]) + ## traced-value.h (module 'core'): void ns3::TracedValue::Disconnect(ns3::CallbackBase const & cb, std::basic_string,std::allocator > path) [member function] + cls.add_method('Disconnect', + 'void', + [param('ns3::CallbackBase const &', 'cb'), param('std::string', 'path')]) + ## traced-value.h (module 'core'): void ns3::TracedValue::DisconnectWithoutContext(ns3::CallbackBase const & cb) [member function] + cls.add_method('DisconnectWithoutContext', + 'void', + [param('ns3::CallbackBase const &', 'cb')]) + ## traced-value.h (module 'core'): bool ns3::TracedValue::Get() const [member function] + cls.add_method('Get', + 'bool', + [], + is_const=True) + ## traced-value.h (module 'core'): void ns3::TracedValue::Set(bool const & v) [member function] + cls.add_method('Set', + 'void', + [param('bool const &', 'v')]) + return + def register_Ns3TracedValue__Double_methods(root_module, cls): ## traced-value.h (module 'core'): ns3::TracedValue::TracedValue() [constructor] cls.add_constructor([]) @@ -7578,6 +7637,94 @@ []) return +def register_Ns3Queue_methods(root_module, cls): + ## queue.h (module 'network'): ns3::Queue::Queue(ns3::Queue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Queue const &', 'arg0')]) + ## queue.h (module 'network'): ns3::Queue::Queue() [constructor] + cls.add_constructor([]) + ## queue.h (module 'network'): ns3::Ptr ns3::Queue::Dequeue() [member function] + cls.add_method('Dequeue', + 'ns3::Ptr< ns3::Packet >', + []) + ## queue.h (module 'network'): void ns3::Queue::DequeueAll() [member function] + cls.add_method('DequeueAll', + 'void', + []) + ## queue.h (module 'network'): bool ns3::Queue::Enqueue(ns3::Ptr p) [member function] + cls.add_method('Enqueue', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')]) + ## queue.h (module 'network'): uint32_t ns3::Queue::GetNBytes() const [member function] + cls.add_method('GetNBytes', + 'uint32_t', + [], + is_const=True) + ## queue.h (module 'network'): uint32_t ns3::Queue::GetNPackets() const [member function] + cls.add_method('GetNPackets', + 'uint32_t', + [], + is_const=True) + ## queue.h (module 'network'): uint32_t ns3::Queue::GetTotalDroppedBytes() const [member function] + cls.add_method('GetTotalDroppedBytes', + 'uint32_t', + [], + is_const=True) + ## queue.h (module 'network'): uint32_t ns3::Queue::GetTotalDroppedPackets() const [member function] + cls.add_method('GetTotalDroppedPackets', + 'uint32_t', + [], + is_const=True) + ## queue.h (module 'network'): uint32_t ns3::Queue::GetTotalReceivedBytes() const [member function] + cls.add_method('GetTotalReceivedBytes', + 'uint32_t', + [], + is_const=True) + ## queue.h (module 'network'): uint32_t ns3::Queue::GetTotalReceivedPackets() const [member function] + cls.add_method('GetTotalReceivedPackets', + 'uint32_t', + [], + is_const=True) + ## queue.h (module 'network'): static ns3::TypeId ns3::Queue::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## queue.h (module 'network'): bool ns3::Queue::IsEmpty() const [member function] + cls.add_method('IsEmpty', + 'bool', + [], + is_const=True) + ## queue.h (module 'network'): ns3::Ptr ns3::Queue::Peek() const [member function] + cls.add_method('Peek', + 'ns3::Ptr< ns3::Packet const >', + [], + is_const=True) + ## queue.h (module 'network'): void ns3::Queue::ResetStatistics() [member function] + cls.add_method('ResetStatistics', + 'void', + []) + ## queue.h (module 'network'): void ns3::Queue::Drop(ns3::Ptr packet) [member function] + cls.add_method('Drop', + 'void', + [param('ns3::Ptr< ns3::Packet >', 'packet')], + visibility='protected') + ## queue.h (module 'network'): ns3::Ptr ns3::Queue::DoDequeue() [member function] + cls.add_method('DoDequeue', + 'ns3::Ptr< ns3::Packet >', + [], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## queue.h (module 'network'): bool ns3::Queue::DoEnqueue(ns3::Ptr p) [member function] + cls.add_method('DoEnqueue', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')], + is_pure_virtual=True, visibility='private', is_virtual=True) + ## queue.h (module 'network'): ns3::Ptr ns3::Queue::DoPeek() const [member function] + cls.add_method('DoPeek', + 'ns3::Ptr< ns3::Packet const >', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + return + def register_Ns3RandomVariableStream_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::RandomVariableStream::GetTypeId() [member function] cls.add_method('GetTypeId', @@ -7622,6 +7769,7 @@ return def register_Ns3RipNgHeader_methods(root_module, cls): + cls.add_output_stream_operator() ## ripng-header.h (module 'internet'): ns3::RipNgHeader::RipNgHeader(ns3::RipNgHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::RipNgHeader const &', 'arg0')]) ## ripng-header.h (module 'internet'): ns3::RipNgHeader::RipNgHeader() [constructor] @@ -7686,6 +7834,7 @@ return def register_Ns3RipNgRte_methods(root_module, cls): + cls.add_output_stream_operator() ## ripng-header.h (module 'internet'): ns3::RipNgRte::RipNgRte(ns3::RipNgRte const & arg0) [copy constructor] cls.add_constructor([param('ns3::RipNgRte const &', 'arg0')]) ## ripng-header.h (module 'internet'): ns3::RipNgRte::RipNgRte() [constructor] @@ -7763,11 +7912,6 @@ cls.add_constructor([]) ## rtt-estimator.h (module 'internet'): ns3::RttEstimator::RttEstimator(ns3::RttEstimator const & r) [copy constructor] cls.add_constructor([param('ns3::RttEstimator const &', 'r')]) - ## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::AckSeq(ns3::SequenceNumber32 ackSeq) [member function] - cls.add_method('AckSeq', - 'ns3::Time', - [param('ns3::SequenceNumber32', 'ackSeq')], - is_virtual=True) ## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::ClearSent() [member function] cls.add_method('ClearSent', 'void', @@ -7778,6 +7922,11 @@ 'ns3::Ptr< ns3::RttEstimator >', [], is_pure_virtual=True, is_const=True, is_virtual=True) + ## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::EstimateRttFromSeq(ns3::SequenceNumber32 ackSeq) [member function] + cls.add_method('EstimateRttFromSeq', + 'ns3::Time', + [param('ns3::SequenceNumber32', 'ackSeq')], + is_virtual=True) ## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetCurrentEstimate() const [member function] cls.add_method('GetCurrentEstimate', 'ns3::Time', @@ -8716,10 +8865,15 @@ return def register_Ns3TcpHeader_methods(root_module, cls): + cls.add_binary_comparison_operator('==') ## tcp-header.h (module 'internet'): ns3::TcpHeader::TcpHeader(ns3::TcpHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::TcpHeader const &', 'arg0')]) ## tcp-header.h (module 'internet'): ns3::TcpHeader::TcpHeader() [constructor] cls.add_constructor([]) + ## tcp-header.h (module 'internet'): bool ns3::TcpHeader::AppendOption(ns3::Ptr option) [member function] + cls.add_method('AppendOption', + 'bool', + [param('ns3::Ptr< ns3::TcpOption >', 'option')]) ## tcp-header.h (module 'internet'): uint32_t ns3::TcpHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', @@ -8754,6 +8908,11 @@ 'uint8_t', [], is_const=True) + ## tcp-header.h (module 'internet'): ns3::Ptr ns3::TcpHeader::GetOption(uint8_t kind) const [member function] + cls.add_method('GetOption', + 'ns3::Ptr< ns3::TcpOption >', + [param('uint8_t', 'kind')], + is_const=True) ## tcp-header.h (module 'internet'): ns3::SequenceNumber32 ns3::TcpHeader::GetSequenceNumber() const [member function] cls.add_method('GetSequenceNumber', 'ns3::SequenceNumber32', @@ -8784,6 +8943,11 @@ 'uint16_t', [], is_const=True) + ## tcp-header.h (module 'internet'): bool ns3::TcpHeader::HasOption(uint8_t kind) const [member function] + cls.add_method('HasOption', + 'bool', + [param('uint8_t', 'kind')], + is_const=True) ## tcp-header.h (module 'internet'): void ns3::TcpHeader::InitializeChecksum(ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol) [member function] cls.add_method('InitializeChecksum', 'void', @@ -8823,10 +8987,6 @@ cls.add_method('SetFlags', 'void', [param('uint8_t', 'flags')]) - ## tcp-header.h (module 'internet'): void ns3::TcpHeader::SetLength(uint8_t length) [member function] - cls.add_method('SetLength', - 'void', - [param('uint8_t', 'length')]) ## tcp-header.h (module 'internet'): void ns3::TcpHeader::SetSequenceNumber(ns3::SequenceNumber32 sequenceNumber) [member function] cls.add_method('SetSequenceNumber', 'void', @@ -8845,6 +9005,100 @@ [param('uint16_t', 'windowSize')]) return +def register_Ns3TcpOption_methods(root_module, cls): + ## tcp-option.h (module 'internet'): ns3::TcpOption::TcpOption(ns3::TcpOption const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TcpOption const &', 'arg0')]) + ## tcp-option.h (module 'internet'): ns3::TcpOption::TcpOption() [constructor] + cls.add_constructor([]) + ## tcp-option.h (module 'internet'): static ns3::Ptr ns3::TcpOption::CreateOption(uint8_t kind) [member function] + cls.add_method('CreateOption', + 'ns3::Ptr< ns3::TcpOption >', + [param('uint8_t', 'kind')], + is_static=True) + ## tcp-option.h (module 'internet'): uint32_t ns3::TcpOption::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_pure_virtual=True, is_virtual=True) + ## tcp-option.h (module 'internet'): ns3::TypeId ns3::TcpOption::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): uint8_t ns3::TcpOption::GetKind() const [member function] + cls.add_method('GetKind', + 'uint8_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): uint32_t ns3::TcpOption::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): static ns3::TypeId ns3::TcpOption::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## tcp-option.h (module 'internet'): static bool ns3::TcpOption::IsKindKnown(uint8_t kind) [member function] + cls.add_method('IsKindKnown', + 'bool', + [param('uint8_t', 'kind')], + is_static=True) + ## tcp-option.h (module 'internet'): void ns3::TcpOption::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_pure_virtual=True, is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): void ns3::TcpOption::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_pure_virtual=True, is_const=True, is_virtual=True) + return + +def register_Ns3TcpOptionUnknown_methods(root_module, cls): + ## tcp-option.h (module 'internet'): ns3::TcpOptionUnknown::TcpOptionUnknown(ns3::TcpOptionUnknown const & arg0) [copy constructor] + cls.add_constructor([param('ns3::TcpOptionUnknown const &', 'arg0')]) + ## tcp-option.h (module 'internet'): ns3::TcpOptionUnknown::TcpOptionUnknown() [constructor] + cls.add_constructor([]) + ## tcp-option.h (module 'internet'): uint32_t ns3::TcpOptionUnknown::Deserialize(ns3::Buffer::Iterator start) [member function] + cls.add_method('Deserialize', + 'uint32_t', + [param('ns3::Buffer::Iterator', 'start')], + is_virtual=True) + ## tcp-option.h (module 'internet'): ns3::TypeId ns3::TcpOptionUnknown::GetInstanceTypeId() const [member function] + cls.add_method('GetInstanceTypeId', + 'ns3::TypeId', + [], + is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): uint8_t ns3::TcpOptionUnknown::GetKind() const [member function] + cls.add_method('GetKind', + 'uint8_t', + [], + is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): uint32_t ns3::TcpOptionUnknown::GetSerializedSize() const [member function] + cls.add_method('GetSerializedSize', + 'uint32_t', + [], + is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): static ns3::TypeId ns3::TcpOptionUnknown::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## tcp-option.h (module 'internet'): void ns3::TcpOptionUnknown::Print(std::ostream & os) const [member function] + cls.add_method('Print', + 'void', + [param('std::ostream &', 'os')], + is_const=True, is_virtual=True) + ## tcp-option.h (module 'internet'): void ns3::TcpOptionUnknown::Serialize(ns3::Buffer::Iterator start) const [member function] + cls.add_method('Serialize', + 'void', + [param('ns3::Buffer::Iterator', 'start')], + is_const=True, is_virtual=True) + return + def register_Ns3TcpRxBuffer_methods(root_module, cls): ## tcp-rx-buffer.h (module 'internet'): ns3::TcpRxBuffer::TcpRxBuffer(ns3::TcpRxBuffer const & arg0) [copy constructor] cls.add_constructor([param('ns3::TcpRxBuffer const &', 'arg0')]) @@ -8961,6 +9215,11 @@ 'uint32_t', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + ## tcp-socket.h (module 'internet'): uint32_t ns3::TcpSocket::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) ## tcp-socket.h (module 'internet'): ns3::Time ns3::TcpSocket::GetPersistTimeout() const [member function] cls.add_method('GetPersistTimeout', 'ns3::Time', @@ -8971,11 +9230,6 @@ 'uint32_t', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) - ## tcp-socket.h (module 'internet'): uint32_t ns3::TcpSocket::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', - 'uint32_t', - [], - is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) ## tcp-socket.h (module 'internet'): uint32_t ns3::TcpSocket::GetSegSize() const [member function] cls.add_method('GetSegSize', 'uint32_t', @@ -9016,6 +9270,11 @@ 'void', [param('uint32_t', 'cwnd')], is_pure_virtual=True, visibility='private', is_virtual=True) + ## tcp-socket.h (module 'internet'): void ns3::TcpSocket::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', + 'void', + [param('uint32_t', 'threshold')], + is_pure_virtual=True, visibility='private', is_virtual=True) ## tcp-socket.h (module 'internet'): void ns3::TcpSocket::SetPersistTimeout(ns3::Time timeout) [member function] cls.add_method('SetPersistTimeout', 'void', @@ -9026,11 +9285,6 @@ 'void', [param('uint32_t', 'size')], is_pure_virtual=True, visibility='private', is_virtual=True) - ## tcp-socket.h (module 'internet'): void ns3::TcpSocket::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', - 'void', - [param('uint32_t', 'threshold')], - is_pure_virtual=True, visibility='private', is_virtual=True) ## tcp-socket.h (module 'internet'): void ns3::TcpSocket::SetSegSize(uint32_t size) [member function] cls.add_method('SetSegSize', 'void', @@ -9168,6 +9422,16 @@ 'int', [], is_virtual=True) + ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::AddOptionTimestamp(ns3::TcpHeader & header) [member function] + cls.add_method('AddOptionTimestamp', + 'void', + [param('ns3::TcpHeader &', 'header')], + visibility='protected') + ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::AddOptionWScale(ns3::TcpHeader & header) [member function] + cls.add_method('AddOptionWScale', + 'void', + [param('ns3::TcpHeader &', 'header')], + visibility='protected') ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::AddOptions(ns3::TcpHeader & tcpHeader) [member function] cls.add_method('AddOptions', 'void', @@ -9188,6 +9452,11 @@ 'uint32_t', [], visibility='protected', is_virtual=True) + ## tcp-socket-base.h (module 'internet'): uint8_t ns3::TcpSocketBase::CalculateWScale() const [member function] + cls.add_method('CalculateWScale', + 'uint8_t', + [], + is_const=True, visibility='protected') ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::CancelAllTimers() [member function] cls.add_method('CancelAllTimers', 'void', @@ -9323,6 +9592,11 @@ 'uint32_t', [], is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) + ## tcp-socket-base.h (module 'internet'): uint32_t ns3::TcpSocketBase::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', + 'uint32_t', + [], + is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) ## tcp-socket-base.h (module 'internet'): ns3::Time ns3::TcpSocketBase::GetPersistTimeout() const [member function] cls.add_method('GetPersistTimeout', 'ns3::Time', @@ -9333,11 +9607,6 @@ 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) - ## tcp-socket-base.h (module 'internet'): uint32_t ns3::TcpSocketBase::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', - 'uint32_t', - [], - is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) ## tcp-socket-base.h (module 'internet'): uint32_t ns3::TcpSocketBase::GetSegSize() const [member function] cls.add_method('GetSegSize', 'uint32_t', @@ -9398,6 +9667,16 @@ 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::TcpHeader const &', 'tcpHeader'), param('ns3::Address const &', 'fromAddress'), param('ns3::Address const &', 'toAddress')], visibility='protected') + ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::ProcessOptionTimestamp(ns3::Ptr const option) [member function] + cls.add_method('ProcessOptionTimestamp', + 'void', + [param('ns3::Ptr< ns3::TcpOption const > const', 'option')], + visibility='protected') + ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::ProcessOptionWScale(ns3::Ptr const option) [member function] + cls.add_method('ProcessOptionWScale', + 'void', + [param('ns3::Ptr< ns3::TcpOption const > const', 'option')], + visibility='protected') ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::ProcessSynRcvd(ns3::Ptr packet, ns3::TcpHeader const & tcpHeader, ns3::Address const & fromAddress, ns3::Address const & toAddress) [member function] cls.add_method('ProcessSynRcvd', 'void', @@ -9488,6 +9767,11 @@ 'void', [param('uint32_t', 'cwnd')], is_pure_virtual=True, visibility='protected', is_virtual=True) + ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', + 'void', + [param('uint32_t', 'threshold')], + is_pure_virtual=True, visibility='protected', is_virtual=True) ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::SetPersistTimeout(ns3::Time timeout) [member function] cls.add_method('SetPersistTimeout', 'void', @@ -9498,11 +9782,6 @@ 'void', [param('uint32_t', 'size')], visibility='protected', is_virtual=True) - ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', - 'void', - [param('uint32_t', 'threshold')], - is_pure_virtual=True, visibility='protected', is_virtual=True) ## tcp-socket-base.h (module 'internet'): void ns3::TcpSocketBase::SetSegSize(uint32_t size) [member function] cls.add_method('SetSegSize', 'void', @@ -9597,8 +9876,8 @@ 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) - ## tcp-tahoe.h (module 'internet'): uint32_t ns3::TcpTahoe::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', + ## tcp-tahoe.h (module 'internet'): uint32_t ns3::TcpTahoe::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) @@ -9617,8 +9896,8 @@ 'void', [param('uint32_t', 'cwnd')], visibility='protected', is_virtual=True) - ## tcp-tahoe.h (module 'internet'): void ns3::TcpTahoe::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', + ## tcp-tahoe.h (module 'internet'): void ns3::TcpTahoe::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', 'void', [param('uint32_t', 'threshold')], visibility='protected', is_virtual=True) @@ -9736,8 +10015,8 @@ 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) - ## tcp-westwood.h (module 'internet'): uint32_t ns3::TcpWestwood::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', + ## tcp-westwood.h (module 'internet'): uint32_t ns3::TcpWestwood::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) @@ -9761,8 +10040,8 @@ 'void', [param('uint32_t', 'cwnd')], visibility='protected', is_virtual=True) - ## tcp-westwood.h (module 'internet'): void ns3::TcpWestwood::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', + ## tcp-westwood.h (module 'internet'): void ns3::TcpWestwood::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', 'void', [param('uint32_t', 'threshold')], visibility='protected', is_virtual=True) @@ -9810,10 +10089,10 @@ cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) + ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor] + cls.add_constructor([param('ns3::int64x64_t const &', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) - ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] - cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function] cls.add_method('As', 'ns3::TimeWithUnit', @@ -9824,25 +10103,25 @@ 'int', [param('ns3::Time const &', 'o')], is_const=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::int64x64_t const &', 'value')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function] cls.add_method('From', 'ns3::Time', - [param('ns3::int64x64_t const &', 'value')], + [param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function] cls.add_method('FromDouble', 'ns3::Time', - [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('double', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) - ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] + ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function] cls.add_method('FromInteger', 'ns3::Time', - [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], + [param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function] cls.add_method('GetDays', @@ -9959,20 +10238,20 @@ 'bool', [], is_static=True) - ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function] cls.add_method('To', 'ns3::int64x64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function] cls.add_method('ToDouble', 'double', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) - ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] + ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function] cls.add_method('ToInteger', 'int64_t', - [param('ns3::Time::Unit', 'timeUnit')], + [param('ns3::Time::Unit', 'unit')], is_const=True) return @@ -10913,6 +11192,65 @@ is_static=True) return +def register_Ns3CoDelQueue_methods(root_module, cls): + ## codel-queue.h (module 'internet'): ns3::CoDelQueue::CoDelQueue(ns3::CoDelQueue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CoDelQueue const &', 'arg0')]) + ## codel-queue.h (module 'internet'): ns3::CoDelQueue::CoDelQueue() [constructor] + cls.add_constructor([]) + ## codel-queue.h (module 'internet'): uint32_t ns3::CoDelQueue::GetDropCount() [member function] + cls.add_method('GetDropCount', + 'uint32_t', + []) + ## codel-queue.h (module 'internet'): uint32_t ns3::CoDelQueue::GetDropNext() [member function] + cls.add_method('GetDropNext', + 'uint32_t', + []) + ## codel-queue.h (module 'internet'): uint32_t ns3::CoDelQueue::GetDropOverLimit() [member function] + cls.add_method('GetDropOverLimit', + 'uint32_t', + []) + ## codel-queue.h (module 'internet'): ns3::Time ns3::CoDelQueue::GetInterval() [member function] + cls.add_method('GetInterval', + 'ns3::Time', + []) + ## codel-queue.h (module 'internet'): ns3::Queue::QueueMode ns3::CoDelQueue::GetMode() [member function] + cls.add_method('GetMode', + 'ns3::Queue::QueueMode', + []) + ## codel-queue.h (module 'internet'): uint32_t ns3::CoDelQueue::GetQueueSize() [member function] + cls.add_method('GetQueueSize', + 'uint32_t', + []) + ## codel-queue.h (module 'internet'): ns3::Time ns3::CoDelQueue::GetTarget() [member function] + cls.add_method('GetTarget', + 'ns3::Time', + []) + ## codel-queue.h (module 'internet'): static ns3::TypeId ns3::CoDelQueue::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## codel-queue.h (module 'internet'): void ns3::CoDelQueue::SetMode(ns3::Queue::QueueMode mode) [member function] + cls.add_method('SetMode', + 'void', + [param('ns3::Queue::QueueMode', 'mode')]) + ## codel-queue.h (module 'internet'): ns3::Ptr ns3::CoDelQueue::DoDequeue() [member function] + cls.add_method('DoDequeue', + 'ns3::Ptr< ns3::Packet >', + [], + visibility='private', is_virtual=True) + ## codel-queue.h (module 'internet'): bool ns3::CoDelQueue::DoEnqueue(ns3::Ptr p) [member function] + cls.add_method('DoEnqueue', + 'bool', + [param('ns3::Ptr< ns3::Packet >', 'p')], + visibility='private', is_virtual=True) + ## codel-queue.h (module 'internet'): ns3::Ptr ns3::CoDelQueue::DoPeek() const [member function] + cls.add_method('DoPeek', + 'ns3::Ptr< ns3::Packet const >', + [], + is_const=True, visibility='private', is_virtual=True) + return + def register_Ns3ConstantRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ConstantRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', @@ -15036,6 +15374,46 @@ visibility='protected', is_virtual=True) return +def register_Ns3StringChecker_methods(root_module, cls): + ## string.h (module 'core'): ns3::StringChecker::StringChecker() [constructor] + cls.add_constructor([]) + ## string.h (module 'core'): ns3::StringChecker::StringChecker(ns3::StringChecker const & arg0) [copy constructor] + cls.add_constructor([param('ns3::StringChecker const &', 'arg0')]) + return + +def register_Ns3StringValue_methods(root_module, cls): + ## string.h (module 'core'): ns3::StringValue::StringValue() [constructor] + cls.add_constructor([]) + ## string.h (module 'core'): ns3::StringValue::StringValue(ns3::StringValue const & arg0) [copy constructor] + cls.add_constructor([param('ns3::StringValue const &', 'arg0')]) + ## string.h (module 'core'): ns3::StringValue::StringValue(std::string const & value) [constructor] + cls.add_constructor([param('std::string const &', 'value')]) + ## string.h (module 'core'): ns3::Ptr ns3::StringValue::Copy() const [member function] + cls.add_method('Copy', + 'ns3::Ptr< ns3::AttributeValue >', + [], + is_const=True, is_virtual=True) + ## string.h (module 'core'): bool ns3::StringValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] + cls.add_method('DeserializeFromString', + 'bool', + [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_virtual=True) + ## string.h (module 'core'): std::string ns3::StringValue::Get() const [member function] + cls.add_method('Get', + 'std::string', + [], + is_const=True) + ## string.h (module 'core'): std::string ns3::StringValue::SerializeToString(ns3::Ptr checker) const [member function] + cls.add_method('SerializeToString', + 'std::string', + [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], + is_const=True, is_virtual=True) + ## string.h (module 'core'): void ns3::StringValue::Set(std::string const & value) [member function] + cls.add_method('Set', + 'void', + [param('std::string const &', 'value')]) + return + def register_Ns3TcpL4Protocol_methods(root_module, cls): ## tcp-l4-protocol.h (module 'internet'): ns3::TcpL4Protocol::PROT_NUMBER [variable] cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True) @@ -15206,8 +15584,8 @@ 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) - ## tcp-newreno.h (module 'internet'): uint32_t ns3::TcpNewReno::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', + ## tcp-newreno.h (module 'internet'): uint32_t ns3::TcpNewReno::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) @@ -15226,8 +15604,8 @@ 'void', [param('uint32_t', 'cwnd')], visibility='protected', is_virtual=True) - ## tcp-newreno.h (module 'internet'): void ns3::TcpNewReno::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', + ## tcp-newreno.h (module 'internet'): void ns3::TcpNewReno::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', 'void', [param('uint32_t', 'threshold')], visibility='protected', is_virtual=True) @@ -15278,8 +15656,8 @@ 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) - ## tcp-reno.h (module 'internet'): uint32_t ns3::TcpReno::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', + ## tcp-reno.h (module 'internet'): uint32_t ns3::TcpReno::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) @@ -15298,8 +15676,8 @@ 'void', [param('uint32_t', 'cwnd')], visibility='protected', is_virtual=True) - ## tcp-reno.h (module 'internet'): void ns3::TcpReno::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', + ## tcp-reno.h (module 'internet'): void ns3::TcpReno::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', 'void', [param('uint32_t', 'threshold')], visibility='protected', is_virtual=True) @@ -15340,8 +15718,8 @@ 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) - ## tcp-rfc793.h (module 'internet'): uint32_t ns3::TcpRfc793::GetSSThresh() const [member function] - cls.add_method('GetSSThresh', + ## tcp-rfc793.h (module 'internet'): uint32_t ns3::TcpRfc793::GetInitialSSThresh() const [member function] + cls.add_method('GetInitialSSThresh', 'uint32_t', [], is_const=True, visibility='protected', is_virtual=True) @@ -15350,8 +15728,8 @@ 'void', [param('uint32_t', 'cwnd')], visibility='protected', is_virtual=True) - ## tcp-rfc793.h (module 'internet'): void ns3::TcpRfc793::SetSSThresh(uint32_t threshold) [member function] - cls.add_method('SetSSThresh', + ## tcp-rfc793.h (module 'internet'): void ns3::TcpRfc793::SetInitialSSThresh(uint32_t threshold) [member function] + cls.add_method('SetInitialSSThresh', 'void', [param('uint32_t', 'threshold')], visibility='protected', is_virtual=True) diff -Naur ns-3.20/src/internet/doc/codel.rst ns-3.21/src/internet/doc/codel.rst --- ns-3.20/src/internet/doc/codel.rst 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/internet/doc/codel.rst 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,134 @@ +.. include:: replace.txt +.. highlight:: cpp + +CoDel queue implementation in |ns3| +----------------------------------- + +This chapter describes the CoDel ([Nic12]_, [Nic14]_) queue implementation +in |ns3|. + +Developed by Kathleen Nichols and Van Jacobson as a solution to the +bufferbloat [Buf14]_ problem, CoDel (Controlled Delay Management) is a queuing +discipline that uses a packet's sojourn time (time in queue) to make +decisions on packet drops. + +Model Description +***************** + +The source code for the CoDel model is located in the directory ``src/internet/model`` +and consists of 2 files `codel-queue.h` and `codel-queue.cc` defining a CoDelQueue +class and a helper CoDelTimestampTag class. The code was ported to |ns3| by +Andrew McGregor based on Linux kernel code implemented by Dave Täht and Eric Dumazet. + +* class :cpp:class:`CoDelQueue`: This class implements the main CoDel algorithm: + + * ``CoDelQueue::DoEnqueue ()``: This routine tags a packet with the current time before pushing it into the queue. The timestamp tag is used by ``CoDelQueue::DoDequeue()`` to compute the packet's sojourn time. If the queue is full upon the packet arrival, this routine will drop the packet and record the number of drops due to queue overflow, which is stored in `m_dropOverLimit`. + + * ``CoDelQueue::ShouldDrop ()``: This routine is ``CoDelQueue::DoDequeue()``'s helper routine that determines whether a packet should be dropped or not based on its sojourn time. If the sojourn time goes above `m_target` and remains above continuously for at least `m_interval`, the routine returns ``true`` indicating that it is OK to drop the packet. Otherwise, it returns ``false``. + + * ``CoDelQueue::DoDequeue ()``: This routine performs the actual packet drop based on ``CoDelQueue::ShouldDrop ()``'s return value and schedules the next drop. +* class :cpp:class:`CoDelTimestampTag`: This class implements the timestamp tagging for a packet. This tag is used to compute the packet's sojourn time (the difference between the time the packet is dequeued and the time it is pushed into the queue). + +There are 2 branches to ``CoDelQueue::DoDequeue ()``: + +1. If the queue is currently in the dropping state, which means the sojourn time has remained above `m_target` for more than `m_interval`, the routine determines if it's OK to leave the dropping state or it's time for the next drop. When ``CoDelQueue::ShouldDrop ()`` returns ``false``, the queue can move out of the dropping state (set `m_dropping` to ``false``). Otherwise, the queue continuously drops packets and updates the time for next drop (`m_dropNext`) until one of the following conditions is met: + + 1. The queue is empty, upon which the queue leaves the dropping state and exits ``CoDelQueue::ShouldDrop ()`` routine; + 2. ``CoDelQueue::ShouldDrop ()`` returns ``false`` (meaning the sojourn time goes below `m_target`) upon which the queue leaves the dropping state; + 3. It is not yet time for next drop (`m_dropNext` is less than current time) upon which the queue waits for the next packet dequeue to check the condition again. + +2. If the queue is not in the dropping state, the routine enters the dropping state and drop the first packet if ``CoDelQueue::ShouldDrop ()`` returns ``true`` (meaning the sojourn time has gone above `m_target` for at least `m_interval` for the first time or it has gone above again after the queue leaves the dropping state). + +References +========== + +.. [Nic12] K. Nichols and V. Jacobson, Controlling Queue Delay, ACM Queue, Vol. 10 No. 5, May 2012. Available online at ``_. + +.. [Nic14] K. Nichols and V. Jacobson, Internet-Draft: Controlled Delay Active Queue Management, March 2014. Available online at ``_. + +.. [Buf14] Bufferbloat.net. Available online at ``_. + +Attributes +========== + +The key attributes that the CoDelQueue class holds include the following: + +* ``Mode:`` CoDel operating mode (BYTES, PACKETS, or ILLEGAL). The default mode is BYTES. +* ``MaxPackets:`` The maximum number of packets the queue can hold. The default value is DEFAULT_CODEL_LIMIT, which is 1000 packets. +* ``MaxBytes:`` The maximum number of bytes the queue can hold. The default value is 1500 * DEFAULT_CODEL_LIMIT, which is 1500 * 1000 bytes. +* ``MinBytes:`` The CoDel algorithm minbytes parameter. The default value is 1500 bytes. +* ``Interval:`` The sliding-minimum window. The default value is 100 ms. +* ``Target:`` The CoDel algorithm target queue delay. The default value is 5 ms. + +Examples +======== + +The first example is `codel-vs-droptail-basic-test.cc` located in ``src/internet/examples``. To run the file (the first invocation below shows the available +command-line options): + +:: + + $ ./waf --run "codel-vs-droptail-basic-test --PrintHelp" + $ ./waf --run "codel-vs-droptail-basic-test --queueType=CoDel --pcapFileName=codel.pcap --cwndTrFileName=cwndCodel.tr" + +The expected output from the previous commands are two files: `codel.pcap` file and `cwndCoDel.tr` (ASCII trace) file The .pcap file can be analyzed using +wireshark or tcptrace: + +:: + + $ tcptrace -l -r -n -W codel.pcap + +The second example is `codel-vs-droptail-asymmetric.cc` located in ``src/internet/examples``. This example is intended to model a typical cable modem +deployment scenario. To run the file: + +:: + + $ ./waf --run "codel-vs-droptail-asymmetric --PrintHelp" + $ ./waf --run codel-vs-droptail-asymmetric + +The expected output from the previous commands is six pcap files: + +* codel-vs-droptail-asymmetric-CoDel-server-lan.pcap +* codel-vs-droptail-asymmetric-CoDel-router-wan.pcap +* codel-vs-droptail-asymmetric-CoDel-router-lan.pcap +* codel-vs-droptail-asymmetric-CoDel-cmts-wan.pcap +* codel-vs-droptail-asymmetric-CoDel-cmts-lan.pcap +* codel-vs-droptail-asymmetric-CoDel-host-lan.pcap + +One attribute file: + +* codel-vs-droptail-asymmetric-CoDel.attr + +Five ASCII trace files: + +* codel-vs-droptail-asymmetric-CoDel-drop.tr +* codel-vs-droptail-asymmetric-CoDel-drop-state.tr +* codel-vs-droptail-asymmetric-CoDel-sojourn.tr +* codel-vs-droptail-asymmetric-CoDel-length.tr +* codel-vs-droptail-asymmetric-CoDel-cwnd.tr + +Validation +********** + +The CoDel model is tested using :cpp:class:`CoDelQueueTestSuite` class defined in `src/internet/test/codel-queue-test-suite.cc`. The suite includes 5 test cases: + +* Test 1: The first test checks the enqueue/dequeue with no drops and makes sure that CoDel attributes can be set correctly. +* Test 2: The second test checks the enqueue with drops due to queue overflow. +* Test 3: The third test checks the NewtonStep() arithmetic against explicit port of Linux implementation +* Test 4: The fourth test checks the ControlLaw() against explicit port of Linux implementation +* Test 5: The fifth test checks the enqueue/dequeue with drops according to CoDel algorithm + +The test suite can be run using the following commands: + +:: + + $ ./waf configure --enable-examples --enable-tests + $ ./waf build + $ ./test.py -s codel-queue + +or + +:: + + $ NS_LOG="CoDelQueue" ./waf --run "test-runner --suite=codel-queue" + diff -Naur ns-3.20/src/internet/doc/internet-stack.rst ns-3.21/src/internet/doc/internet-stack.rst --- ns-3.20/src/internet/doc/internet-stack.rst 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/internet/doc/internet-stack.rst 2014-09-17 20:03:14.000000000 -0700 @@ -204,6 +204,35 @@ a :cpp:class:`Ipv4Address` or :cpp:class:`Ipv6Address`, these functions will return an error. The ``Bind (void)`` and ``Bind6 (void)`` functions bind to "0.0.0.0" and "::" respectively. + +The socket can also be bound to a specific NetDevice though the +``BindToNetDevice (Ptr netdevice)`` function. +``BindToNetDevice (Ptr netdevice)`` will bind the socket +to "0.0.0.0" and "::" (equivalent to calling ``Bind ()`` and ``Bind6 ()``, +unless the socket has been already bound to a specific address. +Summarizing, the correct sequence is:: + + Ptr udpSocketFactory = GetNode ()->GetObject (); + Ptr m_socket = socketFactory->CreateSocket (); + m_socket->BindToNetDevice (n_netDevice); + ... + +or:: + + Ptr udpSocketFactory = GetNode ()->GetObject (); + Ptr m_socket = socketFactory->CreateSocket (); + m_socket->Bind (m_local_address); + m_socket->BindToNetDevice (n_netDevice); + ... + +The following raises an error:: + + Ptr udpSocketFactory = GetNode ()->GetObject (); + Ptr m_socket = socketFactory->CreateSocket (); + m_socket->BindToNetDevice (n_netDevice); + m_socket->Bind (m_local_address); + ... + See the chapter on |ns3| sockets for more information. We have described so far a socket factory (e.g. ``class Udp``) and a socket, diff -Naur ns-3.20/src/internet/examples/codel-vs-droptail-asymmetric.cc ns-3.21/src/internet/examples/codel-vs-droptail-asymmetric.cc --- ns-3.20/src/internet/examples/codel-vs-droptail-asymmetric.cc 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/internet/examples/codel-vs-droptail-asymmetric.cc 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,435 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 ResiliNets, ITTC, University of Kansas + * + * 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 + * + * Author: Truc Anh N Nguyen + * + */ + +/* + * This is an example that compares CoDel and DropTail queues using a + * typical cable modem topology and delay + * (total RTT 37 ms as measured by Measuring Broadband America) + * + * 10gigE 22 Mb/s gigE + * 15 ms 1 ms 0.1 ms + * -------- ------- (1) -------- ------- + * | |------>| |------>| |------->| | + * |server| |CMTS | |Router| |Host | + * | |<------| |<------| |<-------| | + * -------- -------- (2)-------- ------- + * 10gigE 5 Mb/s gigE + * 15 ms 6 ms 0.1 ms + * ----------------- + * (1) DropTail queue , 256K bytes + * (2) DropTail, CoDel, FqCoDel, SfqCoDel, etc. + * + * The server initiates a bulk send TCP transfer to the host. + * The host initiates a bulk send TCP transfer to the server. + * Also, isochronous traffic (VoIP-like) between server and host + * The default TCP version in ns-3, TcpNewReno, is used as the transport-layer + * protocol. + * Packets transmitted during a simulation run are captured into a .pcap file, + * and congestion window values are also traced. + */ + +#include +#include +#include + +#include "ns3/core-module.h" +#include "ns3/network-module.h" +#include "ns3/internet-module.h" +#include "ns3/point-to-point-module.h" +#include "ns3/applications-module.h" +#include "ns3/config-store-module.h" +#include "ns3/error-model.h" +#include "ns3/tcp-header.h" +#include "ns3/udp-header.h" +#include "ns3/enum.h" +#include "ns3/event-id.h" +#include "ns3/ipv4-global-routing-helper.h" + +using namespace ns3; + +NS_LOG_COMPONENT_DEFINE ("CoDelDropTailAsymmetricTest"); + +static void +CwndTracer (Ptrstream, uint32_t oldval, uint32_t newval) +{ + *stream->GetStream () << oldval << " " << newval << std::endl; +} + +static void +TraceCwnd (std::string cwndTrFileName) +{ + AsciiTraceHelper ascii; + if (cwndTrFileName.compare ("") == 0) + { + NS_LOG_DEBUG ("No trace file for cwnd provided"); + return; + } + else + { + Ptr stream = ascii.CreateFileStream (cwndTrFileName.c_str ()); + Config::ConnectWithoutContext ("/NodeList/0/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow",MakeBoundCallback (&CwndTracer, stream)); + } +} + +static void +SojournTracer (Ptrstream, Time oldval, Time newval) +{ + *stream->GetStream () << oldval << " " << newval << std::endl; +} + +static void +TraceSojourn (std::string sojournTrFileName) +{ + AsciiTraceHelper ascii; + if (sojournTrFileName.compare ("") == 0) + { + NS_LOG_DEBUG ("No trace file for sojourn provided"); + return; + } + else + { + Ptr stream = ascii.CreateFileStream (sojournTrFileName.c_str ()); + Config::ConnectWithoutContext ("/NodeList/2/DeviceList/1/$ns3::PointToPointNetDevice/TxQueue/$ns3::CoDelQueue/Sojourn", MakeBoundCallback (&SojournTracer, stream)); + } +} + +static void +QueueLengthTracer (Ptrstream, uint32_t oldval, uint32_t newval) +{ + *stream->GetStream () << oldval << " " << newval << std::endl; +} + +static void +TraceQueueLength (std::string queueLengthTrFileName) +{ + AsciiTraceHelper ascii; + if (queueLengthTrFileName.compare ("") == 0) + { + NS_LOG_DEBUG ("No trace file for queue length provided"); + return; + } + else + { + Ptr stream = ascii.CreateFileStream (queueLengthTrFileName.c_str ()); + Config::ConnectWithoutContext ("/NodeList/2/DeviceList/1/$ns3::PointToPointNetDevice/TxQueue/$ns3::CoDelQueue/BytesInQueue", MakeBoundCallback (&QueueLengthTracer, stream)); + } +} + +static void +EveryDropTracer (Ptrstream, Ptr p) +{ + *stream->GetStream () << Simulator::Now ().GetSeconds () << " " << p << std::endl; +} + +static void +TraceEveryDrop (std::string everyDropTrFileName) +{ + AsciiTraceHelper ascii; + if (everyDropTrFileName.compare ("") == 0) + { + NS_LOG_DEBUG ("No trace file for every drop event provided"); + return; + } + else + { + Ptr stream = ascii.CreateFileStream (everyDropTrFileName.c_str ()); + Config::ConnectWithoutContext ("/NodeList/2/DeviceList/1/$ns3::PointToPointNetDevice/TxQueue/Drop", MakeBoundCallback (&EveryDropTracer, stream)); + } +} + +static void +DroppingStateTracer (Ptrstream, bool oldVal, bool newVal) +{ + if (oldVal == false && newVal == true) + { + NS_LOG_INFO ("Entering the dropping state"); + *stream->GetStream () << Simulator::Now ().GetSeconds () << " "; + } + else if (oldVal == true && newVal == false) + { + NS_LOG_INFO ("Leaving the dropping state"); + *stream->GetStream () << Simulator::Now ().GetSeconds () << std::endl; + } +} + +static void +TraceDroppingState (std::string dropStateTrFileName) +{ + AsciiTraceHelper ascii; + if (dropStateTrFileName.compare ("") == 0) + { + NS_LOG_DEBUG ("No trace file for dropping state provided"); + return; + } + else + { + Ptr stream = ascii.CreateFileStream (dropStateTrFileName.c_str ()); + Config::ConnectWithoutContext ("/NodeList/2/DeviceList/1/$ns3::PointToPointNetDevice/TxQueue/$ns3::CoDelQueue/DropState", MakeBoundCallback (&DroppingStateTracer, stream)); + } +} + +void +CreateBulkFlow (AddressValue remoteAddress, Ptr sender, uint32_t pktSize, float stopTime) +{ + BulkSendHelper sourceHelper ("ns3::TcpSocketFactory", Address ()); + sourceHelper.SetAttribute ("Remote", remoteAddress); + sourceHelper.SetAttribute ("SendSize", UintegerValue (pktSize)); + sourceHelper.SetAttribute ("MaxBytes", UintegerValue (0)); + ApplicationContainer sourceApp = sourceHelper.Install (sender); + sourceApp.Start (Seconds (0)); + sourceApp.Stop (Seconds (stopTime - 3)); +} + +void +CreateOnOffFlow (AddressValue remoteAddress, Ptr sender, float stopTime) +{ + OnOffHelper sourceHelper ("ns3::UdpSocketFactory", Address ()); + sourceHelper.SetAttribute ("PacketSize", UintegerValue (280)); + sourceHelper.SetAttribute ("Remote", remoteAddress); + ApplicationContainer sourceApp = sourceHelper.Install (sender); + sourceApp.Start (Seconds (0)); + sourceApp.Stop (Seconds (stopTime - 3)); +} + +int main (int argc, char *argv[]) +{ + std::string serverCmtsDelay = "15ms"; + std::string cmtsRouterDelay = "6ms"; + std::string routerHostDelay = "0.1ms"; + std::string serverLanDataRate = "10Gbps"; + std::string cmtsLanDataRate = "10Gbps"; + std::string cmtsWanDataRate = "22Mbps"; + std::string routerWanDataRate = "5Mbps"; + std::string routerLanDataRate = "10Gbps"; + std::string hostLanDataRate = "10Gbps"; + + std::string routerWanQueueType = "CoDel"; // outbound cable router queue + uint32_t pktSize = 1458; // in bytes. 1458 to prevent fragments + uint32_t queueSize = 1000; // in packets + uint32_t numOfUpLoadBulkFlows = 1; // # of upload bulk transfer flows + uint32_t numOfDownLoadBulkFlows = 1; // # of download bulk transfer flows + uint32_t numOfUpLoadOnOffFlows = 1; // # of upload onoff flows + uint32_t numOfDownLoadOnOffFlows = 1; // # of download onoff flows + bool isPcapEnabled = true; + + float startTime = 0.1; + float simDuration = 60; //in seconds + + std::string fileNamePrefix = "codel-vs-droptail-asymmetric"; + bool logging = true; + + CommandLine cmd; + cmd.AddValue ("serverCmtsDelay", "Link delay between server and CMTS", serverCmtsDelay); + cmd.AddValue ("cmtsRouterDelay", "Link delay between CMTS and rounter", cmtsRouterDelay); + cmd.AddValue ("routerHostDelay", "Link delay between router and host", routerHostDelay); + cmd.AddValue ("serverLanDataRate", "Server LAN net device data rate", serverLanDataRate); + cmd.AddValue ("cmtsLanDataRate", "CMTS LAN net device data rate", cmtsLanDataRate); + cmd.AddValue ("cmtsWanDataRate", "CMTS WAN net device data rate", cmtsWanDataRate); + cmd.AddValue ("routerWanDataRate", "Router WAN net device data rate", routerWanDataRate); + cmd.AddValue ("routerLanDataRate", "Router LAN net device data rate", routerLanDataRate); + cmd.AddValue ("hostLanDataRate", "Host LAN net device data rate", hostLanDataRate); + cmd.AddValue ("routerWanQueueType", "Router WAN net device queue type", routerWanQueueType); + cmd.AddValue ("queueSize", "Queue size in packets", queueSize); + cmd.AddValue ("pktSize", "Packet size in bytes", pktSize); + cmd.AddValue ("numOfUpLoadBulkFlows", "Number of upload bulk transfer flows", numOfUpLoadBulkFlows); + cmd.AddValue ("numOfDownLoadBulkFlows", "Number of download bulk transfer flows", numOfDownLoadBulkFlows); + cmd.AddValue ("numOfUpLoadOnOffFlows", "Number of upload OnOff flows", numOfUpLoadOnOffFlows); + cmd.AddValue ("numOfDownLoadOnOffFlows", "Number of download OnOff flows", numOfDownLoadOnOffFlows); + cmd.AddValue ("startTime", "Simulation start time", startTime); + cmd.AddValue ("simDuration", "Simulation duration in seconds", simDuration); + cmd.AddValue ("isPcapEnabled", "Flag to enable/disable pcap", isPcapEnabled); + cmd.AddValue ("logging", "Flag to enable/disable logging", logging); + cmd.Parse (argc, argv); + + float stopTime = startTime + simDuration; + + std::string pcapFileName = fileNamePrefix + "-" + routerWanQueueType; + std::string cwndTrFileName = fileNamePrefix + "-" + routerWanQueueType + "-cwnd" + ".tr"; + std::string attributeFileName = fileNamePrefix + "-" + routerWanQueueType + ".attr"; + std::string sojournTrFileName = fileNamePrefix + "-" + routerWanQueueType + "-sojourn" + ".tr"; + std::string queueLengthTrFileName = fileNamePrefix + "-" + routerWanQueueType + "-length" + ".tr"; + std::string everyDropTrFileName = fileNamePrefix + "-" + routerWanQueueType + "-drop" + ".tr"; + std::string dropStateTrFileName = fileNamePrefix + "-" + routerWanQueueType + "-drop-state" + ".tr"; + if (logging) + { + //LogComponentEnable ("CoDelDropTailAsymmetricTest", LOG_LEVEL_ALL); + //LogComponentEnable ("BulkSendApplication", LOG_LEVEL_INFO); + //LogComponentEnable ("DropTailQueue", LOG_LEVEL_ALL); + LogComponentEnable ("CoDelQueue", LOG_LEVEL_FUNCTION); + } + + // Queue defaults + Config::SetDefault ("ns3::DropTailQueue::MaxPackets", UintegerValue (queueSize)); + Config::SetDefault ("ns3::CoDelQueue::MaxPackets", UintegerValue (queueSize)); + Config::SetDefault ("ns3::DropTailQueue::Mode", StringValue ("QUEUE_MODE_PACKETS")); + Config::SetDefault ("ns3::CoDelQueue::Mode", StringValue ("QUEUE_MODE_PACKETS")); + + // Create the nodes + NS_LOG_INFO ("Create nodes"); + NodeContainer nodes; + nodes.Create (4); + // Descriptive names + Names::Add ("server", nodes.Get (0)); + Names::Add ("cmts", nodes.Get (1)); + Names::Add ("router", nodes.Get (2)); + Names::Add ("host", nodes.Get (3)); + NodeContainer serverCmts; + serverCmts = NodeContainer (nodes.Get (0), nodes.Get (1)); + NodeContainer cmtsRouter; + cmtsRouter = NodeContainer (nodes.Get (1), nodes.Get (2)); + NodeContainer routerHost; + routerHost = NodeContainer (nodes.Get (2), nodes.Get (3)); + + // Enable checksum + if (isPcapEnabled) + { + GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true)); + } + + Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (pktSize)); + + NS_LOG_INFO ("Install Internet stack on all nodes"); + InternetStackHelper stack; + stack.InstallAll (); + + NS_LOG_INFO ("Create channels and install net devices on nodes"); + PointToPointHelper p2p; + + p2p.SetChannelAttribute ("Delay", StringValue (serverCmtsDelay)); + NetDeviceContainer serverCmtsDev = p2p.Install (serverCmts); + Names::Add ("server/lan", serverCmtsDev.Get (0)); + Names::Add ("cmts/lan", serverCmtsDev.Get (1)); + Ptr serverLanDev = DynamicCast (serverCmtsDev.Get (0)); + serverLanDev->SetAttribute ("DataRate", StringValue (serverLanDataRate)); + Ptr cmtsLanDev = DynamicCast (serverCmtsDev.Get (1)); + cmtsLanDev->SetAttribute ("DataRate", StringValue (cmtsLanDataRate)); + + p2p.SetChannelAttribute ("Delay", StringValue (cmtsRouterDelay)); + NetDeviceContainer cmtsRouterDev = p2p.Install (cmtsRouter); + Names::Add ("cmts/wan", cmtsRouterDev.Get (0)); + Names::Add ("router/wan", cmtsRouterDev.Get (1)); + Ptr cmtsWanDev = DynamicCast (cmtsRouterDev.Get (0)); + cmtsWanDev->SetAttribute ("DataRate", StringValue (cmtsWanDataRate)); + Ptr queue = cmtsWanDev->GetQueue (); + DynamicCast (queue)->SetMode (DropTailQueue::QUEUE_MODE_BYTES); + DynamicCast (queue)->SetAttribute ("MaxBytes", UintegerValue (256000)); + + Ptr routerWanDev = DynamicCast (cmtsRouterDev.Get (1)); + routerWanDev->SetAttribute ("DataRate", StringValue (routerWanDataRate)); + if (routerWanQueueType.compare ("DropTail") == 0) + { + Ptr dropTail = CreateObject (); + routerWanDev->SetQueue (dropTail); + } + else if (routerWanQueueType.compare ("CoDel") == 0) + { + Ptr codel = CreateObject (); + routerWanDev->SetQueue (codel); + } + + p2p.SetChannelAttribute ("Delay", StringValue (routerHostDelay)); + NetDeviceContainer routerHostDev = p2p.Install (routerHost); + Names::Add ("router/lan", routerHostDev.Get (0)); + Names::Add ("host/lan", routerHostDev.Get (1)); + Ptr routerLanDev = DynamicCast (routerHostDev.Get (0)); + routerLanDev->SetAttribute ("DataRate", StringValue (routerLanDataRate)); + Ptr hostLanDev = DynamicCast (routerHostDev.Get (1)); + hostLanDev->SetAttribute ("DataRate", StringValue (hostLanDataRate)); + + NS_LOG_INFO ("Assign IP Addresses"); + Ipv4AddressHelper ipv4; + ipv4.SetBase ("10.1.1.0", "255.255.255.0"); + Ipv4InterfaceContainer serverCmtsInterface = ipv4.Assign (serverCmtsDev); + ipv4.SetBase ("10.1.2.0", "255.255.255.0"); + Ipv4InterfaceContainer cmtsRouterInterface = ipv4.Assign (cmtsRouterDev); + ipv4.SetBase ("10.1.3.0", "255.255.255.0"); + Ipv4InterfaceContainer routerHostInterface = ipv4.Assign (routerHostDev); + + NS_LOG_INFO ("Initialize Global Routing"); + Ipv4GlobalRoutingHelper::PopulateRoutingTables (); + + NS_LOG_INFO ("Configure downstream"); + uint16_t port1 = 50000; + Address sinkLocalAddress1 (InetSocketAddress (Ipv4Address::GetAny (), port1)); + PacketSinkHelper sinkHelper1 ("ns3::TcpSocketFactory", sinkLocalAddress1); + ApplicationContainer sinkApp1 = sinkHelper1.Install (routerHost.Get (1)); + sinkApp1.Start (Seconds (0)); + sinkApp1.Stop (Seconds (stopTime)); + AddressValue remoteAddress1 (InetSocketAddress (routerHostInterface.GetAddress (1), port1)); + while (numOfDownLoadBulkFlows) + { + CreateBulkFlow (remoteAddress1, serverCmts.Get (0), pktSize, stopTime); + numOfDownLoadBulkFlows--; + } + + while (numOfDownLoadOnOffFlows) + { + CreateOnOffFlow (remoteAddress1, serverCmts.Get (0), stopTime); + numOfDownLoadOnOffFlows--; + } + + NS_LOG_INFO ("Configure upstream"); + uint16_t port2 = 50001; + Address sinkLocalAddress2 (InetSocketAddress (Ipv4Address::GetAny (), port2)); + PacketSinkHelper sinkHelper2 ("ns3::TcpSocketFactory", sinkLocalAddress2); + ApplicationContainer sinkApp2 = sinkHelper2.Install (serverCmts.Get (0)); + sinkApp2.Start (Seconds (0)); + sinkApp2.Stop (Seconds (stopTime)); + AddressValue remoteAddress2 (InetSocketAddress (serverCmtsInterface.GetAddress (0), port2)); + while (numOfUpLoadBulkFlows) + { + CreateBulkFlow (remoteAddress2, routerHost.Get (1), pktSize, stopTime); + numOfUpLoadBulkFlows--; + } + + while (numOfUpLoadOnOffFlows) + { + CreateOnOffFlow (remoteAddress2, routerHost.Get (1), stopTime); + numOfUpLoadOnOffFlows--; + } + + Simulator::Schedule (Seconds (0.00001), &TraceCwnd, cwndTrFileName); + TraceEveryDrop (everyDropTrFileName); + if (routerWanQueueType.compare ("CoDel") == 0) + { + TraceSojourn (sojournTrFileName); + TraceQueueLength (queueLengthTrFileName); + TraceDroppingState (dropStateTrFileName); + } + if (isPcapEnabled) + { + p2p.EnablePcapAll (pcapFileName); + } + + // Output config store to txt format + Config::SetDefault ("ns3::ConfigStore::Filename", StringValue (attributeFileName)); + Config::SetDefault ("ns3::ConfigStore::FileFormat", StringValue ("RawText")); + Config::SetDefault ("ns3::ConfigStore::Mode", StringValue ("Save")); + ConfigStore outputConfig; + outputConfig.ConfigureDefaults (); + outputConfig.ConfigureAttributes (); + + Simulator::Stop (Seconds (stopTime)); + Simulator::Run (); + + Simulator::Destroy (); + return 0; +} diff -Naur ns-3.20/src/internet/examples/codel-vs-droptail-basic-test.cc ns-3.21/src/internet/examples/codel-vs-droptail-basic-test.cc --- ns-3.20/src/internet/examples/codel-vs-droptail-basic-test.cc 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/internet/examples/codel-vs-droptail-basic-test.cc 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,219 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2014 ResiliNets, ITTC, University of Kansas + * + * 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 + * + * Author: Truc Anh N Nguyen + * + */ + +/* + * This is a basic example that compares CoDel and DropTail queues using a simple, single-flow topology: + * + * source -------------------------- router ------------------------ sink + * 100 Mb/s, 0.1 ms droptail 5 Mb/s, 5ms + * or codel bottleneck + * + * The source generates traffic across the network using BulkSendApplication. + * The default TCP version in ns-3, TcpNewReno, is used as the transport-layer protocol. + * Packets transmitted during a simulation run are captured into a .pcap file, and + * congestion window values are also traced. + */ + +#include +#include +#include + +#include "ns3/core-module.h" +#include "ns3/network-module.h" +#include "ns3/internet-module.h" +#include "ns3/point-to-point-module.h" +#include "ns3/applications-module.h" +#include "ns3/error-model.h" +#include "ns3/tcp-header.h" +#include "ns3/udp-header.h" +#include "ns3/enum.h" +#include "ns3/event-id.h" +#include "ns3/ipv4-global-routing-helper.h" + +using namespace ns3; + +NS_LOG_COMPONENT_DEFINE ("CoDelDropTailBasicTest"); + +static void +CwndTracer (Ptrstream, uint32_t oldval, uint32_t newval) +{ + *stream->GetStream () << oldval << " " << newval << std::endl; +} + +static void +TraceCwnd (std::string cwndTrFileName) +{ + AsciiTraceHelper ascii; + if (cwndTrFileName.compare ("") == 0) + { + NS_LOG_DEBUG ("No trace file for cwnd provided"); + return; + } + else + { + Ptr stream = ascii.CreateFileStream (cwndTrFileName.c_str ()); + Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow",MakeBoundCallback (&CwndTracer, stream)); + } +} + +int main (int argc, char *argv[]) +{ + std::string bottleneckBandwidth = "5Mbps"; + std::string bottleneckDelay = "5ms"; + std::string accessBandwidth = "100Mbps"; + std::string accessDelay = "0.1ms"; + + std::string queueType = "DropTail"; //DropTail or CoDel + uint32_t queueSize = 1000; //in packets + uint32_t pktSize = 1458; //in bytes. 1458 to prevent fragments + float startTime = 0.1; + float simDuration = 60; //in seconds + + bool isPcapEnabled = true; + std::string pcapFileName = "pcapFileDropTail.pcap"; + std::string cwndTrFileName = "cwndDropTail.tr"; + bool logging = false; + + CommandLine cmd; + cmd.AddValue ("bottleneckBandwidth", "Bottleneck bandwidth", bottleneckBandwidth); + cmd.AddValue ("bottleneckDelay", "Bottleneck delay", bottleneckDelay); + cmd.AddValue ("accessBandwidth", "Access link bandwidth", accessBandwidth); + cmd.AddValue ("accessDelay", "Access link delay", accessDelay); + cmd.AddValue ("queueType", "Queue type: DropTail, CoDel", queueType); + cmd.AddValue ("queueSize", "Queue size in packets", queueSize); + cmd.AddValue ("pktSize", "Packet size in bytes", pktSize); + cmd.AddValue ("startTime", "Simulation start time", startTime); + cmd.AddValue ("simDuration", "Simulation duration in seconds", simDuration); + cmd.AddValue ("isPcapEnabled", "Flag to enable/disable pcap", isPcapEnabled); + cmd.AddValue ("pcapFileName", "Name of pcap file", pcapFileName); + cmd.AddValue ("cwndTrFileName", "Name of cwnd trace file", cwndTrFileName); + cmd.AddValue ("logging", "Flag to enable/disable logging", logging); + cmd.Parse (argc, argv); + + float stopTime = startTime + simDuration; + + if (logging) + { + LogComponentEnable ("CoDelDropTailBasicTest", LOG_LEVEL_ALL); + LogComponentEnable ("BulkSendApplication", LOG_LEVEL_INFO); + LogComponentEnable ("DropTailQueue", LOG_LEVEL_ALL); + LogComponentEnable ("CoDelQueue", LOG_LEVEL_ALL); + } + + // Enable checksum + if (isPcapEnabled) + { + GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true)); + } + + // Create gateway, source, and sink + NodeContainer gateway; + gateway.Create (1); + NodeContainer source; + source.Create (1); + NodeContainer sink; + sink.Create (1); + + // Create and configure access link and bottleneck link + PointToPointHelper accessLink; + accessLink.SetDeviceAttribute ("DataRate", StringValue (accessBandwidth)); + accessLink.SetChannelAttribute ("Delay", StringValue (accessDelay)); + + PointToPointHelper bottleneckLink; + bottleneckLink.SetDeviceAttribute ("DataRate", StringValue (bottleneckBandwidth)); + bottleneckLink.SetChannelAttribute ("Delay", StringValue (bottleneckDelay)); + + // Configure the queue + if (queueType.compare ("DropTail") == 0) + { + bottleneckLink.SetQueue ("ns3::DropTailQueue", + "Mode", StringValue ("QUEUE_MODE_PACKETS"), + "MaxPackets", UintegerValue (queueSize)); + } + else if (queueType.compare ("CoDel") == 0) + { + bottleneckLink.SetQueue ("ns3::CoDelQueue", + "Mode", StringValue ("QUEUE_MODE_PACKETS"), + "MaxPackets", UintegerValue (queueSize)); + } + else + { + NS_LOG_DEBUG ("Invalid queue type"); + exit (1); + } + + InternetStackHelper stack; + stack.InstallAll (); + + Ipv4AddressHelper address; + address.SetBase ("10.0.0.0", "255.255.255.0"); + + // Configure the source and sink net devices + // and the channels between the source/sink and the gateway + Ipv4InterfaceContainer sinkInterface; + + NetDeviceContainer devices; + devices = accessLink.Install (source.Get (0), gateway.Get (0)); + address.NewNetwork (); + Ipv4InterfaceContainer interfaces = address.Assign (devices); + devices = bottleneckLink.Install (gateway.Get (0), sink.Get (0)); + address.NewNetwork (); + interfaces = address.Assign (devices); + + sinkInterface.Add (interfaces.Get (1)); + + NS_LOG_INFO ("Initialize Global Routing."); + Ipv4GlobalRoutingHelper::PopulateRoutingTables (); + + uint16_t port = 50000; + Address sinkLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port)); + PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", sinkLocalAddress); + + // Configure application + AddressValue remoteAddress (InetSocketAddress (sinkInterface.GetAddress (0, 0), port)); + Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (pktSize)); + BulkSendHelper ftp ("ns3::TcpSocketFactory", Address ()); + ftp.SetAttribute ("Remote", remoteAddress); + ftp.SetAttribute ("SendSize", UintegerValue (pktSize)); + ftp.SetAttribute ("MaxBytes", UintegerValue (0)); + + ApplicationContainer sourceApp = ftp.Install (source.Get (0)); + sourceApp.Start (Seconds (0)); + sourceApp.Stop (Seconds (stopTime - 3)); + + sinkHelper.SetAttribute ("Protocol", TypeIdValue (TcpSocketFactory::GetTypeId ())); + ApplicationContainer sinkApp = sinkHelper.Install (sink); + sinkApp.Start (Seconds (0)); + sinkApp.Stop (Seconds (stopTime)); + + Simulator::Schedule (Seconds (0.00001), &TraceCwnd, cwndTrFileName); + + if (isPcapEnabled) + { + accessLink.EnablePcap (pcapFileName,source,true); + } + + Simulator::Stop (Seconds (stopTime)); + Simulator::Run (); + + Simulator::Destroy (); + return 0; +} diff -Naur ns-3.20/src/internet/examples/wscript ns-3.21/src/internet/examples/wscript --- ns-3.20/src/internet/examples/wscript 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/internet/examples/wscript 2014-09-17 20:03:14.000000000 -0700 @@ -7,3 +7,11 @@ obj = bld.create_ns3_program('main-simple', ['network', 'internet', 'applications']) obj.source = 'main-simple.cc' + + obj = bld.create_ns3_program('codel-vs-droptail-basic-test', + ['point-to-point','network', 'internet', 'applications']) + obj.source = 'codel-vs-droptail-basic-test.cc' + + obj = bld.create_ns3_program('codel-vs-droptail-asymmetric', + ['point-to-point','network', 'internet', 'applications']) + obj.source = 'codel-vs-droptail-asymmetric.cc' diff -Naur ns-3.20/src/internet/helper/ipv4-address-helper.h ns-3.21/src/internet/helper/ipv4-address-helper.h --- ns-3.20/src/internet/helper/ipv4-address-helper.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/internet/helper/ipv4-address-helper.h 2014-09-17 20:03:14.000000000 -0700 @@ -55,6 +55,9 @@ * @brief Construct a helper class to make life easier while doing simple IPv4 * address assignment in scripts. This version sets the base and mask * in the constructor + * @param network the network part + * @param mask the address mask + * @param base the host part to start from */ Ipv4AddressHelper (Ipv4Address network, Ipv4Mask mask, Ipv4Address base = "0.0.0.1"); diff -Naur ns-3.20/src/internet/helper/ripng-helper.h ns-3.21/src/internet/helper/ripng-helper.h --- ns-3.20/src/internet/helper/ripng-helper.h 2014-06-16 22:00:29.000000000 -0700 +++ ns-3.21/src/internet/helper/ripng-helper.h 2014-09-17 20:03:14.000000000 -0700 @@ -135,7 +135,7 @@ */ RipNgHelper &operator = (const RipNgHelper &o); - ObjectFactory m_factory; //|< Object Factory + ObjectFactory m_factory; //!< Object Factory std::map< Ptr, std::set > m_interfaceExclusions; //!< Interface Exclusion set std::map< Ptr, std::map > m_interfaceMetrics; //!< Interface Metric set diff -Naur ns-3.20/src/internet/model/codel-queue.cc ns-3.21/src/internet/model/codel-queue.cc --- ns-3.20/src/internet/model/codel-queue.cc 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/internet/model/codel-queue.cc 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,564 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2012 Andrew McGregor + * + * 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 + * + * Codel, the COntrolled DELay Queueing discipline + * Based on ns2 simulation code presented by Kathie Nichols + * + * This port based on linux kernel code by + * Authors: Dave Täht + * Eric Dumazet + * + * Ported to ns-3 by: Andrew McGregor +*/ + +#include "ns3/log.h" +#include "ns3/enum.h" +#include "ns3/uinteger.h" +#include "ns3/abort.h" +#include "codel-queue.h" + +NS_LOG_COMPONENT_DEFINE ("CoDelQueue"); + +namespace ns3 { + +/* borrowed from the linux kernel */ +static inline uint32_t ReciprocalDivide (uint32_t A, uint32_t R) +{ + return (uint32_t)(((uint64_t)A * R) >> 32); +} + +/* end kernel borrowings */ + +static uint32_t CoDelGetTime (void) +{ + Time time = Simulator::Now (); + uint64_t ns = time.GetNanoSeconds (); + + return ns >> CODEL_SHIFT; +} + +class CoDelTimestampTag : public Tag +{ +public: + CoDelTimestampTag (); + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + + virtual uint32_t GetSerializedSize (void) const; + virtual void Serialize (TagBuffer i) const; + virtual void Deserialize (TagBuffer i); + virtual void Print (std::ostream &os) const; + + Time GetTxTime (void) const; +private: + uint64_t m_creationTime; +}; + +CoDelTimestampTag::CoDelTimestampTag () + : m_creationTime (Simulator::Now ().GetTimeStep ()) +{ +} + +TypeId +CoDelTimestampTag::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::CoDelTimestampTag") + .SetParent () + .AddConstructor () + .AddAttribute ("CreationTime", + "The time at which the timestamp was created", + StringValue ("0.0s"), + MakeTimeAccessor (&CoDelTimestampTag::GetTxTime), + MakeTimeChecker ()) + ; + return tid; +} + +TypeId +CoDelTimestampTag::GetInstanceTypeId (void) const +{ + return GetTypeId (); +} + +uint32_t +CoDelTimestampTag::GetSerializedSize (void) const +{ + return 8; +} +void +CoDelTimestampTag::Serialize (TagBuffer i) const +{ + i.WriteU64 (m_creationTime); +} +void +CoDelTimestampTag::Deserialize (TagBuffer i) +{ + m_creationTime = i.ReadU64 (); +} +void +CoDelTimestampTag::Print (std::ostream &os) const +{ + os << "CreationTime=" << m_creationTime; +} +Time +CoDelTimestampTag::GetTxTime (void) const +{ + return TimeStep (m_creationTime); +} + +NS_OBJECT_ENSURE_REGISTERED (CoDelQueue); + +TypeId CoDelQueue::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::CoDelQueue") + .SetParent () + .AddConstructor () + .AddAttribute ("Mode", + "Whether to use Bytes (see MaxBytes) or Packets (see MaxPackets) as the maximum queue size metric.", + EnumValue (QUEUE_MODE_BYTES), + MakeEnumAccessor (&CoDelQueue::SetMode), + MakeEnumChecker (QUEUE_MODE_BYTES, "QUEUE_MODE_BYTES", + QUEUE_MODE_PACKETS, "QUEUE_MODE_PACKETS")) + .AddAttribute ("MaxPackets", + "The maximum number of packets accepted by this CoDelQueue.", + UintegerValue (DEFAULT_CODEL_LIMIT), + MakeUintegerAccessor (&CoDelQueue::m_maxPackets), + MakeUintegerChecker ()) + .AddAttribute ("MaxBytes", + "The maximum number of bytes accepted by this CoDelQueue.", + UintegerValue (1500 * DEFAULT_CODEL_LIMIT), + MakeUintegerAccessor (&CoDelQueue::m_maxBytes), + MakeUintegerChecker ()) + .AddAttribute ("MinBytes", + "The CoDel algorithm minbytes parameter.", + UintegerValue (1500), + MakeUintegerAccessor (&CoDelQueue::m_minBytes), + MakeUintegerChecker ()) + .AddAttribute ("Interval", + "The CoDel algorithm interval", + StringValue ("100ms"), + MakeTimeAccessor (&CoDelQueue::m_interval), + MakeTimeChecker ()) + .AddAttribute ("Target", + "The CoDel algorithm target queue delay", + StringValue ("5ms"), + MakeTimeAccessor (&CoDelQueue::m_target), + MakeTimeChecker ()) + .AddTraceSource ("Count", + "CoDel count", + MakeTraceSourceAccessor (&CoDelQueue::m_count)) + .AddTraceSource ("DropCount", + "CoDel drop count", + MakeTraceSourceAccessor (&CoDelQueue::m_dropCount)) + .AddTraceSource ("LastCount", + "CoDel lastcount", + MakeTraceSourceAccessor (&CoDelQueue::m_lastCount)) + .AddTraceSource ("DropState", + "Dropping state", + MakeTraceSourceAccessor (&CoDelQueue::m_dropping)) + .AddTraceSource ("BytesInQueue", + "Number of bytes in the queue", + MakeTraceSourceAccessor (&CoDelQueue::m_bytesInQueue)) + .AddTraceSource ("Sojourn", + "Time in the queue", + MakeTraceSourceAccessor (&CoDelQueue::m_sojourn)) + .AddTraceSource ("DropNext", + "Time until next packet drop", + MakeTraceSourceAccessor (&CoDelQueue::m_dropNext)) + ; + + return tid; +} + +CoDelQueue::CoDelQueue () + : Queue (), + m_packets (), + m_maxBytes (), + m_bytesInQueue (0), + m_count (0), + m_dropCount (0), + m_lastCount (0), + m_dropping (false), + m_recInvSqrt (~0U >> REC_INV_SQRT_SHIFT), + m_firstAboveTime (0), + m_dropNext (0), + m_state1 (0), + m_state2 (0), + m_state3 (0), + m_states (0), + m_dropOverLimit (0), + m_sojourn (0) +{ + NS_LOG_FUNCTION (this); +} + +CoDelQueue::~CoDelQueue () +{ + NS_LOG_FUNCTION (this); +} + +void +CoDelQueue::NewtonStep (void) +{ + NS_LOG_FUNCTION (this); + uint32_t invsqrt = ((uint32_t) m_recInvSqrt) << REC_INV_SQRT_SHIFT; + uint32_t invsqrt2 = ((uint64_t) invsqrt * invsqrt) >> 32; + uint64_t val = (3ll << 32) - ((uint64_t) m_count * invsqrt2); + + val >>= 2; /* avoid overflow */ + val = (val * invsqrt) >> (32 - 2 + 1); + m_recInvSqrt = val >> REC_INV_SQRT_SHIFT; +} + +uint32_t +CoDelQueue::ControlLaw (uint32_t t) +{ + NS_LOG_FUNCTION (this); + return t + ReciprocalDivide (Time2CoDel (m_interval), m_recInvSqrt << REC_INV_SQRT_SHIFT); +} + +void +CoDelQueue::SetMode (CoDelQueue::QueueMode mode) +{ + NS_LOG_FUNCTION (mode); + m_mode = mode; +} + +CoDelQueue::QueueMode +CoDelQueue::GetMode (void) +{ + NS_LOG_FUNCTION (this); + return m_mode; +} + +bool +CoDelQueue::DoEnqueue (Ptr p) +{ + NS_LOG_FUNCTION (this << p); + + if (m_mode == QUEUE_MODE_PACKETS && (m_packets.size () + 1 > m_maxPackets)) + { + NS_LOG_LOGIC ("Queue full (at max packets) -- droppping pkt"); + Drop (p); + ++m_dropOverLimit; + return false; + } + + if (m_mode == QUEUE_MODE_BYTES && (m_bytesInQueue + p->GetSize () > m_maxBytes)) + { + NS_LOG_LOGIC ("Queue full (packet would exceed max bytes) -- droppping pkt"); + Drop (p); + ++m_dropOverLimit; + return false; + } + + // Tag packet with current time for DoDequeue() to compute sojourn time + CoDelTimestampTag tag; + p->AddPacketTag (tag); + + m_bytesInQueue += p->GetSize (); + m_packets.push (p); + + NS_LOG_LOGIC ("Number packets " << m_packets.size ()); + NS_LOG_LOGIC ("Number bytes " << m_bytesInQueue); + + return true; +} + +bool +CoDelQueue::OkToDrop (Ptr p, uint32_t now) +{ + NS_LOG_FUNCTION (this); + CoDelTimestampTag tag; + bool okToDrop; + p->FindFirstMatchingByteTag (tag); + bool found = p->RemovePacketTag (tag); + NS_ASSERT_MSG (found, "found a packet without an input timestamp tag"); + NS_UNUSED (found); //silence compiler warning + Time delta = Simulator::Now () - tag.GetTxTime (); + NS_LOG_INFO ("Sojourn time " << delta.GetSeconds ()); + m_sojourn = delta; + uint32_t sojournTime = Time2CoDel (delta); + + if (CoDelTimeBefore (sojournTime, Time2CoDel (m_target)) + || m_bytesInQueue < m_minBytes) + { + // went below so we'll stay below for at least q->interval + NS_LOG_LOGIC ("Sojourn time is below target or number of bytes in queue is less than minBytes; packet should not be dropped"); + m_firstAboveTime = 0; + return false; + } + okToDrop = false; + if (m_firstAboveTime == 0) + { + /* just went above from below. If we stay above + * for at least q->interval we'll say it's ok to drop + */ + NS_LOG_LOGIC ("Sojourn time has just gone above target from below, need to stay above for at least q->interval before packet can be dropped. "); + m_firstAboveTime = now + Time2CoDel (m_interval); + } + else + if (CoDelTimeAfter (now, m_firstAboveTime)) + { + NS_LOG_LOGIC ("Sojourn time has been above target for at least q->interval; it's OK to (possibly) drop packet."); + okToDrop = true; + ++m_state1; + } + return okToDrop; +} + +Ptr +CoDelQueue::DoDequeue (void) +{ + NS_LOG_FUNCTION (this); + + if (m_packets.empty ()) + { + // Leave dropping state when queue is empty + m_dropping = false; + m_firstAboveTime = 0; + NS_LOG_LOGIC ("Queue empty"); + return 0; + } + uint32_t now = CoDelGetTime (); + Ptr p = m_packets.front (); + m_packets.pop (); + m_bytesInQueue -= p->GetSize (); + + NS_LOG_LOGIC ("Popped " << p); + NS_LOG_LOGIC ("Number packets remaining " << m_packets.size ()); + NS_LOG_LOGIC ("Number bytes remaining " << m_bytesInQueue); + + // Determine if p should be dropped + bool okToDrop = OkToDrop (p, now); + + if (m_dropping) + { // In the dropping state (sojourn time has gone above target and hasn't come down yet) + // Check if we can leave the dropping state or next drop should occur + NS_LOG_LOGIC ("In dropping state, check if it's OK to leave or next drop should occur"); + if (!okToDrop) + { + /* sojourn time fell below target - leave dropping state */ + NS_LOG_LOGIC ("Sojourn time goes below target, it's OK to leave dropping state."); + m_dropping = false; + } + else + if (CoDelTimeAfterEq (now, m_dropNext)) + { + m_state2++; + while (m_dropping && CoDelTimeAfterEq (now, m_dropNext)) + { + // It's time for the next drop. Drop the current packet and + // dequeue the next. The dequeue might take us out of dropping + // state. If not, schedule the next drop. + // A large amount of packets in queue might result in drop + // rates so high that the next drop should happen now, + // hence the while loop. + NS_LOG_LOGIC ("Sojourn time is still above target and it's time for next drop; dropping " << p); + Drop (p); + ++m_dropCount; + ++m_count; + NewtonStep (); + if (m_packets.empty ()) + { + m_dropping = false; + NS_LOG_LOGIC ("Queue empty"); + ++m_states; + return 0; + } + p = m_packets.front (); + m_packets.pop (); + m_bytesInQueue -= p->GetSize (); + + NS_LOG_LOGIC ("Popped " << p); + NS_LOG_LOGIC ("Number packets remaining " << m_packets.size ()); + NS_LOG_LOGIC ("Number bytes remaining " << m_bytesInQueue); + + if (!OkToDrop (p, now)) + { + /* leave dropping state */ + NS_LOG_LOGIC ("Leaving dropping state"); + m_dropping = false; + } + else + { + /* schedule the next drop */ + NS_LOG_LOGIC ("Running ControlLaw for input m_dropNext: " << (double)m_dropNext / 1000000); + m_dropNext = ControlLaw (m_dropNext); + NS_LOG_LOGIC ("Scheduled next drop at " << (double)m_dropNext / 1000000); + } + } + } + } + else + { + // Not in the dropping state + // Decide if we have to enter the dropping state and drop the first packet + NS_LOG_LOGIC ("Not in dropping state; decide if we have to enter the state and drop the first packet"); + if (okToDrop) + { + // Drop the first packet and enter dropping state unless the queue is empty + NS_LOG_LOGIC ("Sojourn time goes above target, dropping the first packet " << p << " and entering the dropping state"); + ++m_dropCount; + Drop (p); + if (m_packets.empty ()) + { + m_dropping = false; + okToDrop = false; + NS_LOG_LOGIC ("Queue empty"); + ++m_states; + } + else + { + p = m_packets.front (); + m_packets.pop (); + m_bytesInQueue -= p->GetSize (); + + NS_LOG_LOGIC ("Popped " << p); + NS_LOG_LOGIC ("Number packets remaining " << m_packets.size ()); + NS_LOG_LOGIC ("Number bytes remaining " << m_bytesInQueue); + + okToDrop = OkToDrop (p, now); + m_dropping = true; + } + ++m_state3; + /* + * if min went above target close to when we last went below it + * assume that the drop rate that controlled the queue on the + * last cycle is a good starting point to control it now. + */ + int delta = m_count - m_lastCount; + if (delta > 1 && CoDelTimeBefore (now - m_dropNext, 16 * Time2CoDel (m_interval))) + { + m_count = delta; + NewtonStep (); + } + else + { + m_count = 1; + m_recInvSqrt = ~0U >> REC_INV_SQRT_SHIFT; + } + m_lastCount = m_count; + NS_LOG_LOGIC ("Running ControlLaw for input now: " << (double)now); + m_dropNext = ControlLaw (now); + NS_LOG_LOGIC ("Scheduled next drop at " << (double)m_dropNext / 1000000 << " now " << (double)now / 1000000); + } + } + ++m_states; + return p; +} + +uint32_t +CoDelQueue::GetQueueSize (void) +{ + NS_LOG_FUNCTION (this); + if (GetMode () == QUEUE_MODE_BYTES) + { + return m_bytesInQueue; + } + else if (GetMode () == QUEUE_MODE_PACKETS) + { + return m_packets.size (); + } + else + { + NS_ABORT_MSG ("Unknown mode."); + } +} + +uint32_t +CoDelQueue::GetDropOverLimit (void) +{ + return m_dropOverLimit; +} + +uint32_t +CoDelQueue::GetDropCount (void) +{ + return m_dropCount; +} + +Time +CoDelQueue::GetTarget (void) +{ + return m_target; +} + +Time +CoDelQueue::GetInterval (void) +{ + return m_interval; +} + +uint32_t +CoDelQueue::GetDropNext (void) +{ + return m_dropNext; +} + +Ptr +CoDelQueue::DoPeek (void) const +{ + NS_LOG_FUNCTION (this); + + if (m_packets.empty ()) + { + NS_LOG_LOGIC ("Queue empty"); + return 0; + } + + Ptr p = m_packets.front (); + + NS_LOG_LOGIC ("Number packets " << m_packets.size ()); + NS_LOG_LOGIC ("Number bytes " << m_bytesInQueue); + + return p; +} + +bool +CoDelQueue::CoDelTimeAfter (uint32_t a, uint32_t b) +{ + return ((int)(a) - (int)(b) > 0); +} + +bool +CoDelQueue::CoDelTimeAfterEq (uint32_t a, uint32_t b) +{ + return ((int)(a) - (int)(b) >= 0); +} + +bool +CoDelQueue::CoDelTimeBefore (uint32_t a, uint32_t b) +{ + return ((int)(a) - (int)(b) < 0); +} + +bool +CoDelQueue::CoDelTimeBeforeEq (uint32_t a, uint32_t b) +{ + return ((int)(a) - (int)(b) <= 0); +} + +uint32_t +CoDelQueue::Time2CoDel (Time t) +{ + return (t.GetNanoSeconds () >> CODEL_SHIFT); +} + + +} // namespace ns3 + diff -Naur ns-3.20/src/internet/model/codel-queue.h ns-3.21/src/internet/model/codel-queue.h --- ns-3.20/src/internet/model/codel-queue.h 1969-12-31 16:00:00.000000000 -0800 +++ ns-3.21/src/internet/model/codel-queue.h 2014-09-17 20:03:14.000000000 -0700 @@ -0,0 +1,218 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2012 Andrew McGregor + * + * 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 + * + * Codel, the COntrolled DELay Queueing discipline + * Based on ns2 simulation code presented by Kathie Nichols + * + * This port based on linux kernel code by + * Authors: Dave Täht + * Eric Dumazet + * + * Ported to ns-3 by: Andrew McGregor + */ + +#ifndef CODEL_H +#define CODEL_H + +#include +#include "ns3/packet.h" +#include "ns3/queue.h" +#include "ns3/nstime.h" +#include "ns3/simulator.h" +#include "ns3/string.h" +#include "ns3/traced-value.h" +#include "ns3/trace-source-accessor.h" + +class CoDelQueueNewtonStepTest; // Forward declaration for unit test +class CoDelQueueControlLawTest; // Forward declaration for unit test + +namespace ns3 { + +static const int CODEL_SHIFT = 10; +static const int DEFAULT_CODEL_LIMIT = 1000; + +#define REC_INV_SQRT_BITS (8 * sizeof(uint16_t)) +#define REC_INV_SQRT_SHIFT (32 - REC_INV_SQRT_BITS) + +class TraceContainer; + +/** + * \ingroup queue + * + * \brief A CoDel packet queue + */ + +class CoDelQueue : public Queue +{ +public: + static TypeId GetTypeId (void); + + /** + * \brief CoDelQueue Constructor + * + * Creates a CoDel queue + */ + CoDelQueue (); + + virtual ~CoDelQueue (); + + /** + * \brief Set the operating mode of this device. + * + * \param mode The operating mode of this device. + */ + void SetMode (CoDelQueue::QueueMode mode); + + /** + * \brief Get the encapsulation mode of this device. + * + * \returns The encapsulation mode of this device. + */ + CoDelQueue::QueueMode GetMode (void); + + /** + * \brief Get the current value of the queue in bytes or packets. + * + * \returns The queue size in bytes or packets. + */ + uint32_t GetQueueSize (void); + + /** + * \brief Get the number of packets dropped when packets + * arrive at a full queue and cannot be enqueued. + * + * \returns The number of dropped packets + */ + uint32_t GetDropOverLimit (void); + + /** + * \brief Get the number of packets dropped according to CoDel algorithm + * + * \returns The number of dropped packets + */ + uint32_t GetDropCount (void); + + /** + * \brief Get the target queue delay + * + * \returns The target queue delay + */ + Time GetTarget (void); + + /** + * \brief Get the interval + * + * \returns The interval + */ + Time GetInterval (void); + + /** + * \brief Get the time for next packet drop while in the dropping state + * + * \returns The time for next packet drop + */ + uint32_t GetDropNext (void); + +private: + friend class::CoDelQueueNewtonStepTest; // Test code + friend class::CoDelQueueControlLawTest; // Test code + /** + * \brief Add a packet to the queue + * + * \param p The packet to be added + * \returns True if the packet can be added, False if the packet is dropped due to full queue + */ + virtual bool DoEnqueue (Ptr p); + + /** + * \brief Remove a packet from queue based on the current state + * If we are in dropping state, check if we could leave the dropping state + * or if we should perform next drop + * If we are not currently in dropping state, check if we need to enter the state + * and drop the first packet + * + * \returns The packet that is examined + */ + virtual Ptr DoDequeue (void); + + virtual Ptr DoPeek (void) const; + + /** + * \brief Calculate the reciprocal square root of m_count by using Newton's method + * http://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Iterative_methods_for_reciprocal_square_roots + * m_recInvSqrt (new) = (m_recInvSqrt (old) / 2) * (3 - m_count * m_recInvSqrt^2) + */ + void NewtonStep (void); + + /** + * \brief Determine the time for next drop + * CoDel control law is t + m_interval/sqrt(m_count). + * Here, we use m_recInvSqrt calculated by Newton's method in NewtonStep() to avoid + * both sqrt() and divide operations + * + * \param t Current next drop time + * \returns The new next drop time: + */ + uint32_t ControlLaw (uint32_t t); + + /** + * \brief Determine whether a packet is OK to be dropped. The packet + * may not be actually dropped (depending on the drop state) + * + * \param p The packet that is considered + * \param now The current time represented as 32-bit unsigned integer (us) + * \returns True if it is OK to drop the packet (sojourn time above target for at least interval) + */ + bool OkToDrop (Ptr p, uint32_t now); + + bool CoDelTimeAfter (uint32_t a, uint32_t b); + bool CoDelTimeAfterEq (uint32_t a, uint32_t b); + bool CoDelTimeBefore (uint32_t a, uint32_t b); + bool CoDelTimeBeforeEq (uint32_t a, uint32_t b); + + /** + * returned unsigned 32-bit integer representation of the input Time object + * units are microseconds + */ + uint32_t Time2CoDel (Time t); + + std::queue > m_packets; //!< The packet queue + uint32_t m_maxPackets; //!< Max # of packets accepted by the queue + uint32_t m_maxBytes; //!< Max # of bytes accepted by the queue + TracedValue m_bytesInQueue; //!< The total number of bytes in queue + uint32_t m_minBytes; //!< Minimum bytes in queue to allow a packet drop + Time m_interval; //!< 100 ms sliding minimum time window width + Time m_target; //!< 5 ms target queue delay + TracedValue m_count; //!< Number of packets dropped since entering drop state + TracedValue m_dropCount; //!< Number of dropped packets according CoDel algorithm + TracedValue m_lastCount; // m_dropping; //!< True if in dropping state + uint16_t m_recInvSqrt; //!< Reciprocal inverse square root + uint32_t m_firstAboveTime; //!< Time to declare sojourn time above target + TracedValue m_dropNext; //!< Time to drop next packet + uint32_t m_state1; //!< Number of times packet sojourn goes above target for interval + uint32_t m_state2; //!< Number of times we perform next drop while in dropping state + uint32_t m_state3; //!< Number of times we enter drop state and drop the fist packet + uint32_t m_states; //!< Total number of times we are in state 1, state 2, or state 3 + uint32_t m_dropOverLimit; //!< The number of packets dropped due to full queue + QueueMode m_mode; //!< The operating mode (Bytes or packets) + TracedValue