30 : m_ephemeral (49152),
53 if ((*i)->GetLocalPort () ==
port)
66 if ((*i)->GetLocalPort () == port
67 && (*i)->GetLocalAddress () == addr)
129 NS_LOG_FUNCTION (
this << localAddress << localPort << peerAddress << peerPort);
132 if ((*i)->GetLocalPort () == localPort
133 && (*i)->GetLocalAddress () == localAddress
134 && (*i)->GetPeerPort () == peerPort
135 && (*i)->GetPeerAddress () == peerAddress)
137 NS_LOG_WARN (
"No way we can allocate this end-point.");
143 endPoint->
SetPeer (peerAddress, peerPort);
174 NS_LOG_FUNCTION (
this << daddr << dport << saddr << sport << incomingInterface);
181 NS_LOG_DEBUG (
"Looking up endpoint for destination address " << daddr);
192 <<
" because endpoint dport "
194 <<
" does not match packet dport " << dport);
203 <<
" because endpoint is bound to specific device and"
205 <<
" does not match packet device " << incomingInterface->
GetDevice ());
218 if (!(localAddressMatchesExact || localAddressMatchesWildCard))
222 bool remotePeerMatchesExact = endP->
GetPeerPort () == sport;
223 bool remotePeerMatchesWildCard = endP->
GetPeerPort () == 0;
224 bool remoteAddressMatchesExact = endP->
GetPeerAddress () == saddr;
229 if (!(remotePeerMatchesExact || remotePeerMatchesWildCard))
233 if (!(remoteAddressMatchesExact || remoteAddressMatchesWildCard))
239 if (localAddressMatchesWildCard
240 && remotePeerMatchesWildCard
241 && remoteAddressMatchesWildCard)
243 retval1.push_back (endP);
245 if ((localAddressMatchesExact || (localAddressMatchesAllRouters))
246 && remotePeerMatchesWildCard
247 && remoteAddressMatchesWildCard)
249 retval2.push_back (endP);
251 if (localAddressMatchesWildCard
252 && remotePeerMatchesExact
253 && remoteAddressMatchesExact)
255 retval3.push_back (endP);
257 if (localAddressMatchesExact
258 && remotePeerMatchesExact
259 && remoteAddressMatchesExact)
261 retval4.push_back (endP);
266 if (!retval4.empty ())
270 if (!retval3.empty ())
274 if (!retval2.empty ())
283 uint32_t genericity = 3;
290 if ((*i)->GetLocalPort () != dport)
295 if ((*i)->GetLocalAddress () == dst && (*i)->GetPeerPort () == sport
296 && (*i)->GetPeerAddress () == src)
312 if (tmp < genericity)