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

A representation of an internet endpoint/connection. More...

#include <ipv4-end-point.h>

+ Collaboration diagram for ns3::Ipv4EndPoint:

Public Member Functions

 Ipv4EndPoint (Ipv4Address address, uint16_t port)
 
 ~Ipv4EndPoint ()
 
void BindToNetDevice (Ptr< NetDevice > netdevice)
 
void ForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo)
 
void ForwardUp (Ptr< Packet > p, const Ipv4Header &header, uint16_t sport, Ptr< Ipv4Interface > incomingInterface)
 
Ptr< NetDeviceGetBoundNetDevice (void)
 
Ipv4Address GetLocalAddress (void)
 
uint16_t GetLocalPort (void)
 
Ipv4Address GetPeerAddress (void)
 
uint16_t GetPeerPort (void)
 
void SetDestroyCallback (Callback< void > callback)
 
void SetIcmpCallback (Callback< void, Ipv4Address, uint8_t, uint8_t, uint8_t, uint32_t > callback)
 
void SetLocalAddress (Ipv4Address address)
 
void SetPeer (Ipv4Address address, uint16_t port)
 
void SetRxCallback (Callback< void, Ptr< Packet >, Ipv4Header, uint16_t, Ptr< Ipv4Interface > > callback)
 

Private Member Functions

void DoForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo)
 
void DoForwardUp (Ptr< Packet > p, const Ipv4Header &header, uint16_t sport, Ptr< Ipv4Interface > incomingInterface)
 

Private Attributes

Ptr< NetDevicem_boundnetdevice
 
Callback< void > m_destroyCallback
 
Callback< void, Ipv4Address,
uint8_t, uint8_t, uint8_t,
uint32_t > 
m_icmpCallback
 
Ipv4Address m_localAddr
 
uint16_t m_localPort
 
Ipv4Address m_peerAddr
 
uint16_t m_peerPort
 
Callback< void, Ptr< Packet >
, Ipv4Header, uint16_t, Ptr
< Ipv4Interface > > 
m_rxCallback
 

Detailed Description

A representation of an internet endpoint/connection.

This class provides an internet four-tuple (source and destination ports and addresses). These are used in the ns3::Ipv4EndPointDemux as targets of lookups. The class also has a callback for notification to higher layers that a packet from a lower layer was received. In the ns3 internet-stack, these notifications are automatically registered to be received by the corresponding socket.

Definition at line 47 of file ipv4-end-point.h.

Constructor & Destructor Documentation

ns3::Ipv4EndPoint::Ipv4EndPoint ( Ipv4Address  address,
uint16_t  port 
)

Definition at line 30 of file ipv4-end-point.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

void ns3::Ipv4EndPoint::BindToNetDevice ( Ptr< NetDevice netdevice)

Definition at line 91 of file ipv4-end-point.cc.

References m_boundnetdevice, and NS_LOG_FUNCTION.

Referenced by ns3::UdpSocketImpl::BindToNetDevice(), and ns3::TcpSocketBase::BindToNetDevice().

+ Here is the caller graph for this function:

void ns3::Ipv4EndPoint::DoForwardIcmp ( Ipv4Address  icmpSource,
uint8_t  icmpTtl,
uint8_t  icmpType,
uint8_t  icmpCode,
uint32_t  icmpInfo 
)
private

Definition at line 163 of file ipv4-end-point.cc.

References m_icmpCallback, and NS_LOG_FUNCTION.

Referenced by ForwardIcmp().

+ Here is the caller graph for this function:

void ns3::Ipv4EndPoint::DoForwardUp ( Ptr< Packet p,
const Ipv4Header header,
uint16_t  sport,
Ptr< Ipv4Interface incomingInterface 
)
private

Definition at line 138 of file ipv4-end-point.cc.

References m_rxCallback, and NS_LOG_FUNCTION.

Referenced by ForwardUp().

+ Here is the caller graph for this function:

void ns3::Ipv4EndPoint::ForwardIcmp ( Ipv4Address  icmpSource,
uint8_t  icmpTtl,
uint8_t  icmpType,
uint8_t  icmpCode,
uint32_t  icmpInfo 
)

Definition at line 150 of file ipv4-end-point.cc.

