Udp -> UdpL4Protocol

This commit is contained in:
Mathieu Lacage
2007-06-04 17:22:52 +02:00
parent 297692d88b
commit 92757ef5c3
7 changed files with 29 additions and 29 deletions

View File

@@ -56,7 +56,7 @@ InternetNode::Construct (void)
{
Ptr<Ipv4L3Protocol> ipv4 = Create<Ipv4L3Protocol> (this);
Ptr<ArpL3Protocol> arp = Create<ArpL3Protocol> (this);
Ptr<Udp> udp = Create<Udp> (this);
Ptr<UdpL4Protocol> udp = Create<UdpL4Protocol> (this);
Ptr<L3Demux> l3Demux = Create<L3Demux> (this);
Ptr<Ipv4L4Demux> ipv4L4Demux = Create<Ipv4L4Demux> (this);

View File

@@ -25,7 +25,7 @@
namespace ns3 {
IUdpImpl::IUdpImpl (Ptr<Udp> udp)
IUdpImpl::IUdpImpl (Ptr<UdpL4Protocol> udp)
: m_udp (udp)
{}
IUdpImpl::~IUdpImpl ()

View File

@@ -26,12 +26,12 @@
namespace ns3 {
class Udp;
class UdpL4Protocol;
class IUdpImpl : public IUdp
{
public:
IUdpImpl (Ptr<Udp> udp);
IUdpImpl (Ptr<UdpL4Protocol> udp);
virtual ~IUdpImpl ();
virtual Ptr<Socket> CreateSocket (void);
@@ -39,7 +39,7 @@ public:
protected:
virtual void DoDispose (void);
private:
Ptr<Udp> m_udp;
Ptr<UdpL4Protocol> m_udp;
};
} // namespace ns3

View File

@@ -36,25 +36,25 @@
namespace ns3 {
/* see http://www.iana.org/assignments/protocol-numbers */
const uint8_t Udp::PROT_NUMBER = 17;
const uint8_t UdpL4Protocol::PROT_NUMBER = 17;
Udp::Udp (Ptr<Node> node)
UdpL4Protocol::UdpL4Protocol (Ptr<Node> node)
: Ipv4L4Protocol (PROT_NUMBER, 2),
m_node (node),
m_endPoints (new Ipv4EndPointDemux ())
{}
Udp::~Udp ()
UdpL4Protocol::~UdpL4Protocol ()
{}
TraceResolver *
Udp::CreateTraceResolver (TraceContext const &context)
UdpL4Protocol::CreateTraceResolver (TraceContext const &context)
{
return new EmptyTraceResolver (context);
}
void
Udp::DoDispose (void)
UdpL4Protocol::DoDispose (void)
{
if (m_endPoints != 0)
{
@@ -66,34 +66,34 @@ Udp::DoDispose (void)
}
Ptr<Socket>
Udp::CreateSocket (void)
UdpL4Protocol::CreateSocket (void)
{
Ptr<Socket> socket = Create<UdpSocket> (m_node, this);
return socket;
}
Ipv4EndPoint *
Udp::Allocate (void)
UdpL4Protocol::Allocate (void)
{
return m_endPoints->Allocate ();
}
Ipv4EndPoint *
Udp::Allocate (Ipv4Address address)
UdpL4Protocol::Allocate (Ipv4Address address)
{
return m_endPoints->Allocate (address);
}
Ipv4EndPoint *
Udp::Allocate (uint16_t port)
UdpL4Protocol::Allocate (uint16_t port)
{
return m_endPoints->Allocate (port);
}
Ipv4EndPoint *
Udp::Allocate (Ipv4Address address, uint16_t port)
UdpL4Protocol::Allocate (Ipv4Address address, uint16_t port)
{
return m_endPoints->Allocate (address, port);
}
Ipv4EndPoint *
Udp::Allocate (Ipv4Address localAddress, uint16_t localPort,
UdpL4Protocol::Allocate (Ipv4Address localAddress, uint16_t localPort,
Ipv4Address peerAddress, uint16_t peerPort)
{
return m_endPoints->Allocate (localAddress, localPort,
@@ -101,13 +101,13 @@ Udp::Allocate (Ipv4Address localAddress, uint16_t localPort,
}
void
Udp::DeAllocate (Ipv4EndPoint *endPoint)
UdpL4Protocol::DeAllocate (Ipv4EndPoint *endPoint)
{
m_endPoints->DeAllocate (endPoint);
}
void
Udp::Receive(Packet& packet,
UdpL4Protocol::Receive(Packet& packet,
Ipv4Address const &source,
Ipv4Address const &destination)
{
@@ -123,7 +123,7 @@ Udp::Receive(Packet& packet,
}
void
Udp::Send (Packet packet,
UdpL4Protocol::Send (Packet packet,
Ipv4Address saddr, Ipv4Address daddr,
uint16_t sport, uint16_t dport)
{

View File

@@ -19,8 +19,8 @@
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
*/
#ifndef UDP_H
#define UDP_H
#ifndef UDP_L4_PROTOCOL_H
#define UDP_L4_PROTOCOL_H
#include <stdint.h>
@@ -39,15 +39,15 @@ class Socket;
/**
* \brief Implementation of the UDP protocol
*/
class Udp : public Ipv4L4Protocol {
class UdpL4Protocol : public Ipv4L4Protocol {
public:
static const uint8_t PROT_NUMBER;
/**
* \brief Constructor
* \param node The node this protocol is associated with
*/
Udp (Ptr<Node> node);
virtual ~Udp ();
UdpL4Protocol (Ptr<Node> node);
virtual ~UdpL4Protocol ();
virtual TraceResolver *CreateTraceResolver (TraceContext const &context);
/**
@@ -96,4 +96,4 @@ private:
}; // namespace ns3
#endif /* UDP_H */
#endif /* UDP_L4_PROTOCOL_H */

View File

@@ -26,7 +26,7 @@
namespace ns3 {
UdpSocket::UdpSocket (Ptr<Node> node, Ptr<Udp> udp)
UdpSocket::UdpSocket (Ptr<Node> node, Ptr<UdpL4Protocol> udp)
: m_endPoint (0),
m_node (node),
m_udp (udp),

View File

@@ -31,7 +31,7 @@ namespace ns3 {
class Ipv4EndPoint;
class Node;
class Packet;
class Udp;
class UdpL4Protocol;
class UdpSocket : public Socket
{
@@ -39,7 +39,7 @@ public:
/**
* Create an unbound udp socket.
*/
UdpSocket (Ptr<Node> node, Ptr<Udp> udp);
UdpSocket (Ptr<Node> node, Ptr<UdpL4Protocol> udp);
virtual ~UdpSocket ();
virtual enum SocketErrno GetErrno (void) const;
@@ -83,7 +83,7 @@ private:
Ipv4EndPoint *m_endPoint;
Ptr<Node> m_node;
Ptr<Udp> m_udp;
Ptr<UdpL4Protocol> m_udp;
Ipv4Address m_defaultAddress;
uint16_t m_defaultPort;
Callback<void,Ptr<Socket>,uint32_t,const Ipv4Address &,uint16_t> m_dummyRxCallback;