src/internet/model/ipv6-static-routing.h
author Tommaso Pecorella <tommaso.pecorella@unifi.it>
Fri, 24 Jul 2015 08:59:57 +0200
changeset 11542 457d8732ca24
parent 10664 2bb07b08e681
permissions -rw-r--r--
Bug 2148 - Ipv6Interface::SetUp doesn't re-create the Link-Local addresses
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 7233
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) 2007-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_STATIC_ROUTING_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_STATIC_ROUTING_H
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    23
5217
8a9dbc333e76 Export more IPv6 includes.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4761
diff changeset
    24
#include <stdint.h>
8a9dbc333e76 Export more IPv6 includes.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4761
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 <list>
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    27
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    28
#include "ns3/ptr.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
#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
    31
#include "ns3/ipv6-header.h"
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    32
#include "ns3/ipv6-routing-protocol.h"
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    33
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
    34
namespace ns3 {
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    35
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    36
class Packet;
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    37
class NetDevice;
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    38
class Ipv6Interface;
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    39
class Ipv6Route;
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    40
class Node;
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    41
class Ipv6RoutingTableEntry;
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    42
class Ipv6MulticastRoutingTableEntry;
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    43
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    44
/**
7233
be0d7443b4ff Updated the modules doxygen page
Mitch Watrous <watrous@u.washington.edu>
parents: 7176
diff changeset
    45
 * \ingroup internet
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    46
 * \defgroup ipv6StaticRouting Ipv6StaticRouting
4761
8c0b3a413f4b Add metric and longest prefix match support for IPv6.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4741
diff changeset
    47
 */
8c0b3a413f4b Add metric and longest prefix match support for IPv6.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4741
diff changeset
    48
/**
8c0b3a413f4b Add metric and longest prefix match support for IPv6.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4741
diff changeset
    49
 * \ingroup ipv6StaticRouting
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    50
 * \class Ipv6StaticRouting
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    51
 *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    52
 * \brief Static routing protocol for IP version 6 stacks.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    53
 *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    54
 * This class provides a basic set of methods for inserting static
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    55
 * unicast and multicast routes into the Ipv6 routing system.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    56
 * This particular protocol is designed to be inserted into an
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    57
 * Ipv6ListRouting protocol but can be used also as a standalone
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    58
 * protocol.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    59
 *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    60
 * The Ipv6StaticRouting class inherits from the abstract base class
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    61
 * Ipv6RoutingProtocol that defines the interface methods that a routing
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    62
 * protocol must support.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    63
 *
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    64
 * \see Ipv6RoutingProtocol
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    65
 * \see Ipv6ListRouting
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
    66
 * \see Ipv6ListRouting::AddRoutingProtocol
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    67
 */
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    68
class Ipv6StaticRouting : public Ipv6RoutingProtocol
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    69
{
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    70
public:
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    71
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    72
   * \brief The interface Id associated with this class.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    73
   * \return type identifier
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    74
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    75
  static TypeId GetTypeId ();
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    76
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    77
  Ipv6StaticRouting ();
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    78
  virtual ~Ipv6StaticRouting ();
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    79
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    80
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    81
   * \brief Add route to host.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    82
   * \param dest destination address
10131
0dc090fc749d Bug 1702 - A router should't aways add itself as the default router
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9848
diff changeset
    83
   * \param nextHop next hop address to route the packet.
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    84
   * \param interface interface index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    85
   * \param prefixToUse prefix that should be used for source address for this destination
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    86
   * \param metric metric of route in case of multiple routes to same destination
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    87
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    88
  void AddHostRouteTo (Ipv6Address dest, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address ("::"), uint32_t metric = 0);
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: 5856
diff changeset
    90
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    91
   * \brief Add route to host.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    92
   * \param dest destination address.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    93
   * \param interface interface index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    94
   * \param metric metric of route in case of multiple routes to same destination
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    95
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    96
  void AddHostRouteTo (Ipv6Address dest, uint32_t interface, uint32_t metric = 0);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    97
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    98
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
    99
   * \brief Add route to network.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   100
   * \param network network address
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   101
   * \param networkPrefix network prefix*
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   102
   * \param nextHop next hop address to route the packet
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   103
   * \param interface interface index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   104
   * \param metric metric of route in case of multiple routes to same destination
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   105
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   106
  void AddNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface, uint32_t metric = 0);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   107
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   108
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   109
   * \brief Add route to network.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   110
   * \param network network address
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   111
   * \param networkPrefix network prefix*
10131
0dc090fc749d Bug 1702 - A router should't aways add itself as the default router
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9848
diff changeset
   112
   * \param nextHop next hop address to route the packet.
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   113
   * \param interface interface index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   114
   * \param prefixToUse prefix that should be used for source address for this destination
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   115
   * \param metric metric of route in case of multiple routes to same destination
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   116
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   117
  void AddNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse, uint32_t metric = 0);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   118
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   119
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   120
   * \brief Add route to network.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   121
   * \param network network address
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   122
   * \param networkPrefix network prefix
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   123
   * \param interface interface index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   124
   * \param metric metric of route in case of multiple routes to same destination
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   125
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   126
  void AddNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, uint32_t interface, uint32_t metric = 0);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   127
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   128
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   129
   * \brief Set the default route.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   130
   * \param nextHop next hop address to route the packet
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   131
   * \param interface interface index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   132
   * \param prefixToUse prefix to use (i.e for multihoming)
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   133
   * \param metric metric of route in case of multiple routes to same destination
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   134
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   135
  void SetDefaultRoute (Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address ("::"), uint32_t metric = 0);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   136
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   137
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   138
   * \brief Get the number or entries in the routing table.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   139
   * \return number of entries
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   140
   */
