author | Tommaso Pecorella <tommaso.pecorella@unifi.it> |
Wed, 13 Aug 2014 23:46:16 +0200 | |
changeset 10855 | 7ef081ddfc7f |
parent 10791 | 9b29bb9d495b |
child 10885 | 462d70f54ada |
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; -*- */ |
6694 | 2 |
/* |
7608
de67936e4017
Mixed bugfixes on TCP, closes bug 1166, 1227, 1242.
Adrian S Tam <adrian.sw.tam@gmail.com>
parents:
7385
diff
changeset
|
3 |
* Copyright (c) 2007 Georgia Tech Research Corporation |
6694 | 4 |
* Copyright (c) 2010 Adrian Sai-wah Tam |
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or modify |
|
7 |
* it under the terms of the GNU General Public License version 2 as |
|
8 |
* published by the Free Software Foundation; |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
18 |
* |
|
19 |
* Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com> |
|
20 |
*/ |
|
21 |
#ifndef TCP_SOCKET_BASE_H |
|
22 |
#define TCP_SOCKET_BASE_H |
|
23 |
||
24 |
#include <stdint.h> |
|
25 |
#include <queue> |
|
26 |
#include "ns3/callback.h" |
|
27 |
#include "ns3/traced-value.h" |
|
28 |
#include "ns3/tcp-socket.h" |
|
29 |
#include "ns3/ptr.h" |
|
30 |
#include "ns3/ipv4-address.h" |
|
31 |
#include "ns3/ipv4-header.h" |
|
32 |
#include "ns3/ipv4-interface.h" |
|
9145
5752b425cdf5
Bug 1361 - Set TOS from Application level (sockets)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9095
diff
changeset
|
33 |
#include "ns3/ipv6-header.h" |
10528
c1e835b43726
Bug 1796 - Ipv6PacketInfoTag is not filled by UdpSocketImpl::ForwardUp6.
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
34 |
#include "ns3/ipv6-interface.h" |
6694 | 35 |
#include "ns3/event-id.h" |
36 |
#include "tcp-tx-buffer.h" |
|
37 |
#include "tcp-rx-buffer.h" |
|
38 |
#include "rtt-estimator.h" |
|
39 |
||
40 |
namespace ns3 { |
|
41 |
||
42 |
class Ipv4EndPoint; |
|
7717
cfa1741013dd
Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents:
7619
diff
changeset
|
43 |
class Ipv6EndPoint; |
6694 | 44 |
class Node; |
45 |
class Packet; |
|
46 |
class TcpL4Protocol; |
|
47 |
class TcpHeader; |
|
48 |
||
49 |
/** |
|
50 |
* \ingroup socket |
|
51 |
* \ingroup tcp |
|
52 |
* |
|
53 |
* \brief A base class for implementation of a stream socket using TCP. |
|
54 |
* |
|
55 |
* This class contains the essential components of TCP, as well as a sockets |
|
56 |
* interface for upper layers to call. This serves as a base for other TCP |
|
57 |
* functions where the sliding window mechanism is handled here. This class |
|
58 |
* provides connection orientation and sliding window flow control. Part of |
|
59 |
* this class is modified from the original NS-3 TCP socket implementation |
|
7608
de67936e4017
Mixed bugfixes on TCP, closes bug 1166, 1227, 1242.
Adrian S Tam <adrian.sw.tam@gmail.com>
parents:
7385
diff
changeset
|
60 |
* (TcpSocketImpl) by Raj Bhattacharjea <raj.b@gatech.edu> of Georgia Tech. |
6694 | 61 |
*/ |
62 |
class TcpSocketBase : public TcpSocket |
|
63 |
{ |
|
64 |
public: |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
65 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
66 |
* Get the type ID. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
67 |
* \brief Get the type ID. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
68 |
* \return the object TypeId |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
69 |
*/ |
6694 | 70 |
static TypeId GetTypeId (void); |
71 |
/** |
|
72 |
* Create an unbound TCP socket |
|
73 |
*/ |
|
74 |
TcpSocketBase (void); |
|
75 |
||
76 |
/** |
|
77 |
* Clone a TCP socket, for use upon receiving a connection request in LISTEN state |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
78 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
79 |
* \param sock the original Tcp Socket |
6694 | 80 |
*/ |
81 |
TcpSocketBase (const TcpSocketBase& sock); |
|
82 |
virtual ~TcpSocketBase (void); |
|
83 |
||
84 |
// Set associated Node, TcpL4Protocol, RttEstimator to this socket |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
85 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
86 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
87 |
* \brief Set the associated node. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
88 |
* \param node the node |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
89 |
*/ |
6694 | 90 |
virtual void SetNode (Ptr<Node> node); |
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
91 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
92 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
93 |
* \brief Set the associated TCP L4 protocol. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
94 |
* \param tcp the TCP L4 protocol |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
95 |
*/ |
6694 | 96 |
virtual void SetTcp (Ptr<TcpL4Protocol> tcp); |
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
97 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
98 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
99 |
* \brief Set the associated RTT estimator. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
100 |
* \param rtt the RTT estimator |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
101 |
*/ |
6694 | 102 |
virtual void SetRtt (Ptr<RttEstimator> rtt); |
103 |
||
104 |
// Necessary implementations of null functions from ns3::Socket |
|
105 |
virtual enum SocketErrno GetErrno (void) const; // returns m_errno |
|
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
106 |
virtual enum SocketType GetSocketType (void) const; // returns socket type |
6694 | 107 |
virtual Ptr<Node> GetNode (void) const; // returns m_node |
108 |
virtual int Bind (void); // Bind a socket by setting up endpoint in TcpL4Protocol |
|
7717
cfa1741013dd
Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents:
7619
diff
changeset
|
109 |
virtual int Bind6 (void); // Bind a socket by setting up endpoint in TcpL4Protocol |
6694 | 110 |
virtual int Bind (const Address &address); // ... endpoint of specific addr or port |
111 |
virtual int Connect (const Address &address); // Setup endpoint and call ProcessAction() to connect |
|
112 |
virtual int Listen (void); // Verify the socket is in a correct state and call ProcessAction() to listen |
|
113 |
virtual int Close (void); // Close by app: Kill socket upon tx buffer emptied |
|
114 |
virtual int ShutdownSend (void); // Assert the m_shutdownSend flag to prevent send to network |
|
115 |
virtual int ShutdownRecv (void); // Assert the m_shutdownRecv flag to prevent forward to app |
|
116 |
virtual int Send (Ptr<Packet> p, uint32_t flags); // Call by app to send data to network |
|
117 |
virtual int SendTo (Ptr<Packet> p, uint32_t flags, const Address &toAddress); // Same as Send(), toAddress is insignificant |
|
118 |
virtual Ptr<Packet> Recv (uint32_t maxSize, uint32_t flags); // Return a packet to be forwarded to app |
|
119 |
virtual Ptr<Packet> RecvFrom (uint32_t maxSize, uint32_t flags, Address &fromAddress); // ... and write the remote address at fromAddress |
|
120 |
virtual uint32_t GetTxAvailable (void) const; // Available Tx buffer size |
|
121 |
virtual uint32_t GetRxAvailable (void) const; // Available-to-read data size, i.e. value of m_rxAvailable |
|
122 |
virtual int GetSockName (Address &address) const; // Return local addr:port in address |
|
123 |
virtual void BindToNetDevice (Ptr<NetDevice> netdevice); // NetDevice with my m_endPoint |
|
124 |
||
125 |
protected: |
|
126 |
// Implementing ns3::TcpSocket -- Attribute get/set |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
127 |
// inherited, no need to doc |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
128 |
|
6694 | 129 |
virtual void SetSndBufSize (uint32_t size); |
130 |
virtual uint32_t GetSndBufSize (void) const; |
|
131 |
virtual void SetRcvBufSize (uint32_t size); |
|
132 |
virtual uint32_t GetRcvBufSize (void) const; |
|
133 |
virtual void SetSegSize (uint32_t size); |
|
134 |
virtual uint32_t GetSegSize (void) const; |
|
10855
7ef081ddfc7f
Bug 1831 - TcpSocket SlowStartThreshold is not a TraceSource
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10791
diff
changeset
|
135 |
virtual void SetInitialSSThresh (uint32_t threshold) = 0; |
7ef081ddfc7f
Bug 1831 - TcpSocket SlowStartThreshold is not a TraceSource
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10791
diff
changeset
|
136 |
virtual uint32_t GetInitialSSThresh (void) const = 0; |
6694 | 137 |
virtual void SetInitialCwnd (uint32_t cwnd) = 0; |
138 |
virtual uint32_t GetInitialCwnd (void) const = 0; |
|
139 |
virtual void SetConnTimeout (Time timeout); |
|
140 |
virtual Time GetConnTimeout (void) const; |
|
141 |
virtual void SetConnCount (uint32_t count); |
|
142 |
virtual uint32_t GetConnCount (void) const; |
|
143 |
virtual void SetDelAckTimeout (Time timeout); |
|
144 |
virtual Time GetDelAckTimeout (void) const; |
|
145 |
virtual void SetDelAckMaxCount (uint32_t count); |
|
146 |
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:
7608
diff
changeset
|
147 |
virtual void SetTcpNoDelay (bool noDelay); |
b4dee6307aa7
Nagle's algorithm in TCP (closes bug 1039)
Adrian S Tam <adrian.sw.tam@gmail.com>
parents:
7608
diff
changeset
|
148 |
virtual bool GetTcpNoDelay (void) const; |
6694 | 149 |
virtual void SetPersistTimeout (Time timeout); |
150 |
virtual Time GetPersistTimeout (void) const; |
|
151 |
virtual bool SetAllowBroadcast (bool allowBroadcast); |
|
7608
de67936e4017
Mixed bugfixes on TCP, closes bug 1166, 1227, 1242.
Adrian S Tam <adrian.sw.tam@gmail.com>
parents:
7385
diff
changeset
|
152 |
virtual bool GetAllowBroadcast (void) const; |
6694 | 153 |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
154 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
155 |
|
6694 | 156 |
// Helper functions: Connection set up |
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
157 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
158 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
159 |
* \brief Common part of the two Bind(), i.e. set callback and remembering local addr:port |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
160 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
161 |
* \returns 0 on success, -1 on failure |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
162 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
163 |
int SetupCallback (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
164 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
165 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
166 |
* \brief Perform the real connection tasks: Send SYN if allowed, RST if invalid |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
167 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
168 |
* \returns 0 on success |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
169 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
170 |
int DoConnect (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
171 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
172 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
173 |
* \brief Schedule-friendly wrapper for Socket::NotifyConnectionSucceeded() |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
174 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
175 |
void ConnectionSucceeded (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
176 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
177 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
178 |
* \brief Configure the endpoint to a local address. Called by Connect() if Bind() didn't specify one. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
179 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
180 |
* \returns 0 on success |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
181 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
182 |
int SetupEndpoint (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
183 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
184 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
185 |
* \brief Configure the endpoint v6 to a local address. Called by Connect() if Bind() didn't specify one. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
186 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
187 |
* \returns 0 on success |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
188 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
189 |
int SetupEndpoint6 (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
190 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
191 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
192 |
* \brief Complete a connection by forking the socket |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
193 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
194 |
* This function is called only if a SYN received in LISTEN state. After |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
195 |
* TcpSocketBase cloned, allocate a new end point to handle the incoming |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
196 |
* connection and send a SYN+ACK to complete the handshake. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
197 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
198 |
* \param p the packet triggering the fork |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
199 |
* \param tcpHeader the TCP header of the triggering packet |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
200 |
* \param fromAddress the address of the remote host |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
201 |
* \param toAddress the address the connection is directed to |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
202 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
203 |
void CompleteFork (Ptr<Packet> p, const TcpHeader& tcpHeader, const Address& fromAddress, const Address& toAddress); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
204 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
205 |
|
6694 | 206 |
|
207 |
// Helper functions: Transfer operation |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
208 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
209 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
210 |
* \brief Called by the L3 protocol when it received a packet to pass on to TCP. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
211 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
212 |
* \param packet the incoming packet |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10405
diff
changeset
|
213 |
* \param header the packet's IPv4 header |
10791
9b29bb9d495b
Clarify doxygen for [Tcp,Udp]Socket ForwardUp functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10575
diff
changeset
|
214 |
* \param port the remote port |
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
215 |
* \param incomingInterface the incoming interface |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
216 |
*/ |
7608
de67936e4017
Mixed bugfixes on TCP, closes bug 1166, 1227, 1242.
Adrian S Tam <adrian.sw.tam@gmail.com>
parents:
7385
diff
changeset
|
217 |
void ForwardUp (Ptr<Packet> packet, Ipv4Header header, uint16_t port, Ptr<Ipv4Interface> incomingInterface); |
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
218 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
219 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
220 |
* \brief Called by the L3 protocol when it received a packet to pass on to TCP. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
221 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
222 |
* \param packet the incoming packet |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10405
diff
changeset
|
223 |
* \param header the packet's IPv6 header |
10791
9b29bb9d495b
Clarify doxygen for [Tcp,Udp]Socket ForwardUp functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10575
diff
changeset
|
224 |
* \param port the remote port |
10528
c1e835b43726
Bug 1796 - Ipv6PacketInfoTag is not filled by UdpSocketImpl::ForwardUp6.
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
225 |
* \param incomingInterface the incoming interface |
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
226 |
*/ |
10528
c1e835b43726
Bug 1796 - Ipv6PacketInfoTag is not filled by UdpSocketImpl::ForwardUp6.
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
227 |
void ForwardUp6 (Ptr<Packet> packet, Ipv6Header header, uint16_t port, Ptr<Ipv6Interface> incomingInterface); |
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
228 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
229 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
230 |
* \brief Called by TcpSocketBase::ForwardUp(). |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
231 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
232 |
* \param packet the incoming packet |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10405
diff
changeset
|
233 |
* \param header the packet's IPv4 header |
10791
9b29bb9d495b
Clarify doxygen for [Tcp,Udp]Socket ForwardUp functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10575
diff
changeset
|
234 |
* \param port the remote port |
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
235 |
* \param incomingInterface the incoming interface |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
236 |
*/ |
7608
de67936e4017
Mixed bugfixes on TCP, closes bug 1166, 1227, 1242.
Adrian S Tam <adrian.sw.tam@gmail.com>
parents:
7385
diff
changeset
|
237 |
virtual void DoForwardUp (Ptr<Packet> packet, Ipv4Header header, uint16_t port, Ptr<Ipv4Interface> incomingInterface); //Get a pkt from L3 |
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
238 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
239 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
240 |
* \brief Called by TcpSocketBase::ForwardUp6(). |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
241 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
242 |
* \param packet the incoming packet |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10405
diff
changeset
|
243 |
* \param header the packet's IPv6 header |
10791
9b29bb9d495b
Clarify doxygen for [Tcp,Udp]Socket ForwardUp functions
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10575
diff
changeset
|
244 |
* \param port the remote port |
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
245 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
246 |
virtual void DoForwardUp (Ptr<Packet> packet, Ipv6Header header, uint16_t port); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
247 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
248 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
249 |
* \brief Called by the L3 protocol when it received an ICMP packet to pass on to TCP. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
250 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
251 |
* \param icmpSource the ICMP source address |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
252 |
* \param icmpTtl the ICMP Time to Live |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
253 |
* \param icmpType the ICMP Type |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
254 |
* \param icmpCode the ICMP Code |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
255 |
* \param icmpInfo the ICMP Info |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
256 |
*/ |
9095
8462a1160246
bug 1359 TCP cannot receive ICMP
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7747
diff
changeset
|
257 |
void ForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo); |
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
258 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
259 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
260 |
* \brief Called by the L3 protocol when it received an ICMPv6 packet to pass on to TCP. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
261 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
262 |
* \param icmpSource the ICMP source address |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
263 |
* \param icmpTtl the ICMP Time to Live |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
264 |
* \param icmpType the ICMP Type |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
265 |
* \param icmpCode the ICMP Code |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
266 |
* \param icmpInfo the ICMP Info |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
267 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
268 |
void ForwardIcmp6 (Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
269 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
270 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
271 |
* \brief Send as much pending data as possible according to the Tx window. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
272 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
273 |
* Note that this function did not implement the PSH flag. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
274 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
275 |
* \param withAck forces an ACK to be sent |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
276 |
* \returns true if some data have been sent |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
277 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
278 |
bool SendPendingData (bool withAck = false); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
279 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
280 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
281 |
* \brief Extract at most maxSize bytes from the TxBuffer at sequence seq, add the |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
282 |
* TCP header, and send to TcpL4Protocol |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
283 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
284 |
* \param seq the sequence number |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
285 |
* \param maxSize the maximum data block to be transmitted (in bytes) |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
286 |
* \param withAck forces an ACK to be sent |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
287 |
* \returns the number of bytes sent |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
288 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
289 |
uint32_t SendDataPacket (SequenceNumber32 seq, uint32_t maxSize, bool withAck); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
290 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
291 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
292 |
* \brief Send a empty packet that carries a flag, e.g. ACK |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
293 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
294 |
* \param flags the packet's flags |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
295 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
296 |
void SendEmptyPacket (uint8_t flags); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
297 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
298 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
299 |
* \brief Send reset and tear down this socket |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
300 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
301 |
void SendRST (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
302 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
303 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
304 |
* \brief Check if a sequence number range is within the rx window |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
305 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
306 |
* \param head start of the Sequence window |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
307 |
* \param tail end of the Sequence window |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
308 |
* \returns true if it is in range |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
309 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
310 |
bool OutOfRange (SequenceNumber32 head, SequenceNumber32 tail) const; |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
311 |
|
6694 | 312 |
|
313 |
// Helper functions: Connection close |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
314 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
315 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
316 |
* \brief Close a socket by sending RST, FIN, or FIN+ACK, depend on the current state |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
317 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
318 |
* \returns 0 on success |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
319 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
320 |
int DoClose (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
321 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
322 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
323 |
* \brief Peacefully close the socket by notifying the upper layer and deallocate end point |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
324 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
325 |
void CloseAndNotify (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
326 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
327 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
328 |
* \brief Kill this socket by zeroing its attributes (IPv4) |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
329 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
330 |
* This is a callback function configured to m_endpoint in |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
331 |
* SetupCallback(), invoked when the endpoint is destroyed. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
332 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
333 |
void Destroy (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
334 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
335 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
336 |
* \brief Kill this socket by zeroing its attributes (IPv6) |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
337 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
338 |
* This is a callback function configured to m_endpoint in |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
339 |
* SetupCallback(), invoked when the endpoint is destroyed. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
340 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
341 |
void Destroy6 (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
342 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
343 |
/** |
10575
16f8ac386faf
Bug 1739 - The endpoint is not deallocated for UDP sockets
Juan C. Granda <jcgranda@uniovi.es>
parents:
10528
diff
changeset
|
344 |
* \brief Deallocate m_endPoint and m_endPoint6 |
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
345 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
346 |
void DeallocateEndPoint (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
347 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
348 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
349 |
* \brief Received a FIN from peer, notify rx buffer |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
350 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
351 |
* \param p the packet |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
352 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
353 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
354 |
void PeerClose (Ptr<Packet> p, const TcpHeader& tcpHeader); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
355 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
356 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
357 |
* \brief FIN is in sequence, notify app and respond with a FIN |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
358 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
359 |
void DoPeerClose (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
360 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
361 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
362 |
* \brief Cancel all timer when endpoint is deleted |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
363 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
364 |
void CancelAllTimers (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
365 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
366 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
367 |
* \brief Move from CLOSING or FIN_WAIT_2 to TIME_WAIT state |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
368 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
369 |
void TimeWait (void); |
6694 | 370 |
|
371 |
// State transition functions |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
372 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
373 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
374 |
* \brief Received a packet upon ESTABLISHED state. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
375 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
376 |
* This function is mimicking the role of tcp_rcv_established() in tcp_input.c in Linux kernel. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
377 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
378 |
* \param packet the packet |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
379 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
380 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
381 |
void ProcessEstablished (Ptr<Packet> packet, const TcpHeader& tcpHeader); // Received a packet upon ESTABLISHED state |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
382 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
383 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
384 |
* \brief Received a packet upon LISTEN state. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
385 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
386 |
* \param packet the packet |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
387 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
388 |
* \param fromAddress the source address |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
389 |
* \param toAddress the destination address |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
390 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
391 |
void ProcessListen (Ptr<Packet> packet, const TcpHeader& tcpHeader, |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
392 |
const Address& fromAddress, const Address& toAddress); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
393 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
394 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
395 |
* \brief Received a packet upon SYN_SENT |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
396 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
397 |
* \param packet the packet |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
398 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
399 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
400 |
void ProcessSynSent (Ptr<Packet> packet, const TcpHeader& tcpHeader); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
401 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
402 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
403 |
* \brief Received a packet upon SYN_RCVD. |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
404 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
405 |
* \param packet the packet |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
406 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
407 |
* \param fromAddress the source address |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
408 |
* \param toAddress the destination address |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
409 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
410 |
void ProcessSynRcvd (Ptr<Packet> packet, const TcpHeader& tcpHeader, |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
411 |
const Address& fromAddress, const Address& toAddress); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
412 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
413 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
414 |
* \brief Received a packet upon CLOSE_WAIT, FIN_WAIT_1, FIN_WAIT_2 |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
415 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
416 |
* \param packet the packet |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
417 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
418 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
419 |
void ProcessWait (Ptr<Packet> packet, const TcpHeader& tcpHeader); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
420 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
421 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
422 |
* \brief Received a packet upon CLOSING |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
423 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
424 |
* \param packet the packet |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
425 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
426 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
427 |
void ProcessClosing (Ptr<Packet> packet, const TcpHeader& tcpHeader); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
428 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
429 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
430 |
* \brief Received a packet upon LAST_ACK |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
431 |
* |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
432 |
* \param packet the packet |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
433 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
434 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
435 |
void ProcessLastAck (Ptr<Packet> packet, const TcpHeader& tcpHeader); |
6694 | 436 |
|
437 |
// Window management |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
438 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
439 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
440 |
* \brief Return count of number of unacked bytes |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
441 |
* \returns count of number of unacked bytes |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
442 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
443 |
virtual uint32_t UnAckDataCount (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
444 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
445 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
446 |
* \brief Return total bytes in flight |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
447 |
* \returns total bytes in flight |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
448 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
449 |
virtual uint32_t BytesInFlight (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
450 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
451 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
452 |
* \brief Return the max possible number of unacked bytes |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
453 |
* \returns the max possible number of unacked bytes |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
454 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
455 |
virtual uint32_t Window (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
456 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
457 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
458 |
* \brief Return unfilled portion of window |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
459 |
* \return unfilled portion of window |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
460 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
461 |
virtual uint32_t AvailableWindow (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
462 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
463 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
464 |
* \brief The amount of Rx window announced to the peer |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
465 |
* \returns size of Rx window announced to the peer |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
466 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
467 |
virtual uint16_t AdvertisedWindowSize (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
468 |
|
6694 | 469 |
|
470 |
// Manage data tx/rx |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
471 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
472 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
473 |
* \brief Call CopyObject<> to clone me |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
474 |
* \returns a copy of the socket |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
475 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
476 |
virtual Ptr<TcpSocketBase> Fork (void) = 0; |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
477 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
478 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
479 |
* \brief Received an ACK packet |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
480 |
* \param packet the packet |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
481 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
482 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
483 |
virtual void ReceivedAck (Ptr<Packet> packet, const TcpHeader& tcpHeader); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
484 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
485 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
486 |
* \brief Recv of a data, put into buffer, call L7 to get it if necessary |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
487 |
* \param packet the packet |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
488 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
489 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
490 |
virtual void ReceivedData (Ptr<Packet> packet, const TcpHeader& tcpHeader); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
491 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
492 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
493 |
* \brief Take into account the packet for RTT estimation |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
494 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
495 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
496 |
virtual void EstimateRtt (const TcpHeader& tcpHeader); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
497 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
498 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
499 |
* \brief Update buffers w.r.t. ACK |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
500 |
* \param seq the sequence number |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
501 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
502 |
virtual void NewAck (SequenceNumber32 const& seq); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
503 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
504 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
505 |
* \brief Received dupack (duplicate ACK) |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
506 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
507 |
* \param count counter of duplicate ACKs |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
508 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
509 |
virtual void DupAck (const TcpHeader& tcpHeader, uint32_t count) = 0; |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
510 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
511 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
512 |
* \brief Call Retransmit() upon RTO event |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
513 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
514 |
virtual void ReTxTimeout (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
515 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
516 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
517 |
* \brief Halving cwnd and call DoRetransmit() |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
518 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
519 |
virtual void Retransmit (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
520 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
521 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
522 |
* \brief Action upon delay ACK timeout, i.e. send an ACK |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
523 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
524 |
virtual void DelAckTimeout (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
525 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
526 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
527 |
* \brief Timeout at LAST_ACK, close the connection |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
528 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
529 |
virtual void LastAckTimeout (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
530 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
531 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
532 |
* \brief Send 1 byte probe to get an updated window size |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
533 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
534 |
virtual void PersistTimeout (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
535 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
536 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
537 |
* \brief Retransmit the oldest packet |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
538 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
539 |
virtual void DoRetransmit (void); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
540 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
541 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
542 |
* \brief Read option from incoming packets |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
543 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
544 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
545 |
virtual void ReadOptions (const TcpHeader& tcpHeader); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
546 |
|
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
547 |
/** |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
548 |
* \brief Add option to outgoing packets |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
549 |
* \param tcpHeader the packet's TCP header |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
550 |
*/ |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
551 |
virtual void AddOptions (TcpHeader& tcpHeader); |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
552 |
|
6694 | 553 |
|
554 |
protected: |
|
555 |
// Counters and events |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
556 |
EventId m_retxEvent; //!< Retransmission event |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
557 |
EventId m_lastAckEvent; //!< Last ACK timeout event |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
558 |
EventId m_delAckEvent; //!< Delayed ACK timeout event |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
559 |
EventId m_persistEvent; //!< Persist event: Send 1 byte to probe for a non-zero Rx window |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
560 |
EventId m_timewaitEvent; //!< TIME_WAIT expiration event: Move this socket to CLOSED state |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
561 |
uint32_t m_dupAckCount; //!< Dupack counter |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
562 |
uint32_t m_delAckCount; //!< Delayed ACK counter |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
563 |
uint32_t m_delAckMaxCount; //!< Number of packet to fire an ACK before delay timeout |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
564 |
bool m_noDelay; //!< Set to true to disable Nagle's algorithm |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
565 |
uint32_t m_cnCount; //!< Count of remaining connection retries |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
566 |
uint32_t m_cnRetries; //!< Number of connection retries before giving up |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
567 |
TracedValue<Time> m_rto; //!< Retransmit timeout |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
568 |
TracedValue<Time> m_lastRtt; //!< Last RTT sample collected |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
569 |
Time m_delAckTimeout; //!< Time to delay an ACK |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
570 |
Time m_persistTimeout; //!< Time between sending 1-byte probes |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
571 |
Time m_cnTimeout; //!< Timeout for connection retry |
6694 | 572 |
|
573 |
// Connections to other layers of TCP/IP |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
574 |
Ipv4EndPoint* m_endPoint; //!< the IPv4 endpoint |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
575 |
Ipv6EndPoint* m_endPoint6; //!< the IPv6 endpoint |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
576 |
Ptr<Node> m_node; //!< the associated node |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
577 |
Ptr<TcpL4Protocol> m_tcp; //!< the associated TCP L4 protocol |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
578 |
Callback<void, Ipv4Address,uint8_t,uint8_t,uint8_t,uint32_t> m_icmpCallback; //!< ICMP callback |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
579 |
Callback<void, Ipv6Address,uint8_t,uint8_t,uint8_t,uint32_t> m_icmpCallback6; //!< ICMPv6 callback |
6694 | 580 |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
581 |
Ptr<RttEstimator> m_rtt; //!< Round trip time estimator |
6694 | 582 |
|
583 |
// Rx and Tx buffer management |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
584 |
TracedValue<SequenceNumber32> m_nextTxSequence; //!< Next seqnum to be sent (SND.NXT), ReTx pushes it back |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
585 |
TracedValue<SequenceNumber32> m_highTxMark; //!< Highest seqno ever sent, regardless of ReTx |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
586 |
TcpRxBuffer m_rxBuffer; //!< Rx buffer (reordering buffer) |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
587 |
TcpTxBuffer m_txBuffer; //!< Tx buffer |
6694 | 588 |
|
589 |
// State-related attributes |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
590 |
TracedValue<TcpStates_t> m_state; //!< TCP state |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
591 |
enum SocketErrno m_errno; //!< Socket error code |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
592 |
bool m_closeNotified; //!< Told app to close socket |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
593 |
bool m_closeOnEmpty; //!< Close socket upon tx buffer emptied |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
594 |
bool m_shutdownSend; //!< Send no longer allowed |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
595 |
bool m_shutdownRecv; //!< Receive no longer allowed |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
596 |
bool m_connected; //!< Connection established |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
597 |
double m_msl; //!< Max segment lifetime |
6694 | 598 |
|
599 |
// Window management |
|
10405
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
600 |
uint32_t m_segmentSize; //!< Segment size |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
601 |
uint16_t m_maxWinSize; //!< Maximum window size to advertise |
45c8fceae24e
Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9145
diff
changeset
|
602 |
TracedValue<uint32_t> m_rWnd; //!< Flow control window at remote side |
6694 | 603 |
}; |
604 |
||
605 |
} // namespace ns3 |
|
606 |
||
607 |
#endif /* TCP_SOCKET_BASE_H */ |