tcp_mib_module.h
Go to the documentation of this file.
1 /**
2  * @file tcp_mib_module.h
3  * @brief TCP MIB module
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _TCP_MIB_MODULE_H
32 #define _TCP_MIB_MODULE_H
33 
34 //Dependencies
35 #include "mibs/mib_common.h"
36 
37 //TCP MIB module support
38 #ifndef TCP_MIB_SUPPORT
39  #define TCP_MIB_SUPPORT DISABLED
40 #elif (TCP_MIB_SUPPORT != ENABLED && TCP_MIB_SUPPORT != DISABLED)
41  #error TCP_MIB_SUPPORT parameter is not valid
42 #endif
43 
44 //Macro definitions
45 #if (TCP_MIB_SUPPORT == ENABLED)
46  #define TCP_MIB_INC_COUNTER32(name, value) tcpMibBase.name += value
47  #define TCP_MIB_INC_COUNTER64(name, value) tcpMibBase.name += value
48 #else
49  #define TCP_MIB_INC_COUNTER32(name, value)
50  #define TCP_MIB_INC_COUNTER64(name, value)
51 #endif
52 
53 //C++ guard
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 
59 /**
60  * @brief RTO calculation algorithm
61  **/
62 
63 typedef enum
64 {
70 
71 
72 /**
73  * @brief TCP connection states
74  **/
75 
76 typedef enum
77 {
91 
92 
93 /**
94  * @brief TCP MIB base
95  **/
96 
97 typedef struct
98 {
99  int32_t tcpRtoAlgorithm;
100  int32_t tcpRtoMin;
101  int32_t tcpRtoMax;
102  int32_t tcpMaxConn;
103  uint32_t tcpActiveOpens;
104  uint32_t tcpPassiveOpens;
105  uint32_t tcpAttemptFails;
106  uint32_t tcpEstabResets;
107  uint32_t tcpInSegs;
108  uint32_t tcpOutSegs;
109  uint32_t tcpRetransSegs;
110  uint32_t tcpInErrs;
111  uint32_t tcpOutRsts;
112  uint64_t tcpHCInSegs;
113  uint64_t tcpHCOutSegs;
114 } TcpMibBase;
115 
116 
117 //TCP MIB related constants
118 extern TcpMibBase tcpMibBase;
119 extern const MibObject tcpMibObjects[];
120 extern const MibModule tcpMibModule;
121 
122 //C++ guard
123 #ifdef __cplusplus
124 }
125 #endif
126 
127 #endif
@ TCP_MIB_RTO_ALGORITHM_OTHER
@ TCP_MIB_CONN_STATE_SYN_SENT
@ TCP_MIB_CONN_STATE_LISTEN
@ TCP_MIB_CONN_STATE_DELETE_TCB
uint32_t tcpInSegs
uint32_t tcpRetransSegs
@ TCP_MIB_CONN_STATE_CLOSING
uint32_t tcpActiveOpens
@ TCP_MIB_CONN_STATE_CLOSED
@ TCP_MIB_CONN_STATE_ESTABLISHED
TcpMibRtoAlgorithm
RTO calculation algorithm.
uint32_t tcpAttemptFails
@ TCP_MIB_CONN_STATE_LAST_ACK
uint32_t tcpEstabResets
@ TCP_MIB_CONN_STATE_TIME_WAIT
TCP MIB base.
uint32_t tcpInErrs
@ TCP_MIB_RTO_ALGORITHM_CONSTANT
@ TCP_MIB_CONN_STATE_CLOSE_WAIT
uint64_t tcpHCOutSegs
uint64_t tcpHCInSegs
TcpMibConnState
TCP connection states.
MIB module.
Definition: mib_common.h:292
int32_t tcpRtoMin
@ TCP_MIB_CONN_STATE_FIN_WAIT_1
const MibObject tcpMibObjects[]
TCP MIB objects.
@ TCP_MIB_CONN_STATE_FIN_WAIT_2
TcpMibBase tcpMibBase
TCP MIB base.
uint32_t tcpOutSegs
uint32_t tcpPassiveOpens
uint32_t tcpOutRsts
Common definitions for MIB modules.
@ TCP_MIB_RTO_ALGORITHM_RSRE
#define MibObject
Definition: mib_common.h:46
int32_t tcpRtoAlgorithm
@ TCP_MIB_CONN_STATE_SYN_RECEIVED
int32_t tcpRtoMax
const MibModule tcpMibModule
TCP MIB module.
@ TCP_MIB_RTO_ALGORITHM_VANJ
int32_t tcpMaxConn