src/routing/static-route-manager.h
author Tom Henderson <tomh@tomh.org>
Wed, 11 Jul 2007 23:43:09 -0700
changeset 1080 82a244f82f80
parent 1079 89b08d079fb6
child 1082 a4ab78763094
permissions -rw-r--r--
finish SPFNext logic; add declaration for NexthopCalculation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1045
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     2
/*
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     3
 * This program is free software; you can redistribute it and/or modify
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     4
 * it under the terms of the GNU General Public License version 2 as
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     5
 * published by the Free Software Foundation;
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     6
 *
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     7
 * This program is distributed in the hope that it will be useful,
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    10
 * GNU General Public License for more details.
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    11
 *
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    12
 * You should have received a copy of the GNU General Public License
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    13
 * along with this program; if not, write to the Free Software
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    14
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    15
 */
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    16
#ifndef STATIC_ROUTE_MANAGER_H
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    17
#define STATIC_ROUTE_MANAGER_H
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    18
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    19
#include <stdint.h>
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    20
#include <list>
1068
019229673fb4 SPFVertex Priority Queue
Craig Dowell <craigdo@ee.washington.edu>
parents: 1067
diff changeset
    21
#include <queue>
1053
57341f5736a7 Add LSDB functions
Tom Henderson <tomh@tomh.org>
parents: 1045
diff changeset
    22
#include <map>
1045
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    23
#include "ns3/object.h"
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    24
#include "ns3/ptr.h"
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    25
#include "ns3/ipv4-address.h"
1053
57341f5736a7 Add LSDB functions
Tom Henderson <tomh@tomh.org>
parents: 1045
diff changeset
    26
