s/ns3::Udp/ns3::UdpSocketFactory
authorTom Henderson <tomh@tomh.org>
Sat, 17 May 2008 12:08:20 -0700
changeset 3125d2d8a36cfd23
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
     1.1 --- a/examples/csma-broadcast.cc	Sat May 17 11:15:02 2008 -0700
     1.2 +++ b/examples/csma-broadcast.cc	Sat May 17 12:08:20 2008 -0700
     1.3 @@ -93,7 +93,7 @@
     1.4    // Create the OnOff application to send UDP datagrams of size
     1.5    // 512 bytes (default) at a rate of 500 Kb/s (default) from n0
     1.6    NS_LOG_INFO ("Create Applications.");
     1.7 -  OnOffHelper onoff ("ns3::Udp", 
     1.8 +  OnOffHelper onoff ("ns3::UdpSocketFactory", 
     1.9      Address (InetSocketAddress (Ipv4Address ("255.255.255.255"), port)));
    1.10    onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
    1.11    onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
    1.12 @@ -104,7 +104,7 @@
    1.13    app.Stop (Seconds (10.0));
    1.14    
    1.15    // Create an optional packet sink to receive these packets
    1.16 -  PacketSinkHelper sink ("ns3::Udp",
    1.17 +  PacketSinkHelper sink ("ns3::UdpSocketFactory",
    1.18      Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
    1.19    sink.Install (c0.Get (1));
    1.20    sink.Install (c1.Get (1));
     2.1 --- a/examples/csma-multicast.cc	Sat May 17 11:15:02 2008 -0700
     2.2 +++ b/examples/csma-multicast.cc	Sat May 17 12:08:20 2008 -0700
     2.3 @@ -140,7 +140,7 @@
     2.4  
     2.5    // Configure a multicast packet generator that generates a packet
     2.6    // every few seconds
     2.7 -  OnOffHelper onoff ("ns3::Udp", 
     2.8 +  OnOffHelper onoff ("ns3::UdpSocketFactory", 
     2.9      Address (InetSocketAddress (multicastGroup, multicastPort)));
    2.10    onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
    2.11    onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
    2.12 @@ -156,7 +156,7 @@
    2.13    srcC.Stop (Seconds(10.));
    2.14  
    2.15    // Create an optional packet sink to receive these packets
    2.16 -  PacketSinkHelper sink ("ns3::Udp",
    2.17 +  PacketSinkHelper sink ("ns3::UdpSocketFactory",
    2.18                           InetSocketAddress (Ipv4Address::GetAny(), multicastPort));
    2.19  
    2.20    ApplicationContainer sinkC = sink.Install (c1.Get (2)); // Node n4 
     3.1 --- a/examples/csma-one-subnet.cc	Sat May 17 11:15:02 2008 -0700
     3.2 +++ b/examples/csma-one-subnet.cc	Sat May 17 12:08:20 2008 -0700
     3.3 @@ -95,7 +95,7 @@
     3.4    NS_LOG_INFO ("Create Applications.");
     3.5    uint16_t port = 9;   // Discard port (RFC 863)
     3.6  
     3.7 -  OnOffHelper onoff ("ns3::Udp", 
     3.8 +  OnOffHelper onoff ("ns3::UdpSocketFactory", 
     3.9      Address (InetSocketAddress (Ipv4Address ("10.1.1.2"), port)));
    3.10    onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
    3.11    onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
    3.12 @@ -106,7 +106,7 @@
    3.13    app.Stop (Seconds (10.0));
    3.14  
    3.15    // Create an optional packet sink to receive these packets
    3.16 -  PacketSinkHelper sink ("ns3::Udp",
    3.17 +  PacketSinkHelper sink ("ns3::UdpSocketFactory",
    3.18      Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
    3.19    sink.Install (c.Get (1));
    3.20  
     4.1 --- a/examples/mixed-global-routing.cc	Sat May 17 11:15:02 2008 -0700
     4.2 +++ b/examples/mixed-global-routing.cc	Sat May 17 12:08:20 2008 -0700
     4.3 @@ -112,7 +112,7 @@
     4.4    // 210 bytes at a rate of 448 Kb/s
     4.5    NS_LOG_INFO ("Create Applications.");
     4.6    uint16_t port = 9;   // Discard port (RFC 863)
     4.7 -  OnOffHelper onoff ("ns3::Udp",
     4.8 +  OnOffHelper onoff ("ns3::UdpSocketFactory",
     4.9                       InetSocketAddress (i5i6.GetAddress (1), port));
    4.10    onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
    4.11    onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
     5.1 --- a/examples/mixed-wireless.cc	Sat May 17 11:15:02 2008 -0700
     5.2 +++ b/examples/mixed-wireless.cc	Sat May 17 12:08:20 2008 -0700
     5.3 @@ -305,7 +305,7 @@
     5.4    Ptr<Node> appSink = NodeList::GetNode (13);  
     5.5    Ipv4Address remoteAddr = Ipv4Address ("172.16.0.5");
     5.6  
     5.7 -  OnOffHelper onoff ("ns3::Udp", 
     5.8 +  OnOffHelper onoff ("ns3::UdpSocketFactory", 
     5.9                       Address (InetSocketAddress (remoteAddr, port)));
    5.10    onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
    5.11    onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
    5.12 @@ -314,7 +314,7 @@
    5.13    apps.Stop (Seconds (20.0));
    5.14  
    5.15    // Create a packet sink to receive these packets
    5.16 -  PacketSinkHelper sink ("ns3::Udp", 
    5.17 +  PacketSinkHelper sink ("ns3::UdpSocketFactory", 
    5.18                           InetSocketAddress (Ipv4Address::GetAny (), port));
    5.19    apps = sink.Install (appSink);
    5.20    apps.Start (Seconds (3.0));
     6.1 --- a/examples/simple-alternate-routing.cc	Sat May 17 11:15:02 2008 -0700
     6.2 +++ b/examples/simple-alternate-routing.cc	Sat May 17 12:08:20 2008 -0700
     6.3 @@ -141,7 +141,7 @@
     6.4    uint16_t port = 9;   // Discard port (RFC 863)
     6.5  
     6.6    // Create a flow from n3 to n1, starting at time 1.1 seconds
     6.7 -  OnOffHelper onoff ("ns3::Udp",
     6.8 +  OnOffHelper onoff ("ns3::UdpSocketFactory",
     6.9      Address (InetSocketAddress (i1i2.GetAddress (0), port)));
    6.10    onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
    6.11    onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
    6.12 @@ -151,7 +151,7 @@
    6.13    apps.Start (Seconds (10.0));
    6.14  
    6.15    // Create a packet sink to receive these packets
    6.16 -  PacketSinkHelper sink ("ns3::Udp",
    6.17 +  PacketSinkHelper sink ("ns3::UdpSocketFactory",
    6.18      Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
    6.19    apps = sink.Install (c.Get (1));
    6.20    apps.Start (Seconds (1.1));
     7.1 --- a/examples/simple-error-model.cc	Sat May 17 11:15:02 2008 -0700
     7.2 +++ b/examples/simple-error-model.cc	Sat May 17 12:08:20 2008 -0700
     7.3 @@ -122,7 +122,7 @@
     7.4    NS_LOG_INFO ("Create Applications.");
     7.5    uint16_t port = 9;   // Discard port (RFC 863)
     7.6  
     7.7 -  OnOffHelper onoff ("ns3::Udp",
     7.8 +  OnOffHelper onoff ("ns3::UdpSocketFactory",
     7.9      Address (InetSocketAddress (i3i2.GetAddress (1), port)));
    7.10    onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable(1)));
    7.11    onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable(0)));
    7.12 @@ -132,7 +132,7 @@
    7.13    apps.Stop (Seconds(10.0));
    7.14  
    7.15    // Create an optional packet sink to receive these packets
    7.16 -  PacketSinkHelper sink ("ns3::Udp",
    7.17 +  PacketSinkHelper sink ("ns3::UdpSocketFactory",
    7.18      Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
    7.19    apps = sink.Install (c.Get (3));
    7.20    apps.Start (Seconds (1.0));
     8.1 --- a/examples/simple-global-routing.cc	Sat May 17 11:15:02 2008 -0700
     8.2 +++ b/examples/simple-global-routing.cc	Sat May 17 12:08:20 2008 -0700
     8.3 @@ -122,7 +122,7 @@
     8.4    // 210 bytes at a rate of 448 Kb/s
     8.5    NS_LOG_INFO ("Create Applications.");
     8.6    uint16_t port = 9;   // Discard port (RFC 863)
     8.7 -  OnOffHelper onoff ("ns3::Udp", 
     8.8 +  OnOffHelper onoff ("ns3::UdpSocketFactory", 
     8.9      Address (InetSocketAddress (i3i2.GetAddress (0), port)));
    8.10    onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
    8.11    onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
    8.12 @@ -131,7 +131,7 @@
    8.13    apps.Stop (Seconds (10.0));
    8.14  
    8.15    // Create a packet sink to receive these packets
    8.16 -  PacketSinkHelper sink ("ns3::Udp",
    8.17 +  PacketSinkHelper sink ("ns3::UdpSocketFactory",
    8.18      Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
    8.19    apps = sink.Install (c.Get (3));
    8.20    apps.Start (Seconds (1.0));
     9.1 --- a/examples/simple-point-to-point-olsr.cc	Sat May 17 11:15:02 2008 -0700
     9.2 +++ b/examples/simple-point-to-point-olsr.cc	Sat May 17 12:08:20 2008 -0700
     9.3 @@ -127,7 +127,7 @@
     9.4    NS_LOG_INFO ("Create Applications.");
     9.5    uint16_t port = 9;   // Discard port (RFC 863)
     9.6  
     9.7 -  OnOffHelper onoff ("ns3::Udp", 
     9.8 +  OnOffHelper onoff ("ns3::UdpSocketFactory", 
     9.9                       InetSocketAddress (i34.GetAddress (1), port));
    9.10    onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
    9.11    onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
    9.12 @@ -137,7 +137,7 @@
    9.13    apps.Stop (Seconds (10.0));
    9.14  
    9.15    // Create a packet sink to receive these packets
    9.16 -  PacketSinkHelper sink ("ns3::Udp",
    9.17 +  PacketSinkHelper sink ("ns3::UdpSocketFactory",
    9.18                           InetSocketAddress (Ipv4Address::GetAny (), port));
    9.19  
    9.20    apps = sink.Install (c.Get (3));
    10.1 --- a/samples/main-simple.cc	Sat May 17 11:15:02 2008 -0700
    10.2 +++ b/samples/main-simple.cc	Sat May 17 12:08:20 2008 -0700
    10.3 @@ -48,7 +48,7 @@
    10.4    internet.Install (c);
    10.5  
    10.6  
    10.7 -  TypeId tid = TypeId::LookupByName ("ns3::Udp");
    10.8 +  TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
    10.9    Ptr<Socket> sink = Socket::CreateSocket (c.Get (0), tid);
   10.10    InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80);
   10.11    sink->Bind (local);
    11.1 --- a/src/applications/onoff/onoff-application.cc	Sat May 17 11:15:02 2008 -0700
    11.2 +++ b/src/applications/onoff/onoff-application.cc	Sat May 17 12:08:20 2008 -0700
    11.3 @@ -35,7 +35,7 @@
    11.4  #include "ns3/uinteger.h"
    11.5  #include "ns3/trace-source-accessor.h"
    11.6  #include "onoff-application.h"
    11.7 -#include "ns3/udp.h"
    11.8 +#include "ns3/udp-socket-factory.h"
    11.9  
   11.10  NS_LOG_COMPONENT_DEFINE ("OnOffApplication");
   11.11  
   11.12 @@ -79,7 +79,7 @@
   11.13                     MakeUintegerAccessor (&OnOffApplication::m_maxBytes),
   11.14                     MakeUintegerChecker<uint32_t> ())
   11.15      .AddAttribute ("Protocol", "The type of protocol to use.",
   11.16 -                   TypeIdValue (Udp::GetTypeId ()),
   11.17 +                   TypeIdValue (UdpSocketFactory::GetTypeId ()),
   11.18                     MakeTypeIdAccessor (&OnOffApplication::m_tid),
   11.19                     MakeTypeIdChecker ())
   11.20      .AddTraceSource ("Tx", "A new packet is created and is sent",
    12.1 --- a/src/applications/packet-sink/packet-sink.cc	Sat May 17 11:15:02 2008 -0700
    12.2 +++ b/src/applications/packet-sink/packet-sink.cc	Sat May 17 12:08:20 2008 -0700
    12.3 @@ -26,7 +26,7 @@
    12.4  #include "ns3/socket-factory.h"
    12.5  #include "ns3/packet.h"
    12.6  #include "ns3/trace-source-accessor.h"
    12.7 -#include "ns3/udp.h"
    12.8 +#include "ns3/udp-socket-factory.h"
    12.9  #include "packet-sink.h"
   12.10  
   12.11  using namespace std;
   12.12 @@ -47,7 +47,7 @@
   12.13                     MakeAddressAccessor (&PacketSink::m_local),
   12.14                     MakeAddressChecker ())
   12.15      .AddAttribute ("Protocol", "The type id of the protocol to use for the rx socket.",
   12.16 -                   TypeIdValue (Udp::GetTypeId ()),
   12.17 +                   TypeIdValue (UdpSocketFactory::GetTypeId ()),
   12.18                     MakeTypeIdAccessor (&PacketSink::m_tid),
   12.19                     MakeTypeIdChecker ())
   12.20      .AddTraceSource ("Rx", "A packet has been received",
    13.1 --- a/src/applications/udp-echo/udp-echo-client.cc	Sat May 17 11:15:02 2008 -0700
    13.2 +++ b/src/applications/udp-echo/udp-echo-client.cc	Sat May 17 12:08:20 2008 -0700
    13.3 @@ -95,7 +95,7 @@
    13.4  
    13.5    if (!m_socket)
    13.6      {
    13.7 -      TypeId tid = TypeId::LookupByName ("ns3::Udp");
    13.8 +      TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
    13.9        m_socket = Socket::CreateSocket (GetNode(), tid);
   13.10        m_socket->Bind ();
   13.11        m_socket->Connect (InetSocketAddress (m_peerAddress, m_peerPort));
    14.1 --- a/src/applications/udp-echo/udp-echo-server.cc	Sat May 17 11:15:02 2008 -0700
    14.2 +++ b/src/applications/udp-echo/udp-echo-server.cc	Sat May 17 12:08:20 2008 -0700
    14.3 @@ -71,7 +71,7 @@
    14.4  
    14.5    if (!m_socket)
    14.6      {
    14.7 -      TypeId tid = TypeId::LookupByName ("ns3::Udp");
    14.8 +      TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
    14.9        m_socket = Socket::CreateSocket (GetNode(), tid);
   14.10        InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), m_port);
   14.11        m_socket->Bind (local);
    15.1 --- a/src/core/type-id.cc	Sat May 17 11:15:02 2008 -0700
    15.2 +++ b/src/core/type-id.cc	Sat May 17 12:08:20 2008 -0700
    15.3 @@ -386,7 +386,7 @@
    15.4  TypeId::LookupByName (std::string name)
    15.5  {
    15.6    uint16_t uid = Singleton<IidManager>::Get ()->GetUid (name);
    15.7 -  NS_ASSERT (uid != 0);
    15.8 +  NS_ASSERT_MSG (uid != 0, "Assert in TypeId::LookupByName: " << name << " not found");
    15.9    return TypeId (uid);
   15.10  }
   15.11  bool
    16.1 --- a/src/helper/packet-sink-helper.cc	Sat May 17 11:15:02 2008 -0700
    16.2 +++ b/src/helper/packet-sink-helper.cc	Sat May 17 12:08:20 2008 -0700
    16.3 @@ -41,7 +41,7 @@
    16.4  void 
    16.5  PacketSinkHelper::SetUdpLocal (Ipv4Address ip, uint16_t port)
    16.6  {
    16.7 -  m_factory.Set ("Protocol", String ("ns3::Udp"));
    16.8 +  m_factory.Set ("Protocol", String ("ns3::UdpSocketFactory"));
    16.9    m_factory.Set ("Local", Address (InetSocketAddress (ip, port)));
   16.10  }
   16.11  void 
    17.1 --- a/src/internet-node/udp-impl.cc	Sat May 17 11:15:02 2008 -0700
    17.2 +++ b/src/internet-node/udp-impl.cc	Sat May 17 12:08:20 2008 -0700
    17.3 @@ -48,7 +48,7 @@
    17.4  UdpImpl::DoDispose (void)
    17.5  {
    17.6    m_udp = 0;
    17.7 -  Udp::DoDispose ();
    17.8 +  UdpSocketFactory::DoDispose ();
    17.9  }
   17.10  
   17.11  } // namespace ns3
    18.1 --- a/src/internet-node/udp-impl.h	Sat May 17 11:15:02 2008 -0700
    18.2 +++ b/src/internet-node/udp-impl.h	Sat May 17 12:08:20 2008 -0700
    18.3 @@ -20,7 +20,7 @@
    18.4  #ifndef UDP_IMPL_H
    18.5  #define UDP_IMPL_H
    18.6  
    18.7 -#include "ns3/udp.h"
    18.8 +#include "ns3/udp-socket-factory.h"
    18.9  #include "ns3/ptr.h"
   18.10  
   18.11  namespace ns3 {
   18.12 @@ -36,7 +36,7 @@
   18.13   * also hold global variables used to initialize newly created sockets, 
   18.14   * such as values that are set through the sysctl or proc interfaces in Linux.
   18.15   */
   18.16 -class UdpImpl : public Udp
   18.17 +class UdpImpl : public UdpSocketFactory
   18.18  {
   18.19  public:
   18.20    UdpImpl ();
    19.1 --- a/src/internet-node/udp-socket.cc	Sat May 17 11:15:02 2008 -0700
    19.2 +++ b/src/internet-node/udp-socket.cc	Sat May 17 12:08:20 2008 -0700
    19.3 @@ -23,8 +23,7 @@
    19.4  #include "ns3/inet-socket-address.h"
    19.5  #include "ns3/ipv4-route.h"
    19.6  #include "ns3/ipv4.h"
    19.7 -#include "ns3/ipv4.h"
    19.8 -#include "ns3/udp.h"
    19.9 +#include "ns3/udp-socket-factory.h"
   19.10  #include "ns3/trace-source-accessor.h"
   19.11  #include "ns3/uinteger.h"
   19.12  #include "ns3/boolean.h"
   19.13 @@ -464,7 +463,7 @@
   19.14  
   19.15  #include "ns3/test.h"
   19.16  #include "ns3/socket-factory.h"
   19.17 -#include "ns3/udp.h"
   19.18 +#include "ns3/udp-socket-factory.h"
   19.19  #include "ns3/simulator.h"
   19.20  #include "ns3/simple-channel.h"
   19.21  #include "ns3/simple-net-device.h"
   19.22 @@ -588,7 +587,7 @@
   19.23  
   19.24  
   19.25    // Create the UDP sockets
   19.26 -  Ptr<SocketFactory> rxSocketFactory = rxNode->GetObject<Udp> ();
   19.27 +  Ptr<SocketFactory> rxSocketFactory = rxNode->GetObject<UdpSocketFactory> ();
   19.28    Ptr<Socket> rxSocket = rxSocketFactory->CreateSocket ();
   19.29    NS_TEST_ASSERT_EQUAL (rxSocket->Bind (InetSocketAddress (Ipv4Address ("10.0.0.1"), 1234)), 0);
   19.30    rxSocket->SetRecvCallback (MakeCallback (&UdpSocketTest::ReceivePkt, this));
   19.31 @@ -597,7 +596,7 @@
   19.32    rxSocket2->SetRecvCallback (MakeCallback (&UdpSocketTest::ReceivePkt2, this));
   19.33    NS_TEST_ASSERT_EQUAL (rxSocket2->Bind (InetSocketAddress (Ipv4Address ("10.0.1.1"), 1234)), 0);
   19.34  
   19.35 -  Ptr<SocketFactory> txSocketFactory = txNode->GetObject<Udp> ();
   19.36 +  Ptr<SocketFactory> txSocketFactory = txNode->GetObject<UdpSocketFactory> ();
   19.37    Ptr<Socket> txSocket = txSocketFactory->CreateSocket ();
   19.38  
   19.39    // ------ Now the tests ------------
    20.1 --- a/src/internet-node/udp-socket.h	Sat May 17 11:15:02 2008 -0700
    20.2 +++ b/src/internet-node/udp-socket.h	Sat May 17 12:08:20 2008 -0700
    20.3 @@ -64,7 +64,7 @@
    20.4    virtual uint32_t GetRxAvailable (void) const;
    20.5  
    20.6  private:
    20.7 -  friend class Udp;
    20.8 +  friend class UdpSocketFactory;
    20.9    // invoked by Udp class
   20.10    int FinishBind (void);
   20.11    void ForwardUp (Ptr<Packet> p, Ipv4Address ipv4, uint16_t port);
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/src/node/udp-socket-factory.cc	Sat May 17 12:08:20 2008 -0700
    21.3 @@ -0,0 +1,35 @@
    21.4 +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
    21.5 +/*
    21.6 + * Copyright (c) 2007 INRIA
    21.7 + *
    21.8 + * This program is free software; you can redistribute it and/or modify
    21.9 + * it under the terms of the GNU General Public License version 2 as
   21.10 + * published by the Free Software Foundation;
   21.11 + *
   21.12 + * This program is distributed in the hope that it will be useful,
   21.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   21.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   21.15 + * GNU General Public License for more details.
   21.16 + *
   21.17 + * You should have received a copy of the GNU General Public License
   21.18 + * along with this program; if not, write to the Free Software
   21.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   21.20 + *
   21.21 + * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   21.22 + */
   21.23 +#include "udp-socket-factory.h"
   21.24 +#include "ns3/uinteger.h"
   21.25 +
   21.26 +namespace ns3 {
   21.27 +
   21.28 +NS_OBJECT_ENSURE_REGISTERED (UdpSocketFactory);
   21.29 +
   21.30 +TypeId UdpSocketFactory::GetTypeId (void)
   21.31 +{
   21.32 +  static TypeId tid = TypeId ("ns3::UdpSocketFactory")
   21.33 +    .SetParent<SocketFactory> ()
   21.34 +    ;
   21.35 +  return tid;
   21.36 +}
   21.37 +
   21.38 +} // namespace ns3
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/src/node/udp-socket-factory.h	Sat May 17 12:08:20 2008 -0700
    22.3 @@ -0,0 +1,59 @@
    22.4 +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
    22.5 +/*
    22.6 + * Copyright (c) 2007 INRIA
    22.7 + *
    22.8 + * This program is free software; you can redistribute it and/or modify
    22.9 + * it under the terms of the GNU General Public License version 2 as
   22.10 + * published by the Free Software Foundation;
   22.11 + *
   22.12 + * This program is distributed in the hope that it will be useful,
   22.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   22.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   22.15 + * GNU General Public License for more details.
   22.16 + *
   22.17 + * You should have received a copy of the GNU General Public License
   22.18 + * along with this program; if not, write to the Free Software
   22.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   22.20 + *
   22.21 + * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   22.22 + */
   22.23 +#ifndef UDP_SOCKET_FACTORY_H
   22.24 +#define UDP_SOCKET_FACTORY_H
   22.25 +
   22.26 +#include "socket-factory.h"
   22.27 +
   22.28 +namespace ns3 {
   22.29 +
   22.30 +class Socket;
   22.31 +
   22.32 +/**
   22.33 + * \brief API to create UDP socket instances 
   22.34 + *
   22.35 + * This abstract class defines the API for UDP sockets.
   22.36 + * This class also can hold the global default variables used to
   22.37 + * initialize newly created sockets, such as values that are
   22.38 + * set through the sysctl or proc interfaces in Linux.
   22.39 +
   22.40 + * All UDP implementations must provide an implementation of CreateSocket
   22.41 + * below.
   22.42 + * 
   22.43 + * \see UdpImpl
   22.44 + */
   22.45 +class UdpSocketFactory : public SocketFactory
   22.46 +{
   22.47 +public:
   22.48 +  static TypeId GetTypeId (void);
   22.49 +
   22.50 +  /**
   22.51 +   * \return smart pointer to Socket
   22.52 +   * 
   22.53 +   * API for creating socket instances; must be implemented by UDP 
   22.54 +   * implementations..
   22.55 +   */
   22.56 +  virtual Ptr<Socket> CreateSocket (void) = 0;
   22.57 +
   22.58 +};
   22.59 +
   22.60 +} // namespace ns3
   22.61 +
   22.62 +#endif /* UDP_SOCKET_FACTORY_H */
    23.1 --- a/src/node/udp.cc	Sat May 17 11:15:02 2008 -0700
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,35 +0,0 @@
    23.4 -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
    23.5 -/*
    23.6 - * Copyright (c) 2007 INRIA
    23.7 - *
    23.8 - * This program is free software; you can redistribute it and/or modify
    23.9 - * it under the terms of the GNU General Public License version 2 as
   23.10 - * published by the Free Software Foundation;
   23.11 - *
   23.12 - * This program is distributed in the hope that it will be useful,
   23.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   23.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   23.15 - * GNU General Public License for more details.
   23.16 - *
   23.17 - * You should have received a copy of the GNU General Public License
   23.18 - * along with this program; if not, write to the Free Software
   23.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   23.20 - *
   23.21 - * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   23.22 - */
   23.23 -#include "udp.h"
   23.24 -#include "ns3/uinteger.h"
   23.25 -
   23.26 -namespace ns3 {
   23.27 -
   23.28 -NS_OBJECT_ENSURE_REGISTERED (Udp);
   23.29 -
   23.30 -TypeId Udp::GetTypeId (void)
   23.31 -{
   23.32 -  static TypeId tid = TypeId ("ns3::Udp")
   23.33 -    .SetParent<SocketFactory> ()
   23.34 -    ;
   23.35 -  return tid;
   23.36 -}
   23.37 -
   23.38 -} // namespace ns3
    24.1 --- a/src/node/udp.h	Sat May 17 11:15:02 2008 -0700
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,59 +0,0 @@
    24.4 -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
    24.5 -/*
    24.6 - * Copyright (c) 2007 INRIA
    24.7 - *
    24.8 - * This program is free software; you can redistribute it and/or modify
    24.9 - * it under the terms of the GNU General Public License version 2 as
   24.10 - * published by the Free Software Foundation;
   24.11 - *
   24.12 - * This program is distributed in the hope that it will be useful,
   24.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   24.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   24.15 - * GNU General Public License for more details.
   24.16 - *
   24.17 - * You should have received a copy of the GNU General Public License
   24.18 - * along with this program; if not, write to the Free Software
   24.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   24.20 - *
   24.21 - * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   24.22 - */
   24.23 -#ifndef UDP_H
   24.24 -#define UDP_H
   24.25 -
   24.26 -#include "socket-factory.h"
   24.27 -
   24.28 -namespace ns3 {
   24.29 -
   24.30 -class Socket;
   24.31 -
   24.32 -/**
   24.33 - * \brief API to create UDP socket instances 
   24.34 - *
   24.35 - * This abstract class defines the API for UDP sockets.
   24.36 - * This class also can hold the global default variables used to
   24.37 - * initialize newly created sockets, such as values that are
   24.38 - * set through the sysctl or proc interfaces in Linux.
   24.39 -
   24.40 - * All UDP implementations must provide an implementation of CreateSocket
   24.41 - * below.
   24.42 - * 
   24.43 - * \see UdpImpl
   24.44 - */
   24.45 -class Udp : public SocketFactory
   24.46 -{
   24.47 -public:
   24.48 -  static TypeId GetTypeId (void);
   24.49 -
   24.50 -  /**
   24.51 -   * \return smart pointer to Socket
   24.52 -   * 
   24.53 -   * API for creating socket instances; must be implemented by UDP 
   24.54 -   * implementations..
   24.55 -   */
   24.56 -  virtual Ptr<Socket> CreateSocket (void) = 0;
   24.57 -
   24.58 -};
   24.59 -
   24.60 -} // namespace ns3
   24.61 -
   24.62 -#endif /* UDP_H */
    25.1 --- a/src/node/wscript	Sat May 17 11:15:02 2008 -0700
    25.2 +++ b/src/node/wscript	Sat May 17 12:08:20 2008 -0700
    25.3 @@ -25,7 +25,7 @@
    25.4          'socket-factory.cc',
    25.5          'packet-socket-factory.cc',
    25.6          'packet-socket.cc',
    25.7 -        'udp.cc',
    25.8 +        'udp-socket-factory.cc',
    25.9          'tcp.cc',
   25.10          'ipv4.cc',
   25.11          'application.cc',
   25.12 @@ -57,7 +57,7 @@
   25.13          'socket.h',
   25.14          'socket-factory.h',
   25.15          'packet-socket-factory.h',
   25.16 -        'udp.h',
   25.17 +        'udp-socket-factory.h',
   25.18          'tcp.h',
   25.19          'ipv4.h',
   25.20          'application.h',
    26.1 --- a/src/routing/olsr/olsr-agent-impl.cc	Sat May 17 11:15:02 2008 -0700
    26.2 +++ b/src/routing/olsr/olsr-agent-impl.cc	Sat May 17 12:08:20 2008 -0700
    26.3 @@ -31,7 +31,7 @@
    26.4  
    26.5  #include "olsr-agent-impl.h"
    26.6  #include "ns3/socket-factory.h"
    26.7 -#include "ns3/udp.h"
    26.8 +#include "ns3/udp-socket-factory.h"
    26.9  #include "ns3/simulator.h"
   26.10  #include "ns3/log.h"
   26.11  #include "ns3/random-variable.h"
   26.12 @@ -280,7 +280,7 @@
   26.13  
   26.14        // Create a socket to listen only on this interface
   26.15        Ptr<Socket> socket = Socket::CreateSocket (GetObject<Node> (), 
   26.16 -        Udp::GetTypeId()); 
   26.17 +        UdpSocketFactory::GetTypeId()); 
   26.18        socket->SetRecvCallback (MakeCallback (&AgentImpl::RecvOlsr,  this));
   26.19        if (socket->Bind (InetSocketAddress (addr, OLSR_PORT_NUMBER)))
   26.20          {
    27.1 --- a/utils/print-introspected-doxygen.cc	Sat May 17 11:15:02 2008 -0700
    27.2 +++ b/utils/print-introspected-doxygen.cc	Sat May 17 12:08:20 2008 -0700
    27.3 @@ -237,7 +237,7 @@
    27.4  
    27.5    StaticInformation info;
    27.6    info.RecordAggregationInfo ("ns3::Node", "ns3::Tcp");
    27.7 -  info.RecordAggregationInfo ("ns3::Node", "ns3::Udp");
    27.8 +  info.RecordAggregationInfo ("ns3::Node", "ns3::UdpSocketFactory");
    27.9    info.RecordAggregationInfo ("ns3::Node", "ns3::PacketSocketFactory");
   27.10    info.RecordAggregationInfo ("ns3::Node", "ns3::olsr::Agent");
   27.11    info.RecordAggregationInfo ("ns3::Node", "ns3::MobilityModel");