diff --git a/bindings/python/ns3_module_internet_stack.py b/bindings/python/ns3_module_internet_stack.py index 9e4973910..a4163c546 100644 --- a/bindings/python/ns3_module_internet_stack.py +++ b/bindings/python/ns3_module_internet_stack.py @@ -82,7 +82,7 @@ def register_types(module): ## ipv6-l3-protocol.h: ns3::Ipv6L3Protocol [class] module.add_class('Ipv6L3Protocol', parent=root_module['ns3::Ipv6']) ## ipv6-l3-protocol.h: ns3::Ipv6L3Protocol::DropReason [enumeration] - module.add_enum('DropReason', ['DROP_TTL_EXPIRED', 'DROP_NO_ROUTE', 'DROP_BAD_CHECKSUM', 'DROP_INTERFACE_DOWN', 'DROP_ROUTE_ERROR'], outer_class=root_module['ns3::Ipv6L3Protocol']) + module.add_enum('DropReason', ['DROP_TTL_EXPIRED', 'DROP_NO_ROUTE', 'DROP_INTERFACE_DOWN', 'DROP_ROUTE_ERROR'], outer_class=root_module['ns3::Ipv6L3Protocol']) ## ipv6-l4-protocol.h: ns3::Ipv6L4Protocol [class] module.add_class('Ipv6L4Protocol', parent=root_module['ns3::Object']) ## ipv6-l4-protocol.h: ns3::Ipv6L4Protocol::RxStatus_e [enumeration] diff --git a/src/applications/radvd/radvd-interface.h b/src/applications/radvd/radvd-interface.h index fe1d275aa..a53175cef 100644 --- a/src/applications/radvd/radvd-interface.h +++ b/src/applications/radvd/radvd-interface.h @@ -81,7 +81,7 @@ class RadvdInterface : public RefCountBase /** * \brief Set send advert flag. - * \return sendAdvert value + * \param sendAdvert value */ void SetSendAdvert (bool sendAdvert); diff --git a/src/core/test.h b/src/core/test.h index 31d720209..83debfc90 100644 --- a/src/core/test.h +++ b/src/core/test.h @@ -574,7 +574,7 @@ namespace ns3 { * This routine is based on the GNU Scientific Library function gsl_fcmp. * * \param a The first of double precision floating point numbers to compare - * \param a The second of double precision floating point numbers to compare + * \param b The second of double precision floating point numbers to compare * \param epsilon The second of double precision floating point numberss to compare * \returns Returns true if the doubles are equal to a precision defined by epsilon */ @@ -591,7 +591,6 @@ public: /** * \brief Run this test case. - * \param verbose Turn on any output the test case may provide * \returns Boolean sense of "an error has occurred." */ bool Run (void); @@ -748,6 +747,10 @@ private: class TestSuite { public: + /** + * \enum TestType + * \brief Type of test. + */ enum TestType { BVT = 1, /**< This test suite implements a Build Verification Test */ UNIT, /**< This test suite implements a Unit Test */ @@ -772,7 +775,6 @@ public: /** * \brief Run this test suite. * - * \param verbose Turn on any output the test case may provide * \returns Boolean sense of "an error has occurred." */ bool Run (void); diff --git a/src/helper/ipv4-nix-vector-helper.h b/src/helper/ipv4-nix-vector-helper.h index 38452b2c6..c524cb03f 100644 --- a/src/helper/ipv4-nix-vector-helper.h +++ b/src/helper/ipv4-nix-vector-helper.h @@ -45,7 +45,7 @@ public: * * This method will be called by ns3::InternetStackHelper::Install */ - virtual Ptr Create (Ptr) const; + virtual Ptr Create (Ptr node) const; private: ObjectFactory m_agentFactory; diff --git a/src/helper/ipv6-interface-container.h b/src/helper/ipv6-interface-container.h index 2330722fd..754051fa6 100644 --- a/src/helper/ipv6-interface-container.h +++ b/src/helper/ipv6-interface-container.h @@ -33,7 +33,7 @@ namespace ns3 /** * \class Ipv6InterfaceContainer - * \brief keep track of a set of IPv6 interfaces. + * \brief Keep track of a set of IPv6 interfaces. */ class Ipv6InterfaceContainer { diff --git a/src/helper/ipv6-routing-helper.h b/src/helper/ipv6-routing-helper.h index 23857c1af..8da0abce4 100644 --- a/src/helper/ipv6-routing-helper.h +++ b/src/helper/ipv6-routing-helper.h @@ -29,7 +29,7 @@ class Ipv6RoutingProtocol; class Node; /** - * \brief a factory to create ns3::Ipv6RoutingProtocol objects + * \brief A factory to create ns3::Ipv6RoutingProtocol objects * * For each new routing protocol created as a subclass of * ns3::Ipv6RoutingProtocol, you need to create a subclass of diff --git a/src/helper/ipv6-static-routing-helper.h b/src/helper/ipv6-static-routing-helper.h index 5f63290c0..700dc86dd 100644 --- a/src/helper/ipv6-static-routing-helper.h +++ b/src/helper/ipv6-static-routing-helper.h @@ -41,6 +41,9 @@ namespace ns3 { class Ipv6StaticRoutingHelper : public Ipv6RoutingHelper { public: + /** + * \brief Constructor. + */ Ipv6StaticRoutingHelper (); /** @@ -51,6 +54,11 @@ public: */ virtual Ptr Create (Ptr node) const; + /** + * \brief Get Ipv6StaticRouting pointer from IPv6 stack. + * \param ipv6 Ipv6 pointer + * \return Ipv6StaticRouting pointer or 0 if not exist + */ Ptr GetStaticRouting (Ptr ipv6) const; void AddMulticastRoute (Ptr n, Ipv6Address source, Ipv6Address group, diff --git a/src/internet-stack/icmpv6-header.cc b/src/internet-stack/icmpv6-header.cc index 86ddfe0f1..afee64aec 100644 --- a/src/internet-stack/icmpv6-header.cc +++ b/src/internet-stack/icmpv6-header.cc @@ -667,7 +667,7 @@ void Icmpv6RS::SetReserved (uint32_t reserved) m_reserved = reserved; } -void Icmpv6RS::Print (std::ostream& os) +void Icmpv6RS::Print (std::ostream& os) const { os << "( type = " << (uint32_t)GetType () << " (RS) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << ")"; } @@ -772,7 +772,7 @@ void Icmpv6Redirection::SetDestination (Ipv6Address destination) m_destination = destination; } -void Icmpv6Redirection::Print (std::ostream& os) +void Icmpv6Redirection::Print (std::ostream& os) const { os << "( type = " << (uint32_t)GetType () << " (Redirection) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << " target = " << m_target << " destination = " << m_destination << ")"; } @@ -971,7 +971,7 @@ void Icmpv6DestinationUnreachable::SetPacket (Ptr p) m_packet = p; } -void Icmpv6DestinationUnreachable::Print (std::ostream& os) +void Icmpv6DestinationUnreachable::Print (std::ostream& os) const { os << "( type = " << (uint32_t)GetType () << " (Destination Unreachable) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << ")"; } @@ -1066,7 +1066,7 @@ void Icmpv6TooBig::SetMtu (uint32_t mtu) m_mtu = mtu; } -void Icmpv6TooBig::Print (std::ostream& os) +void Icmpv6TooBig::Print (std::ostream& os) const { os << "( type = " << (uint32_t)GetType () << " (Too Big) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << " mtu = " << (uint32_t)GetMtu () << ")"; } @@ -1150,7 +1150,7 @@ void Icmpv6TimeExceeded::SetPacket (Ptr p) m_packet = p; } -void Icmpv6TimeExceeded::Print (std::ostream& os) +void Icmpv6TimeExceeded::Print (std::ostream& os) const { os << "( type = " << (uint32_t)GetType () << " (Destination Unreachable) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << ")"; } @@ -1245,7 +1245,7 @@ void Icmpv6ParameterError::SetPtr (uint32_t ptr) m_ptr = ptr; } -void Icmpv6ParameterError::Print (std::ostream& os) +void Icmpv6ParameterError::Print (std::ostream& os) const { os << "( type = " << (uint32_t)GetType () << " (Destination Unreachable) code = " << (uint32_t)GetCode () << " checksum = " << (uint32_t)GetChecksum () << " ptr = " << (uint32_t)GetPtr () << ")"; } diff --git a/src/internet-stack/icmpv6-header.h b/src/internet-stack/icmpv6-header.h index 8cf5027f3..786ac4ca1 100644 --- a/src/internet-stack/icmpv6-header.h +++ b/src/internet-stack/icmpv6-header.h @@ -384,8 +384,8 @@ class Icmpv6NS : public Icmpv6Header void SetIpv6Target (Ipv6Address target); /** - * \brief Get the IPv6 target field. - * \return IPv6 address + * \brief Print informations. + * \param os output stream */ virtual void Print (std::ostream& os) const; @@ -799,7 +799,7 @@ class Icmpv6RS : public Icmpv6Header * \brief Print informations. * \param os output stream */ - virtual void Print (std::ostream& os); + virtual void Print (std::ostream& os) const; /** * \brief Get the serialized size. @@ -884,7 +884,7 @@ class Icmpv6Redirection : public Icmpv6Header * \brief Print informations. * \param os output stream */ - virtual void Print (std::ostream& os); + virtual void Print (std::ostream& os) const; /** * \brief Get the serialized size. @@ -1075,7 +1075,7 @@ class Icmpv6DestinationUnreachable : public Icmpv6Header * \brief Print informations. * \param os output stream */ - virtual void Print (std::ostream& os); + virtual void Print (std::ostream& os) const; /** * \brief Get the serialized size. @@ -1160,7 +1160,7 @@ class Icmpv6TooBig : public Icmpv6Header * \brief Print informations. * \param os output stream */ - virtual void Print (std::ostream& os); + virtual void Print (std::ostream& os) const; /** * \brief Get the serialized size. @@ -1239,7 +1239,7 @@ class Icmpv6TimeExceeded : public Icmpv6Header * \brief Print informations. * \param os output stream */ - virtual void Print (std::ostream& os); + virtual void Print (std::ostream& os) const; /** * \brief Get the serialized size. @@ -1325,7 +1325,7 @@ class Icmpv6ParameterError : public Icmpv6Header * \brief Print informations. * \param os output stream */ - virtual void Print (std::ostream& os); + virtual void Print (std::ostream& os) const; /** * \brief Get the serialized size. diff --git a/src/internet-stack/ipv4-l3-protocol.h b/src/internet-stack/ipv4-l3-protocol.h index 46d61dc9e..c60119f89 100644 --- a/src/internet-stack/ipv4-l3-protocol.h +++ b/src/internet-stack/ipv4-l3-protocol.h @@ -63,13 +63,17 @@ public: Ipv4L3Protocol(); virtual ~Ipv4L3Protocol (); + /** + * \enum DropReason + * \brief Reason why a packet has been dropped. + */ enum DropReason { - DROP_TTL_EXPIRED = 1, - DROP_NO_ROUTE, - DROP_BAD_CHECKSUM, - DROP_INTERFACE_DOWN, - DROP_ROUTE_ERROR, + DROP_TTL_EXPIRED = 1, /**< Packet TTL has expired */ + DROP_NO_ROUTE, /**< No route to host */ + DROP_BAD_CHECKSUM, /**< Bad checksum */ + DROP_INTERFACE_DOWN, /**< Interface is down so can not send packet */ + DROP_ROUTE_ERROR, /**< Route error */ }; void SetNode (Ptr node); diff --git a/src/internet-stack/ipv6-autoconfigured-prefix.h b/src/internet-stack/ipv6-autoconfigured-prefix.h index 2277935d1..85d81e57e 100644 --- a/src/internet-stack/ipv6-autoconfigured-prefix.h +++ b/src/internet-stack/ipv6-autoconfigured-prefix.h @@ -100,13 +100,13 @@ class Ipv6AutoconfiguredPrefix : public Object uint32_t GetValidLifeTime (void) const; /** - * \brief Set the prefix valid life time + * \brief Set the prefix valid life time. * \param v the prefix valid life time */ void SetValidLifeTime (uint32_t v); /** - * \brief Test if the prefix is preferred + * \brief Test if the prefix is preferred. * \return true if prefix is in preferred state, false otherwise */ bool IsPreferred () const; @@ -118,74 +118,74 @@ class Ipv6AutoconfiguredPrefix : public Object bool IsValid () const; /** - * \brief Set the prefix as preferred + * \brief Set the prefix as preferred. */ void SetPreferred (); /** - * \brief Set the prefix as valid + * \brief Set the prefix as valid. */ void SetValid (); /** - * \brief Start the preferred timer + * \brief Start the preferred timer. */ void StartPreferredTimer (); /** - * \brief Start the valid timer + * \brief Start the valid timer. */ void StartValidTimer (); /** - * \brief Stop the preferred timer + * \brief Stop the preferred timer. */ void StopPreferredTimer (); /** - * \brief Stop the valid timer + * \brief Stop the valid timer. */ void StopValidTimer (); /** - * \brief Set the prefix as preferred + * \brief Set the prefix as preferred. */ void MarkPreferredTime (); /** - * \brief Set the prefix as valid + * \brief Set the prefix as valid. */ void MarkValidTime (); /** - * \brief Signal that the preferred time expired and start the valid timer + * \brief Signal that the preferred time expired and start the valid timer. */ void FunctionPreferredTimeout (); /** - * \brief Signal that the valid time expired + * \brief Signal that the valid time expired. */ void FunctionValidTimeout (); /** - * \brief Remove this prefix from the prefix list + * \brief Remove this prefix from the prefix list. */ void RemoveMe (); /** - * \brief Get the prefix identificator + * \brief Get the prefix identifier. * \return id of the prefix. */ uint32_t GetId () const; /** - * \brief Get the prefix address + * \brief Get the prefix address. * \return prefix address */ Ipv6Address GetPrefix () const; /** - * \brief Set the prefix address + * \brief Set the prefix address. * \param prefix prefix address to set */ void SetPrefix (Ipv6Address prefix); @@ -229,7 +229,8 @@ class Ipv6AutoconfiguredPrefix : public Object Ipv6Prefix m_mask; /** - * \brief Default gateway router + * \brief Default gateway router. + * * If the RA received also configured the default gateway, * this variable has the link-local address. Otherwise this * is "::" diff --git a/src/internet-stack/ipv6-end-point-demux.h b/src/internet-stack/ipv6-end-point-demux.h index a8bfe1a46..00e3bbe24 100644 --- a/src/internet-stack/ipv6-end-point-demux.h +++ b/src/internet-stack/ipv6-end-point-demux.h @@ -95,7 +95,8 @@ class Ipv6EndPointDemux /** * \brief Allocate a Ipv6EndPoint. - * \return an empty Ipv6EndPoint instance + * \param address IPv6 address + * \return an Ipv6EndPoint instance */ Ipv6EndPoint *Allocate (Ipv6Address address); diff --git a/src/internet-stack/ipv6-l3-protocol.h b/src/internet-stack/ipv6-l3-protocol.h index 8d7e6e029..f79eccc26 100644 --- a/src/internet-stack/ipv6-l3-protocol.h +++ b/src/internet-stack/ipv6-l3-protocol.h @@ -59,13 +59,16 @@ class Ipv6L3Protocol : public Ipv6 */ static const uint16_t PROT_NUMBER; + /** + * \enum DropReason + * \brief Reason why a packet has been dropped. + */ enum DropReason { - DROP_TTL_EXPIRED = 1, - DROP_NO_ROUTE, - DROP_BAD_CHECKSUM, - DROP_INTERFACE_DOWN, - DROP_ROUTE_ERROR, + DROP_TTL_EXPIRED = 1, /**< Packet TTL has expired */ + DROP_NO_ROUTE, /**< No route to host */ + DROP_INTERFACE_DOWN, /**< Interface is down so can not send packet */ + DROP_ROUTE_ERROR, /**< Route error */ }; /** @@ -216,6 +219,7 @@ class Ipv6L3Protocol : public Ipv6 /** * \brief Get number of address for an interface. + * \param interface interface index * \return number of address */ uint32_t GetNAddresses (uint32_t interface) const; diff --git a/src/internet-stack/ipv6-l4-protocol.h b/src/internet-stack/ipv6-l4-protocol.h index 6f9f1bcc7..095dfa3ca 100644 --- a/src/internet-stack/ipv6-l4-protocol.h +++ b/src/internet-stack/ipv6-l4-protocol.h @@ -44,14 +44,14 @@ class Ipv6L4Protocol : public Object */ enum RxStatus_e { - RX_OK, - RX_CSUM_FAILED, - RX_ENDPOINT_UNREACH + RX_OK, /**< Receive OK */ + RX_CSUM_FAILED, /**< Checksum of layer 4 protocol failed */ + RX_ENDPOINT_UNREACH /**< Destination unreachable */ }; /** - * \brief Get the type identificator. - * \return type identificator + * \brief Get the type identifier. + * \return type identifier */ static TypeId GetTypeId (void); @@ -77,9 +77,12 @@ class Ipv6L4Protocol : public Object * \param incomingInterface the Ipv6Interface on which the packet arrived * \return status (OK, destination unreachable or checksum failed) */ - virtual enum RxStatus_e Receive (Ptr p, Ipv6Address const &src, Ipv6Address const &dst, Ptr incomingInterface) = 0; + virtual enum RxStatus_e Receive (Ptr p, Ipv6Address const &src, + Ipv6Address const &dst, + Ptr incomingInterface) = 0; /** + * \brief ICMPv6 receive method. * \param icmpSource the source address of the ICMPv6 message * \param icmpTtl the ttl of the ICMPv6 message * \param icmpType the 'type' field of the ICMPv6 message @@ -94,9 +97,9 @@ class Ipv6L4Protocol : public Object * which triggered the ICMPv6 message. */ virtual void ReceiveIcmp (Ipv6Address icmpSource, uint8_t icmpTtl, - uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, - Ipv6Address payloadSource, Ipv6Address payloadDestination, - const uint8_t* payload); + uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, + Ipv6Address payloadSource, Ipv6Address payloadDestination, + const uint8_t* payload); }; diff --git a/src/internet-stack/ndisc-cache.h b/src/internet-stack/ndisc-cache.h index 09f095342..569be145a 100644 --- a/src/internet-stack/ndisc-cache.h +++ b/src/internet-stack/ndisc-cache.h @@ -443,7 +443,7 @@ class NdiscCache : public Object Ptr m_interface; /** - * A list of Entry. + * \brief A list of Entry. */ Cache m_ndCache; diff --git a/src/node/ipv6-address.h b/src/node/ipv6-address.h index 4b6f40274..291d1dbe5 100644 --- a/src/node/ipv6-address.h +++ b/src/node/ipv6-address.h @@ -214,7 +214,8 @@ class Ipv6Address operator Address () const; /** - * \brief Convert the Address object into an Ipv6Address one. + * \brief Convert the Address object into an Ipv6Address ones. + * \param address address to convert * \return an Ipv6Address */ static Ipv6Address ConvertFrom (const Address& address); @@ -403,13 +404,13 @@ class Ipv6Prefix /** * \class ns3::Ipv6AddressValue - * \brief hold objects of type ns3::Ipv6Address + * \brief Hold objects of type ns3::Ipv6Address */ ATTRIBUTE_HELPER_HEADER (Ipv6Address); /** * \class ns3::Ipv6PrefixValue - * \brief hold objects of type ns3::Ipv6Prefix + * \brief Hold objects of type ns3::Ipv6Prefix */ ATTRIBUTE_HELPER_HEADER (Ipv6Prefix); @@ -433,9 +434,17 @@ inline bool operator < (const Ipv6Address& a, const Ipv6Address& b) return (memcmp (a.m_address, b.m_address, 16) < 0); } +/** + * \class Ipv6AddressHash + * \brief Hash function class for IPv6 addresses. + */ class Ipv6AddressHash : public std::unary_function { public: + /** + * \brief Unary operator to hash IPv6 address. + * \param x IPv6 address to hash + */ size_t operator () (Ipv6Address const &x) const; }; diff --git a/src/node/ipv6-interface-address.h b/src/node/ipv6-interface-address.h index 1e6d0bb6e..20648da82 100644 --- a/src/node/ipv6-interface-address.h +++ b/src/node/ipv6-interface-address.h @@ -190,7 +190,7 @@ class Ipv6InterfaceAddress std::ostream& operator<< (std::ostream& os, const Ipv6InterfaceAddress &addr); -/* follow Ipv6InterfaceAddress way, maybe not inline them */ +/* follow Ipv4InterfaceAddress way, maybe not inline them */ inline bool operator == (const Ipv6InterfaceAddress& a, const Ipv6InterfaceAddress& b) { return (a.m_address == b.m_address && a.m_prefix == b.m_prefix && diff --git a/src/node/ipv6-route.h b/src/node/ipv6-route.h index 7cf18807d..0b7c37ec7 100644 --- a/src/node/ipv6-route.h +++ b/src/node/ipv6-route.h @@ -177,22 +177,26 @@ class Ipv6MulticastRoute : public RefCountBase Ipv6Address GetOrigin (void) const; /** + * \brief Set parent for this route. * \param iif Parent (input interface) for this route */ void SetParent (uint32_t iif); + /** + * \brief Get parent for this route. * \return Parent (input interface) for this route */ uint32_t GetParent (void) const; /** + * \brief set output TTL for this route. * \param oif Outgoing interface index * \param ttl time-to-live for this route */ void SetOutputTtl (uint32_t oif, uint32_t ttl); /** - * \brief Get output TTL. + * \brief Get output TTL for this route. * \param oif outgoing interface * \return TTL for this route */ @@ -215,7 +219,7 @@ class Ipv6MulticastRoute : public RefCountBase uint32_t m_parent; /** - * \brief TTLs; + * \brief TTLs. */ std::vector m_ttls; }; diff --git a/src/node/ipv6-routing-protocol.h b/src/node/ipv6-routing-protocol.h index 6040adbdd..3341f662c 100644 --- a/src/node/ipv6-routing-protocol.h +++ b/src/node/ipv6-routing-protocol.h @@ -40,6 +40,7 @@ class NetDevice; * \ingroup node * \defgroup ipv6Routing Ipv6RoutingProtocol */ + /** * \ingroup ipv6Routing * \brief Abstract base class for Ipv6 routing protocols. @@ -103,37 +104,42 @@ public: LocalDeliverCallback lcb, ErrorCallback ecb) = 0; /** - * \param interface the index of the interface we are being notified about + * \brief Notify when specified interface goes UP. * * Protocols are expected to implement this method to be notified of the state change of * an interface in a node. + * \param interface the index of the interface we are being notified about */ virtual void NotifyInterfaceUp (uint32_t interface) = 0; + /** - * \param interface the index of the interface we are being notified about + * \brief Notify when specified interface goes DOWN. * * Protocols are expected to implement this method to be notified of the state change of * an interface in a node. + * \param interface the index of the interface we are being notified about */ virtual void NotifyInterfaceDown (uint32_t interface) = 0; /** - * \param interface the index of the interface we are being notified about - * \param address a new address being added to an interface + * \brief Notify when specified interface add an address. * * Protocols are expected to implement this method to be notified whenever * a new address is added to an interface. Typically used to add a 'network route' on an * interface. Can be invoked on an up or down interface. + * \param interface the index of the interface we are being notified about + * \param address a new address being added to an interface */ virtual void NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address) = 0; /** - * \param interface the index of the interface we are being notified about - * \param address a new address being added to an interface + * \brief Notify when specified interface add an address. * * Protocols are expected to implement this method to be notified whenever * a new address is removed from an interface. Typically used to remove the 'network route' of an * interface. Can be invoked on an up or down interface. + * \param interface the index of the interface we are being notified about + * \param address a new address being added to an interface */ virtual void NotifyRemoveAddress (uint32_t interface, Ipv6InterfaceAddress address) = 0; @@ -161,9 +167,8 @@ public: virtual void NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address::GetZero ()) = 0; /** + * \brief Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol * \param ipv6 the ipv6 object this routing protocol is being associated with - * - * Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol */ virtual void SetIpv6 (Ptr ipv6) = 0; }; diff --git a/src/node/ipv6.h b/src/node/ipv6.h index b345c6c9a..f5fc6c50f 100644 --- a/src/node/ipv6.h +++ b/src/node/ipv6.h @@ -110,17 +110,19 @@ public: virtual Ptr GetRoutingProtocol (void) const = 0; /** - * \param device device to add to the list of IPv6 interfaces - * which can be used as output interfaces during packet forwarding. - * \returns the index of the IPv6 interface added. + * \brief Add a NetDevice interface. * * Once a device has been added, it can never be removed: if you want * to disable it, you can invoke Ipv6::SetDown which will * make sure that it is never used during packet forwarding. + * \param device device to add to the list of IPv6 interfaces + * which can be used as output interfaces during packet forwarding. + * \returns the index of the IPv6 interface added. */ virtual uint32_t AddInterface (Ptr device) = 0; /** + * \brief Get number of interfaces. * \returns the number of interfaces added by the user. */ virtual uint32_t GetNInterfaces (void) const = 0; @@ -161,18 +163,21 @@ public: Ipv6Prefix mask) const = 0; /** + * \brief Get the NetDevice of the specified interface number. * \param interface The interface number of an IPv6 interface. * \returns The NetDevice associated with the IPv6 interface number. */ virtual Ptr GetNetDevice (uint32_t interface) = 0; /** + * \brief Get the interface index of the specified NetDevice. * \param device The NetDevice for an Ipv6Interface * \returns The interface number of an IPv6 interface or -1 if not found. */ virtual int32_t GetInterfaceForDevice (Ptr device) const = 0; /** + * \brief Add an address on the specified IPv6 interface. * \param interface Interface number of an IPv6 interface * \param address Ipv6InterfaceAddress address to associate with the underlying IPv6 interface * \returns true if the operation succeeded @@ -180,12 +185,15 @@ public: virtual bool AddAddress (uint32_t interface, Ipv6InterfaceAddress address) = 0; /** + * \brief Get number of addresses on specified IPv6 interface. * \param interface Interface number of an IPv6 interface * \returns the number of Ipv6InterfaceAddress entries for the interface. */ virtual uint32_t GetNAddresses (uint32_t interface) const = 0; /** + * \brief Get IPv6 address on specified IPv6 interface. + * * Because addresses can be removed, the addressIndex is not guaranteed * to be static across calls to this method. * @@ -196,6 +204,8 @@ public: virtual Ipv6InterfaceAddress GetAddress (uint32_t interface, uint32_t addressIndex) const = 0; /** + * \brief Remove an address on specified IPv6 interface. + * * Remove the address at addressIndex on named interface. The addressIndex * for all higher indices will decrement by one after this method is called; * so, for example, to remove 5 addresses from an interface i, one could @@ -208,6 +218,8 @@ public: virtual bool RemoveAddress (uint32_t interface, uint32_t addressIndex) = 0; /** + * \brief Set metric on specified Ipv6 interface. + * * \param interface The interface number of an IPv6 interface * \param metric routing metric (cost) associated to the underlying * IPv6 interface @@ -215,6 +227,8 @@ public: virtual void SetMetric (uint32_t interface, uint16_t metric) = 0; /** + * \brief Get metric for the specified IPv6 interface. + * * \param interface The interface number of an IPv6 interface * \returns routing metric (cost) associated to the underlying * IPv6 interface @@ -222,6 +236,7 @@ public: virtual uint16_t GetMetric (uint32_t interface) const = 0; /** + * \brief Get MTU for the specified IPv6 interface. * \param interface Interface number of IPv6 interface * \returns the Maximum Transmission Unit (in bytes) associated * to the underlying IPv6 interface @@ -229,6 +244,7 @@ public: virtual uint16_t GetMtu (uint32_t interface) const = 0; /** + * \brief If the specified interface index is in "up" state. * \param interface Interface number of IPv6 interface * \returns true if the underlying interface is in the "up" state, * false otherwise. @@ -236,28 +252,30 @@ public: virtual bool IsUp (uint32_t interface) const = 0; /** + * \brief Set the interface into the "up" state. + * + * In this state, it is considered valid during IPv6 forwarding. * \param interface Interface number of IPv6 interface - * - * Set the interface into the "up" state. In this state, it is - * considered valid during IPv6 forwarding. */ virtual void SetUp (uint32_t interface) = 0; /** - * \param interface Interface number of IPv6 interface + * \brief Set the interface into the "down" state. * - * Set the interface into the "down" state. In this state, it is - * ignored during IPv6 forwarding. + * In this state, it is ignored during IPv6 forwarding. + * \param interface Interface number of IPv6 interface */ virtual void SetDown (uint32_t interface) = 0; /** + * \brief If the specified IPv6 interface has forwarding enabled. * \param interface Interface number of IPv6 interface * \returns true if IPv6 forwarding enabled for input datagrams on this device */ virtual bool IsForwarding (uint32_t interface) const = 0; /** + * \brief Set forwarding on specified IPv6 interface. * \param interface Interface number of IPv6 interface * \param val Value to set the forwarding flag * diff --git a/src/node/packetbb.cc b/src/node/packetbb.cc index eaa60d070..1060c7d2d 100644 --- a/src/node/packetbb.cc +++ b/src/node/packetbb.cc @@ -728,7 +728,7 @@ PbbPacket::Unref (void) const TypeId PbbPacket::GetTypeId (void) { - static TypeId tid = TypeId ("PbbPacket") + static TypeId tid = TypeId ("ns3::PbbPacket") .SetParent
() .AddConstructor () ; diff --git a/src/routing/list-routing/ipv6-list-routing.h b/src/routing/list-routing/ipv6-list-routing.h index 03db18704..fb0527e79 100644 --- a/src/routing/list-routing/ipv6-list-routing.h +++ b/src/routing/list-routing/ipv6-list-routing.h @@ -28,8 +28,11 @@ namespace ns3 { * \ingroup routing * \defgroup ipv6ListRouting Ipv6 List Routing */ + /** * \ingroup ipv6ListRouting + * \class Ipv6ListRouting + * \brief Hold list of Ipv6RoutingProtocol objects. * * This class is a specialization of Ipv6RoutingProtocol that allows * other instances of Ipv6RoutingProtocol to be inserted in a @@ -44,33 +47,46 @@ namespace ns3 { class Ipv6ListRouting : public Ipv6RoutingProtocol { public: + /** + * \brief Get the type ID of this class. + * \return type ID + */ static TypeId GetTypeId (void); + /** + * \brief Constructor. + */ Ipv6ListRouting (); + + /** + * \brief Destructor. + */ virtual ~Ipv6ListRouting (); /** * \brief Register a new routing protocol to be used in this IPv4 stack - * * \param routingProtocol new routing protocol implementation object * \param priority priority to give to this routing protocol. * Values may range between -32768 and +32767. */ virtual void AddRoutingProtocol (Ptr routingProtocol, int16_t priority); + /** + * \brief Get the number of routing protocols. * \return number of routing protocols in the list */ virtual uint32_t GetNRoutingProtocols (void) const; + /** - * Return pointer to routing protocol stored at index, with the - * first protocol (index 0) the highest priority, the next one (index 1) + * \brief Get pointer to routing protocol stored at index, + * + * The first protocol (index 0) the highest priority, the next one (index 1) * the second highest priority, and so on. The priority parameter is an * output parameter and it returns the integer priority of the protocol. - * - * \return pointer to routing protocol indexed by * \param index index of protocol to return * \param priority output parameter, set to the priority of the protocol - being returned + * being returned + * \return pointer to routing protocol indexed by */ virtual Ptr GetRoutingProtocol (uint32_t index, int16_t& priority) const; @@ -89,14 +105,32 @@ public: virtual void SetIpv6 (Ptr ipv6); protected: + /** + * \brief Dispose this object. + */ void DoDispose (void); + private: typedef std::pair > Ipv6RoutingProtocolEntry; typedef std::list Ipv6RoutingProtocolList; - Ipv6RoutingProtocolList m_routingProtocols; - static bool Compare (const Ipv6RoutingProtocolEntry& a, const Ipv6RoutingProtocolEntry& b); - Ptr m_ipv6; + /** + * \brief Compare two routing protocols. + * \param a first object to compare + * \param b second object to compare + * \return true if they are the same, false otherwise + */ + static bool Compare (const Ipv6RoutingProtocolEntry& a, const Ipv6RoutingProtocolEntry& b); + + /** + * \brief List of routing protocols. + */ + Ipv6RoutingProtocolList m_routingProtocols; + + /** + * \brief Ipv6 reference. + */ + Ptr m_ipv6; }; } //namespace ns3 diff --git a/src/routing/static-routing/ipv6-static-routing.h b/src/routing/static-routing/ipv6-static-routing.h index a54ce307c..155f10852 100644 --- a/src/routing/static-routing/ipv6-static-routing.h +++ b/src/routing/static-routing/ipv6-static-routing.h @@ -58,7 +58,7 @@ class Ipv6StaticRouting : public Ipv6RoutingProtocol public: /** * \brief The interface Id associated with this class. - * \return type identificator + * \return type identifier */ static TypeId GetTypeId ();