20 #ifndef UDP_SOCKET_IMPL_H
21 #define UDP_SOCKET_IMPL_H
25 #include "ns3/callback.h"
26 #include "ns3/traced-callback.h"
27 #include "ns3/socket.h"
29 #include "ns3/ipv4-address.h"
30 #include "ns3/udp-socket.h"
31 #include "ns3/ipv4-interface.h"
53 static TypeId GetTypeId (
void);
63 virtual enum SocketErrno
GetErrno (
void)
const;
66 virtual int Bind (
void);
67 virtual int Bind6 (
void);
69 virtual int Close (
void);
90 virtual void SetRcvBufSize (uint32_t size);
91 virtual uint32_t GetRcvBufSize (
void)
const;
92 virtual void SetIpMulticastTtl (uint8_t ipTtl);
93 virtual uint8_t GetIpMulticastTtl (
void)
const;
94 virtual void SetIpMulticastIf (int32_t ipIf);
95 virtual int32_t GetIpMulticastIf (
void)
const;
96 virtual void SetIpMulticastLoop (
bool loop);
97 virtual bool GetIpMulticastLoop (
void)
const;
98 virtual void SetMtuDiscover (
bool discover);
99 virtual bool GetMtuDiscover (
void)
const;
104 int FinishBind (
void);
109 void Destroy6 (
void);
114 void ForwardIcmp (
Ipv4Address icmpSource, uint8_t icmpTtl,
115 uint8_t icmpType, uint8_t icmpCode,
117 void ForwardIcmp6 (
Ipv6Address icmpSource, uint8_t icmpTtl,
118 uint8_t icmpType, uint8_t icmpCode,
126 uint16_t m_defaultPort;
129 enum SocketErrno m_errno;
133 bool m_allowBroadcast;
135 std::queue<Ptr<Packet> > m_deliveryQueue;
136 uint32_t m_rxAvailable;
139 uint32_t m_rcvBufSize;
140 uint8_t m_ipMulticastTtl;
141 int32_t m_ipMulticastIf;
142 bool m_ipMulticastLoop;
(abstract) base class of all UdpSockets
virtual bool GetAllowBroadcast() const
Query whether broadcast datagram transmissions are allowed.
Ptr< Packet > Recv(void)
Read a single packet from the socket.
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
virtual int Close(void)
Close a socket.
virtual void BindToNetDevice(Ptr< NetDevice > netdevice)
Bind a socket to specific device.
A sockets interface to UDP.
a polymophic address class
virtual int Bind(void)
Allocate a local IPv4 endpoint for this socket.
virtual enum SocketErrno GetErrno(void) const
virtual int ShutdownRecv(void)
virtual int GetSockName(Address &address) const
virtual int MulticastLeaveGroup(uint32_t interfaceIndex, const Address &groupAddress)
Corresponds to socket option MCAST_LEAVE_GROUP.
virtual uint32_t GetRxAvailable(void) const
virtual int Bind6(void)
Allocate a local IPv6 endpoint for this socket.
virtual int Connect(const Address &address)
Initiate a connection to a remote host.
virtual int MulticastJoinGroup(uint32_t interfaceIndex, const Address &groupAddress)
Corresponds to socket option MCAST_JOIN_GROUP.
virtual enum SocketType GetSocketType(void) const
virtual int Send(Ptr< Packet > p, uint32_t flags)
Send data (or dummy data) to the remote host.
virtual int ShutdownSend(void)
Describes an IPv6 address.
Ipv4 addresses are stored in host order in this class.
virtual uint32_t GetTxAvailable(void) const
Returns the number of bytes which can be sent in a single call to Send.
virtual bool SetAllowBroadcast(bool allowBroadcast)
Configure whether broadcast datagram transmissions are allowed.
virtual int Listen(void)
Listen for incoming connections.
An IPv6 end point, four tuples identification.
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &address)
Send data to a specified peer.
virtual Ptr< Packet > RecvFrom(uint32_t maxSize, uint32_t flags, Address &fromAddress)
Read a single packet from the socket and retrieve the sender address.
API to create UDP socket instances.
a unique identifier for an interface.
A representation of an internet endpoint/connection.
virtual Ptr< Node > GetNode(void) const