remove Node::GetUdp

Mathieu Lacage 2007-05-03 14:23:41 +02:00
parent b1eccbe7bf
commit 2f1189d766
7 changed files with 5 additions and 29 deletions

View File

@ -94,12 +94,6 @@ InternetNode::CreateTraceResolver (TraceContext const &context)
InternetNode::ARP);
arp->Unref ();
Udp *udp = GetUdp ();
resolver->Add ("udp",
MakeCallback (&Udp::CreateTraceResolver, udp),
InternetNode::UDP);
udp->Unref ();
return resolver;
}
@ -118,15 +112,6 @@ InternetNode::GetIpv4 (void) const
ipv4->Ref ();
return ipv4;
}
Udp *
InternetNode::GetUdp (void) const
{
Ipv4L4Demux *demux = QueryInterface<Ipv4L4Demux> (Ipv4L4Demux::iid);
Udp *udp = static_cast<Udp*> (demux->PeekProtocol (Udp::PROT_NUMBER));
demux->Unref ();
udp->Ref ();
return udp;
}
Arp *
InternetNode::GetArp (void) const

View File

@ -38,7 +38,6 @@ class InternetNode : public Node
public:
enum TraceType {
IPV4,
UDP,
ARP,
};
InternetNode();
@ -46,7 +45,6 @@ public:
virtual TraceResolver *CreateTraceResolver (TraceContext const &context);
// Capability access
virtual Ipv4 * GetIpv4 (void) const;
virtual Udp * GetUdp (void) const;
virtual Arp * GetArp (void) const;
void SetName(std::string name);

View File

@ -107,11 +107,6 @@ Node::GetIpv4 (void) const
{
return 0;
}
Udp *
Node::GetUdp (void) const
{
return 0;
}
Arp *
Node::GetArp (void) const

View File

@ -32,7 +32,6 @@
namespace ns3 {
class Ipv4;
class Udp;
class Arp;
class TraceContext;
@ -72,7 +71,6 @@ public:
// of the correct type if one exists, or the nil pointer if no
// null capability exists.
virtual Ipv4 * GetIpv4 (void) const;
virtual Udp * GetUdp (void) const;
virtual Arp * GetArp (void) const;
private:

View File

@ -26,16 +26,16 @@
namespace ns3 {
UdpSocket::UdpSocket (Node *node)
UdpSocket::UdpSocket (Node *node, Udp *udp)
: m_endPoint (0),
m_node (node),
m_udp (udp),
m_errno (ENOTERROR),
m_shutdownSend (false),
m_shutdownRecv (false),
m_connected (false)
{
m_udp = m_node->GetUdp ();
NS_ASSERT (m_udp != 0);
m_udp->Ref ();
m_node->Ref ();
}
UdpSocket::~UdpSocket ()

View File

@ -38,7 +38,7 @@ public:
/**
* Create an unbound udp socket.
*/
UdpSocket (Node *node);
UdpSocket (Node *node, Udp *udp);
virtual ~UdpSocket ();
virtual enum SocketErrno GetErrno (void) const;

View File

@ -73,7 +73,7 @@ Udp::DoDispose (void)
Socket *
Udp::CreateSocket (void)
{
return new UdpSocket (m_node);
return new UdpSocket (m_node, this);
}
Ipv4EndPoint *