s/ns3::Udp/ns3::UdpSocketFactory
authorTom Henderson <tomh@tomh.org>
Sat, 17 May 2008 12:08:20 -0700
changeset 3125 d2d8a36cfd23
parent 3124 473e59b5e141
child 3126 68d35477a842
s/ns3::Udp/ns3::UdpSocketFactory
examples/csma-broadcast.cc
examples/csma-multicast.cc
examples/csma-one-subnet.cc
examples/mixed-global-routing.cc
examples/mixed-wireless.cc
examples/simple-alternate-routing.cc
examples/simple-error-model.cc
examples/simple-global-routing.cc
examples/simple-point-to-point-olsr.cc
samples/main-simple.cc
src/applications/onoff/onoff-application.cc
src/applications/packet-sink/packet-sink.cc
src/applications/udp-echo/udp-echo-client.cc
src/applications/udp-echo/udp-echo-server.cc
src/core/type-id.cc
src/helper/packet-sink-helper.cc
src/internet-node/udp-impl.cc
src/internet-node/udp-impl.h
src/internet-node/udp-socket.cc
src/internet-node/udp-socket.h
src/node/udp-socket-factory.cc
src/node/udp-socket-factory.h
src/node/udp.cc
src/node/udp.h
src/node/wscript
src/routing/olsr/olsr-agent-impl.cc
utils/print-introspected-doxygen.cc
--- a/examples/csma-broadcast.cc	Sat May 17 11:15:02 2008 -0700
+++ b/examples/csma-broadcast.cc	Sat May 17 12:08:20 2008 -0700
@@ -93,7 +93,7 @@
   // Create the OnOff application to send UDP datagrams of size
   // 512 bytes (default) at a rate of 500 Kb/s (default) from n0
   NS_LOG_INFO ("Create Applications.");
