A representation of an internet endpoint/connection. More...
#include <ipv4-end-point.h>
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< NetDevice > | GetBoundNetDevice (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< NetDevice > | m_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 |
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.
ns3::Ipv4EndPoint::Ipv4EndPoint | ( | Ipv4Address | address, |
uint16_t | port | ||
) |
Definition at line 30 of file ipv4-end-point.cc.
References NS_LOG_FUNCTION.
ns3::Ipv4EndPoint::~Ipv4EndPoint | ( | ) |
Definition at line 38 of file ipv4-end-point.cc.
References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_destroyCallback, m_icmpCallback, m_rxCallback, NS_LOG_FUNCTION, and ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::Nullify().
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().
|
private |
Definition at line 163 of file ipv4-end-point.cc.
References m_icmpCallback, and NS_LOG_FUNCTION.
Referenced by ForwardIcmp().
|
private |
Definition at line 138 of file ipv4-end-point.cc.
References m_rxCallback, and NS_LOG_FUNCTION.
Referenced by ForwardUp().
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().
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().
Definition at line 99 of file ipv4-end-point.cc.
References m_boundnetdevice, and NS_LOG_FUNCTION.
Referenced by ns3::Ipv4EndPointDemux::Lookup().
Ipv4Address ns3::Ipv4EndPoint::GetLocalAddress | ( | void | ) |
Definition at line 51 of file ipv4-end-point.cc.
References m_localAddr, and NS_LOG_FUNCTION.
Referenced by ns3::TcpSocketBase::DoForwardUp(), ns3::UdpSocketImpl::DoSendTo(), ns3::NscTcpSocketImpl::FinishBind(), ns3::UdpSocketImpl::GetSockName(), ns3::TcpSocketBase::GetSockName(), ns3::Ipv4EndPointDemux::Lookup(), ns3::TcpSocketBase::PersistTimeout(), ns3::TcpSocketBase::SendDataPacket(), and ns3::TcpSocketBase::SendEmptyPacket().
uint16_t ns3::Ipv4EndPoint::GetLocalPort | ( | void | ) |
Definition at line 65 of file ipv4-end-point.cc.
References m_localPort, and NS_LOG_FUNCTION.
Referenced by ns3::TcpSocketBase::DoForwardUp(), ns3::UdpSocketImpl::DoSendTo(), ns3::NscTcpSocketImpl::FinishBind(), ns3::UdpSocketImpl::GetSockName(), ns3::TcpSocketBase::GetSockName(), ns3::Ipv4EndPointDemux::Lookup(), ns3::TcpSocketBase::PersistTimeout(), ns3::TcpSocketBase::SendDataPacket(), and ns3::TcpSocketBase::SendEmptyPacket().
Ipv4Address ns3::Ipv4EndPoint::GetPeerAddress | ( | void | ) |
Definition at line 71 of file ipv4-end-point.cc.
References m_peerAddr, and NS_LOG_FUNCTION.
Referenced by ns3::TcpSocketBase::DoForwardUp(), ns3::Ipv4EndPointDemux::Lookup(), ns3::TcpSocketBase::PersistTimeout(), ns3::TcpSocketBase::Recv(), ns3::TcpSocketBase::RecvFrom(), ns3::TcpSocketBase::SendDataPacket(), ns3::TcpSocketBase::SendEmptyPacket(), and ns3::TcpSocketBase::SetupEndpoint().
uint16_t ns3::Ipv4EndPoint::GetPeerPort | ( | void | ) |
Definition at line 77 of file ipv4-end-point.cc.
References m_peerPort, and NS_LOG_FUNCTION.
Referenced by ns3::TcpSocketBase::DoForwardUp(), ns3::Ipv4EndPointDemux::Lookup(), ns3::TcpSocketBase::PersistTimeout(), ns3::TcpSocketBase::Recv(), ns3::TcpSocketBase::RecvFrom(), ns3::TcpSocketBase::SendDataPacket(), and ns3::TcpSocketBase::SendEmptyPacket().
void ns3::Ipv4EndPoint::SetDestroyCallback | ( | Callback< void > | callback | ) |
Definition at line 119 of file ipv4-end-point.cc.
References m_destroyCallback, and NS_LOG_FUNCTION.
Referenced by ns3::NscTcpSocketImpl::CompleteFork(), ns3::TcpSocketBase::DeallocateEndPoint(), ns3::NscTcpSocketImpl::FinishBind(), ns3::UdpSocketImpl::FinishBind(), and ns3::TcpSocketBase::SetupCallback().
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().
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().
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().
void ns3::Ipv4EndPoint::SetRxCallback | ( | Callback< void, Ptr< Packet >, Ipv4Header, uint16_t, Ptr< Ipv4Interface > > | callback | ) |
Definition at line 106 of file ipv4-end-point.cc.
References m_rxCallback, and NS_LOG_FUNCTION.
Referenced by ns3::NscTcpSocketImpl::CompleteFork(), ns3::NscTcpSocketImpl::FinishBind(), ns3::UdpSocketImpl::FinishBind(), and ns3::TcpSocketBase::SetupCallback().
Definition at line 88 of file ipv4-end-point.h.
Referenced by BindToNetDevice(), and GetBoundNetDevice().
|
private |
Definition at line 91 of file ipv4-end-point.h.
Referenced by SetDestroyCallback(), and ~Ipv4EndPoint().
|
private |
Definition at line 90 of file ipv4-end-point.h.
Referenced by DoForwardIcmp(), ForwardIcmp(), SetIcmpCallback(), and ~Ipv4EndPoint().
|
private |
Definition at line 84 of file ipv4-end-point.h.
Referenced by GetLocalAddress(), and SetLocalAddress().
|
private |
Definition at line 85 of file ipv4-end-point.h.
Referenced by GetLocalPort().
|
private |
Definition at line 86 of file ipv4-end-point.h.
Referenced by GetPeerAddress(), and SetPeer().
|
private |
Definition at line 87 of file ipv4-end-point.h.
Referenced by GetPeerPort(), and SetPeer().
|
private |
Definition at line 89 of file ipv4-end-point.h.
Referenced by DoForwardUp(), ForwardUp(), SetRxCallback(), and ~Ipv4EndPoint().