|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #ifndef IPV4_END_POINT_H
22 #define IPV4_END_POINT_H
25 #include "ns3/ipv4-address.h"
26 #include "ns3/callback.h"
27 #include "ns3/net-device.h"
28 #include "ns3/ipv4-header.h"
29 #include "ns3/ipv4-interface.h"
170 uint8_t icmpType, uint8_t icmpCode,
void SetRxEnabled(bool enabled)
Enable or Disable the endpoint Rx capability.
uint16_t m_peerPort
The peer port.
Callback< void, Ptr< Packet >, Ipv4Header, uint16_t, Ptr< Ipv4Interface > > m_rxCallback
The RX callback.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< NetDevice > GetBoundNetDevice(void)
Returns socket's bound netdevice, if any.
void BindToNetDevice(Ptr< NetDevice > netdevice)
Bind a socket to specific device.
Ipv4 addresses are stored in host order in this class.
void SetLocalAddress(Ipv4Address address)
Set the local address.
bool IsRxEnabled(void)
Checks if the endpoint can receive packets.
bool m_rxEnabled
true if the endpoint can receive packets.
uint16_t GetLocalPort(void)
Get the local port.
void SetPeer(Ipv4Address address, uint16_t port)
Set the peer information (address and port).
uint16_t m_localPort
The local port.
void ForwardIcmp(Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo)
Forward the ICMP packet to the upper level.
Ipv4Address GetLocalAddress(void)
Get the local address.
Ipv4Address m_peerAddr
The peer address.
Ptr< NetDevice > m_boundnetdevice
The NetDevice the EndPoint is bound to (if any).
Callback< void > m_destroyCallback
The destroy callback.
void SetDestroyCallback(Callback< void > callback)
Set the default destroy callback.
uint16_t GetPeerPort(void)
Get the peer port.
void SetRxCallback(Callback< void, Ptr< Packet >, Ipv4Header, uint16_t, Ptr< Ipv4Interface > > callback)
Set the reception callback.
Ipv4Address m_localAddr
The local address.
Ipv4Address GetPeerAddress(void)
Get the peer address.
void SetIcmpCallback(Callback< void, Ipv4Address, uint8_t, uint8_t, uint8_t, uint32_t > callback)
Set the ICMP callback.
void ForwardUp(Ptr< Packet > p, const Ipv4Header &header, uint16_t sport, Ptr< Ipv4Interface > incomingInterface)
Forward the packet to the upper level.
Callback< void, Ipv4Address, uint8_t, uint8_t, uint8_t, uint32_t > m_icmpCallback
The ICMPv6 callback.
A representation of an internet endpoint/connection.
Ipv4EndPoint(Ipv4Address address, uint16_t port)
Constructor.