src/internet-stack/udp-socket-impl.cc
changeset 3778 78c4c41557f3
parent 3776 362d7e1c12a6
child 3820 c04ecfdce1ef
--- a/src/internet-stack/udp-socket-impl.cc	Thu Oct 23 21:27:28 2008 +0200
+++ b/src/internet-stack/udp-socket-impl.cc	Thu Oct 23 15:59:48 2008 -0700
@@ -437,6 +437,21 @@
   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)
 {