46 if ((*i)->GetLocalPort() ==
port)
60 if ((*i)->GetLocalPort() ==
port && (*i)->GetLocalAddress() == addr &&
134 if ((*i)->GetLocalPort() ==
localPort && (*i)->GetLocalAddress() == localAddress &&
136 ((*i)->GetBoundNetDevice() ==
boundNetDevice || !(*i)->GetBoundNetDevice()))
208 <<
endP->GetLocalPort() <<
" daddr=" <<
endP->GetLocalAddress()
209 <<
" sport=" <<
endP->GetPeerPort() <<
" saddr=" <<
endP->GetPeerAddress());
211 if (!
endP->IsRxEnabled())
214 <<
" because endpoint can not receive packets");
221 <<
endP->GetLocalPort()
222 <<
" does not match packet dport " <<
dport);
225 if (
endP->GetBoundNetDevice())
230 << &
endP <<
" because endpoint is bound to specific device and"
231 <<
endP->GetBoundNetDevice() <<
" does not match packet device "
268 <<
endP->GetLocalAddress() <<
"/"
306 NS_LOG_LOGIC(
"Found an endpoint for case 4, adding " <<
endP->GetLocalAddress() <<
":"
307 <<
endP->GetLocalPort());
312 NS_LOG_LOGIC(
"Found an endpoint for case 3, adding " <<
endP->GetLocalAddress() <<
":"
313 <<
endP->GetLocalPort());
318 NS_LOG_LOGIC(
"Found an endpoint for case 2, adding " <<
endP->GetLocalAddress() <<
":"
319 <<
endP->GetLocalPort());
325 NS_LOG_LOGIC(
"Found an endpoint for case 1, adding " <<
endP->GetLocalAddress() <<
":"
326 <<
endP->GetLocalPort());
351 "Too many endpoints - perhaps you created too many sockets without binding "
352 "them to different NetDevices.");
370 if ((*i)->GetLocalPort() !=
dport)
374 if ((*i)->GetLocalAddress() ==
daddr && (*i)->GetPeerPort() ==
sport &&
375 (*i)->GetPeerAddress() ==
saddr)
Ipv4 addresses are stored in host order in this class.
Ipv4Address CombineMask(const Ipv4Mask &mask) const
Combine this address with a network mask.
static Ipv4Address GetAny()
uint16_t m_portFirst
The first ephemeral port.
uint16_t AllocateEphemeralPort()
Allocate an ephemeral port.
EndPoints m_endPoints
A list of IPv4 end points.
uint16_t m_portLast
The last ephemeral port.
Ipv4EndPoint * SimpleLookup(Ipv4Address daddr, uint16_t dport, Ipv4Address saddr, uint16_t sport)
simple lookup for a match with all the parameters.
bool LookupLocal(Ptr< NetDevice > boundNetDevice, Ipv4Address addr, uint16_t port)
Lookup for address and port.
EndPoints GetAllEndPoints()
Get the entire list of end points registered.
uint16_t m_ephemeral
The ephemeral port.
EndPoints Lookup(Ipv4Address daddr, uint16_t dport, Ipv4Address saddr, uint16_t sport, Ptr< Ipv4Interface > incomingInterface)
lookup for a match with all the parameters.
bool LookupPortLocal(uint16_t port)
Lookup for port local.
void DeAllocate(Ipv4EndPoint *endPoint)
Remove a end point.
Ipv4EndPoint * Allocate()
Allocate a Ipv4EndPoint.
std::list< Ipv4EndPoint * > EndPoints
Container of the IPv4 endpoints.
A representation of an internet endpoint/connection.
a class to store IPv4 address information on an interface
Ipv4Mask GetMask() const
Get the network mask.
Ipv4Address GetAddress() const
Get the local address.
Ipv4Address GetLocal() const
Get the local address.
uint16_t GetPrefixLength() const
Smart pointer class similar to boost::intrusive_ptr.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.