A Discrete-Event Network Simulator
API
ns3::Ipv6EndPointDemux Class Reference

Demultiplexer for end points. More...

#include "ipv6-end-point-demux.h"

+ Collaboration diagram for ns3::Ipv6EndPointDemux:

Public Types

typedef std::list< Ipv6EndPoint * > EndPoints
 Container of the IPv6 endpoints. More...
 
typedef std::list< Ipv6EndPoint * >::iterator EndPointsI
 Iterator to the container of the IPv6 endpoints. More...
 

Public Member Functions

 Ipv6EndPointDemux ()
 
 ~Ipv6EndPointDemux ()
 
Ipv6EndPointAllocate ()
 Allocate a Ipv6EndPoint. More...
 
Ipv6EndPointAllocate (Ipv6Address address)
 Allocate a Ipv6EndPoint. More...
 
Ipv6EndPointAllocate (Ptr< NetDevice > boundNetDevice, Ipv6Address address, uint16_t port)
 Allocate a Ipv6EndPoint. More...
 
Ipv6EndPointAllocate (Ptr< NetDevice > boundNetDevice, Ipv6Address localAddress, uint16_t localPort, Ipv6Address peerAddress, uint16_t peerPort)
 Allocate a Ipv6EndPoint. More...
 
Ipv6EndPointAllocate (Ptr< NetDevice > boundNetDevice, uint16_t port)
 Allocate a Ipv6EndPoint. More...
 
void DeAllocate (Ipv6EndPoint *endPoint)
 Remove a end point. More...
 
EndPoints GetEndPoints () const
 Get the entire list of end points registered. More...
 
EndPoints Lookup (Ipv6Address dst, uint16_t dport, Ipv6Address src, uint16_t sport, Ptr< Ipv6Interface > incomingInterface)
 lookup for a match with all the parameters. More...
 
bool LookupLocal (Ptr< NetDevice > boundNetDevice, Ipv6Address addr, uint16_t port)
 Lookup for address and port. More...
 
bool LookupPortLocal (uint16_t port)
 Lookup for port local. More...
 
Ipv6EndPointSimpleLookup (Ipv6Address dst, uint16_t dport, Ipv6Address src, uint16_t sport)
 Simple lookup for a four-tuple match. More...
 

Private Member Functions

uint16_t AllocateEphemeralPort ()
 Allocate a ephemeral port. More...
 

Private Attributes

EndPoints m_endPoints
 A list of IPv6 end points. More...
 
uint16_t m_ephemeral
 The ephemeral port. More...
 
uint16_t m_portFirst
 The first ephemeral port. More...
 
uint16_t m_portLast
 The last ephemeral port. More...
 

Detailed Description

Demultiplexer for end points.

Definition at line 40 of file ipv6-end-point-demux.h.

Member Typedef Documentation

◆ EndPoints

Container of the IPv6 endpoints.

Definition at line 46 of file ipv6-end-point-demux.h.

◆ EndPointsI

Iterator to the container of the IPv6 endpoints.

Definition at line 51 of file ipv6-end-point-demux.h.

Constructor & Destructor Documentation

◆ Ipv6EndPointDemux()

ns3::Ipv6EndPointDemux::Ipv6EndPointDemux ( )

Definition at line 31 of file ipv6-end-point-demux.cc.

References NS_LOG_FUNCTION.

◆ ~Ipv6EndPointDemux()

ns3::Ipv6EndPointDemux::~Ipv6EndPointDemux ( )

Definition at line 39 of file ipv6-end-point-demux.cc.

References m_endPoints, and NS_LOG_FUNCTION.

Member Function Documentation

◆ Allocate() [1/5]

Ipv6EndPoint * ns3::Ipv6EndPointDemux::Allocate ( )

Allocate a Ipv6EndPoint.

Returns
an empty Ipv6EndPoint instance

Definition at line 80 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(), and ns3::UdpL4Protocol::Allocate6().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Allocate() [2/5]

Ipv6EndPoint * ns3::Ipv6EndPointDemux::Allocate ( Ipv6Address  address)

Allocate a Ipv6EndPoint.

Parameters
addressIPv6 address
Returns
an Ipv6EndPoint instance

Definition at line 96 of file ipv6-end-point-demux.cc.

References first::address, AllocateEphemeralPort(), m_endPoints, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_WARN, and port.

+ Here is the call graph for this function:

◆ Allocate() [3/5]

Ipv6EndPoint * ns3::Ipv6EndPointDemux::Allocate ( Ptr< NetDevice boundNetDevice,
Ipv6Address  address,
uint16_t  port 
)

Allocate a Ipv6EndPoint.

Parameters
boundNetDeviceBound NetDevice (if any)
addresslocal address
portlocal port
Returns
an Ipv6EndPoint instance

Definition at line 120 of file ipv6-end-point-demux.cc.

References first::address, LookupLocal(), m_endPoints, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_WARN, and port.

+ Here is the call graph for this function:

◆ Allocate() [4/5]

Ipv6EndPoint * ns3::Ipv6EndPointDemux::Allocate ( Ptr< NetDevice boundNetDevice,
Ipv6Address  localAddress,
uint16_t  localPort,
Ipv6Address  peerAddress,
uint16_t  peerPort 
)

Allocate a Ipv6EndPoint.

Parameters
boundNetDeviceBound NetDevice (if any)
localAddresslocal address
localPortlocal port
peerAddresspeer address
peerPortpeer port
Returns
an Ipv6EndPoint instance