References DoForwardIcmp(), m_icmpCallback, NS_LOG_FUNCTION, and ns3::Simulator::ScheduleNow().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Ipv4EndPoint::ForwardUp ( Ptr< Packet p,
const Ipv4Header header,
uint16_t  sport,
Ptr< Ipv4Interface incomingInterface 
)

Definition at line 126 of file ipv4-end-point.cc.

References DoForwardUp(), m_rxCallback, NS_LOG_FUNCTION, and ns3::Simulator::ScheduleNow().

+ Here is the call graph for this function:

Ptr< NetDevice > ns3::Ipv4EndPoint::GetBoundNetDevice ( void  )

Definition at line 99 of file ipv4-end-point.cc.

References m_boundnetdevice, and NS_LOG_FUNCTION.

Referenced by ns3::Ipv4EndPointDemux::Lookup().

+ Here is the caller graph for this function:

void ns3::Ipv4EndPoint::SetDestroyCallback ( Callback< void >  callback)
void ns3::Ipv4EndPoint::SetIcmpCallback ( Callback< void, Ipv4Address, uint8_t, uint8_t, uint8_t, uint32_t >  callback)

Definition at line 112 of file ipv4-end-point.cc.

References m_icmpCallback, and NS_LOG_FUNCTION.

Referenced by ns3::UdpSocketImpl::FinishBind(), and ns3::TcpSocketBase::SetupCallback().

+ Here is the caller graph for this function:

void ns3::Ipv4EndPoint::SetLocalAddress ( Ipv4Address  address)

Definition at line 58 of file ipv4-end-point.cc.

References first::address, m_localAddr, and NS_LOG_FUNCTION.

Referenced by ns3::TcpSocketBase::SetupEndpoint().

+ Here is the caller graph for this function:

void ns3::Ipv4EndPoint::SetPeer ( Ipv4Address  address,
uint16_t  port 
)

Definition at line 83 of file ipv4-end-point.cc.

References first::address, m_peerAddr, m_peerPort, NS_LOG_FUNCTION, and port.

Referenced by ns3::Ipv4EndPointDemux::Allocate(), ns3::TcpSocketBase::Connect(), and ns3::TcpSocketBase::ProcessSynRcvd().

+ Here is the caller graph for this function:

void ns3::Ipv4EndPoint::SetRxCallback ( Callback< void, Ptr< Packet >, Ipv4Header, uint16_t, Ptr< Ipv4Interface > >  callback)

Member Data Documentation

Ptr<NetDevice> ns3::Ipv4EndPoint::m_boundnetdevice
private

Definition at line 88 of file ipv4-end-point.h.

Referenced by BindToNetDevice(), and GetBoundNetDevice().

Callback<void> ns3::Ipv4EndPoint::m_destroyCallback
private

Definition at line 91 of file ipv4-end-point.h.

Referenced by SetDestroyCallback(), and ~Ipv4EndPoint().

Callback<void,Ipv4Address,uint8_t,uint8_t,uint8_t,uint32_t> ns3::Ipv4EndPoint::m_icmpCallback
private

Definition at line 90 of file ipv4-end-point.h.

Referenced by DoForwardIcmp(), ForwardIcmp(), SetIcmpCallback(), and ~Ipv4EndPoint().

Ipv4Address ns3::Ipv4EndPoint::m_localAddr
private

Definition at line 84 of file ipv4-end-point.h.

Referenced by GetLocalAddress(), and SetLocalAddress().

uint16_t ns3::Ipv4EndPoint::m_localPort
private

Definition at line 85 of file ipv4-end-point.h.

Referenced by GetLocalPort().

Ipv4Address ns3::Ipv4EndPoint::m_peerAddr
private

Definition at line 86 of file ipv4-end-point.h.

Referenced by GetPeerAddress(), and SetPeer().

uint16_t ns3::Ipv4EndPoint::m_peerPort
private

Definition at line 87 of file ipv4-end-point.h.

Referenced by GetPeerPort(), and SetPeer().

Callback<void,Ptr<Packet>, Ipv4Header, uint16_t, Ptr<Ipv4Interface> > ns3::Ipv4EndPoint::m_rxCallback
private

Definition at line 89 of file ipv4-end-point.h.

Referenced by DoForwardUp(), ForwardUp(), SetRxCallback(), and ~Ipv4EndPoint().


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