OnixS C++ B3 BOE Binary Order Entry  1.2.0
API Documentation
TcpInfo.h
Go to the documentation of this file.
1 /*
2  * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3  *
4  * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5  * and international copyright treaties.
6  *
7  * Access to and use of the software is governed by the terms of the applicable OnixS Software
8  * Services Agreement (the Agreement) and Customer end user license agreements granting
9  * a non-assignable, non-transferable and non-exclusive license to use the software
10  * for it's own data processing purposes under the terms defined in the Agreement.
11  *
12  * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13  * of this source code or associated reference material to any other location for further reproduction
14  * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15  *
16  * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17  * the terms of the Agreement is a violation of copyright law.
18  */
19 
20 #pragma once
21 
22 #include <OnixS/B3/BOE/ABI.h>
23 
24 namespace OnixS {
25 namespace B3 {
26 namespace BOE {
27 
28 /// TCP state information.
29 
30 struct TcpInfo
31 {
32  /// State of the connection
33  struct TcpState
34  {
35  enum Enum
36  {
37  /// TCP connection is established
39 
40  /// TCP SYN packet has been sent
42 
43  /// TCP SYN packet has been received
45 
46  /// TCP connection is in FIN wait state 1
48 
49  /// TCP connection is in FIN wait state 2
51 
52  /// TCP connection is in time wait state
54 
55  /// TCP connection is closing
57 
58  /// TCP connection is in close wait state
60 
61  /// Last acknowledgment has been sent
63 
64  /// TCP socket is listening for incoming connections
66 
67  /// TCP connection is in closing state
69 
70  /// TCP connection has received a new SYN packet
72  };
73  };
74 
75  /// TCP congestion avoidance state
76  struct TcpCaState
77  {
78  enum Enum
79  {
80  /// TCP congestion avoidance state: open
81  Open = 0,
82 
83  /// TCP congestion avoidance state: disorder
85 
86  /// TCP congestion avoidance state: congestion window reduced
87  Cwr,
88 
89  /// TCP congestion avoidance state: recovery
91 
92  /// TCP congestion avoidance state: loss
93  Loss
94  };
95  };
96 
97  /// Represents the state of the TCP connection.
99 
100  /// Represents the congestion avoidance state of the TCP connection.
102 
103  /// Number of retransmitted segments.
104  UInt8 retransmits;
105 
106  /// Number of probe packets sent.
107  UInt8 probes;
108 
109  /// Number of times the retransmission timer has been backed off.
110  UInt8 backoff;
111 
112  /// TCP options (e.g., selective acknowledgments) enabled for the connection.
113  UInt8 options;
114 
115  /// Sender's and receiver's window scale factors.
116  /// Note: Each field is 4 bits wide.
117  UInt8 sndWscale : 4, rcvWscale : 4;
118 
119  /// Retransmission timeout value in milliseconds.
120  UInt32 rto;
121 
122  /// Predicted average time in milliseconds between transmission and acknowledgment.
123  UInt32 ato;
124 
125  /// Maximum segment size (MSS) advertised by the sender.
126  UInt32 sndMss;
127 
128  /// Maximum segment size (MSS) advertised by the receiver.
129  UInt32 rcvMss;
130 
131  /// Number of segments sent but not yet acknowledged.
132  UInt32 unacked;
133 
134  /// Number of selective acknowledgments received.
135  UInt32 sacked;
136 
137  /// Number of lost segments.
138  UInt32 lost;
139 
140  /// Number of retransmitted segments.
141  UInt32 retrans;
142 
143  /// Number of forward acknowledgments (FACKs).
144  UInt32 fackets;
145 
146  /* Metrics. */
147  /// Path Maximum Transmission Unit (PMTU) estimate.
148  UInt32 pmtu;
149 
150  /// Receiver's slow-start threshold.
151  UInt32 rcvSsthresh;
152 
153  /// Smoothed round-trip time (RTT) estimate in microseconds.
154  UInt32 rtt;
155 
156  /// Round-trip time variance estimate in microseconds.
157  UInt32 rttvar;
158 
159  /// Sender's slow-start threshold.
160  UInt32 sndSsthresh;
161 
162  /// Sender's congestion window size.
163  UInt32 sndCwnd;
164 
165  /// Advertised maximum segment size (MSS).
166  UInt32 advmss;
167 
168  /// Reordering metric.
169  UInt32 reordering;
170 
171  /// Receiver's smoothed RTT estimate.
172  UInt32 rcvRtt;
173 
174  /// Available receive buffer space in bytes.
175  UInt32 rcvSpace;
176 
177  /// Total number of retransmissions.
178  UInt32 totalRetrans;
179 
180  /// \return a human-readable presentation.
182  std::string toString() const;
183 };
184 
185 
186 }
187 }
188 }
TCP congestion avoidance state: congestion window reduced.
Definition: TcpInfo.h:87
UInt32 rcvRtt
Receiver&#39;s smoothed RTT estimate.
Definition: TcpInfo.h:172
TCP connection is in closing state.
Definition: TcpInfo.h:68
TCP state information.
Definition: TcpInfo.h:30
UInt32 retrans
Number of retransmitted segments.
Definition: TcpInfo.h:141
TCP connection has received a new SYN packet.
Definition: TcpInfo.h:71
UInt8 backoff
Number of times the retransmission timer has been backed off.
Definition: TcpInfo.h:110
TCP SYN packet has been sent.
Definition: TcpInfo.h:41
UInt8 sndWscale
Sender&#39;s and receiver&#39;s window scale factors.
Definition: TcpInfo.h:117
#define ONIXS_B3_BOE_EXPORTED
Definition: Compiler.h:181
Last acknowledgment has been sent.
Definition: TcpInfo.h:62
TcpCaState::Enum caState
Represents the congestion avoidance state of the TCP connection.
Definition: TcpInfo.h:101
UInt32 lost
Number of lost segments.
Definition: TcpInfo.h:138
TCP connection is in time wait state.
Definition: TcpInfo.h:53
UInt32 totalRetrans
Total number of retransmissions.
Definition: TcpInfo.h:178
TCP connection is in close wait state.
Definition: TcpInfo.h:59
UInt32 unacked
Number of segments sent but not yet acknowledged.
Definition: TcpInfo.h:132
TCP socket is listening for incoming connections.
Definition: TcpInfo.h:65
Definition: Defines.h:40
TCP connection is in FIN wait state 2.
Definition: TcpInfo.h:50
TCP connection is in FIN wait state 1.
Definition: TcpInfo.h:47
UInt32 sndMss
Maximum segment size (MSS) advertised by the sender.
Definition: TcpInfo.h:126
TCP congestion avoidance state: recovery.
Definition: TcpInfo.h:90
UInt32 rcvSsthresh
Receiver&#39;s slow-start threshold.
Definition: TcpInfo.h:151
UInt32 fackets
Number of forward acknowledgments (FACKs).
Definition: TcpInfo.h:144
UInt32 ato
Predicted average time in milliseconds between transmission and acknowledgment.
Definition: TcpInfo.h:123
UInt32 rto
Retransmission timeout value in milliseconds.
Definition: TcpInfo.h:120
UInt32 sndSsthresh
Sender&#39;s slow-start threshold.
Definition: TcpInfo.h:160
UInt8 options
TCP options (e.g., selective acknowledgments) enabled for the connection.
Definition: TcpInfo.h:113
UInt32 sndCwnd
Sender&#39;s congestion window size.
Definition: TcpInfo.h:163
TCP congestion avoidance state.
Definition: TcpInfo.h:76
UInt32 rcvSpace
Available receive buffer space in bytes.
Definition: TcpInfo.h:175
TCP SYN packet has been received.
Definition: TcpInfo.h:44
TCP connection is established.
Definition: TcpInfo.h:38
TCP connection is closing.
Definition: TcpInfo.h:56
UInt8 probes
Number of probe packets sent.
Definition: TcpInfo.h:107
TcpState::Enum state
Represents the state of the TCP connection.
Definition: TcpInfo.h:98
TCP congestion avoidance state: disorder.
Definition: TcpInfo.h:84
UInt32 reordering
Reordering metric.
Definition: TcpInfo.h:169
State of the connection.
Definition: TcpInfo.h:33
std::string toString() const
UInt32 sacked
Number of selective acknowledgments received.
Definition: TcpInfo.h:135
UInt32 rcvMss
Maximum segment size (MSS) advertised by the receiver.
Definition: TcpInfo.h:129
UInt32 pmtu
Path Maximum Transmission Unit (PMTU) estimate.
Definition: TcpInfo.h:148
UInt32 rttvar
Round-trip time variance estimate in microseconds.
Definition: TcpInfo.h:157
UInt8 retransmits
Number of retransmitted segments.
Definition: TcpInfo.h:104
UInt32 advmss
Advertised maximum segment size (MSS).
Definition: TcpInfo.h:166
UInt32 rtt
Smoothed round-trip time (RTT) estimate in microseconds.
Definition: TcpInfo.h:154