ip_mib_module.h
Go to the documentation of this file.
1 /**
2  * @file ip_mib_module.h
3  * @brief IP 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 _IP_MIB_MODULE_H
30 #define _IP_MIB_MODULE_H
31 
32 //Dependencies
33 #include "mibs/mib_common.h"
34 
35 //IP MIB module support
36 #ifndef IP_MIB_SUPPORT
37  #define IP_MIB_SUPPORT DISABLED
38 #elif (IP_MIB_SUPPORT != ENABLED && IP_MIB_SUPPORT != DISABLED)
39  #error IP_MIB_SUPPORT parameter is not valid
40 #endif
41 
42 //Macro definitions
43 #if (IP_MIB_SUPPORT == ENABLED)
44  #define IP_MIB_INC_COUNTER32(name, value) ipMibBase.name += value
45  #define IP_MIB_INC_COUNTER64(name, value) ipMibBase.name += value
46 #else
47  #define IP_MIB_INC_COUNTER32(name, value)
48  #define IP_MIB_INC_COUNTER64(name, value)
49 #endif
50 
51 //C++ guard
52 #ifdef __cplusplus
53  extern "C" {
54 #endif
55 
56 
57 /**
58  * @brief IP forwarding state
59  **/
60 
61 typedef enum
62 {
66 
67 
68 /**
69  * @brief IP status
70  **/
71 
72 typedef enum
73 {
77 
78 
79 /**
80  * @brief IP address type
81  **/
82 
83 typedef enum
84 {
89 
90 
91 /**
92  * @brief IP address origin
93  **/
94 
95 typedef enum
96 {
102 
103 /**
104  * @brief IP address status
105  **/
106 
107 typedef enum
108 {
118 
119 
120 /**
121  * @brief Prefix origin
122  **/
123 
124 typedef enum
125 {
131 
132 
133 /**
134  * @brief Type of mapping
135  **/
136 
137 typedef enum
138 {
145 
146 
147 /**
148  * @brief Entry state
149  **/
150 
151 typedef enum
152 {
161 
162 
163 /**
164  * @brief Router preferences
165  **/
166 
167 typedef enum
168 {
174 
175 
176 /**
177  * @brief System-wide IP statistics
178  **/
179 
180 typedef struct
181 {
228 
229 
230 /**
231  * @brief Per-interface IP statistics
232  **/
233 
234 typedef struct
235 {
281 
282 
283 /**
284  * @brief ICMP statistics
285  **/
286 
287 typedef struct
288 {
289  uint32_t icmpStatsInMsgs;
294 
295 
296 /**
297  * @brief Per-message ICMP statistics
298  **/
299 
300 typedef struct
301 {
302  uint32_t icmpMsgStatsInPkts[256];
303  uint32_t icmpMsgStatsOutPkts[256];
305 
306 
307 /**
308  * @brief IP MIB base
309  **/
310 
311 typedef struct
312 {
315 #if (IPV4_SUPPORT == ENABLED)
316  int32_t ipForwarding;
317  int32_t ipDefaultTTL;
318  int32_t ipReasmTimeout;
324 #endif
325 #if (IPV6_SUPPORT == ENABLED)
334 #endif
335 } IpMibBase;
336 
337 
338 //IP MIB related constants
339 extern IpMibBase ipMibBase;
340 extern const MibObject ipMibObjects[];
341 extern const MibModule ipMibModule;
342 
343 //C++ guard
344 #ifdef __cplusplus
345  }
346 #endif
347 
348 #endif
IpMibPrefixOrigin
Prefix origin.
uint64_t ipIfStatsHCOutOctets
uint32_t ipSystemStatsOutMcastPkts
IpMibIpSystemStatsEntry ipv6SystemStats
int32_t ipDefaultTTL
uint32_t ipSystemStatsInForwDatagrams
uint32_t ipSystemStatsOutTransmits
uint64_t ipIfStatsHCOutForwDatagrams
IpMibAddrStatus
IP address status.
uint32_t ipIfStatsOutMcastPkts
uint32_t ipIfStatsRefreshRate
uint32_t ipSystemStatsReasmOKs
uint64_t ipIfStatsHCOutMcastOctets
uint32_t ipIfStatsInMcastPkts
uint64_t ipIfStatsHCInDelivers
uint64_t ipSystemStatsHCInDelivers
uint32_t ipSystemStatsDiscontinuityTime
uint32_t icmpStatsInMsgs
uint32_t ipIfStatsInAddrErrors
uint32_t ipIfStatsOutRequests
uint32_t ipv4InterfaceTableLastChange
uint64_t ipIfStatsHCInOctets
uint32_t ipIfStatsOutFragCreates
IpMibIpForwarding
IP forwarding state.
Definition: ip_mib_module.h:61
IpMibIpStatus
IP status.
Definition: ip_mib_module.h:72
uint32_t ipIfStatsInForwDatagrams
#define MibObject
Definition: mib_common.h:44
uint32_t ipIfStatsInOctets
uint32_t ipSystemStatsReasmReqds
IP MIB base.
uint32_t ipIfStatsOutFragFails
uint32_t ipSystemStatsReasmFails
uint32_t ipSystemStatsInTruncatedPkts
uint32_t ipSystemStatsInUnknownProtos
uint64_t ipSystemStatsHCOutOctets
uint32_t ipIfStatsReasmReqds
uint64_t ipSystemStatsHCOutTransmits
uint32_t ipIfStatsOutFragOKs
IpMibIcmpMsgStatsEntry icmpMsgStatsTable
int32_t ipForwarding
IpMibRouterPreference
Router preferences.
uint32_t ipIfStatsTableLastChange
uint64_t ipIfStatsHCInMcastPkts
uint64_t ipSystemStatsHCInForwDatagrams
int32_t ipAddressSpinLock
uint32_t ipIfStatsOutOctets
uint32_t ipSystemStatsOutNoRoutes
IpMibBase ipMibBase
IP MIB base.
Definition: ip_mib_module.c:58
IpMibAddrType
IP address type.
Definition: ip_mib_module.h:83
uint64_t ipSystemStatsHCInMcastOctets
IpMibAddrOrigin
IP address origin.
Definition: ip_mib_module.h:95
uint64_t ipSystemStatsHCOutRequests
Per-interface IP statistics.
uint32_t ipSystemStatsInReceives
IpMibNetToPhysType
Type of mapping.
uint64_t ipSystemStatsHCOutMcastPkts
int32_t ipv6RouterAdvertSpinLock
uint32_t ipSystemStatsInMcastPkts
uint32_t ipIfStatsInUnknownProtos
uint64_t ipSystemStatsHCInOctets
uint64_t ipSystemStatsHCInMcastPkts
uint64_t ipIfStatsHCOutRequests
uint32_t ipSystemStatsInMcastOctets
uint32_t ipSystemStatsOutFragOKs
uint32_t ipIfStatsOutMcastOctets
#define NET_INTERFACE_COUNT
Definition: net.h:108
uint32_t ipSystemStatsRefreshRate
uint32_t icmpStatsOutMsgs
IpMibIcmpStatsEntry icmpStats
IpMibIcmpStatsEntry icmpv6Stats
uint32_t ipIfStatsInDiscards
IpMibIcmpMsgStatsEntry icmpv6MsgStatsTable
uint32_t ipSystemStatsOutForwDatagrams
uint64_t ipIfStatsHCOutTransmits
uint32_t ipIfStatsOutTransmits
uint32_t ipIfStatsOutDiscards
uint32_t ipSystemStatsOutDiscards
uint64_t ipSystemStatsHCOutBcastPkts
uint32_t ipSystemStatsInBcastPkts
uint64_t ipSystemStatsHCOutForwDatagrams
uint32_t ipIfStatsInBcastPkts
ICMP statistics.
uint32_t ipSystemStatsOutBcastPkts
uint32_t ipSystemStatsOutFragReqds
uint64_t ipSystemStatsHCInReceives
IpMibNetToPhysState
Entry state.
int32_t ipv6IpForwarding
uint32_t ipIfStatsInReceives
uint32_t ipSystemStatsInHdrErrors
uint32_t ipSystemStatsInNoRoutes
uint64_t ipSystemStatsHCOutMcastOctets
uint32_t ipIfStatsInHdrErrors
uint32_t ipIfStatsInDelivers
uint64_t ipIfStatsHCInMcastOctets
uint32_t ipSystemStatsOutFragFails
uint32_t ipIfStatsReasmFails
const MibObject ipMibObjects[]
IP MIB objects.
Definition: ip_mib_module.c:65
IpMibIpSystemStatsEntry ipv4SystemStats
uint64_t ipIfStatsHCOutBcastPkts
uint32_t ipIfStatsInMcastOctets
uint32_t ipSystemStatsOutRequests
uint64_t ipIfStatsHCInBcastPkts
uint32_t ipSystemStatsInOctets
Common definitions for MIB modules.
uint32_t ipSystemStatsOutMcastOctets
uint64_t ipSystemStatsHCInBcastPkts
uint32_t icmpStatsOutErrors
uint32_t ipSystemStatsOutOctets
uint32_t ipIfStatsInTruncatedPkts
System-wide IP statistics.
Per-message ICMP statistics.
uint32_t ipIfStatsOutFragReqds
uint32_t ipIfStatsOutBcastPkts
uint32_t ipSystemStatsInDiscards
int32_t ipv6IpDefaultHopLimit
uint32_t ipv6InterfaceTableLastChange
MIB module.
Definition: mib_common.h:285
uint32_t ipIfStatsInNoRoutes
uint64_t ipIfStatsHCOutMcastPkts
int32_t ipReasmTimeout
uint32_t ipIfStatsOutForwDatagrams
uint64_t ipIfStatsHCInForwDatagrams
uint32_t ipIfStatsDiscontinuityTime
const MibModule ipMibModule
IP MIB module.
uint32_t ipSystemStatsOutFragCreates
uint32_t icmpStatsInErrors
uint32_t ipSystemStatsInAddrErrors
uint64_t ipIfStatsHCInReceives
uint32_t ipSystemStatsInDelivers
uint32_t ipIfStatsReasmOKs