21 #ifndef UDP_L4_PROTOCOL_H
22 #define UDP_L4_PROTOCOL_H
26 #include "ns3/packet.h"
27 #include "ns3/ipv4-address.h"
28 #include "ns3/ipv6-address.h"
30 #include "ns3/ip-l4-protocol.h"
38 class Ipv4EndPointDemux;
40 class Ipv6EndPointDemux;
93 uint16_t sport, uint16_t dport);
99 uint16_t sport, uint16_t dport);
129 uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo,
131 const uint8_t payload[8]);
133 uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo,
135 const uint8_t payload[8]);
Ptr< Socket > CreateSocket(void)
virtual void DoDispose(void)
virtual void SetDownTarget(IpL4Protocol::DownTargetCallback cb)
virtual void SetDownTarget6(IpL4Protocol::DownTargetCallback6 cb)
void SetNode(Ptr< Node > node)
Demultiplexes packets to various transport layer endpoints.
virtual int GetProtocolNumber(void) const
virtual enum IpL4Protocol::RxStatus Receive(Ptr< Packet > p, Ipv4Header const &header, Ptr< Ipv4Interface > interface)
Receive a packet up the protocol stack.
Ipv4EndPoint * Allocate(void)
UdpL4Protocol & operator=(const UdpL4Protocol &o)
static TypeId GetTypeId(void)
virtual IpL4Protocol::DownTargetCallback6 GetDownTarget6(void) const
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])
Receive an ICMP packet.
Ipv6EndPointDemux * m_endPoints6
L4 Protocol abstract base class.
void DeAllocate(Ipv4EndPoint *endPoint)
IpL4Protocol::DownTargetCallback6 m_downTarget6
virtual IpL4Protocol::DownTargetCallback GetDownTarget(void) const
Describes an IPv6 address.
Ipv4 addresses are stored in host order in this class.
IpL4Protocol::DownTargetCallback m_downTarget
virtual void NotifyNewAggregate()
Implementation of the UDP protocol.
Demultiplexor for end points.
std::vector< Ptr< UdpSocketImpl > > m_sockets
An IPv6 end point, four tuples identification.
Ipv4EndPointDemux * m_endPoints
void Send(Ptr< Packet > packet, Ipv4Address saddr, Ipv4Address daddr, uint16_t sport, uint16_t dport)
Send a packet via UDP.
Ipv6EndPoint * Allocate6(void)
a unique identifier for an interface.
static const uint8_t PROT_NUMBER
A representation of an internet endpoint/connection.