src/internet/model/global-route-manager-impl.h
author Pedro Silva <pmms@inesctec.pt>
Wed, 29 Oct 2014 10:12:53 -0700
changeset 11040 cd2eda848730
parent 10872 0d7c9bf5f537
child 11045 6024c150e4c8
permissions -rw-r--r--
bug 1791: TCP Endpoint never deallocates when closing
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     2
/*
1457
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1316
diff changeset
     3
 * Copyright 2007 University of Washington
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1316
diff changeset
     4
 * 
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     8
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    12
 * GNU General Public License for more details.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    13
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1457
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1316
diff changeset
    17
 *
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1316
diff changeset
    18
 * Authors:  Craig Dowell (craigdo@ee.washington.edu)
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1316
diff changeset
    19
 *           Tom Henderson (tomhend@u.washington.edu)
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    20
 */
1112
4f18aeb5e2f1 copywrongs
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    21
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    22
#ifndef GLOBAL_ROUTE_MANAGER_IMPL_H
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    23
#define GLOBAL_ROUTE_MANAGER_IMPL_H
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    24
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    25
#include <stdint.h>
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    26
#include <list>
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    27
#include <queue>
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    28
#include <map>
4745
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
    29
#include <vector>
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    30
#include "ns3/object.h"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    31
#include "ns3/ptr.h"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    32
#include "ns3/ipv4-address.h"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    33
#include "global-router-interface.h"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    34
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    35
namespace ns3 {
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    36
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
    37
const uint32_t SPF_INFINITY = 0xffffffff; //!< "infinite" distance between nodes
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    38
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    39
class CandidateQueue;
3959
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
    40
class Ipv4GlobalRouting;
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    41
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    42
/**
10158
971f362648c3 Link to RFC num with \RFC{num}
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9870
diff changeset
    43
 * @brief Vertex used in shortest path first (SPF) computations. See \RFC{2328},
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    44
 * Section 16.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    45
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    46
 * Each router in the simulation is associated with an SPFVertex object.  When
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    47
 * calculating routes, each of these routers is, in turn, chosen as the "root"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    48
 * of the calculation and routes to all of the other routers are eventually
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    49
 * saved in the routing tables of each of the chosen nodes.  Each of these 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    50
 * routers in the calculation has an associated SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    51
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    52
 * The "Root" vertex is the SPFVertex representing the router that is having
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    53
 * its routing tables set.  The SPFVertex objects representing other routers
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    54
 * or networks in the simulation are arranged in the SPF tree.  It is this 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    55
 * tree that represents the Shortest Paths to the other networks.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    56
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    57
 * Each SPFVertex has a pointer to the Global Router Link State Advertisement
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    58
 * (LSA) that its underlying router has exported.  Within these LSAs are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    59
 * Global Router Link Records that describe the point to point links from the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    60
 * underlying router to other nodes (represented by other SPFVertex objects)
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    61
 * in the simulation topology.  The combination of the arrangement of the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    62
 * SPFVertex objects in the SPF tree, along with the details of the link
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    63
 * records that connect them provide the information required to construct the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    64
 * required routes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    65
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    66
class SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    67
{
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    68
public:
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    69
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    70
 * @brief Enumeration of the possible types of SPFVertex objects.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
    71
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    72
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    73
 * Currently we use VertexRouter to identify objects that represent a router 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    74
 * in the simulation topology, and VertexNetwork to identify objects that 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    75
 * represent a network.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    76
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    77
  enum VertexType {
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    78
    VertexUnknown = 0,  /**< Uninitialized Link Record */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    79
    VertexRouter,       /**< Vertex representing a router in the topology */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    80
    VertexNetwork       /**< Vertex representing a network in the topology */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    81
  };
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
    82
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    83
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    84
 * @brief Construct an empty ("uninitialized") SPFVertex (Shortest Path First 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    85
 * Vertex).
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
    86
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    87
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    88
 * The Vertex Type is set to VertexUnknown, the Vertex ID is set to 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    89
 * 255.255.255.255, and the distance from root is set to infinity 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    90
 * (UINT32_MAX).  The referenced Link State Advertisement (LSA) is set to 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    91
 * null as is the parent SPFVertex.  The outgoing interface index is set to
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    92
 * infinity, the next hop address is set to 0.0.0.0 and the list of children
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    93
 * of the SPFVertex is initialized to empty.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    94
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    95
 * @see VertexType
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    96
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    97
  SPFVertex();
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
    98
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    99
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   100
 * @brief Construct an initialized SPFVertex (Shortest Path First Vertex).
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   101
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   102
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   103
 * The Vertex Type is initialized to VertexRouter and the Vertex ID is found
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   104
 * from the Link State ID of the Link State Advertisement (LSA) passed as a
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   105
 * parameter.  The Link State ID is set to the Router ID of the advertising
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   106
 * router.  The referenced LSA (m_lsa) is set to the given LSA.  Other than 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   107
 * these members, initialization is as in the default constructor.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   108
 * of the SPFVertex is initialized to empty.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   109
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   110
 * @see SPFVertex::SPFVertex ()
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   111
 * @see VertexType
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   112
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   113
 * @param lsa The Link State Advertisement used for finding initial values.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   114
 */
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   115
  SPFVertex(GlobalRoutingLSA* lsa);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   116
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   117
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   118
 * @brief Destroy an SPFVertex (Shortest Path First Vertex).
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   119
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   120
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   121
 * The children vertices of the SPFVertex are recursively deleted.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   122
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   123
 * @see SPFVertex::SPFVertex ()
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   124
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   125
  ~SPFVertex();
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   126
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   127
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   128
 * @brief Get the Vertex Type field of a SPFVertex object.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   129
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   130
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   131
 * The Vertex Type describes the kind of simulation object a given SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   132
 * represents.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   133
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   134
 * @see VertexType
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   135
 * @returns The VertexType of the current SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   136
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   137
  VertexType GetVertexType (void) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   138
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   139
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   140
 * @brief Set the Vertex Type field of a SPFVertex object.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   141
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   142
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   143
 * The Vertex Type describes the kind of simulation object a given SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   144
 * represents.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   145
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   146
 * @see VertexType
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   147
 * @param type The new VertexType for the current SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   148
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   149
  void SetVertexType (VertexType type);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   150
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   151
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   152
 * @brief Get the Vertex ID field of a SPFVertex object.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   153
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   154
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   155
 * The Vertex ID uniquely identifies the simulation object a given SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   156
 * represents.  Typically, this is the Router ID for SPFVertex objects 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   157
 * representing routers, and comes from the Link State Advertisement of a 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   158
 * router aggregated to a node in the simulation.  These IDs are allocated
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   159
 * automatically by the routing environment and look like IP addresses 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   160
 * beginning at 0.0.0.0 and monotonically increasing as new routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   161
 * instantiated.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   162
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   163
 * @returns The Ipv4Address Vertex ID of the current SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   164
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   165
  Ipv4Address GetVertexId (void) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   166
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   167
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   168
 * @brief Set the Vertex ID field of a SPFVertex object.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   169
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   170
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   171
 * The Vertex ID uniquely identifies the simulation object a given SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   172
 * represents.  Typically, this is the Router ID for SPFVertex objects 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   173
 * representing routers, and comes from the Link State Advertisement of a 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   174
 * router aggregated to a node in the simulation.  These IDs are allocated
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   175
 * automatically by the routing environment and look like IP addresses 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   176
 * beginning at 0.0.0.0 and monotonically increase as new routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   177
 * instantiated.  This method is an explicit override of the automatically
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   178
 * generated value.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   179
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   180
 * @param id The new Ipv4Address Vertex ID for the current SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   181
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   182
  void SetVertexId (Ipv4Address id);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   183
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   184
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   185
 * @brief Get the Global Router Link State Advertisement returned by the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   186
 * Global Router represented by this SPFVertex during the route discovery 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   187
 * process.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   188
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   189
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   190
 * @see GlobalRouter
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   191
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   192
 * @see GlobalRouter::DiscoverLSAs ()
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   193
 * @returns A pointer to the GlobalRoutingLSA found by the router represented
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   194
 * by this SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   195
 */
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   196
  GlobalRoutingLSA* GetLSA (void) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   197
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   198
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   199
 * @brief Set the Global Router Link State Advertisement returned by the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   200
 * Global Router represented by this SPFVertex during the route discovery 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   201
 * process.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   202
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   203
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   204
 * @see SPFVertex::GetLSA ()
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   205
 * @see GlobalRouter
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   206
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   207
 * @see GlobalRouter::DiscoverLSAs ()
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   208
 * @warning Ownership of the LSA is transferred to the "this" SPFVertex.  You
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   209
 * must not delete the LSA after calling this method.
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   210
 * @param lsa A pointer to the GlobalRoutingLSA.
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   211
 */
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   212
  void SetLSA (GlobalRoutingLSA* lsa);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   213
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   214
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   215
 * @brief Get the distance from the root vertex to "this" SPFVertex object.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   216
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   217
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   218
 * Each router in the simulation is associated with an SPFVertex object.  When
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   219
 * calculating routes, each of these routers is, in turn, chosen as the "root"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   220
 * of the calculation and routes to all of the other routers are eventually
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   221
 * saved in the routing tables of each of the chosen nodes.  Each of these 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   222
 * routers in the calculation has an associated SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   223
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   224
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   225
 * having its routing tables set.  The "this" SPFVertex is the vertex to which
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   226
 * a route is being calculated from the root.  The distance from the root that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   227
 * we're asking for is the number of hops from the root vertex to the vertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   228
 * in question.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   229
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   230
 * The distance is calculated during route discovery and is stored in a
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   231
 * member variable.  This method simply fetches that value.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   232
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   233
 * @returns The distance, in hops, from the root SPFVertex to "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   234
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   235
  uint32_t GetDistanceFromRoot (void) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   236
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   237
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   238
 * @brief Set the distance from the root vertex to "this" SPFVertex object.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   239
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   240
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   241
 * Each router in the simulation is associated with an SPFVertex object.  When
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   242
 * calculating routes, each of these routers is, in turn, chosen as the "root"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   243
 * of the calculation and routes to all of the other routers are eventually
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   244
 * saved in the routing tables of each of the chosen nodes.  Each of these 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   245
 * routers in the calculation has an associated SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   246
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   247
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   248
 * having its routing tables set.  The "this" SPFVertex is the vertex to which
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   249
 * a route is being calculated from the root.  The distance from the root that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   250
 * we're asking for is the number of hops from the root vertex to the vertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   251
 * in question.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   252
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   253
 * @param distance The distance, in hops, from the root SPFVertex to "this"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   254
 * SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   255
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   256
  void SetDistanceFromRoot (uint32_t distance);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   257
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   258
/**
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   259
 * @brief Set the IP address and outgoing interface index that should be used 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   260
 * to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   261
 * @internal
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   262
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   263
 * Each router node in the simulation is associated with an SPFVertex object.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   264
 * When calculating routes, each of these routers is, in turn, chosen as the 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   265
 * "root" of the calculation and routes to all of the other routers are
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   266
 * eventually saved in the routing tables of each of the chosen nodes.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   267
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   268
 * The "Root" vertex is then the SPFVertex representing the router that is
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   269
 * having its routing tables set.  The "this" SPFVertex is the vertex that
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   270
 * represents the host or network to which a route is being calculated from 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   271
 * the root.  The IP address that we're asking for is the address on the 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   272
 * remote side of a link off of the root node that should be used as the
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   273
 * destination for packets along the path to "this" vertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   274
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   275
 * When initializing the root SPFVertex, the IP address used when forwarding
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   276
 * packets is determined by examining the Global Router Link Records of the
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   277
 * Link State Advertisement generated by the root node's GlobalRouter.  This
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   278
 * address is used to forward packets off of the root's network down those
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   279
 * links.  As other vertices / nodes are discovered which are further away
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   280
 * from the root, they will be accessible down one of the paths via a link
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   281
 * described by one of these Global Router Link Records.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   282
 * 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   283
 * To forward packets to these hosts or networks, the root node must begin
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   284
 * the forwarding process by sending the packets to a first hop router down
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   285
 * an interface.  This means that the first hop address and interface ID must
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   286
 * be the same for all downstream SPFVertices.  We call this "inheriting"
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   287
 * the interface and next hop.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   288
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   289
 * In this method we are telling the root node which exit direction it should send
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   290
 * should I send a packet to the network or host represented by 'this' SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   291
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   292
 * @see GlobalRouter
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   293
 * @see GlobalRoutingLSA
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   294
 * @see GlobalRoutingLinkRecord
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   295
 * @param nextHop The IP address to use when forwarding packets to the host
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   296
 * or network represented by "this" SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   297
 * @param id The interface index to use when forwarding packets to the host or
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   298
 * network represented by "this" SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   299
 */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   300
  void SetRootExitDirection (Ipv4Address nextHop, int32_t id = SPF_INFINITY);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   301
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   302
  typedef std::pair<Ipv4Address, int32_t> NodeExit_t; //!< IPv4 / interface container for exit nodes.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   303
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   304
/**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   305
 * @brief Set the IP address and outgoing interface index that should be used 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   306
 * to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   307
 * @internal
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   308
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   309
 * Each router node in the simulation is associated with an SPFVertex object.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   310
 * When calculating routes, each of these routers is, in turn, chosen as the 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   311
 * "root" of the calculation and routes to all of the other routers are
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   312
 * eventually saved in the routing tables of each of the chosen nodes.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   313
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   314
 * The "Root" vertex is then the SPFVertex representing the router that is
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   315
 * having its routing tables set.  The "this" SPFVertex is the vertex that
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   316
 * represents the host or network to which a route is being calculated from 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   317
 * the root.  The IP address that we're asking for is the address on the 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   318
 * remote side of a link off of the root node that should be used as the
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   319
 * destination for packets along the path to "this" vertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   320
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   321
 * When initializing the root SPFVertex, the IP address used when forwarding
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   322
 * packets is determined by examining the Global Router Link Records of the
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   323
 * Link State Advertisement generated by the root node's GlobalRouter.  This
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   324
 * address is used to forward packets off of the root's network down those
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   325
 * links.  As other vertices / nodes are discovered which are further away
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   326
 * from the root, they will be accessible down one of the paths via a link
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   327
 * described by one of these Global Router Link Records.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   328
 * 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   329
 * To forward packets to these hosts or networks, the root node must begin
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   330
 * the forwarding process by sending the packets to a first hop router down
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   331
 * an interface.  This means that the first hop address and interface ID must
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   332
 * be the same for all downstream SPFVertices.  We call this "inheriting"
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   333
 * the interface and next hop.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   334
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   335
 * In this method we are telling the root node which exit direction it should send
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   336
 * should I send a packet to the network or host represented by 'this' SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   337
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   338
 * @see GlobalRouter
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   339
 * @see GlobalRoutingLSA
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   340
 * @see GlobalRoutingLinkRecord
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   341
 * @param exit The pair of next-hop-IP and outgoing-interface-index to use when 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   342
 * forwarding packets to the host or network represented by "this" SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   343
 */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   344
  void SetRootExitDirection (SPFVertex::NodeExit_t exit);
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   345
  /**
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   346
   * \brief Obtain a pair indicating the exit direction from the root
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   347
   *
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   348
   * \param i An index to a pair
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   349
   * \return A pair of next-hop-IP and outgoing-interface-index for
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   350
   * indicating an exit direction from the root. It is 0 if the index 'i'
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   351
   * is out-of-range
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   352
   */
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   353
  NodeExit_t GetRootExitDirection (uint32_t i) const;
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   354
  /**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   355
   * \brief Obtain a pair indicating the exit direction from the root
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   356
   *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   357
   * This method assumes there is only a single exit direction from the root.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   358
   * Error occur if this assumption is invalid.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   359
   *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   360
   * \return The pair of next-hop-IP and outgoing-interface-index for reaching
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   361
   * 'this' vertex from the root
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   362
   */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   363
  NodeExit_t GetRootExitDirection () const;
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   364
  /**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   365
   * \brief Merge into 'this' vertex the list of exit directions from
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   366
   * another vertex
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   367
   *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   368
   * This merge is necessary when ECMP are found. 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   369
   *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   370
   * \param vertex From which the list of exit directions are obtain
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   371
   * and are merged into 'this' vertex
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   372
   */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   373
  void MergeRootExitDirections (const SPFVertex* vertex);
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   374
  /**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   375
   * \brief Inherit all root exit directions from a given vertex to 'this' vertex
6273
8d70de29d514 spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents: 5935
diff changeset
   376
   * \param vertex The vertex from which all root exit directions are to be inherited
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   377
   *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   378
   * After the call of this method, the original root exit directions
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   379
   * in 'this' vertex are all lost.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   380
   */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   381
  void InheritAllRootExitDirections (const SPFVertex* vertex);
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   382
  /**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   383
   * \brief Get the number of exit directions from root for reaching 'this' vertex
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   384
   * \return The number of exit directions from root
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   385
   */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   386
  uint32_t GetNRootExitDirections () const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   387
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   388
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   389
 * @brief Get a pointer to the SPFVector that is the parent of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   390
 * SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   391
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   392
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   393
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   394
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   395
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   396
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   397
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   398
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   399
 * having its routing tables set and is the root of the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   400
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   401
 * This method returns a pointer to the parent node of "this" SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   402
 * (both of which reside in that SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   403
 *
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   404
 * @param i The index to one of the parents
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   405
 * @returns A pointer to the SPFVertex that is the parent of "this" SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   406
 * in the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   407
 */
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   408
  SPFVertex* GetParent (uint32_t i = 0) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   409
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   410
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   411
 * @brief Set the pointer to the SPFVector that is the parent of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   412
 * SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   413
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   414
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   415
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   416
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   417
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   418
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   419
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   420
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   421
 * having its routing tables set and is the root of the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   422
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   423
 * This method sets the parent pointer of "this" SPFVertex (both of which
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   424
 * reside in that SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   425
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   426
 * @param parent A pointer to the SPFVertex that is the parent of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   427
 * SPFVertex* in the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   428
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   429
  void SetParent (SPFVertex* parent);
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   430
  /**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   431
   * \brief Merge the Parent list from the v into this vertex
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   432
   *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   433
   * \param v The vertex from which its list of Parent is read
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   434
   * and then merged into the list of Parent of *this* vertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   435
   * Note that the list in v remains intact
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   436
   */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   437
  void MergeParent (const SPFVertex* v);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   438
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   439
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   440
 * @brief Get the number of children of "this" SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   441
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   442
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   443
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   444
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   445
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   446
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   447
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   448
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   449
 * having its routing tables set and is the root of the SPF tree.  Each vertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   450
 * in the SPF tree can have a number of children that represent host or 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   451
 * network routes available via that vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   452
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   453
 * This method returns the number of children of "this" SPFVertex (which 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   454
 * reside in the SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   455
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   456
 * @returns The number of children of "this" SPFVertex (which reside in the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   457
 * SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   458
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   459
  uint32_t GetNChildren (void) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   460
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   461
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   462
 * @brief Get a borrowed SPFVertex pointer to the specified child of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   463
 * SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   464
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   465
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   466
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   467
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   468
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   469
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   470
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   471
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   472
 * having its routing tables set and is the root of the SPF tree.  Each vertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   473
 * in the SPF tree can have a number of children that represent host or 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   474
 * network routes available via that vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   475
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   476
 * This method the number of children of "this" SPFVertex (which reside in
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   477
 * the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   478
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   479
 * @see SPFVertex::GetNChildren
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   480
 * @param n The index (from 0 to the number of children minus 1) of the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   481
 * child SPFVertex to return.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   482
 * @warning The pointer returned by GetChild () is a borrowed pointer.  You
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   483
 * do not have any ownership of the underlying object and must not delete
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   484
 * that object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   485
 * @returns A pointer to the specified child SPFVertex (which resides in the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   486
 * SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   487
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   488
  SPFVertex* GetChild (uint32_t n) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   489
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   490
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   491
 * @brief Get a borrowed SPFVertex pointer to the specified child of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   492
 * SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   493
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   494
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   495
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   496
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   497
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   498
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   499
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   500
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   501
 * having its routing tables set and is the root of the SPF tree.  Each vertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   502
 * in the SPF tree can have a number of children that represent host or 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   503
 * network routes available via that vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   504
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   505
 * This method the number of children of "this" SPFVertex (which reside in
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   506
 * the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   507
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   508
 * @see SPFVertex::GetNChildren
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   509
 * @warning Ownership of the pointer added to the children of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   510
 * SPFVertex is transferred to the "this" SPFVertex.  You must not delete the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   511
 * (now) child SPFVertex after calling this method.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   512
 * @param child A pointer to the SPFVertex (which resides in the SPF tree) to
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   513
 * be added to the list of children of "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   514
 * @returns The number of children of "this" SPFVertex after the addition of
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   515
 * the new child.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   516
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   517
  uint32_t AddChild (SPFVertex* child);
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   518
3960
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   519
  /**
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   520
   * @brief Set the value of the VertexProcessed flag
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   521
   *
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   522
   * Flag to note whether vertex has been processed in stage two of 
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   523
   * SPF computation
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   524
   * @param value boolean value to set the flag
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   525
   */ 
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   526
  void SetVertexProcessed (bool value);
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   527
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   528
  /**
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   529
   * @brief Check the value of the VertexProcessed flag
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   530
   *
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   531
   * Flag to note whether vertex has been processed in stage two of 
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   532
   * SPF computation
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   533
   * @returns value of underlying flag
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   534
   */ 
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   535
  bool IsVertexProcessed (void) const;
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   536
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   537
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   538
   * @brief Clear the value of the VertexProcessed flag
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   539
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   540
   * Flag to note whether vertex has been processed in stage two of
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   541
   * SPF computation
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   542
   */
4745
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   543
  void ClearVertexProcessed (void);
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   544
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   545
private:
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   546
  VertexType m_vertexType; //!< Vertex type
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   547
  Ipv4Address m_vertexId; //!< Vertex ID
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   548
  GlobalRoutingLSA* m_lsa; //!< Link State Advertisement
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   549
  uint32_t m_distanceFromRoot; //!< Distance from root node
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   550
  int32_t m_rootOif; //!< root Output Interface
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   551
  Ipv4Address m_nextHop; //!< next hop
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   552
  typedef std::list< NodeExit_t > ListOfNodeExit_t; //!< container of Exit nodes
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   553
  ListOfNodeExit_t m_ecmpRootExits; //!< store the multiple root's exits for supporting ECMP
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   554
  typedef std::list<SPFVertex*> ListOfSPFVertex_t; //!< container of SPFVertexes
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   555
  ListOfSPFVertex_t m_parents; //!< parent list
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   556
  ListOfSPFVertex_t m_children; //!< Children list
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   557
  bool m_vertexProcessed; //!< Flag to note whether vertex has been processed in stage two of SPF computation
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   558
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   559
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   560
 * @brief The SPFVertex copy construction is disallowed.  There's no need for
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   561
 * it and a compiler provided shallow copy would be wrong.
10872
0d7c9bf5f537 [Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10440
diff changeset
   562
 * @param v object to copy from
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   563
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   564
  SPFVertex (SPFVertex& v);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   565
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   566
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   567
 * @brief The SPFVertex copy assignment operator is disallowed.  There's no 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   568
 * need for it and a compiler provided shallow copy would be wrong.
10872
0d7c9bf5f537 [Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10440
diff changeset
   569
 * @param v object to copy from
0d7c9bf5f537 [Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10440
diff changeset
   570
 * @returns the copied object
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   571
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   572
  SPFVertex& operator= (SPFVertex& v);
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   573
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   574
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   575
   * \brief Stream insertion operator.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   576
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   577
   * \param os the reference to the output stream
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   578
   * \param vs a list of SPFVertexes
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   579
   * \returns the reference to the output stream
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   580
   */
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   581
  friend std::ostream& operator<< (std::ostream& os, const SPFVertex::ListOfSPFVertex_t& vs);
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   582
};
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   583
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   584
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   585
 * @brief The Link State DataBase (LSDB) of the Global Route Manager.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   586
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   587
 * Each node in the simulation participating in global routing has a
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   588
 * GlobalRouter interface.  The primary job of this interface is to export
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   589
 * Global Router Link State Advertisements (LSAs).  These advertisements in
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   590
 * turn contain a number of Global Router Link Records that describe the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   591
 * point to point links from the underlying node to other nodes (that will 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   592
 * also export their own LSAs.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   593
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   594
 * This class implements a searchable database of LSAs gathered from every
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   595
 * router in the simulation.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   596
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   597
class GlobalRouteManagerLSDB
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   598
{
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   599
public:
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   600
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   601
 * @brief Construct an empty Global Router Manager Link State Database.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   602
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   603
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   604
 * The database map composing the Link State Database is initialized in
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   605
 * this constructor.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   606
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   607
  GlobalRouteManagerLSDB ();
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   608
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   609
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   610
 * @brief Destroy an empty Global Router Manager Link State Database.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   611
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   612
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   613
 * The database map is walked and all of the Link State Advertisements stored
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   614
 * in the database are freed; then the database map itself is clear ()ed to
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   615
 * release any remaining resources.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   616
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   617
  ~GlobalRouteManagerLSDB ();
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   618
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   619
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   620
 * @brief Insert an IP address / Link State Advertisement pair into the Link
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   621
 * State Database.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   622
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   623
 *
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   624
 * The IPV4 address and the GlobalRoutingLSA given as parameters are converted
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   625
 * to an STL pair and are inserted into the database map.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   626
 *
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   627
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   628
 * @see Ipv4Address
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   629
 * @param addr The IP address associated with the LSA.  Typically the Router 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   630
 * ID.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   631
 * @param lsa A pointer to the Link State Advertisement for the router.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   632
 */
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7176
diff changeset
   633
  void Insert (Ipv4Address addr, GlobalRoutingLSA* lsa);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   634
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   635
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   636
 * @brief Look up the Link State Advertisement associated with the given
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   637
 * link state ID (address).
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   638
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   639
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   640
 * The database map is searched for the given IPV4 address and corresponding
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   641
 * GlobalRoutingLSA is returned.
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   642
 *
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   643
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   644
 * @see Ipv4Address
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   645
 * @param addr The IP address associated with the LSA.  Typically the Router 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   646
 * ID.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   647
 * @returns A pointer to the Link State Advertisement for the router specified
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   648
 * by the IP address addr.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   649
 */
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   650
  GlobalRoutingLSA* GetLSA (Ipv4Address addr) const;
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   651
/**
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   652
 * @brief Look up the Link State Advertisement associated with the given
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   653
 * link state ID (address).  This is a variation of the GetLSA call
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   654
 * to allow the LSA to be found by matching addr with the LinkData field
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   655
 * of the TransitNetwork link record.
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   656
 * @internal
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   657
 *
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   658
 * @see GetLSA
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   659
 * @param addr The IP address associated with the LSA.  Typically the Router 
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   660
 * @returns A pointer to the Link State Advertisement for the router specified
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   661
 * by the IP address addr.
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   662
 * ID.
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   663
 */
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   664
  GlobalRoutingLSA* GetLSAByLinkData (Ipv4Address addr) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   665
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   666
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   667
 * @brief Set all LSA flags to an initialized state, for SPF computation
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   668
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   669
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   670
 * This function walks the database and resets the status flags of all of the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   671
 * contained Link State Advertisements to LSA_SPF_NOT_EXPLORED.  This is done
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   672
 * prior to each SPF calculation to reset the state of the SPFVertex structures
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   673
 * that will reference the LSAs during the calculation.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   674
 *
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   675
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   676
 * @see SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   677
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   678
  void Initialize ();
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   679
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   680
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   681
   * @brief Look up the External Link State Advertisement associated with the given
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   682
   * index.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   683
   * @internal
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   684
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   685
   * The external database map is searched for the given index and corresponding
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   686
   * GlobalRoutingLSA is returned.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   687
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   688
   * @see GlobalRoutingLSA
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   689
   * @param index the index associated with the LSA.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   690
   * @returns A pointer to the Link State Advertisement.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   691
   */
4745
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   692
  GlobalRoutingLSA* GetExtLSA (uint32_t index) const;
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   693
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   694
   * @brief Get the number of External Link State Advertisements.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   695
   * @internal
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   696
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   697
   * @see GlobalRoutingLSA
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   698
   * @returns the number of External Link State Advertisements.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   699
   */
4745
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   700
  uint32_t GetNumExtLSAs () const;
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   701
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   702
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   703
private:
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   704
  typedef std::map<Ipv4Address, GlobalRoutingLSA*> LSDBMap_t; //!< container of IPv4 addresses / Link State Advertisements
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   705
  typedef std::pair<Ipv4Address, GlobalRoutingLSA*> LSDBPair_t; //!< pair of IPv4 addresses / Link State Advertisements
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   706
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   707
  LSDBMap_t m_database; //!< database of IPv4 addresses / Link State Advertisements
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   708
  std::vector<GlobalRoutingLSA*> m_extdatabase; //!< database of External Link State Advertisements
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   709
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   710
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   711
 * @brief GlobalRouteManagerLSDB copy construction is disallowed.  There's no 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   712
 * need for it and a compiler provided shallow copy would be wrong.
10872
0d7c9bf5f537 [Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10440
diff changeset
   713
 * @param lsdb object to copy from
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   714
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   715
  GlobalRouteManagerLSDB (GlobalRouteManagerLSDB& lsdb);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   716
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   717
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   718
 * @brief The SPFVertex copy assignment operator is disallowed.  There's no 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   719
 * need for it and a compiler provided shallow copy would be wrong.
10872
0d7c9bf5f537 [Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10440
diff changeset
   720
 * @param lsdb object to copy from
0d7c9bf5f537 [Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10440
diff changeset
   721
 * @returns the copied object
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   722
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   723
  GlobalRouteManagerLSDB& operator= (GlobalRouteManagerLSDB& lsdb);
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   724
};
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   725
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   726
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   727
 * @brief A global router implementation.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   728
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   729
 * This singleton object can query interface each node in the system
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   730
 * for a GlobalRouter interface.  For those nodes, it fetches one or
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   731
 * more Link State Advertisements and stores them in a local database.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   732
 * Then, it can compute shortest paths on a per-node basis to all routers, 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   733
 * and finally configure each of the node's forwarding tables.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   734
 *
10158
971f362648c3 Link to RFC num with \RFC{num}
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9870
diff changeset
   735
 * The design is guided by OSPFv2 \RFC{2328} section 16.1.1 and quagga ospfd.
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   736
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   737
class GlobalRouteManagerImpl
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   738
{
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   739
public:
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   740
  GlobalRouteManagerImpl ();
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   741
  virtual ~GlobalRouteManagerImpl ();
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   742
/**
3959
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   743
 * @brief Delete all static routes on all nodes that have a
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   744
 * GlobalRouterInterface
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   745
 *
9870
6543f3876ff5 [Doxygen] use \todo
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8866
diff changeset
   746
 * \todo  separate manually assigned static routes from static routes that
3959
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   747
 * the global routing code injects, and only delete the latter
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   748
 * @internal
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   749
 *
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   750
 */
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   751
  virtual void DeleteGlobalRoutes ();
3937
04f9377661b8 convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents: 2250
diff changeset
   752
04f9377661b8 convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents: 2250
diff changeset
   753
/**
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   754
 * @brief Build the routing database by gathering Link State Advertisements
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   755
 * from each node exporting a GlobalRouter interface.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   756
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   757
 */
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   758
  virtual void BuildGlobalRoutingDatabase ();
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   759
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   760
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   761
 * @brief Compute routes using a Dijkstra SPF computation and populate
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   762
 * per-node forwarding tables
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   763
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   764
 */
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   765
  virtual void InitializeRoutes ();
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   766
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   767
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   768
 * @brief Debugging routine; allow client code to supply a pre-built LSDB
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   769
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   770
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   771
  void DebugUseLsdb (GlobalRouteManagerLSDB*);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   772
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   773
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   774
 * @brief Debugging routine; call the core SPF from the unit tests
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   775
 * @internal
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   776
 * @param root the root node to start calculations
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   777
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   778
  void DebugSPFCalculate (Ipv4Address root);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   779
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   780
private:
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   781
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   782
 * @brief GlobalRouteManagerImpl copy construction is disallowed.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   783
 * There's no  need for it and a compiler provided shallow copy would be 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   784
 * wrong.
10872
0d7c9bf5f537 [Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10440
diff changeset
   785
 *
0d7c9bf5f537 [Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10440
diff changeset
   786
 * @param srmi object to copy from
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   787
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   788
  GlobalRouteManagerImpl (GlobalRouteManagerImpl& srmi);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   789
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   790
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   791
 * @brief Global Route Manager Implementation assignment operator is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   792
 * disallowed.  There's no  need for it and a compiler provided shallow copy
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   793
 * would be hopelessly wrong.
10872
0d7c9bf5f537 [Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10440
diff changeset
   794
 *
0d7c9bf5f537 [Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10440
diff changeset
   795
 * @param srmi object to copy from
0d7c9bf5f537 [Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10440
diff changeset
   796
 * @returns the copied object
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   797
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   798
  GlobalRouteManagerImpl& operator= (GlobalRouteManagerImpl& srmi);
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   799
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   800
  SPFVertex* m_spfroot; //!< the root node
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   801
  GlobalRouteManagerLSDB* m_lsdb; //!< the Link State DataBase (LSDB) of the Global Route Manager
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   802
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   803
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   804
   * \brief Test if a node is a stub, from an OSPF sense.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   805
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   806
   * If there is only one link of type 1 or 2, then a default route
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   807
   * can safely be added to the next-hop router and SPF does not need
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   808
   * to be run
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   809
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   810
   * \param root the root node
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   811
   * \returns true if the node is a stub
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   812
   */
4628
a5a8c44e4240 bug 521. Ipv4 global routing inefficient. Updated Tom's patch
Craig Dowell <craigdo@ee.washington.edu>
parents: 4616
diff changeset
   813
  bool CheckForStubNode (Ipv4Address root);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   814
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   815
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   816
   * \brief Calculate the shortest path first (SPF) tree
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   817
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   818
   * Equivalent to quagga ospf_spf_calculate
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   819
   * \param root the root node
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   820
   */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   821
  void SPFCalculate (Ipv4Address root);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   822
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   823
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   824
   * \brief Process Stub nodes
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   825
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   826
   * Processing logic from RFC 2328, page 166 and quagga ospf_spf_process_stubs ()
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   827
   * stub link records will exist for point-to-point interfaces and for
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   828
   * broadcast interfaces for which no neighboring router can be found
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   829
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   830
   * \param v vertex to be processed
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   831
   */
3960
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   832
  void SPFProcessStubs (SPFVertex* v);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   833
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   834
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   835
   * \brief Process Autonomous Systems (AS) External LSA
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   836
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   837
   * \param v vertex to be processed
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   838
   * \param extlsa external LSA
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   839
   */
4745
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   840
  void ProcessASExternals (SPFVertex* v, GlobalRoutingLSA* extlsa);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   841
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   842
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   843
   * \brief Examine the links in v's LSA and update the list of candidates with any
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   844
   *        vertices not already on the list
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   845
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   846
   * \internal
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   847
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   848
   * This method is derived from quagga ospf_spf_next ().  See RFC2328 Section
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   849
   * 16.1 (2) for further details.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   850
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   851
   * We're passed a parameter \a v that is a vertex which is already in the SPF
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   852
   * tree.  A vertex represents a router node.  We also get a reference to the
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   853
   * SPF candidate queue, which is a priority queue containing the shortest paths
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   854
   * to the networks we know about.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   855
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   856
   * We examine the links in v's LSA and update the list of candidates with any
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   857
   * vertices not already on the list.  If a lower-cost path is found to a
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   858
   * vertex already on the candidate list, store the new (lower) cost.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   859
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   860
   * \param v the vertex
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   861
   * \param candidate the SPF candidate queue
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   862
   */
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   863
  void SPFNext (SPFVertex* v, CandidateQueue& candidate);
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   864
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   865
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   866
   * \brief Calculate nexthop from root through V (parent) to vertex W (destination)
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   867
   *        with given distance from root->W.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   868
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   869
   * This method is derived from quagga ospf_nexthop_calculation() 16.1.1.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   870
   * For now, this is greatly simplified from the quagga code
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   871
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   872
   * \param v the parent
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   873
   * \param w the destination
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   874
   * \param l the link record
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   875
   * \param distance the target distance
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   876
   * \returns 1 on success
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   877
   */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   878
  int SPFNexthopCalculation (SPFVertex* v, SPFVertex* w, 
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   879
                             GlobalRoutingLinkRecord* l, uint32_t distance);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   880
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   881
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   882
   * \brief Adds a vertex to the list of children *in* each of its parents
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   883
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   884
   * Derived from quagga ospf_vertex_add_parents ()
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   885
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   886
   * This is a somewhat oddly named method (blame quagga).  Although you might
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   887
   * expect it to add a parent *to* something, it actually adds a vertex
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   888
   * to the list of children *in* each of its parents.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   889
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   890
   * Given a pointer to a vertex, it links back to the vertex's parent that it
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   891
   * already has set and adds itself to that vertex's list of children.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   892
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   893
   * \param v the vertex
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   894
   */
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   895
  void SPFVertexAddParent (SPFVertex* v);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   896
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   897
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   898
   * \brief Search for a link between two vertexes.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   899
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   900
   * This method is derived from quagga ospf_get_next_link ()
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   901
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   902
   * First search the Global Router Link Records of vertex \a v for one
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   903
   * representing a point-to point link to vertex \a w.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   904
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   905
   * What is done depends on prev_link.  Contrary to appearances, prev_link just
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   906
   * acts as a flag here.  If prev_link is NULL, we return the first Global
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   907
   * Router Link Record we find that describes a point-to-point link from \a v
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   908
   * to \a w.  If prev_link is not NULL, we return a Global Router Link Record
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   909
   * representing a possible *second* link from \a v to \a w.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   910
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   911
   * \param v first vertex
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   912
   * \param w second vertex
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   913
   * \param prev_link the previous link in the list
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   914
   * \returns the link's record
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   915
   */
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   916
  GlobalRoutingLinkRecord* SPFGetNextLink (SPFVertex* v, SPFVertex* w, 
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   917
                                           GlobalRoutingLinkRecord* prev_link);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   918
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   919
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   920
   * \brief Add a host route to the routing tables
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   921
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   922
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   923
   * This method is derived from quagga ospf_intra_add_router ()
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   924
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   925
   * This is where we are actually going to add the host routes to the routing
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   926
   * tables of the individual nodes.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   927
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   928
   * The vertex passed as a parameter has just been added to the SPF tree.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   929
   * This vertex must have a valid m_root_oid, corresponding to the outgoing
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   930
   * interface on the root router of the tree that is the first hop on the path
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   931
   * to the vertex.  The vertex must also have a next hop address, corresponding
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   932
   * to the next hop on the path to the vertex.  The vertex has an m_lsa field
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   933
   * that has some number of link records.  For each point to point link record,
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   934
   * the m_linkData is the local IP address of the link.  This corresponds to
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   935
   * a destination IP address, reachable from the root, to which we add a host
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   936
   * route.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   937
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   938
   * \param v the vertex
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   939
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   940
   */
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   941
  void SPFIntraAddRouter (SPFVertex* v);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   942
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   943
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   944
   * \brief Add a transit to the routing tables
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   945
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   946
   * \param v the vertex
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   947
   */
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   948
  void SPFIntraAddTransit (SPFVertex* v);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   949
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   950
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   951
   * \brief Add a stub to the routing tables
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   952
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   953
   * \param l the global routing link record
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   954
   * \param v the vertex
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   955
   */
3960
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   956
  void SPFIntraAddStub (GlobalRoutingLinkRecord *l, SPFVertex* v);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   957
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   958
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   959
   * \brief Add an external route to the routing tables
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   960
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   961
   * \param extlsa the external LSA
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   962
   * \param v the vertex
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   963
   */
4745
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   964
  void SPFAddASExternal (GlobalRoutingLSA *extlsa, SPFVertex *v);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   965
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   966
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   967
   * \brief Return the interface number corresponding to a given IP address and mask
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   968
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   969
   * This is a wrapper around GetInterfaceForPrefix(), but we first
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   970
   * have to find the right node pointer to pass to that function.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   971
   * If no such interface is found, return -1 (note:  unit test framework
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   972
   * for routing assumes -1 to be a legal return value)
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   973
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   974
   * \param a the target IP address
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   975
   * \param amask the target subnet mask
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   976
   * \return the outgoing interface number
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10158
diff changeset
   977
   */
4476
4763b00ff02f fix build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   978
  int32_t FindOutgoingInterfaceId (Ipv4Address a, 
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7176
diff changeset
   979
                                   Ipv4Mask amask = Ipv4Mask ("255.255.255.255"));
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   980
};
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   981
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   982
} // namespace ns3
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   983
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   984
#endif /* GLOBAL_ROUTE_MANAGER_IMPL_H */