Demultiplexer for end points. More...
#include "ipv6-end-point-demux.h"
Public Types | |
typedef std::list< Ipv6EndPoint * > | EndPoints |
Container of the IPv6 endpoints. | |
typedef std::list< Ipv6EndPoint * >::iterator | EndPointsI |
Iterator to the container of the IPv6 endpoints. | |
Public Member Functions | |
Ipv6EndPointDemux () | |
~Ipv6EndPointDemux () | |
Ipv6EndPoint * | Allocate () |
Allocate a Ipv6EndPoint. | |
Ipv6EndPoint * | Allocate (Ipv6Address address) |
Allocate a Ipv6EndPoint. | |
Ipv6EndPoint * | Allocate (Ptr< NetDevice > boundNetDevice, Ipv6Address address, uint16_t port) |
Allocate a Ipv6EndPoint. | |
Ipv6EndPoint * | Allocate (Ptr< NetDevice > boundNetDevice, Ipv6Address localAddress, uint16_t localPort, Ipv6Address peerAddress, uint16_t peerPort) |
Allocate a Ipv6EndPoint. | |
Ipv6EndPoint * | Allocate (Ptr< NetDevice > boundNetDevice, uint16_t port) |
Allocate a Ipv6EndPoint. | |
void | DeAllocate (Ipv6EndPoint *endPoint) |
Remove a end point. | |
EndPoints | GetEndPoints () const |
Get the entire list of end points registered. | |
EndPoints | Lookup (Ipv6Address dst, uint16_t dport, Ipv6Address src, uint16_t sport, Ptr< Ipv6Interface > incomingInterface) |
lookup for a match with all the parameters. | |
bool | LookupLocal (Ptr< NetDevice > boundNetDevice, Ipv6Address addr, uint16_t port) |
Lookup for address and port. | |
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. | |
Private Member Functions | |
uint16_t | AllocateEphemeralPort () |
Allocate a ephemeral port. | |
Private Attributes | |
EndPoints | m_endPoints |
A list of IPv6 end points. | |
uint16_t | m_ephemeral |
The ephemeral port. | |
uint16_t | m_portFirst |
The first ephemeral port. | |
uint16_t | m_portLast |
The last ephemeral port. | |
Demultiplexer for end points.
Definition at line 29 of file ipv6-end-point-demux.h.
typedef std::list<Ipv6EndPoint*> ns3::Ipv6EndPointDemux::EndPoints |
Container of the IPv6 endpoints.
Definition at line 35 of file ipv6-end-point-demux.h.
typedef std::list<Ipv6EndPoint*>::iterator ns3::Ipv6EndPointDemux::EndPointsI |
Iterator to the container of the IPv6 endpoints.
Definition at line 40 of file ipv6-end-point-demux.h.
ns3::Ipv6EndPointDemux::Ipv6EndPointDemux | ( | ) |
Definition at line 20 of file ipv6-end-point-demux.cc.
References NS_LOG_FUNCTION.
ns3::Ipv6EndPointDemux::~Ipv6EndPointDemux | ( | ) |
Definition at line 28 of file ipv6-end-point-demux.cc.
References m_endPoints, and NS_LOG_FUNCTION.
Ipv6EndPoint * ns3::Ipv6EndPointDemux::Allocate | ( | ) |
Allocate a Ipv6EndPoint.
Definition at line 69 of file ipv6-end-point-demux.cc.
References AllocateEphemeralPort(), ns3::Ipv6Address::GetAny(), m_endPoints, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_WARN, and port.
Referenced by Allocate(), ns3::TcpL4Protocol::Allocate6(), ns3::TcpL4Protocol::Allocate6(), ns3::TcpL4Protocol::Allocate6(), ns3::TcpL4Protocol::Allocate6(), ns3::TcpL4Protocol::Allocate6(), ns3::UdpL4Protocol::Allocate6(), ns3::UdpL4Protocol::Allocate6(), ns3::UdpL4Protocol::Allocate6(), ns3::UdpL4Protocol::Allocate6(), and ns3::UdpL4Protocol::Allocate6().
Ipv6EndPoint * ns3::Ipv6EndPointDemux::Allocate | ( | Ipv6Address | address | ) |
Allocate a Ipv6EndPoint.
address | IPv6 address |
Definition at line 85 of file ipv6-end-point-demux.cc.
References AllocateEphemeralPort(), m_endPoints, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_WARN, and port.
Ipv6EndPoint * ns3::Ipv6EndPointDemux::Allocate | ( | Ptr< NetDevice > | boundNetDevice, |
Ipv6Address | address, | ||
uint16_t | port ) |
Allocate a Ipv6EndPoint.
boundNetDevice | Bound NetDevice (if any) |
address | local address |
port | local port |
Definition at line 109 of file ipv6-end-point-demux.cc.
References LookupLocal(), m_endPoints, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_WARN, and port.
Ipv6EndPoint * ns3::Ipv6EndPointDemux::Allocate | ( | Ptr< NetDevice > | boundNetDevice, |
Ipv6Address | localAddress, | ||
uint16_t | localPort, | ||
Ipv6Address | peerAddress, | ||
uint16_t | peerPort ) |
Allocate a Ipv6EndPoint.
boundNetDevice | Bound NetDevice (if any) |
localAddress | local address |
localPort | local port |
peerAddress | peer address |
peerPort | peer port |
Definition at line 124 of file ipv6-end-point-demux.cc.
References m_endPoints, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_WARN.
Ipv6EndPoint * ns3::Ipv6EndPointDemux::Allocate | ( | Ptr< NetDevice > | boundNetDevice, |
uint16_t | port ) |
Allocate a Ipv6EndPoint.
boundNetDevice | Bound NetDevice (if any) |
port | local port |
Definition at line 101 of file ipv6-end-point-demux.cc.
References Allocate(), ns3::Ipv6Address::GetAny(), NS_LOG_FUNCTION, and port.
|
private |
Allocate a ephemeral port.
Definition at line 341 of file ipv6-end-point-demux.cc.
References LookupPortLocal(), m_ephemeral, m_portFirst, m_portLast, NS_LOG_FUNCTION, and port.
Referenced by Allocate(), and Allocate().
void ns3::Ipv6EndPointDemux::DeAllocate | ( | Ipv6EndPoint * | endPoint | ) |
Remove a end point.
endPoint | the end point to remove |
Definition at line 151 of file ipv6-end-point-demux.cc.
References m_endPoints, and NS_LOG_FUNCTION.
Referenced by ns3::TcpL4Protocol::DeAllocate(), and ns3::UdpL4Protocol::DeAllocate().
Ipv6EndPointDemux::EndPoints ns3::Ipv6EndPointDemux::GetEndPoints | ( | ) | const |
Get the entire list of end points registered.
Definition at line 363 of file ipv6-end-point-demux.cc.
References m_endPoints.
Ipv6EndPointDemux::EndPoints ns3::Ipv6EndPointDemux::Lookup | ( | Ipv6Address | dst, |
uint16_t | dport, | ||
Ipv6Address | src, | ||
uint16_t | sport, | ||
Ptr< Ipv6Interface > | incomingInterface ) |
lookup for a match with all the parameters.
The function will return a list of most-matching EndPoints, in this order:
EndPoint with disabled Rx are skipped.
dst | destination address to test |
dport | destination port to test |
src | source address to test |
sport | source port to test |
incomingInterface | the incoming interface |
Definition at line 171 of file ipv6-end-point-demux.cc.
References ns3::Ipv6Address::GetAllRoutersMulticast(), ns3::Ipv6Address::GetAny(), ns3::Ipv6EndPoint::GetBoundNetDevice(), ns3::Ipv6EndPoint::GetLocalAddress(), ns3::Ipv6EndPoint::GetLocalPort(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Ipv6EndPoint::GetPeerPort(), ns3::Ipv6EndPoint::IsRxEnabled(), m_endPoints, NS_ABORT_MSG_IF, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by ns3::TcpL4Protocol::Receive(), and ns3::UdpL4Protocol::Receive().
bool ns3::Ipv6EndPointDemux::LookupLocal | ( | Ptr< NetDevice > | boundNetDevice, |
Ipv6Address | addr, | ||
uint16_t | port ) |
Lookup for address and port.
boundNetDevice | Bound NetDevice (if any) |
addr | address to test |
port | port to test |
Definition at line 54 of file ipv6-end-point-demux.cc.
References m_endPoints, NS_LOG_FUNCTION, and port.
Referenced by Allocate().
bool ns3::Ipv6EndPointDemux::LookupPortLocal | ( | uint16_t | port | ) |
Lookup for port local.
port | port to test |
Definition at line 40 of file ipv6-end-point-demux.cc.
References m_endPoints, NS_LOG_FUNCTION, and port.
Referenced by AllocateEphemeralPort().
Ipv6EndPoint * ns3::Ipv6EndPointDemux::SimpleLookup | ( | Ipv6Address | dst, |
uint16_t | dport, | ||
Ipv6Address | src, | ||
uint16_t | sport ) |
Simple lookup for a four-tuple match.
dst | destination address to test |
dport | destination port to test |
src | source address to test |
sport | source port to test |
Definition at line 300 of file ipv6-end-point-demux.cc.
References ns3::Ipv6Address::GetAny(), and m_endPoints.
Referenced by ns3::TcpL4Protocol::ReceiveIcmp(), and ns3::UdpL4Protocol::ReceiveIcmp().
|
private |
A list of IPv6 end points.
Definition at line 177 of file ipv6-end-point-demux.h.
Referenced by ~Ipv6EndPointDemux(), Allocate(), Allocate(), Allocate(), Allocate(), DeAllocate(), GetEndPoints(), Lookup(), LookupLocal(), LookupPortLocal(), and SimpleLookup().
|
private |
The ephemeral port.
Definition at line 162 of file ipv6-end-point-demux.h.
Referenced by AllocateEphemeralPort().
|
private |
The first ephemeral port.
Definition at line 167 of file ipv6-end-point-demux.h.
Referenced by AllocateEphemeralPort().
|
private |
The last ephemeral port.
Definition at line 172 of file ipv6-end-point-demux.h.
Referenced by AllocateEphemeralPort().