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  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneTCP Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _UDP_MIB_MODULE_H
30 #define _UDP_MIB_MODULE_H
31 
32 //Dependencies
33 #include "mibs/mib_common.h"
34 
35 //UDP MIB module support
36 #ifndef UDP_MIB_SUPPORT
37  #define UDP_MIB_SUPPORT DISABLED
38 #elif (UDP_MIB_SUPPORT != ENABLED && UDP_MIB_SUPPORT != DISABLED)
39  #error UDP_MIB_SUPPORT parameter is not valid
40 #endif
41 
42 //Macro definitions
43 #if (UDP_MIB_SUPPORT == ENABLED)
44  #define UDP_MIB_INC_COUNTER32(name, value) udpMibBase.name += value
45  #define UDP_MIB_INC_COUNTER64(name, value) udpMibBase.name += value
46 #else
47  #define UDP_MIB_INC_COUNTER32(name, value)
48  #define UDP_MIB_INC_COUNTER64(name, value)
49 #endif
50 
51 //C++ guard
52 #ifdef __cplusplus
53  extern "C" {
54 #endif
55 
56 
57 /**
58  * @brief UDP MIB base
59  **/
60 
61 typedef struct
62 {
63  uint32_t udpInDatagrams;
64  uint32_t udpNoPorts;
65  uint32_t udpInErrors;
66  uint32_t udpOutDatagrams;
67  uint64_t udpHCInDatagrams;
69 } UdpMibBase;
70 
71 
72 //UDP MIB related constants
73 extern UdpMibBase udpMibBase;
74 extern const MibObject udpMibObjects[];
75 extern const MibModule udpMibModule;
76 
77 //C++ guard
78 #ifdef __cplusplus
79  }
80 #endif
81 
82 #endif
#define MibObject
Definition: mib_common.h:44
uint32_t udpInErrors
const MibModule udpMibModule
UDP MIB module.
uint64_t udpHCOutDatagrams
UDP MIB base.
const MibObject udpMibObjects[]
UDP MIB objects.
uint32_t udpOutDatagrams
UdpMibBase udpMibBase
UDP MIB base.
uint32_t udpInDatagrams
uint32_t udpNoPorts
Common definitions for MIB modules.
MIB module.
Definition: mib_common.h:285
uint64_t udpHCInDatagrams