author | Brian Swenson <bswenson3@gatech.edu> |
Tue, 22 Apr 2014 11:52:55 -0400 | |
changeset 10694 | 4af272d94cfd |
parent 10440 | 1e48ff9185f1 |
child 10855 | 7ef081ddfc7f |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7256
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
3578 | 2 |
/* |
3 |
* This program is free software; you can redistribute it and/or modify |
|
4 |
* it under the terms of the GNU General Public License version 2 as |
|
5 |
* published by the Free Software Foundation; |
|
6 |
* |
|
7 |
* This program is distributed in the hope that it will be useful, |
|
8 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
9 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
10 |
* GNU General Public License for more details. |
|
11 |
* |
|
12 |
* You should have received a copy of the GNU General Public License |
|
13 |
* along with this program; if not, write to the Free Software |
|
14 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
15 |
*/ |
|
16 |
#ifndef NSC_TCP_SOCKET_IMPL_H |
|
17 |
#define NSC_TCP_SOCKET_IMPL_H |
|
18 |
||
19 |
#include <stdint.h> |
|
20 |
#include <queue> |
|
21 |
#include <vector> |
|
22 |
||
23 |
#include "ns3/callback.h" |
|
24 |
#include "ns3/traced-value.h" |
|
25 |
#include "ns3/tcp-socket.h" |
|
26 |
#include "ns3/ptr.h" |
|
27 |
#include "ns3/ipv4-address.h" |
|
28 |
#include "ns3/inet-socket-address.h" |
|
29 |
#include "ns3/event-id.h" |
|
30 |
#include "pending-data.h" |
|
6434
ac8b4bf77e50
Bug 385 - Add a generic "sequence number" class.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6273
diff
changeset
|
31 |
#include "ns3/sequence-number.h" |
4740
34acfd7ad508
export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3778
diff
changeset
|
32 |
|
34acfd7ad508
export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3778
diff
changeset
|
33 |
struct INetStreamSocket; |
3578 | 34 |
|
35 |
namespace ns3 { |
|
36 |
||
37 |
class Ipv4EndPoint; |
|
38 |
class Node; |
|
39 |
class Packet; |
|
40 |
class NscTcpL4Protocol; |
|
41 |
class TcpHeader; |
|
42 |
||
3691 | 43 |
/** |
44 |
* \ingroup socket |
|
45 |
* \ingroup nsctcp |
|
46 |
* |
|
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
47 |
* \brief Socket logic for the NSC TCP sockets. |
3691 | 48 |
* |
49 |
* Most of the TCP internal |
|
50 |
* logic is handled by the NSC tcp library itself; this class maps ns3::Socket |
|
51 |
* calls to the NSC TCP library. |
|
52 |
*/ |
|
3578 | 53 |
class NscTcpSocketImpl : public TcpSocket |
54 |
{ |
|
55 |
public: |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
56 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
57 |
* \brief Get the type ID. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
58 |
* \return the object TypeId |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
59 |
*/ |
3578 | 60 |
static TypeId GetTypeId (void); |
61 |
/** |
|
62 |
* Create an unbound tcp socket. |
|
63 |
*/ |
|
64 |
NscTcpSocketImpl (); |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
65 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
66 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
67 |
* Clone a TCP socket, for use upon receiving a connection request in LISTEN state |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
68 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
69 |
* \param sock the original Tcp Socket |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
70 |
*/ |
3578 | 71 |
NscTcpSocketImpl (const NscTcpSocketImpl& sock); |
72 |
virtual ~NscTcpSocketImpl (); |
|
73 |
||
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
74 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
75 |
* \brief Set the associated node. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
76 |
* \param node the node |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
77 |
*/ |
3578 | 78 |
void SetNode (Ptr<Node> node); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
79 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
80 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
81 |
* \brief Set the associated TCP L4 protocol. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
82 |
* \param tcp the TCP L4 protocol |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
83 |
*/ |
3578 | 84 |
void SetTcp (Ptr<NscTcpL4Protocol> tcp); |
85 |
||
86 |
virtual enum SocketErrno GetErrno (void) const; |
|
6689
e2de571e920a
Implement Socket::GetSocketType
Josh Pelkey <jpelkey@gatech.edu>
parents:
6448
diff
changeset
|
87 |
virtual enum SocketType GetSocketType (void) const; |
3578 | 88 |
virtual Ptr<Node> GetNode (void) const; |
89 |
virtual int Bind (void); |
|
7717
cfa1741013dd
Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents:
7619
diff
changeset
|
90 |
virtual int Bind6 (void); |
3578 | 91 |
virtual int Bind (const Address &address); |
92 |
virtual int Close (void); |
|
93 |
virtual int ShutdownSend (void); |
|
94 |
virtual int ShutdownRecv (void); |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
95 |
virtual int Connect (const Address &address); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
96 |
virtual int Listen (void); |
3578 | 97 |
virtual uint32_t GetTxAvailable (void) const; |
98 |
virtual int Send (Ptr<Packet> p, uint32_t flags); |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
99 |
virtual int SendTo (Ptr<Packet> p, uint32_t flags, const Address &toAddress); |
3578 | 100 |
virtual uint32_t GetRxAvailable (void) const; |
101 |
virtual Ptr<Packet> Recv (uint32_t maxSize, uint32_t flags); |
|
102 |
virtual Ptr<Packet> RecvFrom (uint32_t maxSize, uint32_t flags, |
|
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
103 |
Address &fromAddress); |
3778
78c4c41557f3
Liu's GetSockName patch
Craig Dowell <craigdo@ee.washington.edu>
parents:
3772
diff
changeset
|
104 |
virtual int GetSockName (Address &address) const; |
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
|
105 |
virtual bool SetAllowBroadcast (bool allowBroadcast); |
6437
c11291f51d57
Bug 943 - Add a SO_BROADCAST socket option
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6434
diff
changeset
|
106 |
virtual bool GetAllowBroadcast () const; |
3578 | 107 |
|
108 |
private: |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
109 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
110 |
* \brief Called by NscTcpSocketImpl::ForwardUp() |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
111 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
112 |
* Actually performs the ForwardUp operations |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
113 |
*/ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
114 |
void NSCWakeup (void); |
3578 | 115 |
friend class Tcp; |
116 |
// invoked by Tcp class |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
117 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
118 |
* Finish the binding process |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
119 |
* \returns 0 on success, -1 on failure |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
120 |
*/ |
3578 | 121 |
int FinishBind (void); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
122 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
123 |
* \brief Called by the L3 protocol when it received a packet to pass on to TCP. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
124 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
125 |
* \param p the incoming packet |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
126 |
* \param header the packet's IPv4 header |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
127 |
* \param port the incoming port |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
128 |
* \param incomingInterface the incoming interface |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
129 |
*/ |
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
|
130 |
void ForwardUp (Ptr<Packet> p, Ipv4Header header, uint16_t port, |
f380cf1aa4d8
Bug 671 add packet-info-tag.cc for IP_PKTINFO/IPV6_PKTINFO
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents:
6437
diff
changeset
|
131 |
Ptr<Ipv4Interface> incomingInterface); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
132 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
133 |
* \brief Kill this socket by zeroing its attributes (IPv4) |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
134 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
135 |
* This is a callback function configured to m_endpoint in |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
136 |
* SetupCallback(), invoked when the endpoint is destroyed. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
137 |
*/ |
3578 | 138 |
void Destroy (void); |
139 |
//methods for state |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
140 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
141 |
* \brief Send all the pending data |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
142 |
* \returns true on success |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
143 |
*/ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
144 |
bool SendPendingData (void); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
145 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
146 |
* \brief Read all the pending data |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
147 |
* \returns true on success |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
148 |
*/ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
149 |
bool ReadPendingData (void); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
150 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
151 |
* \brief Accept an incoming connection |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
152 |
* \returns true on success |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
153 |
*/ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
154 |
bool Accept (void); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
155 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
156 |
* \brief Complete the Fork operations (after a connection has been accepted) |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
157 |
*/ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
158 |
void CompleteFork (void); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
159 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
160 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
161 |
* \brief Called when a connection is in Established state |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
162 |
*/ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
163 |
void ConnectionSucceeded (); |
3578 | 164 |
|
165 |
// Manage data tx/rx |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
166 |
// \todo This should be virtual and overridden |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
167 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
168 |
* \brief Copy self |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
169 |
* \returns a copy of self |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
170 |
*/ |
3578 | 171 |
Ptr<NscTcpSocketImpl> Copy (); |
172 |
||
173 |
// attribute related |
|
174 |
virtual void SetSndBufSize (uint32_t size); |
|
175 |
virtual uint32_t GetSndBufSize (void) const; |
|
176 |
virtual void SetRcvBufSize (uint32_t size); |
|
177 |
virtual uint32_t GetRcvBufSize (void) const; |
|
178 |
virtual void SetSegSize (uint32_t size); |
|
179 |
virtual uint32_t GetSegSize (void) const; |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
180 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
181 |
* \brief Set the Advertised Window size |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
182 |
* \param window the window size |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
183 |
*/ |
3578 | 184 |
virtual void SetAdvWin (uint32_t window); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
185 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
186 |
* \brief Get the Advertised Window size |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
187 |
* \returns the window size |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
188 |
*/ |
3578 | 189 |
virtual uint32_t GetAdvWin (void) const; |
190 |
virtual void SetSSThresh (uint32_t threshold); |
|
191 |
virtual uint32_t GetSSThresh (void) const; |
|
192 |
virtual void SetInitialCwnd (uint32_t cwnd); |
|
193 |
virtual uint32_t GetInitialCwnd (void) const; |
|
194 |
virtual void SetConnTimeout (Time timeout); |
|
195 |
virtual Time GetConnTimeout (void) const; |
|
196 |
virtual void SetConnCount (uint32_t count); |
|
197 |
virtual uint32_t GetConnCount (void) const; |
|
198 |
virtual void SetDelAckTimeout (Time timeout); |
|
199 |
virtual Time GetDelAckTimeout (void) const; |
|
200 |
virtual void SetDelAckMaxCount (uint32_t count); |
|
201 |
virtual uint32_t GetDelAckMaxCount (void) const; |
|
7619
b4dee6307aa7
Nagle's algorithm in TCP (closes bug 1039)
Adrian S Tam <adrian.sw.tam@gmail.com>
parents:
7386
diff
changeset
|
202 |
virtual void SetTcpNoDelay (bool noDelay); |
b4dee6307aa7
Nagle's algorithm in TCP (closes bug 1039)
Adrian S Tam <adrian.sw.tam@gmail.com>
parents:
7386
diff
changeset
|
203 |
virtual bool GetTcpNoDelay (void) const; |
6694 | 204 |
virtual void SetPersistTimeout (Time timeout); |
205 |
virtual Time GetPersistTimeout (void) const; |
|
3578 | 206 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
207 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
208 |
* \brief Translate between a NSC error and a ns-3 error code |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
209 |
* \param err NSC error |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
210 |
* \returns ns-3 error code |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
211 |
*/ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
212 |
enum Socket::SocketErrno GetNativeNs3Errno (int err) const; |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
213 |
uint32_t m_delAckMaxCount; //!< Number of packet to fire an ACK before delay timeout |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
214 |
Time m_delAckTimeout; //!< Time to delay an ACK |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
215 |
bool m_noDelay; //!< Disable ACk delay |
3578 | 216 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
217 |
Ipv4EndPoint *m_endPoint; //!< the IPv4 endpoint |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
218 |
Ptr<Node> m_node; //!< the associated node |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
219 |
Ptr<NscTcpL4Protocol> m_tcp; //!< the associated TCP L4 protocol |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
220 |
Ipv4Address m_remoteAddress; //!< peer IP address |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
221 |
uint16_t m_remotePort; //!< peer port |
3578 | 222 |
//these two are so that the socket/endpoint cloning works |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
223 |
Ipv4Address m_localAddress; //!< local address |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
224 |
uint16_t m_localPort; //!< local port |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
225 |
InetSocketAddress m_peerAddress; //!< peer IP and port |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
226 |
enum SocketErrno m_errno; //!< last error number |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
227 |
bool m_shutdownSend; //!< Send no longer allowed |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
228 |
bool m_shutdownRecv; //!< Receive no longer allowed |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
229 |
bool m_connected; //!< Connection established |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
230 |
|
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
5971
diff
changeset
|
231 |
//manage the state information |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
232 |
TracedValue<TcpStates_t> m_state; //!< state information |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
233 |
bool m_closeOnEmpty; //!< true if socket will close when buffer is empty |
3578 | 234 |
|
235 |
//needed to queue data when in SYN_SENT state |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
236 |
std::queue<Ptr<Packet> > m_txBuffer; //!< transmission buffer |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
237 |
uint32_t m_txBufferSize; //!< transmission buffer size |
3578 | 238 |
|
239 |
// Window management |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
240 |
uint32_t m_segmentSize; //!< SegmentSize |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
241 |
uint32_t m_rxWindowSize; //!< Receive window size |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
242 |
uint32_t m_advertisedWindowSize; //!< Window to advertise |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
243 |
TracedValue<uint32_t> m_cWnd; //!< Congestion window |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
244 |
uint32_t m_ssThresh; //!< Slow Start Threshold |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
245 |
uint32_t m_initialCWnd; //!< Initial cWnd value |
3578 | 246 |
|
247 |
// Round trip time estimation |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
248 |
Time m_lastMeasuredRtt; //!< Last measured RTT |
3578 | 249 |
|
250 |
// Timer-related members |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
251 |
Time m_cnTimeout; //!< Timeout for connection retry |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
252 |
uint32_t m_cnCount; //!< Count of remaining connection retries |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
253 |
Time m_persistTimeout; //!< Time between sending 1-byte probes |
3578 | 254 |
|
255 |
// Temporary queue for delivering data to application |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
256 |
std::queue<Ptr<Packet> > m_deliveryQueue; //!< receive buffer |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
257 |
uint32_t m_rxAvailable; //!< receive buffer available size |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
258 |
INetStreamSocket* m_nscTcpSocket; //!< the real NSC TCP socket |
3578 | 259 |
|
260 |
// Attributes |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
261 |
uint32_t m_sndBufSize; //!< buffer limit for the outgoing queue |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9894
diff
changeset
|
262 |
uint32_t m_rcvBufSize; //!< maximum receive socket buffer size |
3578 | 263 |
}; |
264 |
||
7386
2310ed220a61
standardize ns-3 namespace declaration format
Vedran Miletić <rivanvx@gmail.com>
parents:
7385
diff
changeset
|
265 |
} // namespace ns3 |
3578 | 266 |
|
267 |
#endif /* NSC_TCP_SOCKET_IMPL_H */ |