An IPv6 end point, four tuples identification. More...
#include <ipv6-end-point.h>
Public Member Functions | |
Ipv6EndPoint (Ipv6Address addr, uint16_t port) | |
Constructor. | |
~Ipv6EndPoint () | |
Destructor. | |
void | ForwardIcmp (Ipv6Address src, uint8_t ttl, uint8_t type, uint8_t code, uint32_t info) |
Function called from an L4Protocol implementation to notify an endpoint of an icmp message reception. | |
void | ForwardUp (Ptr< Packet > p, Ipv6Address srcAddr, Ipv6Address dstAddr, uint16_t port) |
Forward the packet to the upper level. | |
Ipv6Address | GetLocalAddress () |
Get the local address. | |
uint16_t | GetLocalPort () |
Get the local port. | |
Ipv6Address | GetPeerAddress () |
Get the peer address. | |
uint16_t | GetPeerPort () |
Get the peer port. | |
void | SetDestroyCallback (Callback< void > callback) |
Set the default destroy callback. | |
void | SetIcmpCallback (Callback< void, Ipv6Address, uint8_t, uint8_t, uint8_t, uint32_t > callback) |
Set the ICMP callback. | |
void | SetLocalAddress (Ipv6Address addr) |
Set the local address. | |
void | SetLocalPort (uint16_t port) |
Set the local port. | |
void | SetPeer (Ipv6Address addr, uint16_t port) |
Set the peer informations (address and port). | |
void | SetRxCallback (Callback< void, Ptr< Packet >, Ipv6Address, Ipv6Address, uint16_t > callback) |
Set the reception callback. |
Private Member Functions | |
void | DoForwardIcmp (Ipv6Address src, uint8_t ttl, uint8_t type, uint8_t code, uint32_t info) |
ForwardIcmp wrapper. | |
void | DoForwardUp (Ptr< Packet > p, Ipv6Address saddr, Ipv6Address daddr, uint16_t sport) |
ForwardUp wrapper. |
Private Attributes | |
Callback< void > | m_destroyCallback |
The destroy callback. | |
Callback< void, Ipv6Address, uint8_t, uint8_t, uint8_t, uint32_t > | m_icmpCallback |
The ICMPv6 callback. | |
Ipv6Address | m_localAddr |
The local address. | |
uint16_t | m_localPort |
The local port. | |
Ipv6Address | m_peerAddr |
The peer address. | |
uint16_t | m_peerPort |
The peer port. | |
Callback< void, Ptr< Packet > , Ipv6Address, Ipv6Address, uint16_t > | m_rxCallback |
The RX callback. |
An IPv6 end point, four tuples identification.
Definition at line 39 of file ipv6-end-point.h.
ns3::Ipv6EndPoint::Ipv6EndPoint | ( | Ipv6Address | addr, |
uint16_t | port | ||
) |
Constructor.
addr | the IPv6 address |
port | the port |
Definition at line 32 of file ipv6-end-point.cc.
ns3::Ipv6EndPoint::~Ipv6EndPoint | ( | ) |
Destructor.
Definition at line 40 of file ipv6-end-point.cc.
References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_destroyCallback, m_icmpCallback, m_rxCallback, and ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::Nullify().
|
private |
ForwardIcmp wrapper.
src | source IPv6 address |
ttl | time-to-live |
type | ICMPv6 type |
code | ICMPv6 code |
info | ICMPv6 info |
Definition at line 125 of file ipv6-end-point.cc.
References m_icmpCallback.
Referenced by ForwardIcmp().
|
private |
ForwardUp wrapper.
p | packet |
saddr | source IPv6 address |
daddr | dest IPv6 address |
sport | source port |
Definition at line 120 of file ipv6-end-point.cc.
References m_rxCallback.
void ns3::Ipv6EndPoint::ForwardIcmp | ( | Ipv6Address | src, |
uint8_t | ttl, | ||
uint8_t | type, | ||
uint8_t | code, | ||
uint32_t | info | ||
) |
Function called from an L4Protocol implementation to notify an endpoint of an icmp message reception.
src | source IPv6 address |
ttl | time-to-live |
type | ICMPv6 type |
code | ICMPv6 code |
info | ICMPv6 info |
Definition at line 110 of file ipv6-end-point.cc.
References DoForwardIcmp(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_icmpCallback, and ns3::Simulator::ScheduleNow().
Referenced by ns3::UdpL4Protocol::ReceiveIcmp().
void ns3::Ipv6EndPoint::ForwardUp | ( | Ptr< Packet > | p, |
Ipv6Address | srcAddr, | ||
Ipv6Address | dstAddr, | ||
uint16_t | port | ||
) |
Forward the packet to the upper level.
p | the packet |
srcAddr | source address |
dstAddr | source address |
port | source port |
Definition at line 102 of file ipv6-end-point.cc.
References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), and m_rxCallback.
Ipv6Address ns3::Ipv6EndPoint::GetLocalAddress | ( | void | ) |
Get the local address.
Definition at line 51 of file ipv6-end-point.cc.
References m_localAddr.
Referenced by ns3::TcpSocketBase::DoForwardUp(), ns3::UdpSocketImpl::DoSendTo(), ns3::TcpSocketBase::GetSockName(), ns3::Ipv6EndPointDemux::Lookup(), ns3::TcpSocketBase::PersistTimeout(), ns3::TcpSocketBase::SendDataPacket(), and ns3::TcpSocketBase::SendEmptyPacket().
uint16_t ns3::Ipv6EndPoint::GetLocalPort | ( | void | ) |
Get the local port.
Definition at line 61 of file ipv6-end-point.cc.
References m_localPort.
Referenced by ns3::TcpSocketBase::DoForwardUp(), ns3::UdpSocketImpl::DoSendTo(), ns3::TcpSocketBase::GetSockName(), ns3::Ipv6EndPointDemux::Lookup(), ns3::TcpSocketBase::PersistTimeout(), ns3::TcpSocketBase::SendDataPacket(), and ns3::TcpSocketBase::SendEmptyPacket().
Ipv6Address ns3::Ipv6EndPoint::GetPeerAddress | ( | void | ) |
Get the peer address.
Definition at line 71 of file ipv6-end-point.cc.
References m_peerAddr.
Referenced by ns3::TcpSocketBase::DoForwardUp(), ns3::Ipv6EndPointDemux::Lookup(), ns3::TcpSocketBase::PersistTimeout(), ns3::TcpSocketBase::Recv(), ns3::TcpSocketBase::RecvFrom(), ns3::TcpSocketBase::SendDataPacket(), ns3::TcpSocketBase::SendEmptyPacket(), and ns3::TcpSocketBase::SetupEndpoint6().
uint16_t ns3::Ipv6EndPoint::GetPeerPort | ( | void | ) |
Get the peer port.
Definition at line 76 of file ipv6-end-point.cc.
References m_peerPort.
Referenced by ns3::TcpSocketBase::DoForwardUp(), ns3::Ipv6EndPointDemux::Lookup(), ns3::TcpSocketBase::PersistTimeout(), ns3::TcpSocketBase::Recv(), ns3::TcpSocketBase::RecvFrom(), ns3::TcpSocketBase::SendDataPacket(), and ns3::TcpSocketBase::SendEmptyPacket().
void ns3::Ipv6EndPoint::SetDestroyCallback | ( | Callback< void > | callback | ) |
Set the default destroy callback.
callback | callback function |
Definition at line 97 of file ipv6-end-point.cc.
References m_destroyCallback.
Referenced by ns3::TcpSocketBase::DeallocateEndPoint(), ns3::UdpSocketImpl::FinishBind(), and ns3::TcpSocketBase::SetupCallback().
void ns3::Ipv6EndPoint::SetIcmpCallback | ( | Callback< void, Ipv6Address, uint8_t, uint8_t, uint8_t, uint32_t > | callback | ) |
Set the ICMP callback.
callback | callback function |
Definition at line 92 of file ipv6-end-point.cc.
References m_icmpCallback.
Referenced by ns3::UdpSocketImpl::FinishBind().
void ns3::Ipv6EndPoint::SetLocalAddress | ( | Ipv6Address | addr | ) |
Set the local address.
addr | the address to set |
Definition at line 56 of file ipv6-end-point.cc.
References m_localAddr.
Referenced by ns3::TcpSocketBase::SetupEndpoint6().
void ns3::Ipv6EndPoint::SetLocalPort | ( | uint16_t | port | ) |
Set the local port.
port | the port to set |
Definition at line 66 of file ipv6-end-point.cc.
References m_localPort, and port.
void ns3::Ipv6EndPoint::SetPeer | ( | Ipv6Address | addr, |
uint16_t | port | ||
) |
Set the peer informations (address and port).
addr | peer address |
port | peer port |
Definition at line 81 of file ipv6-end-point.cc.
References m_peerAddr, m_peerPort, and port.
Referenced by ns3::Ipv6EndPointDemux::Allocate(), ns3::TcpSocketBase::Connect(), and ns3::TcpSocketBase::ProcessSynRcvd().
void ns3::Ipv6EndPoint::SetRxCallback | ( | Callback< void, Ptr< Packet >, Ipv6Address, Ipv6Address, uint16_t > | callback | ) |
Set the reception callback.
callback | callback function |
Definition at line 87 of file ipv6-end-point.cc.
References m_rxCallback.
Referenced by ns3::UdpSocketImpl::FinishBind(), and ns3::TcpSocketBase::SetupCallback().
|
private |
The destroy callback.
Definition at line 190 of file ipv6-end-point.h.
Referenced by SetDestroyCallback(), and ~Ipv6EndPoint().
|
private |
The ICMPv6 callback.
Definition at line 185 of file ipv6-end-point.h.
Referenced by DoForwardIcmp(), ForwardIcmp(), SetIcmpCallback(), and ~Ipv6EndPoint().
|
private |
The local address.
Definition at line 160 of file ipv6-end-point.h.
Referenced by GetLocalAddress(), and SetLocalAddress().
|
private |
The local port.
Definition at line 165 of file ipv6-end-point.h.
Referenced by GetLocalPort(), and SetLocalPort().
|
private |
The peer address.
Definition at line 170 of file ipv6-end-point.h.
Referenced by GetPeerAddress(), and SetPeer().
|
private |
The peer port.
Definition at line 175 of file ipv6-end-point.h.
Referenced by GetPeerPort(), and SetPeer().
|
private |
The RX callback.
Definition at line 180 of file ipv6-end-point.h.
Referenced by DoForwardUp(), ForwardUp(), SetRxCallback(), and ~Ipv6EndPoint().