author | Vedran Miletić <rivanvx@gmail.com> |
Tue, 02 Aug 2011 17:42:33 -0400 | |
changeset 7385 | 10beb0e53130 |
parent 7176 | 9f2663992e99 |
child 7717 | cfa1741013dd |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7176
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
3820 | 2 |
#ifndef IPV4_RAW_SOCKET_IMPL_H |
3 |
#define IPV4_RAW_SOCKET_IMPL_H |
|
4 |
||
5 |
#include "ns3/socket.h" |
|
6 |
#include "ns3/ipv4-header.h" |
|
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
3820
diff
changeset
|
7 |
#include "ns3/ipv4-route.h" |
6442
f380cf1aa4d8
Bug 671 add packet-info-tag.cc for IP_PKTINFO/IPV6_PKTINFO
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents:
6437
diff
changeset
|
8 |
#include "ns3/ipv4-interface.h" |
3820 | 9 |
#include <list> |
10 |
||
11 |
namespace ns3 { |
|
12 |
||
13 |
class NetDevice; |
|
14 |
class Node; |
|
15 |
||
16 |
class Ipv4RawSocketImpl : public Socket |
|
17 |
{ |
|
18 |
public: |
|
19 |
static TypeId GetTypeId (void); |
|
20 |
||
21 |
Ipv4RawSocketImpl (); |
|
22 |
||
23 |
void SetNode (Ptr<Node> node); |
|
24 |
||
25 |
virtual enum Socket::SocketErrno GetErrno (void) const; |
|
6689
e2de571e920a
Implement Socket::GetSocketType
Josh Pelkey <jpelkey@gatech.edu>
parents:
6448
diff
changeset
|
26 |
virtual enum Socket::SocketType GetSocketType (void) const; |
3820 | 27 |
virtual Ptr<Node> GetNode (void) const; |
28 |
virtual int Bind (const Address &address); |
|
29 |
virtual int Bind (); |
|
30 |
virtual int GetSockName (Address &address) const; |
|
31 |
virtual int Close (void); |
|
32 |
virtual int ShutdownSend (void); |
|
33 |
virtual int ShutdownRecv (void); |
|
34 |
virtual int Connect (const Address &address); |
|
35 |
virtual int Listen (void); |
|
36 |
virtual uint32_t GetTxAvailable (void) const; |
|
37 |
virtual int Send (Ptr<Packet> p, uint32_t flags); |
|
38 |
virtual int SendTo (Ptr<Packet> p, uint32_t flags, |
|
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
39 |
const Address &toAddress); |
3820 | 40 |
virtual uint32_t GetRxAvailable (void) const; |
41 |
virtual Ptr<Packet> Recv (uint32_t maxSize, uint32_t flags); |
|
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
42 |
virtual Ptr<Packet> RecvFrom (uint32_t maxSize, uint32_t flags, |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
43 |
Address &fromAddress); |
3820 | 44 |
|
45 |
void SetProtocol (uint16_t protocol); |
|
6442
f380cf1aa4d8
Bug 671 add packet-info-tag.cc for IP_PKTINFO/IPV6_PKTINFO
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents:
6437
diff
changeset
|
46 |
bool ForwardUp (Ptr<const Packet> p, Ipv4Header ipHeader, Ptr<Ipv4Interface> incomingInterface); |
6448
184a509cc71d
Still Bug 943: fix UdpSocketImpl::GetAllowBroadcast, let Socket::SetAllowBroadcast return a bool indicating success/failure, instead of a fatal error.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6442
diff
changeset
|
47 |
virtual bool SetAllowBroadcast (bool allowBroadcast); |
6437
c11291f51d57
Bug 943 - Add a SO_BROADCAST socket option
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6334
diff
changeset
|
48 |
virtual bool GetAllowBroadcast () const; |
c11291f51d57
Bug 943 - Add a SO_BROADCAST socket option
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6334
diff
changeset
|
49 |
|
3820 | 50 |
private: |
51 |
virtual void DoDispose (void); |
|
52 |
||
53 |
struct Data { |
|
54 |
Ptr<Packet> packet; |
|
55 |
Ipv4Address fromIp; |
|
56 |
uint16_t fromProtocol; |
|
57 |
}; |
|
58 |
||
59 |
enum Socket::SocketErrno m_err; |
|
60 |
Ptr<Node> m_node; |
|
61 |
Ipv4Address m_src; |
|
62 |
Ipv4Address m_dst; |
|
63 |
uint16_t m_protocol; |
|
64 |
std::list<struct Data> m_recv; |
|
65 |
bool m_shutdownSend; |
|
66 |
bool m_shutdownRecv; |
|
67 |
uint32_t m_icmpFilter; |
|
6334
c9373f264dfe
Bug 932 - Support IP_HDRINCL option for Ipv4RawSocket
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents:
4472
diff
changeset
|
68 |
bool m_iphdrincl; |
3820 | 69 |
}; |
70 |
||
71 |
} // namespace ns3 |
|
72 |
||
73 |
#endif /* IPV4_RAW_SOCKET_IMPL_H */ |