#include "static-router.h"
1045
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    27
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    28
namespace ns3 {
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    29
1062
ea9b7839421d SPFVertex constructor
Tom Henderson <tomh@tomh.org>
parents: 1059
diff changeset
    30
const uint32_t SPF_INFINITY = 0xffffffff;
ea9b7839421d SPFVertex constructor
Tom Henderson <tomh@tomh.org>
parents: 1059
diff changeset
    31
1077
ee75a75b51b3 Replace SPFVertexPriorityQueue with CandidateQueue
Tom Henderson <tomh@tomh.org>
parents: 1076
diff changeset
    32
class CandidateQueue;
ee75a75b51b3 Replace SPFVertexPriorityQueue with CandidateQueue
Tom Henderson <tomh@tomh.org>
parents: 1076
diff changeset
    33
1045
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    34
/**
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    35
 * \brief Vertex used in shortest path first (SPF) computations
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    36
 *
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    37
 * See RFC 2328, Section 16.
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    38
 */
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    39
class SPFVertex
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    40
{
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    41
public:
1062
ea9b7839421d SPFVertex constructor
Tom Henderson <tomh@tomh.org>
parents: 1059
diff changeset
    42
  SPFVertex();
1079
89b08d079fb6 Non-default constructor for SPFVertex
Tom Henderson <tomh@tomh.org>
parents: 1078
diff changeset
    43
  SPFVertex(StaticRouterLSA*);
1058
de579b1ff195 convert LSDB to class SPFVertex
Tom Henderson <tomh@tomh.org>
parents: 1053
diff changeset
    44
  ~SPFVertex();
1063
98fe4e27c65a Initialize LSDB for SPF runs
Tom Henderson <tomh@tomh.org>
parents: 1062
diff changeset
    45
  void Initialize ();
1058
de579b1ff195 convert LSDB to class SPFVertex
Tom Henderson <tomh@tomh.org>
parents: 1053
diff changeset
    46
1045
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    47
  enum VertexType {
1062
ea9b7839421d SPFVertex constructor
Tom Henderson <tomh@tomh.org>
parents: 1059
diff changeset
    48
    VertexUnknown = 0,
ea9b7839421d SPFVertex constructor
Tom Henderson <tomh@tomh.org>
parents: 1059
diff changeset
    49
    VertexRouter,
1045
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    50
    VertexNetwork
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    51
  } m_vertexType;
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    52
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    53
  Ipv4Address m_vertexId;
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    54
1058
de579b1ff195 convert LSDB to class SPFVertex
Tom Henderson <tomh@tomh.org>
parents: 1053
diff changeset
    55
  StaticRouterLSA* m_lsa;  // This pointer owns LSA for mem. mgmt purposes
1045
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    56
1072
7002990baec9 Add candidate list (priority queue)
Tom Henderson <tomh@tomh.org>
parents: 1068
diff changeset
    57
  // XXX not sure exactly what data structure is needed here
7002990baec9 Add candidate list (priority queue)
Tom Henderson <tomh@tomh.org>
parents: 1068
diff changeset
    58
  // need to keep track of previous vertex
1045
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    59
  typedef std::list<SPFVertex> type_listOfSPFVertex;
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    60
  type_listOfSPFVertex m_parents;
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    61
  type_listOfSPFVertex m_children;
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    62
  type_listOfSPFVertex::iterator m_iter;
1058
de579b1ff195 convert LSDB to class SPFVertex
Tom Henderson <tomh@tomh.org>
parents: 1053
diff changeset
    63
de579b1ff195 convert LSDB to class SPFVertex
Tom Henderson <tomh@tomh.org>
parents: 1053
diff changeset
    64
  uint32_t m_distanceFromRoot;
1062
ea9b7839421d SPFVertex constructor
Tom Henderson <tomh@tomh.org>
parents: 1059
diff changeset
    65
1045
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    66
};
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    67
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    68
/**
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    69
 * \brief The Link State DataBase (LSDB) of a static router
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    70
 */
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    71
class StaticRouteManagerLSDB
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    72
{
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    73
public:
1053
57341f5736a7 Add LSDB functions
Tom Henderson <tomh@tomh.org>
parents: 1045
diff changeset
    74
  ~StaticRouteManagerLSDB ();
1067
704eb2583865 Iterate link records (16.1(2))
Tom Henderson <tomh@tomh.org>
parents: 1063
diff changeset
    75
  void Insert(Ipv4Address addr, StaticRouterLSA* lsa);
1076
1fa07692b5ca Make LSDB back into a storage for LSAs
Tom Henderson <tomh@tomh.org>
parents: 1072
diff changeset
    76
  StaticRouterLSA* GetLSA (Ipv4Address addr);
1063
98fe4e27c65a Initialize LSDB for SPF runs
Tom Henderson <tomh@tomh.org>
parents: 1062
diff changeset
    77
  /**
98fe4e27c65a Initialize LSDB for SPF runs
Tom Henderson <tomh@tomh.org>
parents: 1062
diff changeset
    78
   * \brief Set all SPFVertex to an initialized state, for SPF computation
98fe4e27c65a Initialize LSDB for SPF runs
Tom Henderson <tomh@tomh.org>
parents: 1062
diff changeset
    79
   */
1076
1fa07692b5ca Make LSDB back into a storage for LSAs
Tom Henderson <tomh@tomh.org>
parents: 1072
diff changeset
    80
#if 0
1063
98fe4e27c65a Initialize LSDB for SPF runs
Tom Henderson <tomh@tomh.org>
parents: 1062
diff changeset
    81
  void Initialize ();
1076
1fa07692b5ca Make LSDB back into a storage for LSAs
Tom Henderson <tomh@tomh.org>
parents: 1072
diff changeset
    82
#endif
1053
57341f5736a7 Add LSDB functions
Tom Henderson <tomh@tomh.org>
parents: 1045
diff changeset
    83
1076
1fa07692b5ca Make LSDB back into a storage for LSAs
Tom Henderson <tomh@tomh.org>
parents: 1072
diff changeset
    84
  typedef std::map<Ipv4Address, StaticRouterLSA*> LSDBMap_t;
1fa07692b5ca Make LSDB back into a storage for LSAs
Tom Henderson <tomh@tomh.org>
parents: 1072
diff changeset
    85
  typedef std::pair<Ipv4Address, StaticRouterLSA*> LSDBPair_t;
1053
57341f5736a7 Add LSDB functions
Tom Henderson <tomh@tomh.org>
parents: 1045
diff changeset
    86
  LSDBMap_t m_database;
1045
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    87
};
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    88
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    89
/**
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    90
 * \brief A global static router
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    91
 *
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    92
 * This singleton object can query interface each node in the system
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    93
 * for a StaticRouter interface.  For those nodes, it fetches one or
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    94
 * more LSAs and stores them in a local database.  Then, it
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    95
 * can compute shortest paths on a per-node basis to all routers, and
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    96
 * finally configure each of the node's forwarding tables.
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    97
 *
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    98
 * The design is guided by OSPFv2 RFC 2328 section 16.1.1
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    99
 * and quagga ospfd
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   100
 */
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   101
class StaticRouteManager : public Object
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   102
{
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   103
public:
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   104
  static const InterfaceId iid;
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   105
  StaticRouteManager ();
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   106
  /**
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   107
   * \brief Build routing database by gathering LSA from each routing node
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   108
   */
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   109
  virtual void BuildStaticRoutingDatabase();
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   110
  /**
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   111
   * \brief Compute routes using Dijkstra SPF computation, and populate
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   112
   *        per-node forwarding tables
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   113
   */
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   114
  virtual void InitializeRoutes();
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   115
1059
2ebd3bb3da3e more plumbing around SPFCalculate()
Tom Henderson <tomh@tomh.org>
parents: 1058
diff changeset
   116
  /**
2ebd3bb3da3e more plumbing around SPFCalculate()
Tom Henderson <tomh@tomh.org>
parents: 1058
diff changeset
   117
   * \brief Debugging routine; allow client code to supply a pre-built LSDB
2ebd3bb3da3e more plumbing around SPFCalculate()
Tom Henderson <tomh@tomh.org>
parents: 1058
diff changeset
   118
   */
2ebd3bb3da3e more plumbing around SPFCalculate()
Tom Henderson <tomh@tomh.org>
parents: 1058
diff changeset
   119
  void DebugUseLsdb (StaticRouteManagerLSDB*);
2ebd3bb3da3e more plumbing around SPFCalculate()
Tom Henderson <tomh@tomh.org>
parents: 1058
diff changeset
   120
  /**
2ebd3bb3da3e more plumbing around SPFCalculate()
Tom Henderson <tomh@tomh.org>
parents: 1058
diff changeset
   121
   * \brief Debugging routine; call the core SPF from the unit tests
2ebd3bb3da3e more plumbing around SPFCalculate()
Tom Henderson <tomh@tomh.org>
parents: 1058
diff changeset
   122
   */
2ebd3bb3da3e more plumbing around SPFCalculate()
Tom Henderson <tomh@tomh.org>
parents: 1058
diff changeset
   123
  void DebugSPFCalculate (Ipv4Address root);
2ebd3bb3da3e more plumbing around SPFCalculate()
Tom Henderson <tomh@tomh.org>
parents: 1058
diff changeset
   124
2ebd3bb3da3e more plumbing around SPFCalculate()
Tom Henderson <tomh@tomh.org>
parents: 1058
diff changeset
   125
  virtual ~StaticRouteManager ();
1067
704eb2583865 Iterate link records (16.1(2))
Tom Henderson <tomh@tomh.org>
parents: 1063
diff changeset
   126
1045
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   127
protected:
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   128
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   129
private:
1059
2ebd3bb3da3e more plumbing around SPFCalculate()
Tom Henderson <tomh@tomh.org>
parents: 1058
diff changeset
   130
  StaticRouteManagerLSDB* m_lsdb;
2ebd3bb3da3e more plumbing around SPFCalculate()
Tom Henderson <tomh@tomh.org>
parents: 1058
diff changeset
   131
  void SPFCalculate (Ipv4Address root);
1077
ee75a75b51b3 Replace SPFVertexPriorityQueue with CandidateQueue
Tom Henderson <tomh@tomh.org>
parents: 1076
diff changeset
   132
  void SPFNext (SPFVertex*, CandidateQueue&);
1080
82a244f82f80 finish SPFNext logic; add declaration for NexthopCalculation
Tom Henderson <tomh@tomh.org>
parents: 1079
diff changeset
   133
  int SPFNexthopCalculation (SPFVertex* v, SPFVertex* w, 
82a244f82f80 finish SPFNext logic; add declaration for NexthopCalculation
Tom Henderson <tomh@tomh.org>
parents: 1079
diff changeset
   134
    StaticRouterLinkRecord* l, uint32_t distance);
1045
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   135
};
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   136
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   137
} // namespace ns3
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   138
c2c43e021fb7 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   139
#endif /* STATIC_ROUTE_MANAGER_H */