22 #include "ns3/packet.h"
24 #include "ns3/simulator.h"
31 : m_localAddr (address),
151 uint8_t icmpType, uint8_t icmpCode,
154 NS_LOG_FUNCTION (
this << icmpSource << (uint32_t)icmpTtl << (uint32_t)icmpType <<
155 (uint32_t)icmpCode << icmpInfo);
159 icmpSource, icmpTtl, icmpType, icmpCode, icmpInfo);
164 uint8_t icmpType, uint8_t icmpCode,
167 NS_LOG_FUNCTION (
this << icmpSource << static_cast<uint32_t> (icmpTtl) << static_cast<uint32_t> (icmpType) << static_cast<uint32_t> (icmpCode) << icmpInfo);
Callback< void, Ptr< Packet >, Ipv4Header, uint16_t, Ptr< Ipv4Interface > > m_rxCallback
The RX callback.
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
Ptr< NetDevice > m_boundnetdevice
The NetDevice the EndPoint is bound to (if any).
void SetRxCallback(Callback< void, Ptr< Packet >, Ipv4Header, uint16_t, Ptr< Ipv4Interface > > callback)
Set the reception callback.
void SetDestroyCallback(Callback< void > callback)
Set the default destroy callback.
void ForwardUp(Ptr< Packet > p, const Ipv4Header &header, uint16_t sport, Ptr< Ipv4Interface > incomingInterface)
Forward the packet to the upper level.
bool IsNull(void) const
Check for null implementation.
void BindToNetDevice(Ptr< NetDevice > netdevice)
Bind a socket to specific device.
void DoForwardUp(Ptr< Packet > p, const Ipv4Header &header, uint16_t sport, Ptr< Ipv4Interface > incomingInterface)
ForwardUp wrapper.
Ipv4Address GetLocalAddress(void)
Get the local address.
NS_LOG_COMPONENT_DEFINE("Ipv4EndPoint")
Ptr< NetDevice > GetBoundNetDevice(void)
Returns socket's bound netdevice, if any.
void ForwardIcmp(Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo)
Forward the ICMP packet to the upper level.
uint16_t m_peerPort
The peer port.
Callback< void, Ipv4Address, uint8_t, uint8_t, uint8_t, uint32_t > m_icmpCallback
The ICMPv6 callback.
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now.
void SetPeer(Ipv4Address address, uint16_t port)
Set the peer informations (address and port).
Ipv4Address m_localAddr
The local address.
void SetLocalAddress(Ipv4Address address)
Set the local address.
Ipv4 addresses are stored in host order in this class.
void DoForwardIcmp(Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo)
ForwardIcmp wrapper.
uint16_t m_localPort
The local port.
uint16_t GetLocalPort(void)
Get the local port.
Ipv4Address GetPeerAddress(void)
Get the peer address.
uint16_t GetPeerPort(void)
Get the peer port.
void Nullify(void)
Discard the implementation, set it to null.
Ipv4EndPoint(Ipv4Address address, uint16_t port)
Constructor.
void SetIcmpCallback(Callback< void, Ipv4Address, uint8_t, uint8_t, uint8_t, uint32_t > callback)
Set the ICMP callback.
Callback< void > m_destroyCallback
The destroy callback.
Ipv4Address m_peerAddr
The peer address.