Definition at line 135 of file ipv6-end-point-demux.cc.

References m_endPoints, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_WARN.

◆ Allocate() [5/5]

Ipv6EndPoint * ns3::Ipv6EndPointDemux::Allocate ( Ptr< NetDevice boundNetDevice,
uint16_t  port 
)

Allocate a Ipv6EndPoint.

Parameters
boundNetDeviceBound NetDevice (if any)
portlocal port
Returns
an Ipv6EndPoint instance

Definition at line 112 of file ipv6-end-point-demux.cc.

References Allocate(), ns3::Ipv6Address::GetAny(), NS_LOG_FUNCTION, and port.

+ Here is the call graph for this function:

◆ AllocateEphemeralPort()

uint16_t ns3::Ipv6EndPointDemux::AllocateEphemeralPort ( )
private

Allocate a ephemeral port.

Returns
a port

Definition at line 352 of file ipv6-end-point-demux.cc.

References LookupPortLocal(), m_ephemeral, m_portFirst, m_portLast, NS_LOG_FUNCTION, and port.

Referenced by Allocate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeAllocate()

void ns3::Ipv6EndPointDemux::DeAllocate ( Ipv6EndPoint endPoint)

Remove a end point.

Parameters
endPointthe end point to remove

Definition at line 162 of file ipv6-end-point-demux.cc.

References m_endPoints, and NS_LOG_FUNCTION.

Referenced by ns3::TcpL4Protocol::DeAllocate(), and ns3::UdpL4Protocol::DeAllocate().

+ Here is the caller graph for this function:

◆ GetEndPoints()

Ipv6EndPointDemux::EndPoints ns3::Ipv6EndPointDemux::GetEndPoints ( ) const

Get the entire list of end points registered.

Returns
list of Ipv6EndPoint

Definition at line 374 of file ipv6-end-point-demux.cc.

References m_endPoints.

◆ Lookup()

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:

  1. Full match
  2. All but local address
  3. Only local port and local address match
  4. Only local port match

EndPoint with disabled Rx are skipped.

Parameters
dstdestination address to test
dportdestination port to test
srcsource address to test
sportsource port to test
incomingInterfacethe incoming interface
Returns
list of IPv6EndPoints (could be 0 element)

Definition at line 182 of file ipv6-end-point-demux.cc.

References ns3::Ipv6Address::GetAllRoutersMulticast(), ns3::Ipv6Address::GetAny(), ns3::Ipv6EndPoint::GetBoundNetDevice(), ns3::Ipv6Interface::GetDevice(), 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::UdpL4Protocol::Receive(), and ns3::TcpL4Protocol::Receive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LookupLocal()

bool ns3::Ipv6EndPointDemux::LookupLocal ( Ptr< NetDevice boundNetDevice,
Ipv6Address  addr,
uint16_t  port 
)

Lookup for address and port.

Parameters
boundNetDeviceBound NetDevice (if any)
addraddress to test
portport to test
Returns
true if there is a match in EndPoints, false otherwise

Definition at line 65 of file ipv6-end-point-demux.cc.

References m_endPoints, NS_LOG_FUNCTION, and port.

Referenced by Allocate().

+ Here is the caller graph for this function:

◆ LookupPortLocal()

bool ns3::Ipv6EndPointDemux::LookupPortLocal ( uint16_t  port)

Lookup for port local.

Parameters
portport to test
Returns
true if a port local is in EndPoints, false otherwise

Definition at line 51 of file ipv6-end-point-demux.cc.

References m_endPoints, NS_LOG_FUNCTION, and port.

Referenced by AllocateEphemeralPort().

+ Here is the caller graph for this function:

◆ SimpleLookup()

Ipv6EndPoint * ns3::Ipv6EndPointDemux::SimpleLookup ( Ipv6Address  dst,
uint16_t  dport,
Ipv6Address  src,
uint16_t  sport 
)

Simple lookup for a four-tuple match.

Parameters
dstdestination address to test
dportdestination port to test
srcsource address to test
sportsource port to test
Returns
match or 0 if not found

Definition at line 311 of file ipv6-end-point-demux.cc.

References ns3::Ipv6Address::GetAny(), and m_endPoints.

Referenced by ns3::TcpL4Protocol::ReceiveIcmp(), and ns3::UdpL4Protocol::ReceiveIcmp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_endPoints

EndPoints ns3::Ipv6EndPointDemux::m_endPoints
private

A list of IPv6 end points.

Definition at line 188 of file ipv6-end-point-demux.h.

Referenced by ~Ipv6EndPointDemux(), Allocate(), DeAllocate(), GetEndPoints(), Lookup(), LookupLocal(), LookupPortLocal(), and SimpleLookup().

◆ m_ephemeral

uint16_t ns3::Ipv6EndPointDemux::m_ephemeral
private

The ephemeral port.

Definition at line 173 of file ipv6-end-point-demux.h.

Referenced by AllocateEphemeralPort().

◆ m_portFirst

uint16_t ns3::Ipv6EndPointDemux::m_portFirst
private

The first ephemeral port.

Definition at line 178 of file ipv6-end-point-demux.h.

Referenced by AllocateEphemeralPort().

◆ m_portLast

uint16_t ns3::Ipv6EndPointDemux::m_portLast
private

The last ephemeral port.

Definition at line 183 of file ipv6-end-point-demux.h.

Referenced by AllocateEphemeralPort().


The documentation for this class was generated from the following files: