tcp_mib_impl.c
Go to the documentation of this file.
1 /**
2  * @file tcp_mib_impl.c
3  * @brief TCP MIB module implementation
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2019 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 1.9.6
29  **/
30 
31 //Switch to the appropriate trace level
32 #define TRACE_LEVEL SNMP_TRACE_LEVEL
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "mibs/mib_common.h"
37 #include "mibs/tcp_mib_module.h"
38 #include "mibs/tcp_mib_impl.h"
39 #include "core/crypto.h"
40 #include "encoding/asn1.h"
41 #include "encoding/oid.h"
42 #include "debug.h"
43 
44 //Check TCP/IP stack configuration
45 #if (TCP_MIB_SUPPORT == ENABLED && TCP_SUPPORT == ENABLED)
46 
47 
48 /**
49  * @brief TCP MIB module initialization
50  * @return Error code
51  **/
52 
54 {
55  //Debug message
56  TRACE_INFO("Initializing TCP-MIB base...\r\n");
57 
58  //Clear TCP MIB base
59  memset(&tcpMibBase, 0, sizeof(tcpMibBase));
60 
61  //tcpRtoAlgorithm object
63  //tcpRtoMin object
65  //tcpRtoMax object
67  //tcpMaxConn object
69 
70  //Successful processing
71  return NO_ERROR;
72 }
73 
74 
75 /**
76  * @brief Get tcpCurrEstab object value
77  * @param[in] object Pointer to the MIB object descriptor
78  * @param[in] oid Object identifier (object name and instance identifier)
79  * @param[in] oidLen Length of the OID, in bytes
80  * @param[out] value Object value
81  * @param[in,out] valueLen Length of the object value, in bytes
82  * @return Error code
83  **/
84 
85 error_t tcpMibGetTcpCurrEstab(const MibObject *object, const uint8_t *oid,
86  size_t oidLen, MibVariant *value, size_t *valueLen)
87 {
88  uint_t i;
89  Socket *socket;
90 
91  //Initialize object value
92  value->gauge32 = 0;
93 
94  //Loop through socket descriptors
95  for(i = 0; i < SOCKET_MAX_COUNT; i++)
96  {
97  //Point to current socket
98  socket = &socketTable[i];
99 
100  //TCP socket?
101  if(socket->type == SOCKET_TYPE_STREAM)
102  {
103  //Check current state
104  if(socket->state == TCP_STATE_ESTABLISHED ||
105  socket->state == TCP_STATE_CLOSE_WAIT)
106  {
107  //Number of TCP connections for which the current state
108  //is either ESTABLISHED or CLOSE-WAIT
109  value->gauge32++;
110  }
111  }
112  }
113 
114  //Return status code
115  return NO_ERROR;
116 }
117 
118 
119 /**
120  * @brief Set tcpConnectionEntry object value
121  * @param[in] object Pointer to the MIB object descriptor
122  * @param[in] oid Object identifier (object name and instance identifier)
123  * @param[in] oidLen Length of the OID, in bytes
124  * @param[in] value Object value
125  * @param[in] valueLen Length of the object value, in bytes
126  * @param[in] commit This flag tells whether the changes shall be committed
127  * to the MIB base
128  * @return Error code
129  **/
130 
131 error_t tcpMibSetTcpConnectionEntry(const MibObject *object, const uint8_t *oid,
132  size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
133 {
134  //Not implemented
135  return ERROR_WRITE_FAILED;
136 }
137 
138 
139 /**
140  * @brief Get tcpConnectionEntry object value
141  * @param[in] object Pointer to the MIB object descriptor
142  * @param[in] oid Object identifier (object name and instance identifier)
143  * @param[in] oidLen Length of the OID, in bytes
144  * @param[out] value Object value
145  * @param[in,out] valueLen Length of the object value, in bytes
146  * @return Error code
147  **/
148 
149 error_t tcpMibGetTcpConnectionEntry(const MibObject *object, const uint8_t *oid,
150  size_t oidLen, MibVariant *value, size_t *valueLen)
151 {
152  error_t error;
153  uint_t i;
154  size_t n;
155  IpAddr localIpAddr;
156  uint16_t localPort;
157  IpAddr remoteIpAddr;
158  uint16_t remotePort;
159  Socket *socket;
160 
161  //Point to the instance identifier
162  n = object->oidLen;
163 
164  //tcpConnectionLocalAddressType and tcpConnectionLocalAddress are used
165  //as 1st and 2nd instance identifiers
166  error = mibDecodeIpAddr(oid, oidLen, &n, &localIpAddr);
167  //Invalid instance identifier?
168  if(error)
169  return error;
170 
171  //tcpConnectionLocalPort is used as 3rd instance identifier
172  error = mibDecodePort(oid, oidLen, &n, &localPort);
173  //Invalid instance identifier?
174  if(error)
175  return error;
176 
177  //tcpConnectionRemAddressType and tcpConnectionRemAddress are used
178  //as 4th and 5th instance identifiers
179  error = mibDecodeIpAddr(oid, oidLen, &n, &remoteIpAddr);
180  //Invalid instance identifier?
181  if(error)
182  return error;
183 
184  //tcpConnectionRemPort is used as 6th instance identifier
185  error = mibDecodePort(oid, oidLen, &n, &remotePort);
186  //Invalid instance identifier?
187  if(error)
188  return error;
189 
190  //Sanity check
191  if(n != oidLen)
193 
194  //Loop through socket descriptors
195  for(i = 0; i < SOCKET_MAX_COUNT; i++)
196  {
197  //Point to current socket
198  socket = &socketTable[i];
199 
200  //TCP socket?
201  if(socket->type == SOCKET_TYPE_STREAM)
202  {
203  //Check local IP address
204  if(!ipCompAddr(&socket->localIpAddr, &localIpAddr))
205  continue;
206  //Check local port number
207  if(socket->localPort != localPort)
208  continue;
209  //Check remote IP address
210  if(!ipCompAddr(&socket->remoteIpAddr, &remoteIpAddr))
211  continue;
212  //Check local port number
213  if(socket->remotePort != remotePort)
214  continue;
215  //Check current state
216  if(socket->state == TCP_STATE_LISTEN)
217  continue;
218 
219  //A matching socket has been found
220  break;
221  }
222  }
223 
224  //No matching connection found in socket table?
225  if(i >= SOCKET_MAX_COUNT)
227 
228  //tcpConnectionState object?
229  if(!strcmp(object->name, "tcpConnectionState"))
230  {
231  //Get object value
232  switch(socket->state)
233  {
234  case TCP_STATE_CLOSED:
235  value->integer = TCP_MIB_CONN_STATE_CLOSED;
236  break;
237  case TCP_STATE_LISTEN:
238  value->integer = TCP_MIB_CONN_STATE_LISTEN;
239  break;
240  case TCP_STATE_SYN_SENT:
242  break;
245  break;
248  break;
251  break;
254  break;
257  break;
258  case TCP_STATE_LAST_ACK:
260  break;
261  case TCP_STATE_CLOSING:
263  break;
264  case TCP_STATE_TIME_WAIT:
266  break;
267  default:
268  value->integer = 0;
269  break;
270  }
271  }
272  //tcpConnectionProcess object?
273  else if(!strcmp(object->name, "tcpConnectionProcess"))
274  {
275  //ID of the process associated with this connection
276  value->unsigned32 = 0;
277  }
278  //Unknown object?
279  else
280  {
281  //The specified object does not exist
282  error = ERROR_OBJECT_NOT_FOUND;
283  }
284 
285  //Return status code
286  return error;
287 }
288 
289 
290 /**
291  * @brief Get next tcpConnectionEntry object
292  * @param[in] object Pointer to the MIB object descriptor
293  * @param[in] oid Object identifier
294  * @param[in] oidLen Length of the OID, in bytes
295  * @param[out] nextOid OID of the next object in the MIB
296  * @param[out] nextOidLen Length of the next object identifier, in bytes
297  * @return Error code
298  **/
299 
300 error_t tcpMibGetNextTcpConnectionEntry(const MibObject *object, const uint8_t *oid,
301  size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
302 {
303  error_t error;
304  uint_t i;
305  size_t n;
306  bool_t acceptable;
307  IpAddr localIpAddr;
308  uint16_t localPort;
309  IpAddr remoteIpAddr;
310  uint16_t remotePort;
311  Socket *socket;
312 
313  //Initialize variables
314  localIpAddr = IP_ADDR_ANY;
315  localPort = 0;
316  remoteIpAddr = IP_ADDR_ANY;
317  remotePort = 0;
318 
319  //Make sure the buffer is large enough to hold the OID prefix
320  if(*nextOidLen < object->oidLen)
321  return ERROR_BUFFER_OVERFLOW;
322 
323  //Copy OID prefix
324  memcpy(nextOid, object->oid, object->oidLen);
325 
326  //Loop through socket descriptors
327  for(i = 0; i < SOCKET_MAX_COUNT; i++)
328  {
329  //Point to current socket
330  socket = &socketTable[i];
331 
332  //TCP socket?
333  if(socket->type == SOCKET_TYPE_STREAM)
334  {
335  //Check current state
336  if(socket->state != TCP_STATE_LISTEN)
337  {
338  //Append the instance identifier to the OID prefix
339  n = object->oidLen;
340 
341  //tcpConnectionLocalAddressType and tcpConnectionLocalAddress are used
342  //as 1st and 2nd instance identifiers
343  error = mibEncodeIpAddr(nextOid, *nextOidLen, &n, &socket->localIpAddr);
344  //Any error to report?
345  if(error)
346  return error;
347 
348  //tcpConnectionLocalPort is used as 3rd instance identifier
349  error = mibEncodePort(nextOid, *nextOidLen, &n, socket->localPort);
350  //Any error to report?
351  if(error)
352  return error;
353 
354  //tcpConnectionRemAddressType and tcpConnectionRemAddress are used
355  //as 4th and 5th instance identifiers
356  error = mibEncodeIpAddr(nextOid, *nextOidLen, &n, &socket->remoteIpAddr);
357  //Any error to report?
358  if(error)
359  return error;
360 
361  //tcpConnectionRemPort is used as 6th instance identifier
362  error = mibEncodePort(nextOid, *nextOidLen, &n, socket->remotePort);
363  //Any error to report?
364  if(error)
365  return error;
366 
367  //Check whether the resulting object identifier lexicographically
368  //follows the specified OID
369  if(oidComp(nextOid, n, oid, oidLen) > 0)
370  {
371  //Perform lexicographic comparison
372  if(localPort == 0 && remotePort == 0)
373  acceptable = TRUE;
374  else if(mibCompIpAddr(&socket->localIpAddr, &localIpAddr) < 0)
375  acceptable = TRUE;
376  else if(mibCompIpAddr(&socket->localIpAddr, &localIpAddr) > 0)
377  acceptable = FALSE;
378  else if(socket->localPort < localPort)
379  acceptable = TRUE;
380  else if(socket->localPort > localPort)
381  acceptable = FALSE;
382  else if(mibCompIpAddr(&socket->remoteIpAddr, &remoteIpAddr) < 0)
383  acceptable = TRUE;
384  else if(mibCompIpAddr(&socket->remoteIpAddr, &remoteIpAddr) > 0)
385  acceptable = FALSE;
386  else if(socket->remotePort < remotePort)
387  acceptable = TRUE;
388  else
389  acceptable = FALSE;
390 
391  //Save the closest object identifier that follows the specified
392  //OID in lexicographic order
393  if(acceptable)
394  {
395  localIpAddr = socket->localIpAddr;
396  localPort = socket->localPort;
397  remoteIpAddr = socket->remoteIpAddr;
398  remotePort = socket->remotePort;
399  }
400  }
401  }
402  }
403  }
404 
405  //The specified OID does not lexicographically precede the name
406  //of some object?
407  if(localPort == 0 && remotePort == 0)
408  return ERROR_OBJECT_NOT_FOUND;
409 
410  //Append the instance identifier to the OID prefix
411  n = object->oidLen;
412 
413  //tcpConnectionLocalAddressType and tcpConnectionLocalAddress are used
414  //as 1st and 2nd instance identifiers
415  error = mibEncodeIpAddr(nextOid, *nextOidLen, &n, &localIpAddr);
416  //Any error to report?
417  if(error)
418  return error;
419 
420  //tcpConnectionLocalPort is used as 3rd instance identifier
421  error = mibEncodePort(nextOid, *nextOidLen, &n, localPort);
422  //Any error to report?
423  if(error)
424  return error;
425 
426  //tcpConnectionRemAddressType and tcpConnectionRemAddress are used
427  //as 4th and 5th instance identifiers
428  error = mibEncodeIpAddr(nextOid, *nextOidLen, &n, &remoteIpAddr);
429  //Any error to report?
430  if(error)
431  return error;
432 
433  //tcpConnectionRemPort is used as 6th instance identifier
434  error = mibEncodePort(nextOid, *nextOidLen, &n, remotePort);
435  //Any error to report?
436  if(error)
437  return error;
438 
439  //Save the length of the resulting object identifier
440  *nextOidLen = n;
441  //Next object found
442  return NO_ERROR;
443 }
444 
445 
446 /**
447  * @brief Get tcpListenerEntry object value
448  * @param[in] object Pointer to the MIB object descriptor
449  * @param[in] oid Object identifier (object name and instance identifier)
450  * @param[in] oidLen Length of the OID, in bytes
451  * @param[out] value Object value
452  * @param[in,out] valueLen Length of the object value, in bytes
453  * @return Error code
454  **/
455 
456 error_t tcpMibGetTcpListenerEntry(const MibObject *object, const uint8_t *oid,
457  size_t oidLen, MibVariant *value, size_t *valueLen)
458 {
459  error_t error;
460  uint_t i;
461  size_t n;
462  IpAddr localIpAddr;
463  uint16_t localPort;
464  Socket *socket;
465 
466  //Point to the instance identifier
467  n = object->oidLen;
468 
469  //tcpListenerLocalAddressType and tcpListenerLocalAddress are used
470  //as 1st and 2nd instance identifiers
471  error = mibDecodeIpAddr(oid, oidLen, &n, &localIpAddr);
472  //Invalid instance identifier?
473  if(error)
474  return error;
475 
476  //tcpListenerLocalPort is used as 3rd instance identifier
477  error = mibDecodePort(oid, oidLen, &n, &localPort);
478  //Invalid instance identifier?
479  if(error)
480  return error;
481 
482  //Sanity check
483  if(n != oidLen)
485 
486  //Loop through socket descriptors
487  for(i = 0; i < SOCKET_MAX_COUNT; i++)
488  {
489  //Point to current socket
490  socket = &socketTable[i];
491 
492  //TCP socket?
493  if(socket->type == SOCKET_TYPE_STREAM)
494  {
495  //Check local IP address
496  if(!ipCompAddr(&socket->localIpAddr, &localIpAddr))
497  continue;
498  //Check local port number
499  if(socket->localPort != localPort)
500  continue;
501  //Check current state
502  if(socket->state != TCP_STATE_LISTEN)
503  continue;
504 
505  //A matching socket has been found
506  break;
507  }
508  }
509 
510  //No matching connection found in socket table?
511  if(i >= SOCKET_MAX_COUNT)
513 
514  //tcpListenerProcess object?
515  if(!strcmp(object->name, "tcpListenerProcess"))
516  {
517  //ID of the process associated with this listener
518  value->unsigned32 = 0;
519  }
520  //Unknown object?
521  else
522  {
523  //The specified object does not exist
524  error = ERROR_OBJECT_NOT_FOUND;
525  }
526 
527  //Return status code
528  return error;
529 }
530 
531 
532 /**
533  * @brief Get next tcpListenerEntry object
534  * @param[in] object Pointer to the MIB object descriptor
535  * @param[in] oid Object identifier
536  * @param[in] oidLen Length of the OID, in bytes
537  * @param[out] nextOid OID of the next object in the MIB
538  * @param[out] nextOidLen Length of the next object identifier, in bytes
539  * @return Error code
540  **/
541 
542 error_t tcpMibGetNextTcpListenerEntry(const MibObject *object, const uint8_t *oid,
543  size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
544 {
545  error_t error;
546  uint_t i;
547  size_t n;
548  bool_t acceptable;
549  IpAddr localIpAddr;
550  uint16_t localPort;
551  Socket *socket;
552 
553  //Initialize variables
554  localIpAddr = IP_ADDR_ANY;
555  localPort = 0;
556 
557  //Make sure the buffer is large enough to hold the OID prefix
558  if(*nextOidLen < object->oidLen)
559  return ERROR_BUFFER_OVERFLOW;
560 
561  //Copy OID prefix
562  memcpy(nextOid, object->oid, object->oidLen);
563 
564  //Loop through socket descriptors
565  for(i = 0; i < SOCKET_MAX_COUNT; i++)
566  {
567  //Point to current socket
568  socket = &socketTable[i];
569 
570  //TCP socket?
571  if(socket->type == SOCKET_TYPE_STREAM)
572  {
573  //Check current state
574  if(socket->state == TCP_STATE_LISTEN)
575  {
576  //Append the instance identifier to the OID prefix
577  n = object->oidLen;
578 
579  //tcpListenerLocalAddressType and tcpListenerLocalAddress are used
580  //as 1st and 2nd instance identifiers
581  error = mibEncodeIpAddr(nextOid, *nextOidLen, &n, &socket->localIpAddr);
582  //Any error to report?
583  if(error)
584  return error;
585 
586  //tcpListenerLocalPort is used as 3rd instance identifier
587  error = mibEncodePort(nextOid, *nextOidLen, &n, socket->localPort);
588  //Any error to report?
589  if(error)
590  return error;
591 
592  //Check whether the resulting object identifier lexicographically
593  //follows the specified OID
594  if(oidComp(nextOid, n, oid, oidLen) > 0)
595  {
596  //Perform lexicographic comparison
597  if(localPort == 0)
598  acceptable = TRUE;
599  else if(mibCompIpAddr(&socket->localIpAddr, &localIpAddr) < 0)
600  acceptable = TRUE;
601  else if(mibCompIpAddr(&socket->localIpAddr, &localIpAddr) > 0)
602  acceptable = FALSE;
603  else if(socket->localPort < localPort)
604  acceptable = TRUE;
605  else
606  acceptable = FALSE;
607 
608  //Save the closest object identifier that follows the specified
609  //OID in lexicographic order
610  if(acceptable)
611  {
612  localIpAddr = socket->localIpAddr;
613  localPort = socket->localPort;
614  }
615  }
616  }
617  }
618  }
619 
620  //The specified OID does not lexicographically precede the name
621  //of some object?
622  if(localPort == 0)
623  return ERROR_OBJECT_NOT_FOUND;
624 
625  //Append the instance identifier to the OID prefix
626  n = object->oidLen;
627 
628  //tcpListenerLocalAddressType and tcpListenerLocalAddress are used
629  //as 1st and 2nd instance identifiers
630  error = mibEncodeIpAddr(nextOid, *nextOidLen, &n, &localIpAddr);
631  //Any error to report?
632  if(error)
633  return error;
634 
635  //tcpListenerLocalPort is used as 3rd instance identifier
636  error = mibEncodePort(nextOid, *nextOidLen, &n, localPort);
637  //Any error to report?
638  if(error)
639  return error;
640 
641  //Save the length of the resulting object identifier
642  *nextOidLen = n;
643  //Next object found
644  return NO_ERROR;
645 }
646 
647 #endif
error_t tcpMibGetNextTcpListenerEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next tcpListenerEntry object.
Definition: tcp_mib_impl.c:542
@ TCP_STATE_TIME_WAIT
Definition: tcp.h:243
error_t mibEncodeIpAddr(uint8_t *oid, size_t maxOidLen, size_t *pos, const IpAddr *ipAddr)
Encode instance identifier (IP address)
Definition: mib_common.c:757
int bool_t
Definition: compiler_port.h:49
error_t tcpMibInit(void)
TCP MIB module initialization.
Definition: tcp_mib_impl.c:53
#define TCP_MAX_RTO
Definition: tcp.h:131
@ TCP_MIB_CONN_STATE_SYN_SENT
@ TCP_MIB_CONN_STATE_LISTEN
IP network address.
Definition: ip.h:71
@ ERROR_BUFFER_OVERFLOW
Definition: error.h:140
TCP MIB module implementation.
OID (Object Identifier)
error_t tcpMibGetNextTcpConnectionEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next tcpConnectionEntry object.
Definition: tcp_mib_impl.c:300
@ TCP_STATE_FIN_WAIT_1
Definition: tcp.h:240
#define TRUE
Definition: os_port.h:50
error_t mibEncodePort(uint8_t *oid, size_t maxOidLen, size_t *pos, uint16_t port)
Encode instance identifier (port number)
Definition: mib_common.c:478
@ TCP_MIB_CONN_STATE_CLOSING
@ TCP_STATE_CLOSE_WAIT
Definition: tcp.h:238
__start_packed struct @205 MibVariant
Variant data type.
@ TCP_MIB_CONN_STATE_CLOSED
@ TCP_MIB_CONN_STATE_ESTABLISHED
error_t mibDecodePort(const uint8_t *oid, size_t oidLen, size_t *pos, uint16_t *port)
Decode instance identifier (port number)
Definition: mib_common.c:495
@ SOCKET_TYPE_STREAM
Definition: socket.h:77
int_t oidComp(const uint8_t *oid1, size_t oidLen1, const uint8_t *oid2, size_t oidLen2)
Compare object identifiers.
Definition: oid.c:101
@ TCP_MIB_CONN_STATE_LAST_ACK
const IpAddr IP_ADDR_ANY
Definition: ip.c:45
int_t mibCompIpAddr(const IpAddr *ipAddr1, const IpAddr *ipAddr2)
Compare IP addresses.
Definition: mib_common.c:903
#define FALSE
Definition: os_port.h:46
@ TCP_MIB_CONN_STATE_TIME_WAIT
error_t
Error codes.
Definition: error.h:42
bool_t ipCompAddr(const IpAddr *ipAddr1, const IpAddr *ipAddr2)
Compare IP addresses.
Definition: ip.c:158
@ ERROR_INSTANCE_NOT_FOUND
Definition: error.h:251
int_t socket(int_t family, int_t type, int_t protocol)
Create a socket that is bound to a specific transport service provider.
Definition: bsd_socket.c:108
@ TCP_MIB_CONN_STATE_CLOSE_WAIT
General definitions for cryptographic algorithms.
uint8_t oid[1]
Definition: mib_common.h:186
@ TCP_STATE_SYN_SENT
Definition: tcp.h:235
#define TRACE_INFO(...)
Definition: debug.h:94
@ TCP_STATE_LAST_ACK
Definition: tcp.h:239
int32_t tcpRtoMin
@ TCP_STATE_CLOSING
Definition: tcp.h:242
Socket socketTable[SOCKET_MAX_COUNT]
Definition: socket.c:49
@ TCP_MIB_CONN_STATE_FIN_WAIT_1
error_t tcpMibGetTcpCurrEstab(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get tcpCurrEstab object value.
Definition: tcp_mib_impl.c:85
@ TCP_STATE_CLOSED
Definition: tcp.h:233
@ TCP_STATE_LISTEN
Definition: tcp.h:234
@ TCP_MIB_CONN_STATE_FIN_WAIT_2
Common definitions for MIB modules.
uint8_t n
TCP MIB module.
@ ERROR_WRITE_FAILED
Definition: error.h:219
@ ERROR_OBJECT_NOT_FOUND
Definition: error.h:250
#define Socket
Definition: socket.h:36
@ TCP_STATE_FIN_WAIT_2
Definition: tcp.h:241
#define MibObject
Definition: mib_common.h:46
error_t mibDecodeIpAddr(const uint8_t *oid, size_t oidLen, size_t *pos, IpAddr *ipAddr)
Decode instance identifier (IP address)
Definition: mib_common.c:835
int32_t tcpRtoAlgorithm
@ TCP_STATE_SYN_RECEIVED
Definition: tcp.h:236
#define TCP_MIN_RTO
Definition: tcp.h:124
error_t tcpMibGetTcpConnectionEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get tcpConnectionEntry object value.
Definition: tcp_mib_impl.c:149
error_t tcpMibGetTcpListenerEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get tcpListenerEntry object value.
Definition: tcp_mib_impl.c:456
TcpMibBase tcpMibBase
TCP MIB base.
uint8_t value[]
Definition: dtls_misc.h:150
unsigned int uint_t
Definition: compiler_port.h:45
TCP/IP stack core.
error_t tcpMibSetTcpConnectionEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set tcpConnectionEntry object value.
Definition: tcp_mib_impl.c:131
@ TCP_MIB_CONN_STATE_SYN_RECEIVED
#define SOCKET_MAX_COUNT
Definition: socket.h:45
int32_t tcpRtoMax
@ TCP_MIB_RTO_ALGORITHM_VANJ
@ TCP_STATE_ESTABLISHED
Definition: tcp.h:237
@ NO_ERROR
Success.
Definition: error.h:44
Debugging facilities.
ASN.1 (Abstract Syntax Notation One)
int32_t tcpMaxConn