author | Pedro Silva <pmms@inesctec.pt> |
Wed, 29 Oct 2014 10:12:53 -0700 | |
changeset 11040 | cd2eda848730 |
parent 11020 | e15cd6420301 |
child 11045 | 6024c150e4c8 |
permissions | -rw-r--r-- |
1111 | 1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
1457
562a7017ed93
Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents:
1121
diff
changeset
|
3 |
* Copyright 2007 University of Washington |
562a7017ed93
Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents:
1121
diff
changeset
|
4 |
* |
1111 | 5 |
* This program is free software; you can redistribute it and/or modify |
6 |
* it under the terms of the GNU General Public License version 2 as |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
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:
1121
diff
changeset
|
17 |
* |
562a7017ed93
Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents:
1121
diff
changeset
|
18 |
* Authors: Craig Dowell (craigdo@ee.washington.edu) |
562a7017ed93
Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents:
1121
diff
changeset
|
19 |
* Tom Henderson (tomhend@u.washington.edu) |
1111 | 20 |
*/ |
21 |
||
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1111
diff
changeset
|
22 |
#ifndef GLOBAL_ROUTE_MANAGER_H |
1111 | 23 |
#define GLOBAL_ROUTE_MANAGER_H |
24 |
||
25 |
namespace ns3 { |
|
26 |
||
27 |
/** |
|
28 |
* @brief A global global router |
|
29 |
* |
|
30 |
* This singleton object can query interface each node in the system |
|
31 |
* for a GlobalRouter interface. For those nodes, it fetches one or |
|
32 |
* more Link State Advertisements and stores them in a local database. |
|
33 |
* Then, it can compute shortest paths on a per-node basis to all routers, |
|
34 |
* and finally configure each of the node's forwarding tables. |
|
35 |
* |
|
10158
971f362648c3
Link to RFC num with \RFC{num}
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
6834
diff
changeset
|
36 |
* The design is guided by OSPFv2 \RFC{2328} section 16.1.1 and quagga ospfd. |
1111 | 37 |
*/ |
38 |
class GlobalRouteManager |
|
39 |
{ |
|
40 |
public: |
|
41 |
/** |
|
4616
a84f60b6cd12
bug 600: lower the default routing priority of Ipv4GlobalRouting; move to helper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3960
diff
changeset
|
42 |
* @brief Allocate a 32-bit router ID from monotonically increasing counter. |
a84f60b6cd12
bug 600: lower the default routing priority of Ipv4GlobalRouting; move to helper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3960
diff
changeset
|
43 |
*/ |
a84f60b6cd12
bug 600: lower the default routing priority of Ipv4GlobalRouting; move to helper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3960
diff
changeset
|
44 |
static uint32_t AllocateRouterId (); |
3959
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
45 |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1111
diff
changeset
|
46 |
/** |
3959
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
47 |
* @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
|
48 |
* GlobalRouterInterface |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
49 |
* |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
50 |
*/ |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
51 |
static void DeleteGlobalRoutes (); |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
52 |
|
1111 | 53 |
/** |
54 |
* @brief Build the routing database by gathering Link State Advertisements |
|
55 |
* from each node exporting a GlobalRouter interface. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
56 |
* @internal |
1111 | 57 |
* |
58 |
*/ |
|
59 |
static void BuildGlobalRoutingDatabase (); |
|
60 |
||
61 |
/** |
|
62 |
* @brief Compute routes using a Dijkstra SPF computation and populate |
|
63 |
* per-node forwarding tables |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
64 |
* @internal |
1111 | 65 |
*/ |
66 |
static void InitializeRoutes (); |
|
67 |
||
4616
a84f60b6cd12
bug 600: lower the default routing priority of Ipv4GlobalRouting; move to helper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3960
diff
changeset
|
68 |
private: |
1111 | 69 |
/** |
70 |
* @brief Global Route Manager copy construction is disallowed. There's no |
|
71 |
* need for it and a compiler provided shallow copy would be wrong. |
|
72 |
* |
|
10872
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
73 |
* @param srm object to copy from |
1111 | 74 |
*/ |
75 |
GlobalRouteManager (GlobalRouteManager& srm); |
|
76 |
||
77 |
/** |
|
78 |
* @brief Global Router copy assignment operator is disallowed. There's no |
|
79 |
* need for it and a compiler provided shallow copy would be wrong. |
|
10872
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
80 |
* |
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
81 |
* @param srm object to copy from |
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
82 |
* @returns the copied object |
1111 | 83 |
*/ |
84 |
GlobalRouteManager& operator= (GlobalRouteManager& srm); |
|
85 |
}; |
|
86 |
||
87 |
} // namespace ns3 |
|
88 |
||
89 |
#endif /* GLOBAL_ROUTE_MANAGER_H */ |