src/helper/ipv4-interface-container.h
author Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
Fri, 18 Sep 2009 22:18:06 +0200
changeset 5227 ecb08c1fc273
parent 4472 e20a31541404
child 5229 0d0779ac3278
permissions -rw-r--r--
Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2748
f65f6e2629dc introduce Ipv4InterfaceContainer and make Ipv4AddressHelper::Allocate return it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2699
diff changeset
     1
#ifndef IPV4_INTERFACE_CONTAINER_H
f65f6e2629dc introduce Ipv4InterfaceContainer and make Ipv4AddressHelper::Allocate return it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2699
diff changeset
     2
#define IPV4_INTERFACE_CONTAINER_H
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
#include <stdint.h>
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
#include <vector>
2748
f65f6e2629dc introduce Ipv4InterfaceContainer and make Ipv4AddressHelper::Allocate return it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2699
diff changeset
     6
#include "ns3/ipv4.h"
f65f6e2629dc introduce Ipv4InterfaceContainer and make Ipv4AddressHelper::Allocate return it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2699
diff changeset
     7
#include "ns3/ipv4-address.h"
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
namespace ns3 {
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
2697
cab2a59cba8f doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    11
/**
2748
f65f6e2629dc introduce Ipv4InterfaceContainer and make Ipv4AddressHelper::Allocate return it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2699
diff changeset
    12
 * \brief keep track of a set of ipv4 interfaces.
2697
cab2a59cba8f doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    13
 *
cab2a59cba8f doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    14
 */
2748
f65f6e2629dc introduce Ipv4InterfaceContainer and make Ipv4AddressHelper::Allocate return it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2699
diff changeset
    15
class Ipv4InterfaceContainer
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    16
{
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
public:
2697
cab2a59cba8f doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    18
  /**
2748
f65f6e2629dc introduce Ipv4InterfaceContainer and make Ipv4AddressHelper::Allocate return it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2699
diff changeset
    19
   * Create an empty Ipv4InterfaceContainer.
2697
cab2a59cba8f doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    20
   */
2748
f65f6e2629dc introduce Ipv4InterfaceContainer and make Ipv4AddressHelper::Allocate return it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2699
diff changeset
    21
  Ipv4InterfaceContainer ();
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
2697
cab2a59cba8f doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    23
  /**
3793
a5895f134543 make star topologies easier to create
Craig Dowell <craigdo@ee.washington.edu>
parents: 2754
diff changeset
    24
   * Concatenate the entries in the other container with ours.
5227
ecb08c1fc273 Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4472
diff changeset
    25
   * \param other container
3793
a5895f134543 make star topologies easier to create
Craig Dowell <craigdo@ee.washington.edu>
parents: 2754
diff changeset
    26
   */
a5895f134543 make star topologies easier to create
Craig Dowell <craigdo@ee.washington.edu>
parents: 2754
diff changeset
    27
  void Add (Ipv4InterfaceContainer other);
a5895f134543 make star topologies easier to create
Craig Dowell <craigdo@ee.washington.edu>
parents: 2754
diff changeset
    28
a5895f134543 make star topologies easier to create
Craig Dowell <craigdo@ee.washington.edu>
parents: 2754
diff changeset
    29
  /**
2748
f65f6e2629dc introduce Ipv4InterfaceContainer and make Ipv4AddressHelper::Allocate return it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2699
diff changeset
    30
   * \returns the number of interfaces stored in this Ipv4InterfaceContainer.
2697
cab2a59cba8f doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    31
   */
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    32
  uint32_t GetN (void) const;
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    33
4375
db81fdcb06e7 Implementation cut over to use Ipv4InterfaceAddress
Tom Henderson <tomh@tomh.org>
parents: 4140
diff changeset
    34
  /**
5227
ecb08c1fc273 Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4472
diff changeset
    35
   * \param i interface index
ecb08c1fc273 Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4472
diff changeset
    36
   * \param j interface address index (if interface has multiple addresses)
4375
db81fdcb06e7 Implementation cut over to use Ipv4InterfaceAddress
Tom Henderson <tomh@tomh.org>
parents: 4140
diff changeset
    37
   * \returns the IPv4 address of the j'th address of the interface
db81fdcb06e7 Implementation cut over to use Ipv4InterfaceAddress
Tom Henderson <tomh@tomh.org>
parents: 4140
diff changeset
    38
   *  corresponding to index i.
db81fdcb06e7 Implementation cut over to use Ipv4InterfaceAddress
Tom Henderson <tomh@tomh.org>
parents: 4140
diff changeset
    39
   * 
db81fdcb06e7 Implementation cut over to use Ipv4InterfaceAddress
Tom Henderson <tomh@tomh.org>
parents: 4140
diff changeset
    40
   * If the second parameter is omitted, the zeroth indexed address of 
db81fdcb06e7 Implementation cut over to use Ipv4InterfaceAddress
Tom Henderson <tomh@tomh.org>
parents: 4140
diff changeset
    41
   * the interface is returned.  Unless IP aliaising is being used on
db81fdcb06e7 Implementation cut over to use Ipv4InterfaceAddress
Tom Henderson <tomh@tomh.org>
parents: 4140
diff changeset
    42
   * the interface, the second parameter may typically be omitted.
db81fdcb06e7 Implementation cut over to use Ipv4InterfaceAddress
Tom Henderson <tomh@tomh.org>
parents: 4140
diff changeset
    43
   */
db81fdcb06e7 Implementation cut over to use Ipv4InterfaceAddress
Tom Henderson <tomh@tomh.org>
parents: 4140
diff changeset
    44
  Ipv4Address GetAddress (uint32_t i, uint32_t j = 0) const;
db81fdcb06e7 Implementation cut over to use Ipv4InterfaceAddress
Tom Henderson <tomh@tomh.org>
parents: 4140
diff changeset
    45
2754
de159080cf8d add SetMetric
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2748
diff changeset
    46
  void SetMetric (uint32_t i, uint16_t metric);
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4375
diff changeset
    47
  /**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4375
diff changeset
    48
   * \param ipv4 pointer to Ipv4 object
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4375
diff changeset
    49
   * \param interface interface index of the Ipv4Interface to add to the container
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4375
diff changeset
    50
   */
2748
f65f6e2629dc introduce Ipv4InterfaceContainer and make Ipv4AddressHelper::Allocate return it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2699
diff changeset
    51
  void Add (Ptr<Ipv4> ipv4, uint32_t interface);
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3793
diff changeset
    52
  void Add (std::string ipv4Name, uint32_t interface);
2699
cbc8b1ae341d add NodeContainer::GetGlobal
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2697
diff changeset
    53
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    54
 private:
3793
a5895f134543 make star topologies easier to create
Craig Dowell <craigdo@ee.washington.edu>
parents: 2754
diff changeset
    55
  
a5895f134543 make star topologies easier to create
Craig Dowell <craigdo@ee.washington.edu>
parents: 2754
diff changeset
    56
  typedef std::vector<std::pair<Ptr<Ipv4>,uint32_t> > InterfaceVector;
a5895f134543 make star topologies easier to create
Craig Dowell <craigdo@ee.washington.edu>
parents: 2754
diff changeset
    57
  InterfaceVector m_interfaces;
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    58
};
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    59
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    60
} // namespace ns3
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    61
2748
f65f6e2629dc introduce Ipv4InterfaceContainer and make Ipv4AddressHelper::Allocate return it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2699
diff changeset
    62
#endif /* IPV4_INTERFACE_CONTAINER_H */