s/UdpImpl/UdpSocketFactoryImpl
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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> node)
|
||||
ipv4L4Demux->Insert (udp);
|
||||
ipv4L4Demux->Insert (tcp);
|
||||
|
||||
Ptr<UdpImpl> udpImpl = CreateObject<UdpImpl> ();
|
||||
Ptr<UdpSocketFactoryImpl> udpFactory = CreateObject<UdpSocketFactoryImpl> ();
|
||||
Ptr<TcpImpl> tcpImpl = CreateObject<TcpImpl> ();
|
||||
Ptr<Ipv4Impl> ipv4Impl = CreateObject<Ipv4Impl> ();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -17,35 +17,35 @@
|
||||
*
|
||||
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
|
||||
*/
|
||||
#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<UdpL4Protocol> udp)
|
||||
UdpSocketFactoryImpl::SetUdp (Ptr<UdpL4Protocol> udp)
|
||||
{
|
||||
m_udp = udp;
|
||||
}
|
||||
|
||||
Ptr<Socket>
|
||||
UdpImpl::CreateSocket (void)
|
||||
UdpSocketFactoryImpl::CreateSocket (void)
|
||||
{
|
||||
return m_udp->CreateSocket ();
|
||||
}
|
||||
|
||||
void
|
||||
UdpImpl::DoDispose (void)
|
||||
UdpSocketFactoryImpl::DoDispose (void)
|
||||
{
|
||||
m_udp = 0;
|
||||
UdpSocketFactory::DoDispose ();
|
||||
@@ -17,8 +17,8 @@
|
||||
*
|
||||
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
|
||||
*/
|
||||
#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<UdpL4Protocol> 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 */
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user