ns-3
|
(abstract) base class of all UdpSockets More...
#include <udp-socket.h>
Public Member Functions | |
virtual int | MulticastJoinGroup (uint32_t interface, const Address &groupAddress)=0 |
Corresponds to socket option MCAST_JOIN_GROUP. | |
virtual int | MulticastLeaveGroup (uint32_t interface, const Address &groupAddress)=0 |
Corresponds to socket option MCAST_LEAVE_GROUP. | |
![]() | |
virtual enum Socket::SocketErrno | GetErrno (void) const =0 |
virtual enum Socket::SocketType | GetSocketType (void) const =0 |
virtual Ptr< Node > | GetNode (void) const =0 |
void | SetConnectCallback (Callback< void, Ptr< Socket > > connectionSucceeded, Callback< void, Ptr< Socket > > connectionFailed) |
Specify callbacks to allow the caller to determine if the connection succeeds of fails. | |
void | SetCloseCallbacks (Callback< void, Ptr< Socket > > normalClose, Callback< void, Ptr< Socket > > errorClose) |
Detect socket recv() events such as graceful shutdown or error. | |
void | SetAcceptCallback (Callback< bool, Ptr< Socket >, const Address & > connectionRequest, Callback< void, Ptr< Socket >, const Address & > newConnectionCreated) |
Accept connection requests from remote hosts. | |
void | SetDataSentCallback (Callback< void, Ptr< Socket >, uint32_t > dataSent) |
Notify application when a packet has been sent from transport protocol (non-standard socket call) | |
void | SetSendCallback (Callback< void, Ptr< Socket >, uint32_t > sendCb) |
Notify application when space in transmit buffer is added. | |
void | SetRecvCallback (Callback< void, Ptr< Socket > >) |
Notify application when new data is available to be read. | |
virtual int | Bind (const Address &address)=0 |
Allocate a local endpoint for this socket. | |
virtual int | Bind ()=0 |
Allocate a local IPv4 endpoint for this socket. | |
virtual int | Bind6 ()=0 |
Allocate a local IPv6 endpoint for this socket. | |
virtual int | Close (void)=0 |
Close a socket. | |
virtual int | ShutdownSend (void)=0 |
virtual int | ShutdownRecv (void)=0 |
virtual int | Connect (const Address &address)=0 |
Initiate a connection to a remote host. | |
virtual int | Listen (void)=0 |
Listen for incoming connections. | |
virtual uint32_t | GetTxAvailable (void) const =0 |
Returns the number of bytes which can be sent in a single call to Send. | |
virtual int | Send (Ptr< Packet > p, uint32_t flags)=0 |
Send data (or dummy data) to the remote host. | |
virtual int | SendTo (Ptr< Packet > p, uint32_t flags, const Address &toAddress)=0 |
Send data to a specified peer. | |
virtual uint32_t | GetRxAvailable (void) const =0 |
virtual Ptr< Packet > | Recv (uint32_t maxSize, uint32_t flags)=0 |
Read data from the socket. | |
virtual Ptr< Packet > | RecvFrom (uint32_t maxSize, uint32_t flags, Address &fromAddress)=0 |
Read a single packet from the socket and retrieve the sender address. | |
int | Send (Ptr< Packet > p) |
Send data (or dummy data) to the remote host. | |
int | Send (const uint8_t *buf, uint32_t size, uint32_t flags) |
Send data (or dummy data) to the remote host. | |
int | SendTo (const uint8_t *buf, uint32_t size, uint32_t flags, const Address &address) |
Send data to a specified peer. | |
Ptr< Packet > | Recv (void) |
Read a single packet from the socket. | |
int | Recv (uint8_t *buf, uint32_t size, uint32_t flags) |
Recv data (or dummy data) from the remote host. | |
Ptr< Packet > | RecvFrom (Address &fromAddress) |
Read a single packet from the socket and retrieve the sender address. | |
int | RecvFrom (uint8_t *buf, uint32_t size, uint32_t flags, Address &fromAddress) |
Read a single packet from the socket and retrieve the sender address. | |
virtual int | GetSockName (Address &address) const =0 |
virtual void | BindToNetDevice (Ptr< NetDevice > netdevice) |
Bind a socket to specific device. | |
Ptr< NetDevice > | GetBoundNetDevice () |
Returns socket's bound netdevice, if any. | |
virtual bool | SetAllowBroadcast (bool allowBroadcast)=0 |
Configure whether broadcast datagram transmissions are allowed. | |
virtual bool | GetAllowBroadcast () const =0 |
Query whether broadcast datagram transmissions are allowed. | |
void | SetRecvPktInfo (bool flag) |
Enable/Disable receive packet information to socket. | |
bool | IsRecvPktInfo () const |
Get status indicating whether enable/disable packet information to socket. | |
![]() | |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Dispose (void) |
void | AggregateObject (Ptr< Object > other) |
AggregateIterator | GetAggregateIterator (void) const |
void | Start (void) |
![]() | |
SimpleRefCount (const SimpleRefCount &o) | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
uint32_t | GetReferenceCount (void) const |
![]() | |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::UdpSocket. | |
![]() | |
static Ptr< Socket > | CreateSocket (Ptr< Node > node, TypeId tid) |
Additional Inherited Members | |
![]() | |
enum | SocketErrno { ERROR_NOTERROR, ERROR_ISCONN, ERROR_NOTCONN, ERROR_MSGSIZE, ERROR_AGAIN, ERROR_SHUTDOWN, ERROR_OPNOTSUPP, ERROR_AFNOSUPPORT, ERROR_INVAL, ERROR_BADF, ERROR_NOROUTETOHOST, ERROR_NODEV, ERROR_ADDRNOTAVAIL, ERROR_ADDRINUSE, SOCKET_ERRNO_LAST } |
enum | SocketType { NS3_SOCK_STREAM, NS3_SOCK_SEQPACKET, NS3_SOCK_DGRAM, NS3_SOCK_RAW } |
![]() | |
void | NotifyConnectionSucceeded (void) |
void | NotifyConnectionFailed (void) |
void | NotifyNormalClose (void) |
void | NotifyErrorClose (void) |
bool | NotifyConnectionRequest (const Address &from) |
void | NotifyNewConnectionCreated (Ptr< Socket > socket, const Address &from) |
void | NotifyDataSent (uint32_t size) |
void | NotifySend (uint32_t spaceAvailable) |
void | NotifyDataRecv (void) |
virtual void | DoDispose (void) |
![]() | |
virtual void | NotifyNewAggregate (void) |
virtual void | DoStart (void) |
Object (const Object &o) | |
![]() | |
Ptr< NetDevice > | m_boundnetdevice |
bool | m_recvPktInfo |
(abstract) base class of all UdpSockets
This class exists solely for hosting UdpSocket attributes that can be reused across different implementations, and for declaring UDP-specific multicast API.
|
static |
This method returns the TypeId associated to ns3::UdpSocket.
Attributes defined for this type:
No TraceSources defined for this type.
Reimplemented from ns3::Socket.
Reimplemented in ns3::UdpSocketImpl.
References ns3::TypeId::SetParent().
|
pure virtual |
Corresponds to socket option MCAST_JOIN_GROUP.
interface | interface number, or 0 |
groupAddress | multicast group address |
Enable reception of multicast datagrams for this socket on the interface number specified. If zero is specified as the interface, then a single local interface is chosen by system. In the future, this function will generate trigger IGMP joins as necessary when IGMP is implemented, but for now, this just enables multicast datagram reception in the system if not already enabled for this interface/groupAddress combination.
This function may be called repeatedly on a given socket but each join must be for a different multicast address, or for the same multicast address but on a different interface from previous joins. This enables host multihoming, and the ability to join the same group on different interfaces.
Implemented in ns3::UdpSocketImpl.
|
pure virtual |
Corresponds to socket option MCAST_LEAVE_GROUP.
interface | interface number, or 0 |
groupAddress | multicast group address |
Disable reception of multicast datagrams for this socket on the interface number specified. If zero is specified as the interfaceIndex, then a single local interface is chosen by system. In the future, this function will generate trigger IGMP leaves as necessary when IGMP is implemented, but for now, this just disables multicast datagram reception in the system if this socket is the last for this interface/groupAddress combination.
Implemented in ns3::UdpSocketImpl.