31 : m_ephemeral (49152),
54 if ((*i)->GetLocalPort () ==
port)
67 if ((*i)->GetLocalPort () == port
68 && (*i)->GetLocalAddress () == addr)
130 NS_LOG_FUNCTION (
this << localAddress << localPort << peerAddress << peerPort);
133 if ((*i)->GetLocalPort () == localPort
134 && (*i)->GetLocalAddress () == localAddress
135 && (*i)->GetPeerPort () == peerPort
136 && (*i)->GetPeerAddress () == peerAddress)
138 NS_LOG_WARN (
"No way we can allocate this end-point.");
144 endPoint->
SetPeer (peerAddress, peerPort);
175 NS_LOG_FUNCTION (
this << daddr << dport << saddr << sport << incomingInterface);
182 NS_LOG_DEBUG (
"Looking up endpoint for destination address " << daddr);
193 <<
" because endpoint dport "
195 <<
" does not match packet dport " << dport);
204 <<
" because endpoint is bound to specific device and"
206 <<
" does not match packet device " << incomingInterface->
GetDevice ());
219 if (!(localAddressMatchesExact || localAddressMatchesWildCard))
223 bool remotePeerMatchesExact = endP->
GetPeerPort () == sport;
224 bool remotePeerMatchesWildCard = endP->
GetPeerPort () == 0;
225 bool remoteAddressMatchesExact = endP->
GetPeerAddress () == saddr;
230 if (!(remotePeerMatchesExact || remotePeerMatchesWildCard))
234 if (!(remoteAddressMatchesExact || remoteAddressMatchesWildCard))
240 if (localAddressMatchesWildCard
241 && remotePeerMatchesWildCard
242 && remoteAddressMatchesWildCard)
244 retval1.push_back (endP);
246 if ((localAddressMatchesExact || (localAddressMatchesAllRouters))
247 && remotePeerMatchesWildCard
248 && remoteAddressMatchesWildCard)
250 retval2.push_back (endP);
252 if (localAddressMatchesWildCard
253 && remotePeerMatchesExact
254 && remoteAddressMatchesExact)
256 retval3.push_back (endP);
258 if (localAddressMatchesExact
259 && remotePeerMatchesExact
260 && remoteAddressMatchesExact)
262 retval4.push_back (endP);
267 if (!retval4.empty ())
271 if (!retval3.empty ())
275 if (!retval2.empty ())
284 uint32_t genericity = 3;
291 if ((*i)->GetLocalPort () != dport)
296 if ((*i)->GetLocalAddress () == dst && (*i)->GetPeerPort () == sport
297 && (*i)->GetPeerAddress () == src)
313 if (tmp < genericity)
Ipv6Address GetLocalAddress()
Get the local address.
#define NS_LOG_FUNCTION(parameters)
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
std::list< Ipv6EndPoint * > EndPoints
Container of the IPv6 endpoints.
EndPoints Lookup(Ipv6Address dst, uint16_t dport, Ipv6Address src, uint16_t sport, Ptr< Ipv6Interface > incomingInterface)
lookup for a match with all the parameters.
uint16_t m_ephemeral
The ephemeral port.
static Ipv6Address GetAny()
Get the "any" (::) Ipv6Address.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
std::list< Ipv6EndPoint * >::iterator EndPointsI
Iterator to the container of the IPv6 endpoints.
EndPoints m_endPoints
A list of IPv6 end points.
bool LookupLocal(Ipv6Address addr, uint16_t port)
Lookup for address and port.
uint16_t GetPeerPort()
Get the peer port.
uint16_t GetLocalPort()
Get the local port.
Ipv6EndPoint * Allocate(void)
Allocate a Ipv6EndPoint.
virtual Ptr< NetDevice > GetDevice() const
Get the NetDevice.
#define NS_LOG_LOGIC(msg)
uint16_t m_portLast
The last ephemeral port.
void DeAllocate(Ipv6EndPoint *endPoint)
Remove a end point.
bool LookupPortLocal(uint16_t port)
Lookup for port local.
Ipv6EndPoint * SimpleLookup(Ipv6Address dst, uint16_t dport, Ipv6Address src, uint16_t sport)
Simple lookup for a four-tuple match.
uint16_t m_portFirst
The first ephemeral port.
Describes an IPv6 address.
Ipv6Address GetPeerAddress()
Get the peer address.
#define NS_LOG_DEBUG(msg)
A representation of an internet IPv6 endpoint/connection.
uint16_t AllocateEphemeralPort()
Allocate a ephemeral port.
Ptr< NetDevice > GetBoundNetDevice(void)
Returns socket's bound netdevice, if any.
EndPoints GetEndPoints() const
Get the entire list of end points registered.
void SetPeer(Ipv6Address addr, uint16_t port)
Set the peer informations (address and port).
static Ipv6Address GetAllRoutersMulticast()
Get the "all routers multicast" address.