author | Kristijan Lenkovi? <k.lenkovic@me.com> |
Sat, 20 Apr 2013 00:29:36 +0200 | |
changeset 9704 | 1db7690f8e8f |
parent 7176 | 9f2663992e99 |
child 10968 | 2d29fee2b7b8 |
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 |
* |
1505 | 18 |
* Author: Tom Henderson (tomhend@u.washington.edu) |
1111 | 19 |
*/ |
20 |
||
21 |
#include "ns3/assert.h" |
|
1505 | 22 |
#include "ns3/log.h" |
1111 | 23 |
#include "ns3/simulation-singleton.h" |
24 |
#include "global-route-manager.h" |
|
25 |
#include "global-route-manager-impl.h" |
|
26 |
||
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenkovi? <k.lenkovic@me.com>
parents:
7176
diff
changeset
|
27 |
NS_LOG_COMPONENT_DEFINE ("GlobalRouteManager"); |
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenkovi? <k.lenkovic@me.com>
parents:
7176
diff
changeset
|
28 |
|
1111 | 29 |
namespace ns3 { |
30 |
||
31 |
// --------------------------------------------------------------------------- |
|
32 |
// |
|
33 |
// GlobalRouteManager Implementation |
|
34 |
// |
|
35 |
// --------------------------------------------------------------------------- |
|
36 |
||
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
37 |
void |
3959
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
38 |
GlobalRouteManager::DeleteGlobalRoutes () |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
39 |
{ |
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenkovi? <k.lenkovic@me.com>
parents:
7176
diff
changeset
|
40 |
NS_LOG_FUNCTION_NOARGS (); |
3959
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
41 |
SimulationSingleton<GlobalRouteManagerImpl>::Get ()-> |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
42 |
DeleteGlobalRoutes (); |
3959
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
43 |
} |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
44 |
|
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
45 |
void |
3937
04f9377661b8
convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents:
1505
diff
changeset
|
46 |
GlobalRouteManager::BuildGlobalRoutingDatabase (void) |
1111 | 47 |
{ |
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenkovi? <k.lenkovic@me.com>
parents:
7176
diff
changeset
|
48 |
NS_LOG_FUNCTION_NOARGS (); |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1111
diff
changeset
|
49 |
SimulationSingleton<GlobalRouteManagerImpl>::Get ()-> |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
50 |
BuildGlobalRoutingDatabase (); |
1111 | 51 |
} |
52 |
||
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
53 |
void |
3937
04f9377661b8
convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents:
1505
diff
changeset
|
54 |
GlobalRouteManager::InitializeRoutes (void) |
1111 | 55 |
{ |
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenkovi? <k.lenkovic@me.com>
parents:
7176
diff
changeset
|
56 |
NS_LOG_FUNCTION_NOARGS (); |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1111
diff
changeset
|
57 |
SimulationSingleton<GlobalRouteManagerImpl>::Get ()-> |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
58 |
InitializeRoutes (); |
1111 | 59 |
} |
60 |
||
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
61 |
uint32_t |
3937
04f9377661b8
convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents:
1505
diff
changeset
|
62 |
GlobalRouteManager::AllocateRouterId (void) |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1111
diff
changeset
|
63 |
{ |
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenkovi? <k.lenkovic@me.com>
parents:
7176
diff
changeset
|
64 |
NS_LOG_FUNCTION_NOARGS (); |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1111
diff
changeset
|
65 |
static uint32_t routerId = 0; |
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1111
diff
changeset
|
66 |
return routerId++; |
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1111
diff
changeset
|
67 |
} |
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1111
diff
changeset
|
68 |
|
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1111
diff
changeset
|
69 |
|
1111 | 70 |
} // namespace ns3 |