-  OnOffHelper onoff ("ns3::Udp", 
+  OnOffHelper onoff ("ns3::UdpSocketFactory", 
     Address (InetSocketAddress (Ipv4Address ("255.255.255.255"), port)));
   onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
   onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
@@ -104,7 +104,7 @@
   app.Stop (Seconds (10.0));
   
   // Create an optional packet sink to receive these packets
-  PacketSinkHelper sink ("ns3::Udp",
+  PacketSinkHelper sink ("ns3::UdpSocketFactory",
     Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
   sink.Install (c0.Get (1));
   sink.Install (c1.Get (1));
--- a/examples/csma-multicast.cc	Sat May 17 11:15:02 2008 -0700
+++ b/examples/csma-multicast.cc	Sat May 17 12:08:20 2008 -0700
@@ -140,7 +140,7 @@
 
   // Configure a multicast packet generator that generates a packet
   // every few seconds
-  OnOffHelper onoff ("ns3::Udp", 
+  OnOffHelper onoff ("ns3::UdpSocketFactory", 
     Address (InetSocketAddress (multicastGroup, multicastPort)));
   onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
   onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
@@ -156,7 +156,7 @@
   srcC.Stop (Seconds(10.));
 
   // Create an optional packet sink to receive these packets
-  PacketSinkHelper sink ("ns3::Udp",
+  PacketSinkHelper sink ("ns3::UdpSocketFactory",
                          InetSocketAddress (Ipv4Address::GetAny(), multicastPort));
 
   ApplicationContainer sinkC = sink.Install (c1.Get (2)); // Node n4 
--- a/examples/csma-one-subnet.cc	Sat May 17 11:15:02 2008 -0700
+++ b/examples/csma-one-subnet.cc	Sat May 17 12:08:20 2008 -0700
@@ -95,7 +95,7 @@
   NS_LOG_INFO ("Create Applications.");
   uint16_t port = 9;   // Discard port (RFC 863)
 
-  OnOffHelper onoff ("ns3::Udp", 
+  OnOffHelper onoff ("ns3::UdpSocketFactory", 
     Address (InetSocketAddress (Ipv4Address ("10.1.1.2"), port)));
   onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
   onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
@@ -106,7 +106,7 @@
   app.Stop (Seconds (10.0));
 
   // Create an optional packet sink to receive these packets
-  PacketSinkHelper sink ("ns3::Udp",
+  PacketSinkHelper sink ("ns3::UdpSocketFactory",
     Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
   sink.Install (c.Get (1));
 
--- a/examples/mixed-global-routing.cc	Sat May 17 11:15:02 2008 -0700
+++ b/examples/mixed-global-routing.cc	Sat May 17 12:08:20 2008 -0700
@@ -112,7 +112,7 @@
   // 210 bytes at a rate of 448 Kb/s
   NS_LOG_INFO ("Create Applications.");
   uint16_t port = 9;   // Discard port (RFC 863)
-  OnOffHelper onoff ("ns3::Udp",
+  OnOffHelper onoff ("ns3::UdpSocketFactory",
                      InetSocketAddress (i5i6.GetAddress (1), port));
   onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
   onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
--- a/examples/mixed-wireless.cc	Sat May 17 11:15:02 2008 -0700
+++ b/examples/mixed-wireless.cc	Sat May 17 12:08:20 2008 -0700
@@ -305,7 +305,7 @@
   Ptr<Node> appSink = NodeList::GetNode (13);  
   Ipv4Address remoteAddr = Ipv4Address ("172.16.0.5");
 
-  OnOffHelper onoff ("ns3::Udp", 
+  OnOffHelper onoff ("ns3::UdpSocketFactory", 
                      Address (InetSocketAddress (remoteAddr, port)));
   onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
   onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
@@ -314,7 +314,7 @@
   apps.Stop (Seconds (20.0));
 
   // Create a packet sink to receive these packets
-  PacketSinkHelper sink ("ns3::Udp", 
+  PacketSinkHelper sink ("ns3::UdpSocketFactory", 
                          InetSocketAddress (Ipv4Address::GetAny (), port));
   apps = sink.Install (appSink);
   apps.Start (Seconds (3.0));
--- a/examples/simple-alternate-routing.cc	Sat May 17 11:15:02 2008 -0700
+++ b/examples/simple-alternate-routing.cc	Sat May 17 12:08:20 2008 -0700
@@ -141,7 +141,7 @@
   uint16_t port = 9;   // Discard port (RFC 863)
 
   // Create a flow from n3 to n1, starting at time 1.1 seconds
-  OnOffHelper onoff ("ns3::Udp",
+  OnOffHelper onoff ("ns3::UdpSocketFactory",
     Address (InetSocketAddress (i1i2.GetAddress (0), port)));
   onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
   onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
@@ -151,7 +151,7 @@
   apps.Start (Seconds (10.0));
 
   // Create a packet sink to receive these packets
-  PacketSinkHelper sink ("ns3::Udp",
+  PacketSinkHelper sink ("ns3::UdpSocketFactory",
     Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
   apps = sink.Install (c.Get (1));
   apps.Start (Seconds (1.1));
--- a/examples/simple-error-model.cc	Sat May 17 11:15:02 2008 -0700
+++ b/examples/simple-error-model.cc	Sat May 17 12:08:20 2008 -0700
@@ -122,7 +122,7 @@
   NS_LOG_INFO ("Create Applications.");
   uint16_t port = 9;   // Discard port (RFC 863)
 
-  OnOffHelper onoff ("ns3::Udp",
+  OnOffHelper onoff ("ns3::UdpSocketFactory",
     Address (InetSocketAddress (i3i2.GetAddress (1), port)));
   onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable(1)));
   onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable(0)));
@@ -132,7 +132,7 @@
   apps.Stop (Seconds(10.0));
 
   // Create an optional packet sink to receive these packets
-  PacketSinkHelper sink ("ns3::Udp",
+  PacketSinkHelper sink ("ns3::UdpSocketFactory",
     Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
   apps = sink.Install (c.Get (3));
   apps.Start (Seconds (1.0));
--- a/examples/simple-global-routing.cc	Sat May 17 11:15:02 2008 -0700
+++ b/examples/simple-global-routing.cc	Sat May 17 12:08:20 2008 -0700
@@ -122,7 +122,7 @@
   // 210 bytes at a rate of 448 Kb/s
   NS_LOG_INFO ("Create Applications.");
   uint16_t port = 9;   // Discard port (RFC 863)
-  OnOffHelper onoff ("ns3::Udp", 
+  OnOffHelper onoff ("ns3::UdpSocketFactory", 
     Address (InetSocketAddress (i3i2.GetAddress (0), port)));
   onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
   onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
@@ -131,7 +131,7 @@
   apps.Stop (Seconds (10.0));
 
   // Create a packet sink to receive these packets
-  PacketSinkHelper sink ("ns3::Udp",
+  PacketSinkHelper sink ("ns3::UdpSocketFactory",
     Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
   apps = sink.Install (c.Get (3));
   apps.Start (Seconds (1.0));
--- a/examples/simple-point-to-point-olsr.cc	Sat May 17 11:15:02 2008 -0700
+++ b/examples/simple-point-to-point-olsr.cc	Sat May 17 12:08:20 2008 -0700
@@ -127,7 +127,7 @@
   NS_LOG_INFO ("Create Applications.");
   uint16_t port = 9;   // Discard port (RFC 863)
 
-  OnOffHelper onoff ("ns3::Udp", 
+  OnOffHelper onoff ("ns3::UdpSocketFactory", 
                      InetSocketAddress (i34.GetAddress (1), port));
   onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
   onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
@@ -137,7 +137,7 @@
   apps.Stop (Seconds (10.0));
 
   // Create a packet sink to receive these packets
-  PacketSinkHelper sink ("ns3::Udp",
+  PacketSinkHelper sink ("ns3::UdpSocketFactory",
                          InetSocketAddress (Ipv4Address::GetAny (), port));
 
   apps = sink.Install (c.Get (3));
--- a/samples/main-simple.cc	Sat May 17 11:15:02 2008 -0700
+++ b/samples/main-simple.cc	Sat May 17 12:08:20 2008 -0700
@@ -48,7 +48,7 @@
   internet.Install (c);
 
 
-  TypeId tid = TypeId::LookupByName ("ns3::Udp");
+  TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
   Ptr<Socket> sink = Socket::CreateSocket (c.Get (0), tid);
   InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80);
   sink->Bind (local);
--- a/src/applications/onoff/onoff-application.cc	Sat May 17 11:15:02 2008 -0700
+++ b/src/applications/onoff/onoff-application.cc	Sat May 17 12:08:20 2008 -0700
@@ -35,7 +35,7 @@
 #include "ns3/uinteger.h"
 #include "ns3/trace-source-accessor.h"
 #include "onoff-application.h"
-#include "ns3/udp.h"
+#include "ns3/udp-socket-factory.h"
 
 NS_LOG_COMPONENT_DEFINE ("OnOffApplication");
 
@@ -79,7 +79,7 @@
                    MakeUintegerAccessor (&OnOffApplication::m_maxBytes),
                    MakeUintegerChecker<uint32_t> ())
     .AddAttribute ("Protocol", "The type of protocol to use.",
-                   TypeIdValue (Udp::GetTypeId ()),
+                   TypeIdValue (UdpSocketFactory::GetTypeId ()),
                    MakeTypeIdAccessor (&OnOffApplication::m_tid),
                    MakeTypeIdChecker ())
     .AddTraceSource ("Tx", "A new packet is created and is sent",
--- a/src/applications/packet-sink/packet-sink.cc	Sat May 17 11:15:02 2008 -0700
+++ b/src/applications/packet-sink/packet-sink.cc	Sat May 17 12:08:20 2008 -0700
@@ -26,7 +26,7 @@
 #include "ns3/socket-factory.h"
 #include "ns3/packet.h"
 #include "ns3/trace-source-accessor.h"
-#include "ns3/udp.h"
+#include "ns3/udp-socket-factory.h"
 #include "packet-sink.h"
 
 using namespace std;
@@ -47,7 +47,7 @@
                    MakeAddressAccessor (&PacketSink::m_local),
                    MakeAddressChecker ())
     .AddAttribute ("Protocol", "The type id of the protocol to use for the rx socket.",
-                   TypeIdValue (Udp::GetTypeId ()),
+                   TypeIdValue (UdpSocketFactory::GetTypeId ()),
                    MakeTypeIdAccessor (&PacketSink::m_tid),
                    MakeTypeIdChecker ())
     .AddTraceSource ("Rx", "A packet has been received",
--- a/src/applications/udp-echo/udp-echo-client.cc	Sat May 17 11:15:02 2008 -0700
+++ b/src/applications/udp-echo/udp-echo-client.cc	Sat May 17 12:08:20 2008 -0700
@@ -95,7 +95,7 @@
 
   if (!m_socket)
     {
-      TypeId tid = TypeId::LookupByName ("ns3::Udp");
+      TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
       m_socket = Socket::CreateSocket (GetNode(), tid);
       m_socket->Bind ();
       m_socket->Connect (InetSocketAddress (m_peerAddress, m_peerPort));
--- a/src/applications/udp-echo/udp-echo-server.cc	Sat May 17 11:15:02 2008 -0700
+++ b/src/applications/udp-echo/udp-echo-server.cc	Sat May 17 12:08:20 2008 -0700
@@ -71,7 +71,7 @@
 
   if (!m_socket)
     {
-      TypeId tid = TypeId::LookupByName ("ns3::Udp");
+      TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
       m_socket = Socket::CreateSocket (GetNode(), tid);
       InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), m_port);
       m_socket->Bind (local);
--- a/src/core/type-id.cc	Sat May 17 11:15:02 2008 -0700
+++ b/src/core/type-id.cc	Sat May 17 12:08:20 2008 -0700
@@ -386,7 +386,7 @@
 TypeId::LookupByName (std::string name)
 {
   uint16_t uid = Singleton<IidManager>::Get ()->GetUid (name);
-  NS_ASSERT (uid != 0);
+  NS_ASSERT_MSG (uid != 0, "Assert in TypeId::LookupByName: " << name << " not found");
   return TypeId (uid);
 }
 bool
--- a/src/helper/packet-sink-helper.cc	Sat May 17 11:15:02 2008 -0700
+++ b/src/helper/packet-sink-helper.cc	Sat May 17 12:08:20 2008 -0700
@@ -41,7 +41,7 @@
 void 
 PacketSinkHelper::SetUdpLocal (Ipv4Address ip, uint16_t port)
 {
-  m_factory.Set ("Protocol", String ("ns3::Udp"));
+  m_factory.Set ("Protocol", String ("ns3::UdpSocketFactory"));
   m_factory.Set ("Local", Address (InetSocketAddress (ip, port)));
 }
 void 
--- a/src/internet-node/udp-impl.cc	Sat May 17 11:15:02 2008 -0700
+++ b/src/internet-node/udp-impl.cc	Sat May 17 12:08:20 2008 -0700
@@ -48,7 +48,7 @@
 UdpImpl::DoDispose (void)
 {
   m_udp = 0;
-  Udp::DoDispose ();
+  UdpSocketFactory::DoDispose ();
 }
 
 } // namespace ns3
--- a/src/internet-node/udp-impl.h	Sat May 17 11:15:02 2008 -0700
+++ b/src/internet-node/udp-impl.h	Sat May 17 12:08:20 2008 -0700
@@ -20,7 +20,7 @@
 #ifndef UDP_IMPL_H
 #define UDP_IMPL_H
 
-#include "ns3/udp.h"
+#include "ns3/udp-socket-factory.h"
 #include "ns3/ptr.h"
 
 namespace ns3 {
@@ -36,7 +36,7 @@
  * also hold global variables used to initialize newly created sockets, 
  * such as values that are set through the sysctl or proc interfaces in Linux.
  */
-class UdpImpl : public Udp
+class UdpImpl : public UdpSocketFactory
 {
 public:
   UdpImpl ();
--- a/src/internet-node/udp-socket.cc	Sat May 17 11:15:02 2008 -0700
+++ b/src/internet-node/udp-socket.cc	Sat May 17 12:08:20 2008 -0700
@@ -23,8 +23,7 @@
 #include "ns3/inet-socket-address.h"
 #include "ns3/ipv4-route.h"
 #include "ns3/ipv4.h"
-#include "ns3/ipv4.h"
-#include "ns3/udp.h"
+#include "ns3/udp-socket-factory.h"
 #include "ns3/trace-source-accessor.h"
 #include "ns3/uinteger.h"
 #include "ns3/boolean.h"
@@ -464,7 +463,7 @@
 
 #include "ns3/test.h"
 #include "ns3/socket-factory.h"
-#include "ns3/udp.h"
+#include "ns3/udp-socket-factory.h"
 #include "ns3/simulator.h"
 #include "ns3/simple-channel.h"
 #include "ns3/simple-net-device.h"
@@ -588,7 +587,7 @@
 
 
   // Create the UDP sockets
-  Ptr<SocketFactory> rxSocketFactory = rxNode->GetObject<Udp> ();
+  Ptr<SocketFactory> rxSocketFactory = rxNode->GetObject<UdpSocketFactory> ();
   Ptr<Socket> rxSocket = rxSocketFactory->CreateSocket ();
   NS_TEST_ASSERT_EQUAL (rxSocket->Bind (InetSocketAddress (Ipv4Address ("10.0.0.1"), 1234)), 0);
   rxSocket->SetRecvCallback (MakeCallback (&UdpSocketTest::ReceivePkt, this));
@@ -597,7 +596,7 @@
   rxSocket2->SetRecvCallback (MakeCallback (&UdpSocketTest::ReceivePkt2, this));
   NS_TEST_ASSERT_EQUAL (rxSocket2->Bind (InetSocketAddress (Ipv4Address ("10.0.1.1"), 1234)), 0);
 
-  Ptr<SocketFactory> txSocketFactory = txNode->GetObject<Udp> ();
+  Ptr<SocketFactory> txSocketFactory = txNode->GetObject<UdpSocketFactory> ();
   Ptr<Socket> txSocket = txSocketFactory->CreateSocket ();
 
   // ------ Now the tests ------------
--- a/src/internet-node/udp-socket.h	Sat May 17 11:15:02 2008 -0700
+++ b/src/internet-node/udp-socket.h	Sat May 17 12:08:20 2008 -0700
@@ -64,7 +64,7 @@
   virtual uint32_t GetRxAvailable (void) const;
 
 private:
-  friend class Udp;
+  friend class UdpSocketFactory;
   // invoked by Udp class
   int FinishBind (void);
   void ForwardUp (Ptr<Packet> p, Ipv4Address ipv4, uint16_t port);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/node/udp-socket-factory.cc	Sat May 17 12:08:20 2008 -0700
@@ -0,0 +1,35 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2007 INRIA
+ *
+ * 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 "udp-socket-factory.h"
+#include "ns3/uinteger.h"
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (UdpSocketFactory);
+
+TypeId UdpSocketFactory::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::UdpSocketFactory")
+    .SetParent<SocketFactory> ()
+    ;
+  return tid;
+}
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/node/udp-socket-factory.h	Sat May 17 12:08:20 2008 -0700
@@ -0,0 +1,59 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2007 INRIA
+ *
+ * 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>
+ */
+#ifndef UDP_SOCKET_FACTORY_H
+#define UDP_SOCKET_FACTORY_H
+
+#include "socket-factory.h"
+
+namespace ns3 {
+
+class Socket;
+
+/**
+ * \brief API to create UDP socket instances 
+ *
+ * This abstract class defines the API for UDP sockets.
+ * This class also can hold the global default variables used to
+ * initialize newly created sockets, such as values that are
+ * set through the sysctl or proc interfaces in Linux.
+
+ * All UDP implementations must provide an implementation of CreateSocket
+ * below.
+ * 
+ * \see UdpImpl
+ */
+class UdpSocketFactory : public SocketFactory
+{
+public:
+  static TypeId GetTypeId (void);
+
+  /**
+   * \return smart pointer to Socket
+   * 
+   * API for creating socket instances; must be implemented by UDP 
+   * implementations..
+   */
+  virtual Ptr<Socket> CreateSocket (void) = 0;
+
+};
+
+} // namespace ns3
+
+#endif /* UDP_SOCKET_FACTORY_H */
--- a/src/node/udp.cc	Sat May 17 11:15:02 2008 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2007 INRIA
- *
- * 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 "udp.h"
-#include "ns3/uinteger.h"
-
-namespace ns3 {
-
-NS_OBJECT_ENSURE_REGISTERED (Udp);
-
-TypeId Udp::GetTypeId (void)
-{
-  static TypeId tid = TypeId ("ns3::Udp")
-    .SetParent<SocketFactory> ()
-    ;
-  return tid;
-}
-
-} // namespace ns3
--- a/src/node/udp.h	Sat May 17 11:15:02 2008 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2007 INRIA
- *
- * 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>
- */
-#ifndef UDP_H
-#define UDP_H
-
-#include "socket-factory.h"
-
-namespace ns3 {
-
-class Socket;
-
-/**
- * \brief API to create UDP socket instances 
- *
- * This abstract class defines the API for UDP sockets.
- * This class also can hold the global default variables used to
- * initialize newly created sockets, such as values that are
- * set through the sysctl or proc interfaces in Linux.
-
- * All UDP implementations must provide an implementation of CreateSocket
- * below.
- * 
- * \see UdpImpl
- */
-class Udp : public SocketFactory
-{
-public:
-  static TypeId GetTypeId (void);
-
-  /**
-   * \return smart pointer to Socket
-   * 
-   * API for creating socket instances; must be implemented by UDP 
-   * implementations..
-   */
-  virtual Ptr<Socket> CreateSocket (void) = 0;
-
-};
-
-} // namespace ns3
-
-#endif /* UDP_H */
--- a/src/node/wscript	Sat May 17 11:15:02 2008 -0700
+++ b/src/node/wscript	Sat May 17 12:08:20 2008 -0700
@@ -25,7 +25,7 @@
         'socket-factory.cc',
         'packet-socket-factory.cc',
         'packet-socket.cc',
-        'udp.cc',
+        'udp-socket-factory.cc',
         'tcp.cc',
         'ipv4.cc',
         'application.cc',
@@ -57,7 +57,7 @@
         'socket.h',
         'socket-factory.h',
         'packet-socket-factory.h',
-        'udp.h',
+        'udp-socket-factory.h',
         'tcp.h',
         'ipv4.h',
         'application.h',
--- a/src/routing/olsr/olsr-agent-impl.cc	Sat May 17 11:15:02 2008 -0700
+++ b/src/routing/olsr/olsr-agent-impl.cc	Sat May 17 12:08:20 2008 -0700
@@ -31,7 +31,7 @@
 
 #include "olsr-agent-impl.h"
 #include "ns3/socket-factory.h"
-#include "ns3/udp.h"
+#include "ns3/udp-socket-factory.h"
 #include "ns3/simulator.h"
 #include "ns3/log.h"
 #include "ns3/random-variable.h"
@@ -280,7 +280,7 @@
 
       // Create a socket to listen only on this interface
       Ptr<Socket> socket = Socket::CreateSocket (GetObject<Node> (), 
-        Udp::GetTypeId()); 
+        UdpSocketFactory::GetTypeId()); 
       socket->SetRecvCallback (MakeCallback (&AgentImpl::RecvOlsr,  this));
       if (socket->Bind (InetSocketAddress (addr, OLSR_PORT_NUMBER)))
         {
--- a/utils/print-introspected-doxygen.cc	Sat May 17 11:15:02 2008 -0700
+++ b/utils/print-introspected-doxygen.cc	Sat May 17 12:08:20 2008 -0700
@@ -237,7 +237,7 @@
 
   StaticInformation info;
   info.RecordAggregationInfo ("ns3::Node", "ns3::Tcp");
-  info.RecordAggregationInfo ("ns3::Node", "ns3::Udp");
+  info.RecordAggregationInfo ("ns3::Node", "ns3::UdpSocketFactory");
   info.RecordAggregationInfo ("ns3::Node", "ns3::PacketSocketFactory");
   info.RecordAggregationInfo ("ns3::Node", "ns3::olsr::Agent");
   info.RecordAggregationInfo ("ns3::Node", "ns3::MobilityModel");