src/routing/routing-environment.cc
author Tom Henderson <tomh@tomh.org>
Fri, 13 Jul 2007 13:33:56 -0700
changeset 1086 43ea23238ce8
parent 1056 dc7924932154
permissions -rw-r--r--
Debugged; works
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1036
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     2
/*
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     3
 * All rights reserved.
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     4
 *
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     8
 *
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    12
 * GNU General Public License for more details.
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    13
 *
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    17
 */
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    18
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    19
#include "ns3/debug.h"
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    20
#include "ns3/default-value.h"
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    21
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    22
#include "routing-environment.h"
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    23
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    24
NS_DEBUG_COMPONENT_DEFINE ("RoutingEnvironment");
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    25
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    26
namespace ns3 {
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    27
namespace RoutingEnvironment {
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    28
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    29
BooleanDefaultValue g_doStaticRoutingDefaultValue ("DoStaticRouting", 
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    30
  "Enable global static routing", false);
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    31
1056
dc7924932154 checkpoint
Craig Dowell <craigdo@ee.washington.edu>
parents: 1036
diff changeset
    32
  bool
1036
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    33
StaticRoutingEnabled(void)
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    34
{
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    35
  return g_doStaticRoutingDefaultValue.GetValue();
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    36
}
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    37
1056
dc7924932154 checkpoint
Craig Dowell <craigdo@ee.washington.edu>
parents: 1036
diff changeset
    38
  uint32_t
dc7924932154 checkpoint
Craig Dowell <craigdo@ee.washington.edu>
parents: 1036
diff changeset
    39
AllocateRouterId(void)
dc7924932154 checkpoint
Craig Dowell <craigdo@ee.washington.edu>
parents: 1036
diff changeset
    40
{
dc7924932154 checkpoint
Craig Dowell <craigdo@ee.washington.edu>
parents: 1036
diff changeset
    41
  static uint32_t routerId = 0;
1086
43ea23238ce8 Debugged; works
Tom Henderson <tomh@tomh.org>
parents: 1056
diff changeset
    42
  return routerId++;
1056
dc7924932154 checkpoint
Craig Dowell <craigdo@ee.washington.edu>
parents: 1036
diff changeset
    43
}
dc7924932154 checkpoint
Craig Dowell <craigdo@ee.washington.edu>
parents: 1036
diff changeset
    44
1036
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    45
} // namespace RoutingEnvironment
3e026cca9e1e static routing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    46
} // namespace ns3