|
229 |
|
229 |
|
230 |
if (InetSocketAddress::IsMatchingType (address)) |
230 |
if (InetSocketAddress::IsMatchingType (address)) |
231 |
{ |
231 |
{ |
|
|
232 |
NS_ASSERT_MSG (m_endPoint == 0, "Endpoint already allocated."); |
233 |
|
232 |
InetSocketAddress transport = InetSocketAddress::ConvertFrom (address); |
234 |
InetSocketAddress transport = InetSocketAddress::ConvertFrom (address); |
233 |
Ipv4Address ipv4 = transport.GetIpv4 (); |
235 |
Ipv4Address ipv4 = transport.GetIpv4 (); |
234 |
uint16_t port = transport.GetPort (); |
236 |
uint16_t port = transport.GetPort (); |
|
256 |
} |
258 |
} |
257 |
else if (Inet6SocketAddress::IsMatchingType (address)) |
259 |
else if (Inet6SocketAddress::IsMatchingType (address)) |
258 |
{ |
260 |
{ |
|
|
261 |
NS_ASSERT_MSG (m_endPoint == 0, "Endpoint already allocated."); |
262 |
|
259 |
Inet6SocketAddress transport = Inet6SocketAddress::ConvertFrom (address); |
263 |
Inet6SocketAddress transport = Inet6SocketAddress::ConvertFrom (address); |
260 |
Ipv6Address ipv6 = transport.GetIpv6 (); |
264 |
Ipv6Address ipv6 = transport.GetIpv6 (); |
261 |
uint16_t port = transport.GetPort (); |
265 |
uint16_t port = transport.GetPort (); |
|
894 |
UdpSocketImpl::BindToNetDevice (Ptr<NetDevice> netdevice) |
898 |
UdpSocketImpl::BindToNetDevice (Ptr<NetDevice> netdevice) |
895 |
{ |
899 |
{ |
896 |
NS_LOG_FUNCTION (netdevice); |
900 |
NS_LOG_FUNCTION (netdevice); |
|
|
901 |
|
897 |
Socket::BindToNetDevice (netdevice); // Includes sanity check |
902 |
Socket::BindToNetDevice (netdevice); // Includes sanity check |
898 |
if (m_endPoint == 0) |
903 |
if (m_endPoint == 0) |
899 |
{ |
904 |
{ |
|
905 |
NS_ASSERT (m_endPoint != 0); |
910 |
NS_ASSERT (m_endPoint != 0); |
906 |
} |
911 |
} |
907 |
m_endPoint->BindToNetDevice (netdevice); |
912 |
m_endPoint->BindToNetDevice (netdevice); |
|
|
913 |
|
914 |
if (m_endPoint6 == 0) |
915 |
{ |
916 |
if (Bind6 () == -1) |
917 |
{ |
918 |
NS_ASSERT (m_endPoint6 == 0); |
919 |
return; |
920 |
} |
921 |
NS_ASSERT (m_endPoint6 != 0); |
922 |
} |
923 |
m_endPoint6->BindToNetDevice (netdevice); |
908 |
return; |
924 |
return; |
909 |
} |
925 |
} |
910 |
|
926 |
|