--- a/src/internet-node/udp-l4-protocol.cc Tue May 20 10:16:03 2008 -0700
+++ b/src/internet-node/udp-l4-protocol.cc Tue May 20 10:30:40 2008 -0700
@@ -28,7 +28,7 @@
#include "ipv4-end-point-demux.h"
#include "ipv4-end-point.h"
#include "ipv4-l3-protocol.h"
-#include "udp-socket.h"
+#include "udp-socket-impl.h"
NS_LOG_COMPONENT_DEFINE ("UdpL4Protocol");
@@ -95,7 +95,7 @@
UdpL4Protocol::CreateSocket (void)
{
NS_LOG_FUNCTION_NOARGS ();
- Ptr<UdpSocket> socket = CreateObject<UdpSocket> ();
+ Ptr<UdpSocketImpl> socket = CreateObject<UdpSocketImpl> ();
socket->SetNode (m_node);
socket->SetUdp (this);
return socket;
--- a/src/internet-node/udp-socket-impl.cc Tue May 20 10:16:03 2008 -0700
+++ b/src/internet-node/udp-socket-impl.cc Tue May 20 10:30:40 2008 -0700
@@ -27,12 +27,12 @@
#include "ns3/trace-source-accessor.h"
#include "ns3/uinteger.h"
#include "ns3/boolean.h"
-#include "udp-socket.h"
+#include "udp-socket-impl.h"
#include "udp-l4-protocol.h"
#include "ipv4-end-point.h"
#include "ipv4-l4-demux.h"
-NS_LOG_COMPONENT_DEFINE ("UdpSocket");
+NS_LOG_COMPONENT_DEFINE ("UdpSocketImpl");
namespace ns3 {
@@ -40,18 +40,18 @@
// Add attributes generic to all UdpSockets to base class UdpSocket
TypeId
-UdpSocket::GetTypeId (void)
+UdpSocketImpl::GetTypeId (void)
{
- static TypeId tid = TypeId ("ns3::UdpSocket")
- .SetParent<UdpSocketx> ()
- .AddConstructor<UdpSocket> ()
+ static TypeId tid = TypeId ("ns3::UdpSocketImpl")
+ .SetParent<UdpSocket> ()
+ .AddConstructor<UdpSocketImpl> ()
.AddTraceSource ("Drop", "Drop UDP packet due to receive buffer overflow",
- MakeTraceSourceAccessor (&UdpSocket::m_dropTrace))
+ MakeTraceSourceAccessor (&UdpSocketImpl::m_dropTrace))
;
return tid;
}
-UdpSocket::UdpSocket ()
+UdpSocketImpl::UdpSocketImpl ()
: m_endPoint (0),
m_node (0),
m_udp (0),
@@ -64,7 +64,7 @@
NS_LOG_FUNCTION_NOARGS ();
}
-UdpSocket::~UdpSocket ()
+UdpSocketImpl::~UdpSocketImpl ()
{
NS_LOG_FUNCTION_NOARGS ();
@@ -88,14 +88,14 @@
}
void
-UdpSocket::SetNode (Ptr<Node> node)
+UdpSocketImpl::SetNode (Ptr<Node> node)
{
NS_LOG_FUNCTION_NOARGS ();
m_node = node;
}
void
-UdpSocket::SetUdp (Ptr<UdpL4Protocol> udp)
+UdpSocketImpl::SetUdp (Ptr<UdpL4Protocol> udp)
{
NS_LOG_FUNCTION_NOARGS ();
m_udp = udp;
@@ -103,21 +103,21 @@
enum Socket::SocketErrno
-UdpSocket::GetErrno (void) const
+UdpSocketImpl::GetErrno (void) const
{
NS_LOG_FUNCTION_NOARGS ();
return m_errno;
}
Ptr<Node>
-UdpSocket::GetNode (void) const
+UdpSocketImpl::GetNode (void) const
{
NS_LOG_FUNCTION_NOARGS ();
return m_node;
}
void
-UdpSocket::Destroy (void)
+UdpSocketImpl::Destroy (void)
{
NS_LOG_FUNCTION_NOARGS ();
m_node = 0;
@@ -126,20 +126,20 @@
}
int
-UdpSocket::FinishBind (void)
+UdpSocketImpl::FinishBind (void)
{
NS_LOG_FUNCTION_NOARGS ();
if (m_endPoint == 0)
{
return -1;
}
- m_endPoint->SetRxCallback (MakeCallback (&UdpSocket::ForwardUp, this));
- m_endPoint->SetDestroyCallback (MakeCallback (&UdpSocket::Destroy, this));
+ m_endPoint->SetRxCallback (MakeCallback (&UdpSocketImpl::ForwardUp, this));
+ m_endPoint->SetDestroyCallback (MakeCallback (&UdpSocketImpl::Destroy, this));
return 0;
}
int
-UdpSocket::Bind (void)
+UdpSocketImpl::Bind (void)
{
NS_LOG_FUNCTION_NOARGS ();
m_endPoint = m_udp->Allocate ();
@@ -147,7 +147,7 @@
}
int
-UdpSocket::Bind (const Address &address)
+UdpSocketImpl::Bind (const Address &address)
{
NS_LOG_FUNCTION (this << address);
@@ -180,7 +180,7 @@
}
int
-UdpSocket::ShutdownSend (void)
+UdpSocketImpl::ShutdownSend (void)
{
NS_LOG_FUNCTION_NOARGS ();
m_shutdownSend = true;
@@ -188,7 +188,7 @@
}
int
-UdpSocket::ShutdownRecv (void)
+UdpSocketImpl::ShutdownRecv (void)
{
NS_LOG_FUNCTION_NOARGS ();
m_shutdownRecv = false;
@@ -196,7 +196,7 @@
}
int
-UdpSocket::Close(void)
+UdpSocketImpl::Close(void)
{
NS_LOG_FUNCTION_NOARGS ();
NotifyCloseCompleted ();
@@ -204,7 +204,7 @@
}
int
-UdpSocket::Connect(const Address & address)
+UdpSocketImpl::Connect(const Address & address)
{
NS_LOG_FUNCTION (this << address);
InetSocketAddress transport = InetSocketAddress::ConvertFrom (address);
@@ -217,7 +217,7 @@
}
int
-UdpSocket::Send (Ptr<Packet> p)
+UdpSocketImpl::Send (Ptr<Packet> p)
{
NS_LOG_FUNCTION (this << p);
@@ -230,7 +230,7 @@
}
int
-UdpSocket::DoSend (Ptr<Packet> p)
+UdpSocketImpl::DoSend (Ptr<Packet> p)
{
NS_LOG_FUNCTION_NOARGS ();
if (m_endPoint == 0)
@@ -252,7 +252,7 @@
}
int
-UdpSocket::DoSendTo (Ptr<Packet> p, const Address &address)
+UdpSocketImpl::DoSendTo (Ptr<Packet> p, const Address &address)
{
NS_LOG_FUNCTION (this << p << address);
@@ -273,7 +273,7 @@
}
int
-UdpSocket::DoSendTo (Ptr<Packet> p, Ipv4Address dest, uint16_t port)
+UdpSocketImpl::DoSendTo (Ptr<Packet> p, Ipv4Address dest, uint16_t port)
{
NS_LOG_FUNCTION (this << p << dest << port);
@@ -364,7 +364,7 @@
// XXX maximum message size for UDP broadcast is limited by MTU
// size of underlying link; we are not checking that now.
uint32_t
-UdpSocket::GetTxAvailable (void) const
+UdpSocketImpl::GetTxAvailable (void) const
{
NS_LOG_FUNCTION_NOARGS ();
// No finite send buffer is modelled, but we must respect
@@ -373,7 +373,7 @@
}
int
-UdpSocket::SendTo (Ptr<Packet> p, const Address &address)
+UdpSocketImpl::SendTo (Ptr<Packet> p, const Address &address)
{
NS_LOG_FUNCTION (this << address << p);
InetSocketAddress transport = InetSocketAddress::ConvertFrom (address);
@@ -383,7 +383,7 @@
}
Ptr<Packet>
-UdpSocket::Recv (uint32_t maxSize, uint32_t flags)
+UdpSocketImpl::Recv (uint32_t maxSize, uint32_t flags)
{
NS_LOG_FUNCTION_NOARGS ();
if (m_deliveryQueue.empty() )
@@ -404,7 +404,7 @@
}
uint32_t
-UdpSocket::GetRxAvailable (void) const
+UdpSocketImpl::GetRxAvailable (void) const
{
NS_LOG_FUNCTION_NOARGS ();
// We separately maintain this state to avoid walking the queue
@@ -413,7 +413,7 @@
}
void
-UdpSocket::ForwardUp (Ptr<Packet> packet, Ipv4Address ipv4, uint16_t port)
+UdpSocketImpl::ForwardUp (Ptr<Packet> packet, Ipv4Address ipv4, uint16_t port)
{
NS_LOG_FUNCTION (this << packet << ipv4 << port);
@@ -445,37 +445,37 @@
void
-UdpSocket::SetRcvBufSize (uint32_t size)
+UdpSocketImpl::SetRcvBufSize (uint32_t size)
{
m_rcvBufSize = size;
}
uint32_t
-UdpSocket::GetRcvBufSize (void) const
+UdpSocketImpl::GetRcvBufSize (void) const
{
return m_rcvBufSize;
}
void
-UdpSocket::SetIpTtl (uint32_t ipTtl)
+UdpSocketImpl::SetIpTtl (uint32_t ipTtl)
{
m_ipTtl = ipTtl;
}
uint32_t
-UdpSocket::GetIpTtl (void) const
+UdpSocketImpl::GetIpTtl (void) const
{
return m_ipTtl;
}
void
-UdpSocket::SetIpMulticastTtl (uint32_t ipTtl)
+UdpSocketImpl::SetIpMulticastTtl (uint32_t ipTtl)
{
m_ipMulticastTtl = ipTtl;
}
uint32_t
-UdpSocket::GetIpMulticastTtl (void) const
+UdpSocketImpl::GetIpMulticastTtl (void) const
{
return m_ipMulticastTtl;
}
@@ -497,14 +497,14 @@
namespace ns3 {
-class UdpSocketTest: public Test
+class UdpSocketImplTest: public Test
{
Ptr<Packet> m_receivedPacket;
Ptr<Packet> m_receivedPacket2;
public:
virtual bool RunTests (void);
- UdpSocketTest ();
+ UdpSocketImplTest ();
void ReceivePacket (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from);
void ReceivePacket2 (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from);
@@ -513,29 +513,29 @@
};
-UdpSocketTest::UdpSocketTest ()
- : Test ("UdpSocket")
+UdpSocketImplTest::UdpSocketImplTest ()
+ : Test ("UdpSocketImpl")
{
}
-void UdpSocketTest::ReceivePacket (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from)
+void UdpSocketImplTest::ReceivePacket (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from)
{
m_receivedPacket = packet;
}
-void UdpSocketTest::ReceivePacket2 (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from)
+void UdpSocketImplTest::ReceivePacket2 (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from)
{
m_receivedPacket2 = packet;
}
-void UdpSocketTest::ReceivePkt (Ptr<Socket> socket)
+void UdpSocketImplTest::ReceivePkt (Ptr<Socket> socket)
{
uint32_t availableData = socket->GetRxAvailable ();
m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
NS_ASSERT (availableData == m_receivedPacket->GetSize ());
}
-void UdpSocketTest::ReceivePkt2 (Ptr<Socket> socket)
+void UdpSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
{
uint32_t availableData = socket->GetRxAvailable ();
m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
@@ -543,7 +543,7 @@
}
bool
-UdpSocketTest::RunTests (void)
+UdpSocketImplTest::RunTests (void)
{
bool result = true;
@@ -615,10 +615,10 @@
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));
+ rxSocket->SetRecvCallback (MakeCallback (&UdpSocketImplTest::ReceivePkt, this));
Ptr<Socket> rxSocket2 = rxSocketFactory->CreateSocket ();
- rxSocket2->SetRecvCallback (MakeCallback (&UdpSocketTest::ReceivePkt2, this));
+ rxSocket2->SetRecvCallback (MakeCallback (&UdpSocketImplTest::ReceivePkt2, this));
NS_TEST_ASSERT_EQUAL (rxSocket2->Bind (InetSocketAddress (Ipv4Address ("10.0.1.1"), 1234)), 0);
Ptr<SocketFactory> txSocketFactory = txNode->GetObject<UdpSocketFactory> ();
@@ -659,7 +659,7 @@
// the socket address matches.
rxSocket2->Dispose ();
rxSocket2 = rxSocketFactory->CreateSocket ();
- rxSocket2->SetRecvCallback (MakeCallback (&UdpSocketTest::ReceivePkt2, this));
+ rxSocket2->SetRecvCallback (MakeCallback (&UdpSocketImplTest::ReceivePkt2, this));
NS_TEST_ASSERT_EQUAL (rxSocket2->Bind (InetSocketAddress (Ipv4Address ("0.0.0.0"), 1234)), 0);
m_receivedPacket = Create<Packet> ();
@@ -678,7 +678,7 @@
return result;
}
-static UdpSocketTest gUdpSocketTest;
+static UdpSocketImplTest gUdpSocketImplTest;
}; // namespace ns3
--- a/src/internet-node/udp-socket-impl.h Tue May 20 10:16:03 2008 -0700
+++ b/src/internet-node/udp-socket-impl.h Tue May 20 10:30:40 2008 -0700
@@ -17,8 +17,8 @@
*
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
*/
-#ifndef UDP_SOCKET_H
-#define UDP_SOCKET_H
+#ifndef UDP_SOCKET_IMPL_H
+#define UDP_SOCKET_IMPL_H
#include <stdint.h>
#include <queue>
@@ -27,7 +27,7 @@
#include "ns3/socket.h"
#include "ns3/ptr.h"
#include "ns3/ipv4-address.h"
-#include "ns3/udp-socketx.h"
+#include "ns3/udp-socket.h"
namespace ns3 {
@@ -36,15 +36,15 @@
class Packet;
class UdpL4Protocol;
-class UdpSocket : public UdpSocketx
+class UdpSocketImpl : public UdpSocket
{
public:
static TypeId GetTypeId (void);
/**
* Create an unbound udp socket.
*/
- UdpSocket ();
- virtual ~UdpSocket ();
+ UdpSocketImpl ();
+ virtual ~UdpSocketImpl ();
void SetNode (Ptr<Node> node);
void SetUdp (Ptr<UdpL4Protocol> udp);
@@ -108,4 +108,4 @@
}//namespace ns3
-#endif /* UDP_SOCKET_H */
+#endif /* UDP_SOCKET_IMPL_H */
--- a/src/internet-node/wscript Tue May 20 10:16:03 2008 -0700
+++ b/src/internet-node/wscript Tue May 20 10:30:40 2008 -0700
@@ -22,7 +22,7 @@
'arp-ipv4-interface.cc',
'arp-l3-protocol.cc',
'ipv4-loopback-interface.cc',
- 'udp-socket.cc',
+ 'udp-socket-impl.cc',
'tcp-socket.cc',
'ipv4-end-point-demux.cc',
'ipv4-impl.cc',
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/node/udp-socket.cc Tue May 20 10:30:40 2008 -0700
@@ -0,0 +1,70 @@
+/* -*- 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 "ns3/object.h"
+#include "ns3/log.h"
+#include "ns3/uinteger.h"
+#include "ns3/trace-source-accessor.h"
+#include "udp-socket.h"
+
+NS_LOG_COMPONENT_DEFINE ("UdpSocket");
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (UdpSocket);
+
+TypeId
+UdpSocket::GetTypeId (void)
+{
+ static TypeId tid = TypeId ("ns3::UdpSocket")
+ .SetParent<Socket> ()
+ .AddAttribute ("RcvBufSize",
+ "UdpSocket maximum receive buffer size (bytes)",
+ UintegerValue (0xffffffffl),
+ MakeUintegerAccessor (&UdpSocket::GetRcvBufSize,
+ &UdpSocket::SetRcvBufSize),
+ MakeUintegerChecker<uint32_t> ())
+ .AddAttribute ("IpTtl",
+ "socket-specific TTL for unicast IP packets (if non-zero)",
+ UintegerValue (0),
+ MakeUintegerAccessor (&UdpSocket::GetIpTtl,
+ &UdpSocket::SetIpTtl),
+ MakeUintegerChecker<uint32_t> ())
+ .AddAttribute ("IpMulticastTtl",
+ "socket-specific TTL for multicast IP packets (if non-zero)",
+ UintegerValue (0),
+ MakeUintegerAccessor (&UdpSocket::GetIpMulticastTtl,
+ &UdpSocket::SetIpMulticastTtl),
+ MakeUintegerChecker<uint32_t> ())
+ ;
+ return tid;
+}
+
+UdpSocket::UdpSocket ()
+{
+ NS_LOG_FUNCTION_NOARGS ();
+}
+
+UdpSocket::~UdpSocket ()
+{
+ NS_LOG_FUNCTION_NOARGS ();
+}
+
+}; // namespace ns3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/node/udp-socket.h Tue May 20 10:30:40 2008 -0700
@@ -0,0 +1,79 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2006 Georgia Tech Research Corporation
+ * 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
+ *
+ * Authors: George F. Riley<riley@ece.gatech.edu>
+ * Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+
+#ifndef __UDP_SOCKET_H__
+#define __UDP_SOCKET_H__
+
+#include "socket.h"
+#include "ns3/traced-callback.h"
+#include "ns3/callback.h"
+#include "ns3/ptr.h"
+#include "ns3/object.h"
+
+namespace ns3 {
+
+class Node;
+class Packet;
+
+/**
+ * \brief (abstract) base class of all UdpSockets
+ *
+ * This class exists solely for hosting UdpSocket attributes that can
+ * be reused across different implementations.
+ */
+class UdpSocket : public Socket
+{
+public:
+ static TypeId GetTypeId (void);
+
+ UdpSocket (void);
+ virtual ~UdpSocket (void);
+
+ virtual enum Socket::SocketErrno GetErrno (void) const = 0;
+ virtual Ptr<Node> GetNode (void) const = 0;
+ virtual int Bind () = 0;
+ virtual int Close (void) = 0;
+ virtual int ShutdownSend (void) = 0;
+ virtual int ShutdownRecv (void) = 0;
+ virtual int Connect (const Address &address) = 0;
+ virtual int Send (Ptr<Packet> p) = 0;
+ virtual uint32_t GetTxAvailable (void) const = 0;
+ virtual int SendTo (Ptr<Packet> p, const Address &address) = 0;
+ virtual Ptr<Packet> Recv (uint32_t maxSize, uint32_t flags) = 0;
+ virtual uint32_t GetRxAvailable (void) const = 0;
+
+public:
+ // Indirect the attribute setting and getting through private virtual methods
+ virtual void SetRcvBufSize (uint32_t size) = 0;
+ virtual uint32_t GetRcvBufSize (void) const = 0;
+ virtual void SetIpTtl (uint32_t ipTtl) = 0;
+ virtual uint32_t GetIpTtl (void) const = 0;
+ virtual void SetIpMulticastTtl (uint32_t ipTtl) = 0;
+ virtual uint32_t GetIpMulticastTtl (void) const = 0;
+
+};
+
+} //namespace ns3
+
+#endif /* UDP_SOCKET_H */
+
+
--- a/src/node/udp-socketx.cc Tue May 20 10:16:03 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +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 "ns3/object.h"
-#include "ns3/log.h"
-#include "ns3/uinteger.h"
-#include "ns3/trace-source-accessor.h"
-#include "udp-socketx.h"
-
-NS_LOG_COMPONENT_DEFINE ("UdpSocketx");
-
-namespace ns3 {
-
-NS_OBJECT_ENSURE_REGISTERED (UdpSocketx);
-
-TypeId
-UdpSocketx::GetTypeId (void)
-{
- static TypeId tid = TypeId ("ns3::UdpSocketx")
- .SetParent<Socket> ()
- .AddAttribute ("RcvBufSize",
- "UdpSocket maximum receive buffer size (bytes)",
- UintegerValue (0xffffffffl),
- MakeUintegerAccessor (&UdpSocketx::GetRcvBufSize,
- &UdpSocketx::SetRcvBufSize),
- MakeUintegerChecker<uint32_t> ())
- .AddAttribute ("IpTtl",
- "socket-specific TTL for unicast IP packets (if non-zero)",
- UintegerValue (0),
- MakeUintegerAccessor (&UdpSocketx::GetIpTtl,
- &UdpSocketx::SetIpTtl),
- MakeUintegerChecker<uint32_t> ())
- .AddAttribute ("IpMulticastTtl",
- "socket-specific TTL for multicast IP packets (if non-zero)",
- UintegerValue (0),
- MakeUintegerAccessor (&UdpSocketx::GetIpMulticastTtl,
- &UdpSocketx::SetIpMulticastTtl),
- MakeUintegerChecker<uint32_t> ())
- ;
- return tid;
-}
-
-UdpSocketx::UdpSocketx ()
-{
- NS_LOG_FUNCTION_NOARGS ();
-}
-
-UdpSocketx::~UdpSocketx ()
-{
- NS_LOG_FUNCTION_NOARGS ();
-}
-
-}; // namespace ns3
--- a/src/node/udp-socketx.h Tue May 20 10:16:03 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2006 Georgia Tech Research Corporation
- * 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
- *
- * Authors: George F. Riley<riley@ece.gatech.edu>
- * Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
- */
-
-#ifndef __UDP_SOCKETX_H__
-#define __UDP_SOCKETX_H__
-
-#include "socket.h"
-#include "ns3/traced-callback.h"
-#include "ns3/callback.h"
-#include "ns3/ptr.h"
-#include "ns3/object.h"
-
-namespace ns3 {
-
-class Node;
-class Packet;
-
-/**
- * \brief (abstract) base class of all UdpSockets
- *
- * This class exists solely for hosting UdpSocket attributes that can
- * be reused across different implementations.
- */
-class UdpSocketx : public Socket
-{
-public:
- static TypeId GetTypeId (void);
-
- UdpSocketx (void);
- virtual ~UdpSocketx (void);
-
- virtual enum Socket::SocketErrno GetErrno (void) const = 0;
- virtual Ptr<Node> GetNode (void) const = 0;
- virtual int Bind () = 0;
- virtual int Close (void) = 0;
- virtual int ShutdownSend (void) = 0;
- virtual int ShutdownRecv (void) = 0;
- virtual int Connect (const Address &address) = 0;
- virtual int Send (Ptr<Packet> p) = 0;
- virtual uint32_t GetTxAvailable (void) const = 0;
- virtual int SendTo (Ptr<Packet> p, const Address &address) = 0;
- virtual Ptr<Packet> Recv (uint32_t maxSize, uint32_t flags) = 0;
- virtual uint32_t GetRxAvailable (void) const = 0;
-
-public:
- // Indirect the attribute setting and getting through private virtual methods
- virtual void SetRcvBufSize (uint32_t size) = 0;
- virtual uint32_t GetRcvBufSize (void) const = 0;
- virtual void SetIpTtl (uint32_t ipTtl) = 0;
- virtual uint32_t GetIpTtl (void) const = 0;
- virtual void SetIpMulticastTtl (uint32_t ipTtl) = 0;
- virtual uint32_t GetIpMulticastTtl (void) const = 0;
-
-};
-
-} //namespace ns3
-
-#endif /* UDP_SOCKET_H */
-
-
--- a/src/node/wscript Tue May 20 10:16:03 2008 -0700
+++ b/src/node/wscript Tue May 20 10:30:40 2008 -0700
@@ -25,7 +25,7 @@
'socket-factory.cc',
'packet-socket-factory.cc',
'packet-socket.cc',
- 'udp-socketx.cc',
+ 'udp-socket.cc',
'udp-socket-factory.cc',
'tcp.cc',
'ipv4.cc',
@@ -58,7 +58,7 @@
'socket.h',
'socket-factory.h',
'packet-socket-factory.h',
- 'udp-socketx.h',
+ 'udp-socket.h',
'udp-socket-factory.h',
'tcp.h',
'ipv4.h',