diff --git a/src/internet-node/internet-node.cc b/src/internet-node/internet-node.cc index f15880d4e..860b98760 100644 --- a/src/internet-node/internet-node.cc +++ b/src/internet-node/internet-node.cc @@ -56,7 +56,7 @@ InternetNode::Construct (void) { Ptr ipv4 = Create (this); Ptr arp = Create (this); - Ptr udp = Create (this); + Ptr udp = Create (this); Ptr l3Demux = Create (this); Ptr ipv4L4Demux = Create (this); diff --git a/src/internet-node/udp-impl.cc b/src/internet-node/udp-impl.cc index 65bd4284a..e46472c18 100644 --- a/src/internet-node/udp-impl.cc +++ b/src/internet-node/udp-impl.cc @@ -25,7 +25,7 @@ namespace ns3 { -IUdpImpl::IUdpImpl (Ptr udp) +IUdpImpl::IUdpImpl (Ptr udp) : m_udp (udp) {} IUdpImpl::~IUdpImpl () diff --git a/src/internet-node/udp-impl.h b/src/internet-node/udp-impl.h index 7bd9c4bae..a812b8e84 100644 --- a/src/internet-node/udp-impl.h +++ b/src/internet-node/udp-impl.h @@ -26,12 +26,12 @@ namespace ns3 { -class Udp; +class UdpL4Protocol; class IUdpImpl : public IUdp { public: - IUdpImpl (Ptr udp); + IUdpImpl (Ptr udp); virtual ~IUdpImpl (); virtual Ptr CreateSocket (void); @@ -39,7 +39,7 @@ public: protected: virtual void DoDispose (void); private: - Ptr m_udp; + Ptr m_udp; }; } // namespace ns3 diff --git a/src/internet-node/udp-l4-protocol.cc b/src/internet-node/udp-l4-protocol.cc index f97caece2..e2c69f575 100644 --- a/src/internet-node/udp-l4-protocol.cc +++ b/src/internet-node/udp-l4-protocol.cc @@ -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) +UdpL4Protocol::UdpL4Protocol (Ptr 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 -Udp::CreateSocket (void) +UdpL4Protocol::CreateSocket (void) { Ptr socket = Create (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) { diff --git a/src/internet-node/udp-l4-protocol.h b/src/internet-node/udp-l4-protocol.h index 54e55be20..4d7a082d4 100644 --- a/src/internet-node/udp-l4-protocol.h +++ b/src/internet-node/udp-l4-protocol.h @@ -19,8 +19,8 @@ * Author: Mathieu Lacage */ -#ifndef UDP_H -#define UDP_H +#ifndef UDP_L4_PROTOCOL_H +#define UDP_L4_PROTOCOL_H #include @@ -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); - virtual ~Udp (); + UdpL4Protocol (Ptr node); + virtual ~UdpL4Protocol (); virtual TraceResolver *CreateTraceResolver (TraceContext const &context); /** @@ -96,4 +96,4 @@ private: }; // namespace ns3 -#endif /* UDP_H */ +#endif /* UDP_L4_PROTOCOL_H */ diff --git a/src/internet-node/udp-socket.cc b/src/internet-node/udp-socket.cc index 23b2171e7..0ab911c9e 100644 --- a/src/internet-node/udp-socket.cc +++ b/src/internet-node/udp-socket.cc @@ -26,7 +26,7 @@ namespace ns3 { -UdpSocket::UdpSocket (Ptr node, Ptr udp) +UdpSocket::UdpSocket (Ptr node, Ptr udp) : m_endPoint (0), m_node (node), m_udp (udp), diff --git a/src/internet-node/udp-socket.h b/src/internet-node/udp-socket.h index 9d2d5805e..c2923c80f 100644 --- a/src/internet-node/udp-socket.h +++ b/src/internet-node/udp-socket.h @@ -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, Ptr udp); + UdpSocket (Ptr node, Ptr udp); virtual ~UdpSocket (); virtual enum SocketErrno GetErrno (void) const; @@ -83,7 +83,7 @@ private: Ipv4EndPoint *m_endPoint; Ptr m_node; - Ptr m_udp; + Ptr m_udp; Ipv4Address m_defaultAddress; uint16_t m_defaultPort; Callback,uint32_t,const Ipv4Address &,uint16_t> m_dummyRxCallback;