2 #ifndef IPV4_RAW_SOCKET_IMPL_H 3 #define IPV4_RAW_SOCKET_IMPL_H 5 #include "ns3/socket.h" 6 #include "ns3/ipv4-header.h" 7 #include "ns3/ipv4-route.h" 8 #include "ns3/ipv4-interface.h" 58 virtual int Close (
void);
Ipv4Address m_src
Source address.
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &toAddress)
Send data to a specified peer.
virtual bool GetAllowBroadcast() const
Query whether broadcast datagram transmissions are allowed.
Ptr< Packet > packet
Packet data.
virtual bool SetAllowBroadcast(bool allowBroadcast)
Configure whether broadcast datagram transmissions are allowed.
Ptr< Packet > Recv(void)
Read a single packet from the socket.
virtual int Send(Ptr< Packet > p, uint32_t flags)
Send data (or dummy data) to the remote host.
static TypeId GetTypeId(void)
Get the type ID of this class.
Ipv4Address fromIp
Source address.
virtual uint32_t GetTxAvailable(void) const
Returns the number of bytes which can be sent in a single call to Send.
void SetNode(Ptr< Node > node)
Set the node associated with this socket.
virtual void DoDispose(void)
Destructor implementation.
SocketErrno
Enumeration of the possible errors returned by a socket.
a polymophic address class
virtual uint32_t GetRxAvailable(void) const
Return number of bytes which can be returned from one or multiple calls to Recv.
virtual int Close(void)
Close a socket.
A low-level Socket API based loosely on the BSD Socket API.
virtual int GetSockName(Address &address) const
Get socket address.
bool m_shutdownSend
Flag to shutdown send capability.
virtual enum Socket::SocketType GetSocketType(void) const
Get socket type (NS3_SOCK_RAW)
Ipv4Address m_dst
Destination address.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual Ptr< Packet > RecvFrom(uint32_t maxSize, uint32_t flags, Address &fromAddress)
Read a single packet from the socket and retrieve the sender address.
virtual int Bind6()
Allocate a local IPv6 endpoint for this socket.
virtual int Bind()
Allocate a local IPv4 endpoint for this socket.
virtual int Connect(const Address &address)
Initiate a connection to a remote host.
std::list< struct Data > m_recv
Packet waiting to be processed.
virtual int ShutdownRecv(void)
virtual Ptr< Node > GetNode(void) const
Return the node this socket is associated with.
Ipv4 addresses are stored in host order in this class.
virtual int Listen(void)
Listen for incoming connections.
uint16_t m_protocol
Protocol.
IPv4 raw data and additional information.
bool ForwardUp(Ptr< const Packet > p, Ipv4Header ipHeader, Ptr< Ipv4Interface > incomingInterface)
Forward up to receive method.
virtual enum Socket::SocketErrno GetErrno() const
Get last error number.
virtual int GetPeerName(Address &address) const
Get the peer address of a connected socket.
uint32_t m_icmpFilter
ICMPv4 filter specification.
SocketType
Enumeration of the possible socket types.
a unique identifier for an interface.
bool m_shutdownRecv
Flag to shutdown receive capability.
uint16_t fromProtocol
Protocol used.
void SetProtocol(uint16_t protocol)
Set protocol field.
bool m_iphdrincl
Include IP Header information (a.k.a setsockopt (IP_HDRINCL))
virtual int ShutdownSend(void)
enum Socket::SocketErrno m_err
Last error number.