udp_mib_module.h
Go to the documentation of this file.
1 /**
2  * @file udp_mib_module.h
3  * @brief UDP 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.0
29  **/
30 
31 #ifndef _UDP_MIB_MODULE_H
32 #define _UDP_MIB_MODULE_H
33 
34 //Dependencies
35 #include "mibs/mib_common.h"
36 
37 //UDP MIB module support
38 #ifndef UDP_MIB_SUPPORT
39  #define UDP_MIB_SUPPORT DISABLED
40 #elif (UDP_MIB_SUPPORT != ENABLED && UDP_MIB_SUPPORT != DISABLED)
41  #error UDP_MIB_SUPPORT parameter is not valid
42 #endif
43 
44 //Macro definitions
45 #if (UDP_MIB_SUPPORT == ENABLED)
46  #define UDP_MIB_INC_COUNTER32(name, value) udpMibBase.name += value
47  #define UDP_MIB_INC_COUNTER64(name, value) udpMibBase.name += value
48 #else
49  #define UDP_MIB_INC_COUNTER32(name, value)
50  #define UDP_MIB_INC_COUNTER64(name, value)
51 #endif
52 
53 //C++ guard
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 
59 /**
60  * @brief UDP MIB base
61  **/
62 
63 typedef struct
64 {
65  uint32_t udpInDatagrams;
66  uint32_t udpNoPorts;
67  uint32_t udpInErrors;
68  uint32_t udpOutDatagrams;
69  uint64_t udpHCInDatagrams;
71 } UdpMibBase;
72 
73 
74 //UDP MIB related constants
75 extern UdpMibBase udpMibBase;
76 extern const MibObject udpMibObjects[];
77 extern const MibModule udpMibModule;
78 
79 //C++ guard
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 #endif
Common definitions for MIB modules.
#define MibObject
Definition: mib_common.h:46
MIB module.
Definition: mib_common.h:292
UDP MIB base.
uint32_t udpNoPorts
uint32_t udpInDatagrams
uint64_t udpHCInDatagrams
uint32_t udpInErrors
uint64_t udpHCOutDatagrams
uint32_t udpOutDatagrams
const MibObject udpMibObjects[]
UDP MIB objects.
UdpMibBase udpMibBase
UDP MIB base.
const MibModule udpMibModule
UDP MIB module.