src/internet/helper/ipv6-interface-container.h
author Vedran Miletić <rivanvx@gmail.com>
Tue, 02 Aug 2011 17:42:33 -0400
changeset 7385 10beb0e53130
parent 6834 036f9a0b9899
child 10131 0dc090fc749d
permissions -rw-r--r--
standardize emacs c++ mode comments
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 6834
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
     2
/*
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
     3
 * Copyright (c) 2008-2009 Strasbourg University
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
     4
 *
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
     8
 *
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    12
 * GNU General Public License for more details.
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    13
 *
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    17
 *
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    18
 * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    19
 */
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    20
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    21
#ifndef IPV6_INTERFACE_CONTAINER_H
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    22
#define IPV6_INTERFACE_CONTAINER_H
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    23
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    24
#include <stdint.h>
5217
8a9dbc333e76 Export more IPv6 includes.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4731
diff changeset
    25
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    26
#include <vector>
5217
8a9dbc333e76 Export more IPv6 includes.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4731
diff changeset
    27
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    28
#include "ns3/ipv6.h"
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    29
#include "ns3/ipv6-address.h"
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    30
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    31
namespace ns3
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    32
{
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    33
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    34
/**
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    35
 * \class Ipv6InterfaceContainer
5225
9c612cb88d6b Doxygenize.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5217
diff changeset
    36
 * \brief Keep track of a set of IPv6 interfaces.
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    37
 */
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    38
class Ipv6InterfaceContainer
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    39
{
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    40
public:
6027
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    41
  typedef std::vector<std::pair<Ptr<Ipv6>, uint32_t> >::const_iterator Iterator;
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    42
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    43
   * \brief Constructor.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    44
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    45
  Ipv6InterfaceContainer ();
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    46
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    47
  /**
6027
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    48
   * \returns the number of Ptr<Ipv6> and interface pairs stored in this 
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    49
   * Ipv4InterfaceContainer.
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    50
   *
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    51
   * Pairs can be retrieved from the container in two ways.  First,
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    52
   * directly by an index into the container, and second, using an iterator.
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    53
   * This method is used in the direct method and is typically used to
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    54
   * define an ending condition in a for-loop that runs through the stored
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    55
   * Nodes
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    56
   *
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    57
   * \code
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    58
   *   uint32_t nNodes = container.GetN ();
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    59
   *   for (uint32_t i = 0 i < nNodes; ++i)
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    60
   *     {
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    61
   *       std::pair<Ptr<Ipv6>, uint32_t> pair = container.Get (i);
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    62
   *       method (pair.first, pair.second);  // use the pair
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    63
   *     }
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    64
   * \endcode
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    65
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    66
  uint32_t GetN (void) const;
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    67
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    68
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    69
   * \brief Get the interface index for the specified node index.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    70
   * \param i index of the node
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    71
   * \return interface index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    72
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    73
  uint32_t GetInterfaceIndex (uint32_t i) const;
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    74
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    75
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    76
   * \brief Get the address for the specified index.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    77
   * \param i interface index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    78
   * \param j address index, generally index 0 is the link-local address
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    79
   * \return IPv6 address
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    80
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    81
  Ipv6Address GetAddress (uint32_t i, uint32_t j) const;
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    82
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    83
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    84
   * \brief Add a couple IPv6/interface.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    85
   * \param ipv6 IPv6 address
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    86
   * \param interface interface index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    87
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    88
  void Add (Ptr<Ipv6> ipv6, uint32_t interface);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    89
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
    90
  /**
6027
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    91
   * \brief Get an iterator which refers to the first pair in the 
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    92
   * container.
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    93
   *
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    94
   * Pairs can be retrieved from the container in two ways.  First,
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    95
   * directly by an index into the container, and second, using an iterator.
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    96
   * This method is used in the iterator method and is typically used in a 
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    97
   * for-loop to run through the pairs
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    98
   *
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
    99
   * \code
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   100
   *   Ipv4InterfaceContainer::Iterator i;
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   101
   *   for (i = container.Begin (); i != container.End (); ++i)
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   102
   *     {
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   103
   *       std::pair<Ptr<Ipv6>, uint32_t> pair = *i;
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   104
   *       method (pair.first, pair.second);  // use the pair
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   105
   *     }
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   106
   * \endcode
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   107
   *
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   108
   * \returns an iterator which refers to the first pair in the container.
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   109
   */
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   110
  Iterator Begin (void) const;
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   111
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   112
  /**
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   113
   * \brief Get an iterator which indicates past-the-last Node in the 
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   114
   * container.
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   115
   *
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   116
   * Nodes can be retrieved from the container in two ways.  First,
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   117
   * directly by an index into the container, and second, using an iterator.
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   118
   * This method is used in the iterator method and is typically used in a 
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   119
   * for-loop to run through the Nodes
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   120
   *
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   121
   * \code
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   122
   *   NodeContainer::Iterator i;
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   123
   *   for (i = container.Begin (); i != container.End (); ++i)
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   124
   *     {
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   125
   *       std::pair<Ptr<Ipv6>, uint32_t> pair = *i;
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   126
   *       method (pair.first, pair.second);  // use the pair
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   127
   *     }
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   128
   * \endcode
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   129
   *
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   130
   * \returns an iterator which indicates an ending condition for a loop.
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   131
   */
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   132
  Iterator End (void) const;
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   133
8ed838dd0be5 add ipv6
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   134
  /**
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   135
   * \brief Fusion with another Ipv6InterfaceContainer.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   136
   * \param c container
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   137
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   138
  void Add (Ipv6InterfaceContainer& c);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   139
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   140
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   141
   * \brief Add a couple of name/interface.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   142
   * \param ipv6Name name of a node
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   143
   * \param interface interface index to add
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   144
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   145
  void Add (std::string ipv6Name, uint32_t interface);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   146
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   147
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   148
   * \brief Set the state of the stack (act as a router or not) for the specified index.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   149
   * \param i index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   150
   * \param router true : is a router, false : is an host
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   151
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   152
  void SetRouter (uint32_t i, bool router);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   153
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   154
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   155
   * \brief Set the default route for the specified index.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   156
   * \param i index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   157
   * \param router the default router
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   158
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   159
  void SetDefaultRoute (uint32_t i, uint32_t router);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   160
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   161
private:
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   162
  typedef std::vector<std::pair<Ptr<Ipv6>, uint32_t> > InterfaceVector;
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   163
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   164
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   165
   * \internal
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   166
   * \brief List of IPv6 stack and interfaces index.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   167
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5361
diff changeset
   168
  InterfaceVector m_interfaces;
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   169
};
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   170
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   171
} /* namespace ns3 */
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   172
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   173
#endif /* IPV6_INTERFACE_CONTAINER_H */
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   174