21 #ifndef UDP_L4_PROTOCOL_H
22 #define UDP_L4_PROTOCOL_H
26 #include "ns3/packet.h"
34 class Ipv4EndPointDemux;
36 class Ipv6EndPointDemux;
191 uint16_t sport, uint16_t dport);
214 uint16_t sport, uint16_t dport);
237 uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo,
239 const uint8_t payload[8]);
241 uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo,
243 const uint8_t payload[8]);
L4 Protocol abstract base class.
Ipv4 addresses are stored in host order in this class.
Demultiplexes packets to various transport layer endpoints.
A representation of an internet endpoint/connection.
Describes an IPv6 address.
Demultiplexer for end points.
A representation of an IPv6 endpoint/connection.
a unique identifier for an interface.
Implementation of the UDP protocol.
void Send(Ptr< Packet > packet, Ipv4Address saddr, Ipv4Address daddr, uint16_t sport, uint16_t dport)
Send a packet via UDP (IPv4)
virtual int GetProtocolNumber(void) const
Returns the protocol number of this protocol.
UdpL4Protocol(const UdpL4Protocol &)=delete
Ipv6EndPointDemux * m_endPoints6
A list of IPv6 end points.
static TypeId GetTypeId(void)
Get the type ID.
virtual void ReceiveIcmp(Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, Ipv4Address payloadSource, Ipv4Address payloadDestination, const uint8_t payload[8])
Called from lower-level layers to send the ICMP packet up in the stack.
Ptr< Node > m_node
the node this stack is associated with
Ipv4EndPointDemux * m_endPoints
A list of IPv4 end points.
virtual void SetDownTarget6(IpL4Protocol::DownTargetCallback6 cb)
This method allows a caller to set the current down target callback set for this L4 protocol (IPv6 ca...
void SetNode(Ptr< Node > node)
Set node associated with this stack.
virtual IpL4Protocol::DownTargetCallback6 GetDownTarget6(void) const
This method allows a caller to get the current down target callback set for this L4 protocol (IPv6 ca...
virtual enum IpL4Protocol::RxStatus Receive(Ptr< Packet > p, Ipv4Header const &header, Ptr< Ipv4Interface > interface)
Called from lower-level layers to send the packet up in the stack.
UdpL4Protocol & operator=(const UdpL4Protocol &)=delete
Ipv4EndPoint * Allocate(void)
Allocate an IPv4 Endpoint.
Ptr< Socket > CreateSocket(void)
virtual void SetDownTarget(IpL4Protocol::DownTargetCallback cb)
This method allows a caller to set the current down target callback set for this L4 protocol (IPv4 ca...
IpL4Protocol::DownTargetCallback m_downTarget
Callback to send packets over IPv4.
IpL4Protocol::DownTargetCallback6 m_downTarget6
Callback to send packets over IPv6.
std::vector< Ptr< UdpSocketImpl > > m_sockets
list of sockets
virtual void NotifyNewAggregate()
Notify all Objects aggregated to this one of a new Object being aggregated.
void DeAllocate(Ipv4EndPoint *endPoint)
Remove an IPv4 Endpoint.
Ipv6EndPoint * Allocate6(void)
Allocate an IPv6 Endpoint.
virtual void DoDispose(void)
Destructor implementation.
static const uint8_t PROT_NUMBER
protocol number (0x11)
virtual IpL4Protocol::DownTargetCallback GetDownTarget(void) const
This method allows a caller to get the current down target callback set for this L4 protocol (IPv4 ca...
Every class exported by the ns3 library is enclosed in the ns3 namespace.