src/routing/global-routing/global-route-manager-impl.h
author Tom Henderson <tomh@tomh.org>
Sun, 30 Nov 2008 23:37:12 -0800
changeset 3960 34908804c029
parent 3959 ec65107df095
child 4297 d8501bae8be1
permissions -rw-r--r--
Add processing logic for stub links in global routing code
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>
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    29
#include "ns3/object.h"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    30
#include "ns3/ptr.h"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    31
#include "ns3/ipv4-address.h"
3937
04f9377661b8 convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents: 2250
diff changeset
    32
#include "ns3/node-container.h"
1111
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
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    37
const uint32_t SPF_INFINITY = 0xffffffff;
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
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    43
 * @brief Vertex used in shortest path first (SPF) computations. See RFC 2328,
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
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   259
 * @brief Get the interface ID that should be used to begin forwarding packets
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   260
 * from the root SPFVertex to "this" SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   261
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   262
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   263
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   264
 * 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
   265
 * "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
   266
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   267
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   268
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   269
 * having its routing tables set.  The "this" SPFVertex is the vertex that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   270
 * represents the host or network to which a route is being calculated from 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   271
 * the root.  The outgoing interface that we're asking for is the interface
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   272
 * index on the root node that should be used to start packets along the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   273
 * path to "this" vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   274
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   275
 * When initializing the root SPFVertex, the interface ID is determined by
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   276
 * examining the Global Router Link Records of the Link State Advertisement
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   277
 * generated by the root node's GlobalRouter.  These interfaces are used to 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   278
 * forward packets off of the root's network down those links.  As other 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   279
 * vertices are discovered which are further away from the root, they will 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   280
 * be accessible down one of the paths begun by a Global Router Link Record.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   281
 * 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   282
 * To forward packets to these hosts or networks, the root node must begin
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   283
 * the forwarding process by sending the packets to the interface of that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   284
 * first hop.  This means that the first hop address and interface ID must
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   285
 * be the same for all downstream SPFVertices.  We call this "inheriting"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   286
 * the interface and next hop.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   287
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   288
 * In this method, the root node is asking, "which of my local interfaces
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   289
 * should I use to get a packet to the network or host represented by 'this'
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   290
 * SPFVertex."
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   291
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   292
 * @see GlobalRouter
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   293
 * @see GlobalRoutingLSA
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   294
 * @see GlobalRoutingLinkRecord
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   295
 * @returns The interface index to use when forwarding packets to the host
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   296
 * or network represented by "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   297
 */
