From 25de2ff3c47700153a9f2455c9ebbb9c695ec152 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Sat, 17 May 2008 22:02:09 -0700 Subject: [PATCH] s/UdpImpl/UdpSocketFactoryImpl --- examples/csma-broadcast.cc | 1 + src/internet-node/internet-stack.cc | 8 ++++---- ...udp-impl.cc => udp-socket-factory-impl.cc} | 12 +++++------ .../{udp-impl.h => udp-socket-factory-impl.h} | 20 +++++++++---------- src/internet-node/wscript | 2 +- 5 files changed, 21 insertions(+), 22 deletions(-) rename src/internet-node/{udp-impl.cc => udp-socket-factory-impl.cc} (80%) rename src/internet-node/{udp-impl.h => udp-socket-factory-impl.h} (72%) diff --git a/examples/csma-broadcast.cc b/examples/csma-broadcast.cc index 7928b3a82..0e5c2f5fb 100644 --- a/examples/csma-broadcast.cc +++ b/examples/csma-broadcast.cc @@ -49,6 +49,7 @@ main (int argc, char *argv[]) #if 0 LogComponentEnable ("CsmaBroadcastExample", LOG_LEVEL_INFO); #endif + LogComponentEnable ("CsmaBroadcastExample", LOG_PREFIX_TIME); // // Make the random number generators generate reproducible results. diff --git a/src/internet-node/internet-stack.cc b/src/internet-node/internet-stack.cc index 916f436ac..8aaab0509 100644 --- a/src/internet-node/internet-stack.cc +++ b/src/internet-node/internet-stack.cc @@ -27,7 +27,7 @@ #include "tcp-l4-protocol.h" #include "ipv4-l3-protocol.h" #include "arp-l3-protocol.h" -#include "udp-impl.h" +#include "udp-socket-factory-impl.h" #include "tcp-impl.h" #include "ipv4-impl.h" @@ -58,18 +58,18 @@ AddInternetStack (Ptr node) ipv4L4Demux->Insert (udp); ipv4L4Demux->Insert (tcp); - Ptr udpImpl = CreateObject (); + Ptr udpFactory = CreateObject (); Ptr tcpImpl = CreateObject (); Ptr ipv4Impl = CreateObject (); - udpImpl->SetUdp (udp); + udpFactory->SetUdp (udp); tcpImpl->SetTcp (tcp); ipv4Impl->SetIpv4 (ipv4); node->AggregateObject (ipv4); node->AggregateObject (arp); node->AggregateObject (ipv4Impl); - node->AggregateObject (udpImpl); + node->AggregateObject (udpFactory); node->AggregateObject (tcpImpl); node->AggregateObject (ipv4L4Demux); } diff --git a/src/internet-node/udp-impl.cc b/src/internet-node/udp-socket-factory-impl.cc similarity index 80% rename from src/internet-node/udp-impl.cc rename to src/internet-node/udp-socket-factory-impl.cc index 86114bb4a..3fd63d6cd 100644 --- a/src/internet-node/udp-impl.cc +++ b/src/internet-node/udp-socket-factory-impl.cc @@ -17,35 +17,35 @@ * * Author: Mathieu Lacage */ -#include "udp-impl.h" +#include "udp-socket-factory-impl.h" #include "udp-l4-protocol.h" #include "ns3/socket.h" #include "ns3/assert.h" namespace ns3 { -UdpImpl::UdpImpl () +UdpSocketFactoryImpl::UdpSocketFactoryImpl () : m_udp (0) {} -UdpImpl::~UdpImpl () +UdpSocketFactoryImpl::~UdpSocketFactoryImpl () { NS_ASSERT (m_udp == 0); } void -UdpImpl::SetUdp (Ptr udp) +UdpSocketFactoryImpl::SetUdp (Ptr udp) { m_udp = udp; } Ptr -UdpImpl::CreateSocket (void) +UdpSocketFactoryImpl::CreateSocket (void) { return m_udp->CreateSocket (); } void -UdpImpl::DoDispose (void) +UdpSocketFactoryImpl::DoDispose (void) { m_udp = 0; UdpSocketFactory::DoDispose (); diff --git a/src/internet-node/udp-impl.h b/src/internet-node/udp-socket-factory-impl.h similarity index 72% rename from src/internet-node/udp-impl.h rename to src/internet-node/udp-socket-factory-impl.h index defbdbb02..b4366fc31 100644 --- a/src/internet-node/udp-impl.h +++ b/src/internet-node/udp-socket-factory-impl.h @@ -17,8 +17,8 @@ * * Author: Mathieu Lacage */ -#ifndef UDP_IMPL_H -#define UDP_IMPL_H +#ifndef UDP_SOCKET_FACTORY_IMPL_H +#define UDP_SOCKET_FACTORY_IMPL_H #include "ns3/udp-socket-factory.h" #include "ns3/ptr.h" @@ -31,21 +31,19 @@ class UdpL4Protocol; * \brief Object to create UDP socket instances * \internal * - * This class implements the API for UDP sockets. - * It is a socket factory (deriving from class SocketFactory) and can - * also hold global variables used to initialize newly created sockets, - * such as values that are set through the sysctl or proc interfaces in Linux. + * This class implements the API for creating UDP sockets. + * It is a socket factory (deriving from class SocketFactory). */ -class UdpImpl : public UdpSocketFactory +class UdpSocketFactoryImpl : public UdpSocketFactory { public: - UdpImpl (); - virtual ~UdpImpl (); + UdpSocketFactoryImpl (); + virtual ~UdpSocketFactoryImpl (); void SetUdp (Ptr udp); /** - * \brief Implements a method to create a UdpImpl-based socket and return + * \brief Implements a method to create a Udp-based socket and return * a base class smart pointer to the socket. * \internal * @@ -61,4 +59,4 @@ private: } // namespace ns3 -#endif /* UDP_IMPL_H */ +#endif /* UDP_SOCKET_FACTORY_IMPL_H */ diff --git a/src/internet-node/wscript b/src/internet-node/wscript index 2d03561ff..abd8f471c 100644 --- a/src/internet-node/wscript +++ b/src/internet-node/wscript @@ -28,7 +28,7 @@ def build(bld): 'ipv4-impl.cc', 'ascii-trace.cc', 'pcap-trace.cc', - 'udp-impl.cc', + 'udp-socket-factory-impl.cc', 'tcp-impl.cc', 'pending-data.cc', 'sequence-number.cc',