src/internet-node/i-ipv4-impl.cc
changeset 524 082ffdd8fbd7
parent 522 d5039448597a
child 540 507eababb124
child 568 e1660959ecbb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/internet-node/i-ipv4-impl.cc	Fri May 04 15:04:07 2007 +0200
@@ -0,0 +1,144 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2007 INRIA
+ * 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
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+#include "i-ipv4-impl.h"
+#include "ipv4.h"
+#include "ns3/assert.h"
+
+namespace ns3 {
+
+IIpv4Impl::IIpv4Impl (Ipv4 *ipv4)
+  : m_ipv4 (ipv4)
+{
+  m_ipv4->Ref ();
+}
+IIpv4Impl::~IIpv4Impl ()
+{
+  NS_ASSERT (m_ipv4 == 0);
+}
+void 
+IIpv4Impl::DoDispose (void)
+{
+  m_ipv4->Unref ();
+  m_ipv4 = 0;
+}
+
+void 
+IIpv4Impl::AddHostRouteTo (Ipv4Address dest, 
+			   Ipv4Address nextHop, 
+			   uint32_t interface)
+{
+  m_ipv4->AddHostRouteTo (dest, nextHop, interface);
+}
+void 
+IIpv4Impl::AddHostRouteTo (Ipv4Address dest, 
+			   uint32_t interface)
+{
+  m_ipv4->AddHostRouteTo (dest, interface);
+}
+void 
+IIpv4Impl::AddNetworkRouteTo (Ipv4Address network, 
+			      Ipv4Mask networkMask, 
+			      Ipv4Address nextHop, 
+			      uint32_t interface)
+{
+  m_ipv4->AddNetworkRouteTo (network, networkMask, nextHop, interface);
+}
+void 
+IIpv4Impl::AddNetworkRouteTo (Ipv4Address network, 
+			      Ipv4Mask networkMask, 
+			      uint32_t interface)
+{
+  m_ipv4->AddNetworkRouteTo (network, networkMask, interface);
+}
+void 
+IIpv4Impl::SetDefaultRoute (Ipv4Address nextHop, 
+			    uint32_t interface)
+{
+  m_ipv4->SetDefaultRoute (nextHop, interface);
+}
+uint32_t 
+IIpv4Impl::GetNRoutes (void)
+{
+  return m_ipv4->GetNRoutes ();
+}
+Ipv4Route *
+IIpv4Impl::GetRoute (uint32_t i)
+{
+  return m_ipv4->GetRoute (i);
+}
+void 
+IIpv4Impl::RemoveRoute (uint32_t i)
+{
+  return m_ipv4->RemoveRoute (i);
+}
+uint32_t 
+IIpv4Impl::AddInterface (NetDevice *device)
+{
+  return m_ipv4->AddInterface (device);
+}
+uint32_t 
+IIpv4Impl::GetNInterfaces (void)
+{
+  return m_ipv4->GetNInterfaces ();
+}
+
+void 
+IIpv4Impl::SetAddress (uint32_t i, Ipv4Address address)
+{
+  m_ipv4->SetAddress (i, address);
+}
+void 
+IIpv4Impl::SetNetworkMask (uint32_t i, Ipv4Mask mask)
+{
+  m_ipv4->SetNetworkMask (i, mask);
+}
+Ipv4Mask 
+IIpv4Impl::GetNetworkMask (uint32_t i) const
+{
+  return m_ipv4->GetNetworkMask (i);
+}
+Ipv4Address 
+IIpv4Impl::GetAddress (uint32_t i) const
+{
+  return m_ipv4->GetAddress (i);
+}
+uint16_t 
+IIpv4Impl::GetMtu (uint32_t i) const
+{
+  return m_ipv4->GetMtu (i);
+}
+bool 
+IIpv4Impl::IsUp (uint32_t i) const
+{
+  return m_ipv4->IsUp (i);
+}
+void 
+IIpv4Impl::SetUp (uint32_t i)
+{
+  m_ipv4->SetUp (i);
+}
+void 
+IIpv4Impl::SetDown (uint32_t i)
+{
+  m_ipv4->SetDown (i);
+}
+
+}//namespace ns3