2250
18f432098389 InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1457
diff changeset
   298
  uint32_t GetOutgoingTypeId (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
   299
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   300
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   301
 * @brief Set the interface ID that should be used to begin forwarding packets
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   302
 * from the root SPFVertex to "this" SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   303
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   304
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   305
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   306
 * 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
   307
 * "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
   308
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   309
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   310
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   311
 * having its routing tables set.  The "this" SPFVertex is the vertex that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   312
 * represents the host or network to which a route is being calculated from 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   313
 * the root.  The outgoing interface that we're asking for is the interface
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   314
 * index on the root node that should be used to start packets along the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   315
 * path to "this" vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   316
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   317
 * When initializing the root SPFVertex, the interface ID is determined by
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   318
 * examining the Global Router Link Records of the Link State Advertisement
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   319
 * generated by the root node's GlobalRouter.  These interfaces are used to 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   320
 * forward packets off of the root's network down those links.  As other 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   321
 * vertices are discovered which are further away from the root, they will 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   322
 * be accessible down one of the paths begun by a Global Router Link Record.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   323
 * 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   324
 * To forward packets to these hosts or networks, the root node must begin
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   325
 * the forwarding process by sending the packets to the interface of that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   326
 * first hop.  This means that the first hop address and interface ID must
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   327
 * be the same for all downstream SPFVertices.  We call this "inheriting"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   328
 * the interface and next hop.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   329
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   330
 * In this method, we are letting the root node know which of its local
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   331
 * interfaces it should use to get a packet to the network or host represented
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   332
 * by "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   333
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   334
 * @see GlobalRouter
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   335
 * @see GlobalRoutingLSA
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   336
 * @see GlobalRoutingLinkRecord
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   337
 * @param id The interface index to use when forwarding packets to the host or
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   338
 * network represented by "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   339
 */
2250
18f432098389 InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1457
diff changeset
   340
  void SetOutgoingTypeId (uint32_t id);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   341
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   342
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   343
 * @brief Get the IP address that should be used to begin forwarding packets 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   344
 * from the root SPFVertex to "this" SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   345
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   346
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   347
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   348
 * 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
   349
 * "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
   350
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   351
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   352
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   353
 * having its routing tables set.  The "this" SPFVertex is the vertex that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   354
 * represents the host or network to which a route is being calculated from 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   355
 * the root.  The IP address that we're asking for is the address on the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   356
 * remote side of a link off of the root node that should be used as the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   357
 * destination for packets along the path to "this" vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   358
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   359
 * When initializing the root SPFVertex, the IP address used when forwarding
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   360
 * packets is determined by examining the Global Router Link Records of the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   361
 * Link State Advertisement generated by the root node's GlobalRouter.  This
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   362
 * address is used to forward packets off of the root's network down those
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   363
 * links.  As other vertices / nodes are discovered which are further away
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   364
 * from the root, they will be accessible down one of the paths via a link
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   365
 * described by one of these Global Router Link Records.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   366
 * 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   367
 * To forward packets to these hosts or networks, the root node must begin
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   368
 * the forwarding process by sending the packets to a first hop router down
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   369
 * an interface.  This means that the first hop address and interface ID must
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   370
 * be the same for all downstream SPFVertices.  We call this "inheriting"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   371
 * the interface and next hop.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   372
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   373
 * In this method, the root node is asking, "which router should I send a
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   374
 * packet to in order to get that packet to the network or host represented 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   375
 * by 'this' SPFVertex."
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   376
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   377
 * @see GlobalRouter
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   378
 * @see GlobalRoutingLSA
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   379
 * @see GlobalRoutingLinkRecord
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   380
 * @returns The IP address to use when forwarding packets to the host
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   381
 * or network represented by "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   382
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   383
  Ipv4Address GetNextHop (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
   384
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   385
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   386
 * @brief Set the IP address that should be used to begin forwarding packets 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   387
 * from the root SPFVertex to "this" SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   388
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   389
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   390
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   391
 * 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
   392
 * "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
   393
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   394
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   395
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   396
 * having its routing tables set.  The "this" SPFVertex is the vertex that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   397
 * represents the host or network to which a route is being calculated from 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   398
 * the root.  The IP address that we're asking for is the address on the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   399
 * remote side of a link off of the root node that should be used as the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   400
 * destination for packets along the path to "this" vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   401
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   402
 * When initializing the root SPFVertex, the IP address used when forwarding
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   403
 * packets is determined by examining the Global Router Link Records of the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   404
 * Link State Advertisement generated by the root node's GlobalRouter.  This
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   405
 * address is used to forward packets off of the root's network down those
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   406
 * links.  As other vertices / nodes are discovered which are further away
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   407
 * from the root, they will be accessible down one of the paths via a link
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   408
 * described by one of these Global Router Link Records.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   409
 * 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   410
 * To forward packets to these hosts or networks, the root node must begin
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   411
 * the forwarding process by sending the packets to a first hop router down
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   412
 * an interface.  This means that the first hop address and interface ID must
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   413
 * be the same for all downstream SPFVertices.  We call this "inheriting"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   414
 * the interface and next hop.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   415
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   416
 * In this method we are telling the root node which router it should send
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   417
 * should I send a packet to in order to get that packet to the network or
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   418
 * host represented by 'this' SPFVertex."
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
 * @see GlobalRouter
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   421
 * @see GlobalRoutingLSA
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   422
 * @see GlobalRoutingLinkRecord
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   423
 * @param nextHop The IP address to use when forwarding packets to the host
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   424
 * or network represented by "this" SPFVertex.
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
  void SetNextHop (Ipv4Address nextHop);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   427
1111
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
 * @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
   430
 * SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   431
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   432
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   433
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   434
 * 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
   435
 * "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
   436
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   437
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   438
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   439
 * 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
   440
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   441
 * This method returns a pointer to the parent node of "this" SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   442
 * (both of which reside in that SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   443
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   444
 * @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
   445
 * in the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   446
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   447
  SPFVertex* GetParent (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
   448
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   449
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   450
 * @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
   451
 * SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   452
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   453
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   454
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   455
 * 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
   456
 * "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
   457
 * eventually saved in the routing tables of each of the chosen nodes.
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
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   460
 * 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
   461
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   462
 * This method sets the parent pointer of "this" SPFVertex (both of which
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   463
 * reside in that SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   464
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   465
 * @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
   466
 * SPFVertex* in the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   467
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   468
  void SetParent (SPFVertex* parent);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   469
1111
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
 * @brief Get the number of children of "this" SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   472
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   473
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   474
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   475
 * 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
   476
 * "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
   477
 * eventually saved in the routing tables of each of the chosen nodes.
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
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   480
 * 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
   481
 * 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
   482
 * network routes available via that vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   483
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   484
 * This method returns the number of children of "this" SPFVertex (which 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   485
 * reside in the SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   486
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   487
 * @returns The number of children of "this" SPFVertex (which reside in the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   488
 * SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   489
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   490
  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
   491
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   492
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   493
 * @brief Get a borrowed SPFVertex pointer to the specified child of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   494
 * SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   495
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   496
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   497
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   498
 * 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
   499
 * "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
   500
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   501
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   502
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   503
 * 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
   504
 * 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
   505
 * network routes available via that vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   506
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   507
 * This method the number of children of "this" SPFVertex (which reside in
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   508
 * the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   509
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   510
 * @see SPFVertex::GetNChildren
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   511
 * @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
   512
 * child SPFVertex to return.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   513
 * @warning The pointer returned by GetChild () is a borrowed pointer.  You
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   514
 * 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
   515
 * that object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   516
 * @returns A pointer to the specified child SPFVertex (which resides in the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   517
 * SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   518
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   519
  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
   520
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   521
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   522
 * @brief Get a borrowed SPFVertex pointer to the specified child of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   523
 * SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   524
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   525
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   526
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   527
 * 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
   528
 * "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
   529
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   530
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   531
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   532
 * 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
   533
 * 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
   534
 * network routes available via that vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   535
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   536
 * This method the number of children of "this" SPFVertex (which reside in
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   537
 * the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   538
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   539
 * @see SPFVertex::GetNChildren
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   540
 * @warning Ownership of the pointer added to the children of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   541
 * SPFVertex is transferred to the "this" SPFVertex.  You must not delete the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   542
 * (now) child SPFVertex after calling this method.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   543
 * @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
   544
 * be added to the list of children of "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   545
 * @returns The number of children of "this" SPFVertex after the addition of
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   546
 * the new child.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   547
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   548
  uint32_t AddChild (SPFVertex* child);
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   549
3960
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   550
  /**
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   551
   * @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
   552
   *
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   553
   * 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
   554
   * SPF computation
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   555
   * @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
   556
   */ 
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   557
  void SetVertexProcessed (bool value);
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   558
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   559
  /**
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   560
   * @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
   561
   *
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   562
   * 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
   563
   * SPF computation
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   564
   * @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
   565
   */ 
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   566
  bool IsVertexProcessed (void) const;
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   567
private:
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   568
  VertexType m_vertexType;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   569
  Ipv4Address m_vertexId;
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   570
  GlobalRoutingLSA* m_lsa;
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   571
  uint32_t m_distanceFromRoot;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   572
  uint32_t m_rootOif;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   573
  Ipv4Address m_nextHop;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   574
  SPFVertex* m_parent;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   575
  typedef std::list<SPFVertex*> ListOfSPFVertex_t;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   576
  ListOfSPFVertex_t m_children;
3960
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   577
  bool m_vertexProcessed; 
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   578
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   579
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   580
 * @brief The SPFVertex copy construction is disallowed.  There's no need for
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   581
 * it and a compiler provided shallow copy would be wrong.
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
  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
   584
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   585
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   586
 * @brief The SPFVertex copy assignment operator is disallowed.  There's no 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   587
 * need for it and a compiler provided shallow copy would be wrong.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   588
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   589
  SPFVertex& operator= (SPFVertex& v);
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   590
};
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   591
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   592
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   593
 * @brief The Link State DataBase (LSDB) of the Global Route Manager.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   594
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   595
 * Each node in the simulation participating in global routing has a
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   596
 * GlobalRouter interface.  The primary job of this interface is to export
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   597
 * Global Router Link State Advertisements (LSAs).  These advertisements in
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   598
 * turn contain a number of Global Router Link Records that describe the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   599
 * 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
   600
 * also export their own LSAs.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   601
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   602
 * This class implements a searchable database of LSAs gathered from every
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   603
 * router in the simulation.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   604
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   605
class GlobalRouteManagerLSDB
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
public:
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   608
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   609
 * @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
   610
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   611
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   612
 * The database map composing the Link State Database is initialized in
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   613
 * this constructor.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   614
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   615
  GlobalRouteManagerLSDB ();
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   616
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   617
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   618
 * @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
   619
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   620
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   621
 * 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
   622
 * 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
   623
 * release any remaining resources.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   624
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   625
  ~GlobalRouteManagerLSDB ();
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   626
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   627
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   628
 * @brief Insert an IP address / Link State Advertisement pair into the Link
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   629
 * State Database.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   630
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   631
 *
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   632
 * The IPV4 address and the GlobalRoutingLSA given as parameters are converted
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   633
 * to an STL pair and are inserted into the database map.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   634
 *
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   635
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   636
 * @see Ipv4Address
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   637
 * @param addr The IP address associated with the LSA.  Typically the Router 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   638
 * ID.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   639
 * @param lsa A pointer to the Link State Advertisement for the router.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   640
 */
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   641
  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
   642
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   643
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   644
 * @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
   645
 * link state ID (address).
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   646
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   647
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   648
 * 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
   649
 * GlobalRoutingLSA is returned.
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   650
 *
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   651
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   652
 * @see Ipv4Address
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   653
 * @param addr The IP address associated with the LSA.  Typically the Router 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   654
 * ID.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   655
 * @returns A pointer to the Link State Advertisement for the router specified
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   656
 * by the IP address addr.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   657
 */
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   658
  GlobalRoutingLSA* GetLSA (Ipv4Address addr) const;
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   659
/**
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   660
 * @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
   661
 * 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
   662
 * 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
   663
 * of the TransitNetwork link record.
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   664
 * @internal
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   665
 *
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   666
 * @see GetLSA
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   667
 * @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
   668
 * @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
   669
 * by the IP address addr.
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   670
 * ID.
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   671
 */
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   672
  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
   673
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   674
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   675
 * @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
   676
 * @internal
1111
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
 * 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
   679
 * contained Link State Advertisements to LSA_SPF_NOT_EXPLORED.  This is done
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   680
 * 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
   681
 * that will reference the LSAs during the calculation.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   682
 *
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   683
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   684
 * @see SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   685
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   686
  void Initialize ();
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   687
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   688
private:
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   689
  typedef std::map<Ipv4Address, GlobalRoutingLSA*> LSDBMap_t;
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   690
  typedef std::pair<Ipv4Address, GlobalRoutingLSA*> LSDBPair_t;
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   691
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   692
  LSDBMap_t m_database;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   693
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   694
 * @brief GlobalRouteManagerLSDB copy construction is disallowed.  There's no 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   695
 * need for it and a compiler provided shallow copy would be wrong.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   696
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   697
  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
   698
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   699
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   700
 * @brief The SPFVertex copy assignment operator is disallowed.  There's no 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   701
 * need for it and a compiler provided shallow copy would be wrong.
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
  GlobalRouteManagerLSDB& operator= (GlobalRouteManagerLSDB& lsdb);
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   704
};
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   705
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   706
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   707
 * @brief A global router implementation.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   708
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   709
 * This singleton object can query interface each node in the system
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   710
 * for a GlobalRouter interface.  For those nodes, it fetches one or
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   711
 * more Link State Advertisements and stores them in a local database.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   712
 * 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
   713
 * and finally configure each of the node's forwarding tables.
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
 * The design is guided by OSPFv2 RFC 2328 section 16.1.1 and quagga ospfd.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   716
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   717
class GlobalRouteManagerImpl
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   718
{
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   719
public:
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   720
  GlobalRouteManagerImpl ();
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   721
  virtual ~GlobalRouteManagerImpl ();
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   722
/**
3959
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   723
 * @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
   724
 * GlobalRouterInterface
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   725
 *
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   726
 * TODO:  separate manually assigned static routes from static routes that
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   727
 * 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
   728
 * @internal
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   729
 *
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   730
 */
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   731
  virtual void DeleteGlobalRoutes ();
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   732
/**
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   733
 * @brief Select which nodes in the system are to be router nodes and 
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   734
 * aggregate the appropriate interfaces onto those nodes.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   735
 * @internal
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   736
 *
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   737
 */
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   738
  virtual void SelectRouterNodes ();
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   739
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   740
/**
3937
04f9377661b8 convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents: 2250
diff changeset
   741
 * @brief Select which nodes in the system are to be router nodes and 
04f9377661b8 convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents: 2250
diff changeset
   742
 * aggregate the appropriate interfaces onto those nodes.
04f9377661b8 convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents: 2250
diff changeset
   743
 * @internal
04f9377661b8 convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents: 2250
diff changeset
   744
 *
04f9377661b8 convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents: 2250
diff changeset
   745
 */
04f9377661b8 convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents: 2250
diff changeset
   746
  virtual void SelectRouterNodes (NodeContainer c);
04f9377661b8 convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents: 2250
diff changeset
   747
04f9377661b8 convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents: 2250
diff changeset
   748
/**
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   749
 * @brief Build the routing database by gathering Link State Advertisements
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   750
 * from each node exporting a GlobalRouter interface.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   751
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   752
 */
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   753
  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
   754
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   755
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   756
 * @brief Compute routes using a Dijkstra SPF computation and populate
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   757
 * per-node forwarding tables
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   758
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   759
 */
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   760
  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
   761
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   762
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   763
 * @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
   764
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   765
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   766
  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
   767
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   768
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   769
 * @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
   770
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   771
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   772
  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
   773
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   774
private:
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   775
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   776
 * @brief GlobalRouteManagerImpl copy construction is disallowed.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   777
 * 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
   778
 * wrong.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   779
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   780
  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
   781
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   782
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   783
 * @brief Global Route Manager Implementation assignment operator is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   784
 * 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
   785
 * would be hopelessly wrong.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   786
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   787
  GlobalRouteManagerImpl& operator= (GlobalRouteManagerImpl& srmi);
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   788
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   789
  SPFVertex* m_spfroot;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   790
  GlobalRouteManagerLSDB* m_lsdb;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   791
  void SPFCalculate (Ipv4Address root);
3960
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   792
  void SPFProcessStubs (SPFVertex* v);
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   793
  void SPFNext (SPFVertex*, CandidateQueue&);
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   794
  int SPFNexthopCalculation (SPFVertex* v, SPFVertex* w, 
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   795
    GlobalRoutingLinkRecord* l, 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
   796
  void SPFVertexAddParent (SPFVertex* v);
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   797
  GlobalRoutingLinkRecord* SPFGetNextLink (SPFVertex* v, SPFVertex* w, 
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   798
    GlobalRoutingLinkRecord* prev_link);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   799
  void SPFIntraAddRouter (SPFVertex* v);
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   800
  void SPFIntraAddTransit (SPFVertex* v);
3960
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   801
  void SPFIntraAddStub (GlobalRoutingLinkRecord *l, SPFVertex* v);
2250
18f432098389 InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1457
diff changeset
   802
  uint32_t FindOutgoingTypeId (Ipv4Address a, 
1316
f357c6a2bb37 Provide two new Ipv4 convenience functions: GetIfIndexByIpv4Address() and GetIpv4RouteToDestination (), and align global routing code to use the first function
Tom Henderson <tomh@tomh.org>
parents: 1278
diff changeset
   803
    Ipv4Mask amask = Ipv4Mask("255.255.255.255"));
3959
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   804
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   805
  // Local cache of the Ipv4GlobalRouting objects, indexed by nodeId
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   806
  typedef std::list< std::pair< uint32_t, Ptr<Ipv4GlobalRouting> > > Ipv4GlobalRoutingList;
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   807
  void AddGlobalRoutingProtocol (uint32_t nodeId, Ptr<Ipv4GlobalRouting> proto);
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   808
  Ptr<Ipv4GlobalRouting> GetGlobalRoutingProtocol (uint32_t nodeId);
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   809
  Ipv4GlobalRoutingList m_routingProtocols;
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   810
};
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   811
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   812
} // namespace ns3
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   813
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   814
#endif /* GLOBAL_ROUTE_MANAGER_IMPL_H */