Liu's GetSockName patch

This commit is contained in:
Craig Dowell committed 2008-10-23 15:59:48 -07:00
1 parent 922d5a4de9
commit b4947df5d0
9 files changed
+68

No files matched your search

+15
View File
@@ -437,6 +437,21 @@ UdpSocketImpl::RecvFrom (uint32_t maxSize, uint32_t flags,
return packet;
}
int
UdpSocketImpl::GetSockName (Address &address) const
{
NS_LOG_FUNCTION_NOARGS ();
if (m_endPoint != 0)
{
address = InetSocketAddress (m_endPoint->GetLocalAddress (), m_endPoint->GetLocalPort());
}
else
{
address = InetSocketAddress(Ipv4Address::GetZero(), 0);
}
return 0;
}
void
UdpSocketImpl::ForwardUp (Ptr<Packet> packet, Ipv4Address ipv4, uint16_t port)
{