From 42bc462559411ecd1b08ed255e7d5e9edaf0d653 Mon Sep 17 00:00:00 2001 From: Craig Dowell Date: Fri, 6 Jul 2007 15:06:26 -0700 Subject: [PATCH] static routing --- src/routing/routing-environment.cc | 39 ++++++++++++++++++++++++++++++ src/routing/routing-environment.h | 32 ++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 src/routing/routing-environment.cc create mode 100644 src/routing/routing-environment.h diff --git a/src/routing/routing-environment.cc b/src/routing/routing-environment.cc new file mode 100644 index 000000000..160bd8668 --- /dev/null +++ b/src/routing/routing-environment.cc @@ -0,0 +1,39 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "ns3/debug.h" +#include "ns3/default-value.h" + +#include "routing-environment.h" + +NS_DEBUG_COMPONENT_DEFINE ("RoutingEnvironment"); + +namespace ns3 { +namespace RoutingEnvironment { + +BooleanDefaultValue g_doStaticRoutingDefaultValue ("DoStaticRouting", + "Enable global static routing", false); + + bool +StaticRoutingEnabled(void) +{ + return g_doStaticRoutingDefaultValue.GetValue(); +} + +} // namespace RoutingEnvironment +} // namespace ns3 diff --git a/src/routing/routing-environment.h b/src/routing/routing-environment.h new file mode 100644 index 000000000..abf9da4d8 --- /dev/null +++ b/src/routing/routing-environment.h @@ -0,0 +1,32 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef ROUTING_ENVIRONMENT_H +#define ROUTING_ENVIRONMENT_H + +#include +#include "ns3/object.h" +#include "ns3/ptr.h" +#include "ns3/ipv4-address.h" + +namespace ns3 { +namespace RoutingEnvironment { + +bool StaticRoutingEnabled(void); + +} // namespace RoutingEnvironment +} // namespace ns3 + +#endif /* ROUTING_ENVIRONMENT_H */