author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Sat, 04 Jul 2009 08:15:48 +0200 | |
changeset 4654 | 2eaebe77d66b |
parent 4472 | e20a31541404 |
permissions | -rw-r--r-- |
3820 | 1 |
#ifndef IPV4_RAW_SOCKET_IMPL_H |
2 |
#define IPV4_RAW_SOCKET_IMPL_H |
|
3 |
||
4 |
#include "ns3/socket.h" |
|
5 |
#include "ns3/ipv4-header.h" |
|
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
3820
diff
changeset
|
6 |
#include "ns3/ipv4-route.h" |
3820 | 7 |
#include <list> |
8 |
||
9 |
namespace ns3 { |
|
10 |
||
11 |
class NetDevice; |
|
12 |
class Node; |
|
13 |
||
14 |
class Ipv4RawSocketImpl : public Socket |
|
15 |
{ |
|
16 |
public: |
|
17 |
static TypeId GetTypeId (void); |
|
18 |
||
19 |
Ipv4RawSocketImpl (); |
|
20 |
||
21 |
void SetNode (Ptr<Node> node); |
|
22 |
||
23 |
virtual enum Socket::SocketErrno GetErrno (void) const; |
|
24 |
virtual Ptr<Node> GetNode (void) const; |
|
25 |
virtual int Bind (const Address &address); |
|
26 |
virtual int Bind (); |
|
27 |
virtual int GetSockName (Address &address) const; |
|
28 |
virtual int Close (void); |
|
29 |
virtual int ShutdownSend (void); |
|
30 |
virtual int ShutdownRecv (void); |
|
31 |
virtual int Connect (const Address &address); |
|
32 |
virtual int Listen (void); |
|
33 |
virtual uint32_t GetTxAvailable (void) const; |
|
34 |
virtual int Send (Ptr<Packet> p, uint32_t flags); |
|
35 |
virtual int SendTo (Ptr<Packet> p, uint32_t flags, |
|
36 |
const Address &toAddress); |
|
37 |
virtual uint32_t GetRxAvailable (void) const; |
|
38 |
virtual Ptr<Packet> Recv (uint32_t maxSize, uint32_t flags); |
|
39 |
virtual Ptr<Packet> RecvFrom (uint32_t maxSize, uint32_t flags, |
|
40 |
Address &fromAddress); |
|
41 |
||
42 |
void SetProtocol (uint16_t protocol); |
|
43 |
bool ForwardUp (Ptr<const Packet> p, Ipv4Header ipHeader, Ptr<NetDevice> device); |
|
44 |
private: |
|
45 |
virtual void DoDispose (void); |
|
46 |
||
47 |
struct Data { |
|
48 |
Ptr<Packet> packet; |
|
49 |
Ipv4Address fromIp; |
|
50 |
uint16_t fromProtocol; |
|
51 |
}; |
|
52 |
||
53 |
enum Socket::SocketErrno m_err; |
|
54 |
Ptr<Node> m_node; |
|
55 |
Ipv4Address m_src; |
|
56 |
Ipv4Address m_dst; |
|
57 |
uint16_t m_protocol; |
|
58 |
std::list<struct Data> m_recv; |
|
59 |
bool m_shutdownSend; |
|
60 |
bool m_shutdownRecv; |
|
61 |
uint32_t m_icmpFilter; |
|
62 |
}; |
|
63 |
||
64 |
} // namespace ns3 |
|
65 |
||
66 |
#endif /* IPV4_RAW_SOCKET_IMPL_H */ |