7791
21c3495394b4 Enhancement 1393 - IPv6 Routing Helper RT Print functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   141
  uint32_t GetNRoutes () const;
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   142
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   143
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   144
   * \brief Get the default route.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   145
   *
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   146
   * If multiple default routes exist, the one with lowest metric is returned.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   147
   * \return default Ipv6Route
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   148
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   149
  Ipv6RoutingTableEntry GetDefaultRoute ();
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   150
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   151
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   152
   * \brief Get a specified route.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   153
   * \param i index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   154
   * \return the route whose index is i
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   155
   */
7791
21c3495394b4 Enhancement 1393 - IPv6 Routing Helper RT Print functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   156
  Ipv6RoutingTableEntry GetRoute (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
   157
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   158
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   159
   * \brief Get a metric for route from the static unicast routing table.
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   160
   * \param index The index (into the routing table) of the route to retrieve.
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   161
   * \return If route is set, the metric is returned. If not, an infinity metric (0xffffffff) is returned
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   162
   */
7791
21c3495394b4 Enhancement 1393 - IPv6 Routing Helper RT Print functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   163
  uint32_t GetMetric (uint32_t index) const;
4761
8c0b3a413f4b Add metric and longest prefix match support for IPv6.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4741
diff changeset
   164
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   165
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   166
   * \brief Remove a route from the routing table.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   167
   * \param i index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   168
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   169
  void RemoveRoute (uint32_t i);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   170
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   171
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   172
   * \brief Remove a route from the routing table.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   173
   * \param network IPv6 network
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   174
   * \param prefix IPv6 prefix
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   175
   * \param ifIndex interface index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   176
   * \param prefixToUse IPv6 prefix to use with this route (multihoming)
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   177
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   178
  void RemoveRoute (Ipv6Address network, Ipv6Prefix prefix, uint32_t ifIndex, Ipv6Address prefixToUse);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   179
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   180
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   181
   * \brief Add a multicast route for a given multicast source and group.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   182
   * \param origin IPv6 address of the source
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   183
   * \param group the multicast group address.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   184
   * \param inputInterface the interface index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   185
   * \param outputInterfaces the list of output interface indices over which the packet
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   186
   * should be sent (excluding the inputInterface).
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   187
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   188
  void AddMulticastRoute (Ipv6Address origin, Ipv6Address group, uint32_t inputInterface, std::vector<uint32_t> outputInterfaces);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   189
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   190
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   191
   * \brief Set the default multicast route.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   192
   * \param outputInterface default output interface
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   193
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   194
  void SetDefaultMulticastRoute (uint32_t outputInterface);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   195
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   196
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   197
   * \brief Get the number of entries in the multicast routing table.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   198
   * \return number of entries
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   199
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   200
  uint32_t GetNMulticastRoutes () const;
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   201
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   202
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   203
   * \brief Get the specified multicast route.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   204
   * \param i index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   205
   * \return the route whose index is i
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   206
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   207
  Ipv6MulticastRoutingTableEntry GetMulticastRoute (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
   208
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   209
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   210
   * \brief Remove a static multicast route.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   211
   * \param origin IPv6 address of the source
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   212
   * \param group the multicast group address.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   213
   * \param inputInterface the input interface index
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10131
diff changeset
   214
   * \return true on success
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   215
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   216
  bool RemoveMulticastRoute (Ipv6Address origin, Ipv6Address group, uint32_t inputInterface);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   217
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   218
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   219
   * \brief Remove a multicast route.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   220
   * \param i index of route to remove
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   221
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   222
  void RemoveMulticastRoute (uint32_t i);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   223
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   224
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   225
   * \brief If the destination is already present in network destination list.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   226
   * \param dest destination address
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   227
   * \param interfaceIndex interface index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   228
   * \return true if dest is already in list, false otherwise
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   229
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   230
  bool HasNetworkDest (Ipv6Address dest, uint32_t interfaceIndex);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   231
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   232
  virtual Ptr<Ipv6Route> RouteOutput (Ptr<Packet> p, const Ipv6Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   233
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   234
  virtual bool RouteInput  (Ptr<const Packet> p, const Ipv6Header &header, Ptr<const NetDevice> idev,
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   235
                            UnicastForwardCallback ucb, MulticastForwardCallback mcb,
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   236
                            LocalDeliverCallback lcb, ErrorCallback ecb);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   237
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   238
  virtual void NotifyInterfaceUp (uint32_t interface);
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   239
  virtual void NotifyInterfaceDown (uint32_t interface);
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   240
  virtual void NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address);
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   241
  virtual void NotifyRemoveAddress (uint32_t interface, Ipv6InterfaceAddress address);
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   242
  virtual void NotifyAddRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address::GetZero ());
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   243
  virtual void NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address::GetZero ());
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   244
  virtual void SetIpv6 (Ptr<Ipv6> ipv6);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   245
