A representation of an internet endpoint/connection. More...
#include <ipv4-end-point.h>
Public Member Functions | |
Ipv4EndPoint (Ipv4Address address, uint16_t port) | |
~Ipv4EndPoint () | |
Ipv4Address | GetLocalAddress (void) |
void | SetLocalAddress (Ipv4Address address) |
uint16_t | GetLocalPort (void) |
Ipv4Address | GetPeerAddress (void) |
uint16_t | GetPeerPort (void) |
void | SetPeer (Ipv4Address address, uint16_t port) |
void | SetRxCallback (Callback< void, Ptr< Packet >, Ipv4Address, uint16_t > callback) |
void | SetIcmpCallback (Callback< void, Ipv4Address, uint8_t, uint8_t, uint8_t, uint32_t > callback) |
void | SetDestroyCallback (Callback< void > callback) |
void | ForwardUp (Ptr< Packet > p, Ipv4Address saddr, uint16_t sport) |
void | ForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo) |
Private Member Functions | |
void | DoForwardUp (Ptr< Packet > p, Ipv4Address saddr, uint16_t sport) |
void | DoForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo) |
Private Attributes | |
Ipv4Address | m_localAddr |
uint16_t | m_localPort |
Ipv4Address | m_peerAddr |
uint16_t | m_peerPort |
Callback< void, Ptr< Packet > , Ipv4Address, uint16_t > | m_rxCallback |
Callback< void, Ipv4Address, uint8_t, uint8_t, uint8_t, uint32_t > | m_icmpCallback |
Callback< void > | m_destroyCallback |
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 44 of file ipv4-end-point.h.
ns3::Ipv4EndPoint::Ipv4EndPoint | ( | Ipv4Address | address, | |
uint16_t | port | |||
) |
Definition at line 30 of file ipv4-end-point.cc.
ns3::Ipv4EndPoint::~Ipv4EndPoint | ( | ) |
Definition at line 36 of file ipv4-end-point.cc.
References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), and m_destroyCallback.
void ns3::Ipv4EndPoint::DoForwardIcmp | ( | Ipv4Address | icmpSource, | |
uint8_t | icmpTtl, | |||
uint8_t | icmpType, | |||
uint8_t | icmpCode, | |||
uint32_t | icmpInfo | |||
) | [private] |
Definition at line 123 of file ipv4-end-point.cc.
References m_icmpCallback.
Referenced by ForwardIcmp().
void ns3::Ipv4EndPoint::DoForwardUp | ( | Ptr< Packet > | p, | |
Ipv4Address | saddr, | |||
uint16_t | sport | |||
) | [private] |
Definition at line 104 of file ipv4-end-point.cc.
References m_rxCallback.
Referenced by ForwardUp().
void ns3::Ipv4EndPoint::ForwardIcmp | ( | Ipv4Address | icmpSource, | |
uint8_t | icmpTtl, | |||
uint8_t | icmpType, | |||
uint8_t | icmpCode, | |||
uint32_t | icmpInfo | |||
) |
Definition at line 110 of file ipv4-end-point.cc.
References DoForwardIcmp(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_icmpCallback, NS_LOG_FUNCTION, and ns3::Simulator::ScheduleNow().
Referenced by ns3::UdpL4Protocol::ReceiveIcmp().
void ns3::Ipv4EndPoint::ForwardUp | ( | Ptr< Packet > | p, | |
Ipv4Address | saddr, | |||
uint16_t | sport | |||
) |
Definition at line 96 of file ipv4-end-point.cc.
References DoForwardUp(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_rxCallback, and ns3::Simulator::ScheduleNow().
Ipv4Address ns3::Ipv4EndPoint::GetLocalAddress | ( | void | ) |
Definition at line 45 of file ipv4-end-point.cc.
References m_localAddr.
Referenced by ns3::TcpSocketImpl::DoSendTo(), ns3::TcpSocketImpl::FinishBind(), ns3::NscTcpSocketImpl::FinishBind(), ns3::TcpSocketImpl::ForwardUp(), ns3::UdpSocketImpl::GetSockName(), ns3::Ipv4EndPointDemux::Lookup(), ns3::TcpSocketImpl::PersistTimeout(), ns3::TcpSocketImpl::Retransmit(), ns3::TcpSocketImpl::SendEmptyPacket(), and ns3::TcpSocketImpl::SendPendingData().
uint16_t ns3::Ipv4EndPoint::GetLocalPort | ( | void | ) |
Definition at line 57 of file ipv4-end-point.cc.
References m_localPort.
Referenced by ns3::UdpSocketImpl::DoSendTo(), ns3::TcpSocketImpl::DoSendTo(), ns3::TcpSocketImpl::FinishBind(), ns3::NscTcpSocketImpl::FinishBind(), ns3::TcpSocketImpl::ForwardUp(), ns3::UdpSocketImpl::GetSockName(), ns3::Ipv4EndPointDemux::Lookup(), ns3::TcpSocketImpl::PersistTimeout(), ns3::TcpSocketImpl::Retransmit(), ns3::TcpSocketImpl::SendEmptyPacket(), and ns3::TcpSocketImpl::SendPendingData().
Ipv4Address ns3::Ipv4EndPoint::GetPeerAddress | ( | void | ) |
Definition at line 62 of file ipv4-end-point.cc.
References m_peerAddr.
Referenced by ns3::TcpSocketImpl::ForwardUp(), and ns3::Ipv4EndPointDemux::Lookup().
uint16_t ns3::Ipv4EndPoint::GetPeerPort | ( | void | ) |
Definition at line 67 of file ipv4-end-point.cc.
References m_peerPort.
Referenced by ns3::TcpSocketImpl::ForwardUp(), and ns3::Ipv4EndPointDemux::Lookup().
void ns3::Ipv4EndPoint::SetDestroyCallback | ( | Callback< void > | callback | ) |
Definition at line 90 of file ipv4-end-point.cc.
References m_destroyCallback.
Referenced by ns3::TcpSocketImpl::CompleteFork(), ns3::NscTcpSocketImpl::CompleteFork(), ns3::UdpSocketImpl::FinishBind(), ns3::TcpSocketImpl::FinishBind(), and ns3::NscTcpSocketImpl::FinishBind().
void ns3::Ipv4EndPoint::SetIcmpCallback | ( | Callback< void, Ipv4Address, uint8_t, uint8_t, uint8_t, uint32_t > | callback | ) |
Definition at line 84 of file ipv4-end-point.cc.
References m_icmpCallback.
Referenced by ns3::UdpSocketImpl::FinishBind().
void ns3::Ipv4EndPoint::SetLocalAddress | ( | Ipv4Address | address | ) |
Definition at line 51 of file ipv4-end-point.cc.
References m_localAddr.
Referenced by ns3::TcpSocketImpl::Connect(), and ns3::TcpSocketImpl::ProcessPacketAction().
void ns3::Ipv4EndPoint::SetPeer | ( | Ipv4Address | address, | |
uint16_t | port | |||
) |
Definition at line 72 of file ipv4-end-point.cc.
References m_peerAddr, and m_peerPort.
Referenced by ns3::Ipv4EndPointDemux::Allocate(), ns3::TcpSocketImpl::ProcessEvent(), and ns3::TcpSocketImpl::ProcessPacketAction().
void ns3::Ipv4EndPoint::SetRxCallback | ( | Callback< void, Ptr< Packet >, Ipv4Address, uint16_t > | callback | ) |
Definition at line 79 of file ipv4-end-point.cc.
References m_rxCallback.
Referenced by ns3::TcpSocketImpl::CompleteFork(), ns3::NscTcpSocketImpl::CompleteFork(), ns3::UdpSocketImpl::FinishBind(), ns3::TcpSocketImpl::FinishBind(), and ns3::NscTcpSocketImpl::FinishBind().
Callback<void> ns3::Ipv4EndPoint::m_destroyCallback [private] |
Definition at line 82 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 81 of file ipv4-end-point.h.
Referenced by DoForwardIcmp(), ForwardIcmp(), and SetIcmpCallback().
Ipv4Address ns3::Ipv4EndPoint::m_localAddr [private] |
Definition at line 76 of file ipv4-end-point.h.
Referenced by GetLocalAddress(), and SetLocalAddress().
uint16_t ns3::Ipv4EndPoint::m_localPort [private] |
Definition at line 77 of file ipv4-end-point.h.
Referenced by GetLocalPort().
Ipv4Address ns3::Ipv4EndPoint::m_peerAddr [private] |
Definition at line 78 of file ipv4-end-point.h.
Referenced by GetPeerAddress(), and SetPeer().
uint16_t ns3::Ipv4EndPoint::m_peerPort [private] |
Definition at line 79 of file ipv4-end-point.h.
Referenced by GetPeerPort(), and SetPeer().
Callback<void,Ptr<Packet>, Ipv4Address, uint16_t> ns3::Ipv4EndPoint::m_rxCallback [private] |
Definition at line 80 of file ipv4-end-point.h.
Referenced by DoForwardUp(), ForwardUp(), and SetRxCallback().