A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::Ipv4EndPointDemux Class Reference

Demultiplexes packets to various transport layer endpoints. More...

#include <ipv4-end-point-demux.h>

+ Collaboration diagram for ns3::Ipv4EndPointDemux:

Public Types

typedef std::list< Ipv4EndPoint * > EndPoints
typedef std::list
< Ipv4EndPoint * >::iterator 
EndPointsI

Public Member Functions

 Ipv4EndPointDemux ()
 ~Ipv4EndPointDemux ()
Ipv4EndPointAllocate (void)
Ipv4EndPointAllocate (Ipv4Address address)
Ipv4EndPointAllocate (uint16_t port)
Ipv4EndPointAllocate (Ipv4Address address, uint16_t port)
Ipv4EndPointAllocate (Ipv4Address localAddress, uint16_t localPort, Ipv4Address peerAddress, uint16_t peerPort)
void DeAllocate (Ipv4EndPoint *endPoint)
EndPoints GetAllEndPoints (void)
EndPoints Lookup (Ipv4Address daddr, uint16_t dport, Ipv4Address saddr, uint16_t sport, Ptr< Ipv4Interface > incomingInterface)
bool LookupLocal (Ipv4Address addr, uint16_t port)
bool LookupPortLocal (uint16_t port)
Ipv4EndPointSimpleLookup (Ipv4Address daddr, uint16_t dport, Ipv4Address saddr, uint16_t sport)

Private Member Functions

uint16_t AllocateEphemeralPort (void)

Private Attributes

EndPoints m_endPoints
uint16_t m_ephemeral
uint16_t m_portFirst
uint16_t m_portLast

Detailed Description

Demultiplexes packets to various transport layer endpoints.

This class serves as a lookup table to match partial or full information about a four-tuple to an ns3::Ipv4EndPoint. It internally contains a list of endpoints, and has APIs to add and find endpoints in this demux. This code is shared in common to TCP and UDP protocols in ns3. This demux sits between ns3's layer four and the socket layer

Definition at line 43 of file ipv4-end-point-demux.h.

Member Typedef Documentation

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

Constructor & Destructor Documentation

ns3::Ipv4EndPointDemux::Ipv4EndPointDemux ( )

Definition at line 29 of file ipv4-end-point-demux.cc.

References NS_LOG_FUNCTION_NOARGS.

ns3::Ipv4EndPointDemux::~Ipv4EndPointDemux ( )

Definition at line 35 of file ipv4-end-point-demux.cc.

References m_endPoints, and NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

Ipv4EndPoint * ns3::Ipv4EndPointDemux::Allocate ( void  )

Definition at line 76 of file ipv4-end-point-demux.cc.

References AllocateEphemeralPort(), ns3::Ipv4Address::GetAny(), m_endPoints, NS_LOG_DEBUG, NS_LOG_FUNCTION_NOARGS, NS_LOG_WARN, and port.

Referenced by ns3::UdpL4Protocol::Allocate(), Allocate(), ns3::NscTcpL4Protocol::Allocate(), and ns3::TcpL4Protocol::Allocate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Ipv4EndPoint * ns3::Ipv4EndPointDemux::Allocate ( Ipv4Address  address)

Definition at line 92 of file ipv4-end-point-demux.cc.

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

+ Here is the call graph for this function:

Ipv4EndPoint * ns3::Ipv4EndPointDemux::Allocate ( uint16_t  port)

Definition at line 108 of file ipv4-end-point-demux.cc.

References Allocate(), ns3::Ipv4Address::GetAny(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Ipv4EndPoint * ns3::Ipv4EndPointDemux::Allocate ( Ipv4Address  address,
uint16_t  port 
)

Definition at line 116 of file ipv4-end-point-demux.cc.

References LookupLocal(), m_endPoints, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_WARN.

+ Here is the call graph for this function:

Ipv4EndPoint * ns3::Ipv4EndPointDemux::Allocate ( Ipv4Address  localAddress,
uint16_t  localPort,
Ipv4Address  peerAddress,
uint16_t  peerPort 
)

Definition at line 131 of file ipv4-end-point-demux.cc.

References m_endPoints, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_WARN, and ns3::Ipv4EndPoint::SetPeer().

+ Here is the call graph for this function:

uint16_t ns3::Ipv4EndPointDemux::AllocateEphemeralPort ( void  )
private

Definition at line 351 of file ipv4-end-point-demux.cc.

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

Referenced by Allocate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Ipv4EndPointDemux::DeAllocate ( Ipv4EndPoint endPoint)

Definition at line 157 of file ipv4-end-point-demux.cc.

References m_endPoints, and NS_LOG_FUNCTION_NOARGS.

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

+ Here is the caller graph for this function:

Ipv4EndPointDemux::EndPoints ns3::Ipv4EndPointDemux::GetAllEndPoints ( void  )

Definition at line 175 of file ipv4-end-point-demux.cc.

References m_endPoints, and NS_LOG_FUNCTION_NOARGS.

Referenced by ns3::NscTcpL4Protocol::wakeup().

+ Here is the caller graph for this function:

bool ns3::Ipv4EndPointDemux::LookupLocal ( Ipv4Address  addr,
uint16_t  port 
)

Definition at line 61 of file ipv4-end-point-demux.cc.

References m_endPoints, and NS_LOG_FUNCTION_NOARGS.

Referenced by Allocate().

+ Here is the caller graph for this function:

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

Definition at line 47 of file ipv4-end-point-demux.cc.

References m_endPoints, NS_LOG_FUNCTION_NOARGS, and port.

Referenced by AllocateEphemeralPort().

+ Here is the caller graph for this function:

Ipv4EndPoint * ns3::Ipv4EndPointDemux::SimpleLookup ( Ipv4Address  daddr,
uint16_t  dport,
Ipv4Address  saddr,
uint16_t  sport 
)

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

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

Referenced by ns3::UdpL4Protocol::ReceiveIcmp().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

EndPoints ns3::Ipv4EndPointDemux::m_endPoints
private
uint16_t ns3::Ipv4EndPointDemux::m_ephemeral
private

Definition at line 79 of file ipv4-end-point-demux.h.

Referenced by AllocateEphemeralPort().

uint16_t ns3::Ipv4EndPointDemux::m_portFirst
private

Definition at line 81 of file ipv4-end-point-demux.h.

Referenced by AllocateEphemeralPort().

uint16_t ns3::Ipv4EndPointDemux::m_portLast
private

Definition at line 80 of file ipv4-end-point-demux.h.

Referenced by AllocateEphemeralPort().


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