7791
21c3495394b4 Enhancement 1393 - IPv6 Routing Helper RT Print functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   246
  /**
21c3495394b4 Enhancement 1393 - IPv6 Routing Helper RT Print functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   247
   * \brief Print the Routing Table entries
21c3495394b4 Enhancement 1393 - IPv6 Routing Helper RT Print functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   248
   *
21c3495394b4 Enhancement 1393 - IPv6 Routing Helper RT Print functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   249
   * \param stream the ostream the Routing table is printed to
21c3495394b4 Enhancement 1393 - IPv6 Routing Helper RT Print functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   250
   */
21c3495394b4 Enhancement 1393 - IPv6 Routing Helper RT Print functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   251
  virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const;
21c3495394b4 Enhancement 1393 - IPv6 Routing Helper RT Print functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   252
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   253
protected:
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   254
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   255
   * \brief Dispose this object.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   256
   */
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   257
  virtual void DoDispose ();
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   258
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   259
private:
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10131
diff changeset
   260
  /// Container for the network routes
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   261
  typedef std::list<std::pair <Ipv6RoutingTableEntry *, uint32_t> > NetworkRoutes;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10131
diff changeset
   262
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10131
diff changeset
   263
  /// Const Iterator for container for the network routes
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   264
  typedef std::list<std::pair <Ipv6RoutingTableEntry *, uint32_t> >::const_iterator NetworkRoutesCI;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10131
diff changeset
   265
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10131
diff changeset
   266
  /// Iterator for container for the network routes
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   267
  typedef std::list<std::pair <Ipv6RoutingTableEntry *, uint32_t> >::iterator NetworkRoutesI;
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   268
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10131
diff changeset
   269
  /// Container for the multicast routes
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   270
  typedef std::list<Ipv6MulticastRoutingTableEntry *> MulticastRoutes;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10131
diff changeset
   271
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10131
diff changeset
   272
  /// Const Iterator for container for the multicast routes
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   273
  typedef std::list<Ipv6MulticastRoutingTableEntry *>::const_iterator MulticastRoutesCI;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10131
diff changeset
   274
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10131
diff changeset
   275
  /// Iterator for container for the multicast routes
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   276
  typedef std::list<Ipv6MulticastRoutingTableEntry *>::iterator MulticastRoutesI;
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   277
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   278
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   279
   * \brief Lookup in the forwarding table for destination.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   280
   * \param dest destination address
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   281
   * \param interface output interface if any (put 0 otherwise)
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   282
   * \return Ipv6Route to route the packet to reach dest address
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   283
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   284
  Ptr<Ipv6Route> LookupStatic (Ipv6Address dest, Ptr<NetDevice> = 0);
5800
082bd197b99a Use RouteOutput instead of getting Ipv6StaticRouting and call LookupStatic.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5793
diff changeset
   285
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   286
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   287
   * \brief Lookup in the multicast forwarding table for destination.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   288
   * \param origin source address
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   289
   * \param group group multicast address
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   290
   * \param ifIndex interface index
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   291
   * \return Ipv6MulticastRoute to route the packet to reach dest address
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   292
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   293
  Ptr<Ipv6MulticastRoute> LookupStatic (Ipv6Address origin, Ipv6Address group, uint32_t ifIndex);
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   294
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   295
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   296
   * \brief the forwarding table for network.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   297
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   298
  NetworkRoutes m_networkRoutes;
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   299
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   300
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   301
   * \brief the forwarding table for multicast.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   302
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   303
  MulticastRoutes m_multicastRoutes;
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   304
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   305
  /**
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   306
   * \brief Ipv6 reference.
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   307
   */
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5856
diff changeset
   308
  Ptr<Ipv6> m_ipv6;
4731
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   309
};
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   310
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   311
} /* namespace ns3 */
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   312
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   313
#endif /* IPV6_STATIC_ROUTING_H */
510db8599bfb second phase of IPv6 checkins from Univ. of Strasbourg team
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   314