diff -r 37b316422064 -r c04ecfdce1ef src/internet-stack/ipv4-raw-socket-impl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/internet-stack/ipv4-raw-socket-impl.h Wed Oct 29 11:18:39 2008 -0700 @@ -0,0 +1,65 @@ +#ifndef IPV4_RAW_SOCKET_IMPL_H +#define IPV4_RAW_SOCKET_IMPL_H + +#include "ns3/socket.h" +#include "ns3/ipv4-header.h" +#include + +namespace ns3 { + +class NetDevice; +class Node; + +class Ipv4RawSocketImpl : public Socket +{ +public: + static TypeId GetTypeId (void); + + Ipv4RawSocketImpl (); + + void SetNode (Ptr node); + + virtual enum Socket::SocketErrno GetErrno (void) const; + virtual Ptr GetNode (void) const; + virtual int Bind (const Address &address); + virtual int Bind (); + virtual int GetSockName (Address &address) const; + virtual int Close (void); + virtual int ShutdownSend (void); + virtual int ShutdownRecv (void); + virtual int Connect (const Address &address); + virtual int Listen (void); + virtual uint32_t GetTxAvailable (void) const; + virtual int Send (Ptr p, uint32_t flags); + virtual int SendTo (Ptr p, uint32_t flags, + const Address &toAddress); + virtual uint32_t GetRxAvailable (void) const; + virtual Ptr Recv (uint32_t maxSize, uint32_t flags); + virtual Ptr RecvFrom (uint32_t maxSize, uint32_t flags, + Address &fromAddress); + + void SetProtocol (uint16_t protocol); + bool ForwardUp (Ptr p, Ipv4Header ipHeader, Ptr device); +private: + virtual void DoDispose (void); + + struct Data { + Ptr packet; + Ipv4Address fromIp; + uint16_t fromProtocol; + }; + + enum Socket::SocketErrno m_err; + Ptr m_node; + Ipv4Address m_src; + Ipv4Address m_dst; + uint16_t m_protocol; + std::list m_recv; + bool m_shutdownSend; + bool m_shutdownRecv; + uint32_t m_icmpFilter; +}; + +} // namespace ns3 + +#endif /* IPV4_RAW_SOCKET_IMPL_H */