mikroSDK Reference Manual
ip_mib_module.h
Go to the documentation of this file.
1
31#ifndef _IP_MIB_MODULE_H
32#define _IP_MIB_MODULE_H
33
34//Dependencies
35#include "mibs/mib_common.h"
36
37//IP MIB module support
38#ifndef IP_MIB_SUPPORT
39 #define IP_MIB_SUPPORT DISABLED
40#elif (IP_MIB_SUPPORT != ENABLED && IP_MIB_SUPPORT != DISABLED)
41 #error IP_MIB_SUPPORT parameter is not valid
42#endif
43
44//Macro definitions
45#if (IP_MIB_SUPPORT == ENABLED)
46 #define IP_MIB_INC_COUNTER32(name, value) ipMibBase.name += value
47 #define IP_MIB_INC_COUNTER64(name, value) ipMibBase.name += value
48#else
49 #define IP_MIB_INC_COUNTER32(name, value)
50 #define IP_MIB_INC_COUNTER64(name, value)
51#endif
52
53//C++ guard
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58
63typedef enum
64{
65 IP_MIB_IP_FORWARDING_ENABLED = 1,
66 IP_MIB_IP_FORWARDING_DISABLED = 2
68
69
74typedef enum
75{
76 IP_MIB_IP_STATUS_UP = 1,
77 IP_MIB_IP_STATUS_DOWN = 2
79
80
85typedef enum
86{
87 IP_MIB_ADDR_TYPE_UNICAST = 1,
88 IP_MIB_ADDR_TYPE_ANYCAST = 2,
89 IP_MIB_ADDR_TYPE_BROADCAST = 3
91
92
97typedef enum
98{
99 IP_MIB_ADDR_ORIGIN_MANUAL = 2,
100 IP_MIB_ADDR_ORIGIN_DHCP = 4,
101 IP_MIB_ADDR_ORIGIN_LINK_LAYER = 5,
102 IP_MIB_ADDR_ORIGIN_RANDOM = 6,
104
109typedef enum
110{
111 IP_MIB_ADDR_STATUS_PREFERRED = 1,
112 IP_MIB_ADDR_STATUS_DEPRECATED = 2,
113 IP_MIB_ADDR_STATUS_INVALID = 3,
114 IP_MIB_ADDR_STATUS_INACCESSIBLE = 4,
115 IP_MIB_ADDR_STATUS_UNKNOWN = 5,
116 IP_MIB_ADDR_STATUS_TENTATIVE = 6,
117 IP_MIB_ADDR_STATUS_DUPLICATE = 7,
118 IP_MIB_ADDR_STATUS_OPTIMISTIC = 8
120
121
126typedef enum
127{
128 IP_MIB_PREFIX_ORIGIN_MANUAL = 2,
129 IP_MIB_PREFIX_ORIGIN_WELL_KNOWN = 3,
130 IP_MIB_PREFIX_ORIGIN_DHCP = 4,
131 IP_MIB_PREFIX_ORIGIN_ROUTER_ADV = 5,
133
134
139typedef enum
140{
141 IP_MIB_NET_TO_PHYS_TYPE_OTHER = 1,
142 IP_MIB_NET_TO_PHYS_TYPE_INVALID = 2,
143 IP_MIB_NET_TO_PHYS_TYPE_DYNAMIC = 3,
144 IP_MIB_NET_TO_PHYS_TYPE_STATIC = 4,
145 IP_MIB_NET_TO_PHYS_TYPE_LOCAL = 5
147
148
153typedef enum
154{
155 IP_MIB_NET_TO_PHYS_STATE_REACHABLE = 1,
156 IP_MIB_NET_TO_PHYS_STATE_STALE = 2,
157 IP_MIB_NET_TO_PHYS_STATE_DELAY = 3,
158 IP_MIB_NET_TO_PHYS_STATE_PROBE = 4,
159 IP_MIB_NET_TO_PHYS_STATE_INVALID = 5,
160 IP_MIB_NET_TO_PHYS_STATE_UNKNOWN = 6,
161 IP_MIB_NET_TO_PHYS_STATE_INCOMPLETE = 7
163
164
169typedef enum
170{
171 IP_MIB_ROUTER_PREFERENCE_RESERVED = -2,
172 IP_MIB_ROUTER_PREFERENCE_LOW = -1,
173 IP_MIB_ROUTER_PREFERENCE_MEDIUM = 0,
174 IP_MIB_ROUTER_PREFERENCE_HIGH = 1
176
177
182typedef struct
183{
184 uint32_t ipSystemStatsInReceives;
185 uint64_t ipSystemStatsHCInReceives;
186 uint32_t ipSystemStatsInOctets;
187 uint64_t ipSystemStatsHCInOctets;
188 uint32_t ipSystemStatsInHdrErrors;
189 uint32_t ipSystemStatsInNoRoutes;
190 uint32_t ipSystemStatsInAddrErrors;
191 uint32_t ipSystemStatsInUnknownProtos;
192 uint32_t ipSystemStatsInTruncatedPkts;
193 uint32_t ipSystemStatsInForwDatagrams;
194 uint64_t ipSystemStatsHCInForwDatagrams;
195 uint32_t ipSystemStatsReasmReqds;
196 uint32_t ipSystemStatsReasmOKs;
197 uint32_t ipSystemStatsReasmFails;
198 uint32_t ipSystemStatsInDiscards;
199 uint32_t ipSystemStatsInDelivers;
200 uint64_t ipSystemStatsHCInDelivers;
201 uint32_t ipSystemStatsOutRequests;
202 uint64_t ipSystemStatsHCOutRequests;
203 uint32_t ipSystemStatsOutNoRoutes;
204 uint32_t ipSystemStatsOutForwDatagrams;
205 uint64_t ipSystemStatsHCOutForwDatagrams;
206 uint32_t ipSystemStatsOutDiscards;
207 uint32_t ipSystemStatsOutFragReqds;
208 uint32_t ipSystemStatsOutFragOKs;
209 uint32_t ipSystemStatsOutFragFails;
210 uint32_t ipSystemStatsOutFragCreates;
211 uint32_t ipSystemStatsOutTransmits;
212 uint64_t ipSystemStatsHCOutTransmits;
213 uint32_t ipSystemStatsOutOctets;
214 uint64_t ipSystemStatsHCOutOctets;
215 uint32_t ipSystemStatsInMcastPkts;
216 uint64_t ipSystemStatsHCInMcastPkts;
217 uint32_t ipSystemStatsInMcastOctets;
218 uint64_t ipSystemStatsHCInMcastOctets;
219 uint32_t ipSystemStatsOutMcastPkts;
220 uint64_t ipSystemStatsHCOutMcastPkts;
221 uint32_t ipSystemStatsOutMcastOctets;
222 uint64_t ipSystemStatsHCOutMcastOctets;
223 uint32_t ipSystemStatsInBcastPkts;
224 uint64_t ipSystemStatsHCInBcastPkts;
225 uint32_t ipSystemStatsOutBcastPkts;
226 uint64_t ipSystemStatsHCOutBcastPkts;
227 uint32_t ipSystemStatsDiscontinuityTime;
228 uint32_t ipSystemStatsRefreshRate;
230
231
236typedef struct
237{
238 uint32_t ipIfStatsInReceives;
239 uint64_t ipIfStatsHCInReceives;
240 uint32_t ipIfStatsInOctets;
241 uint64_t ipIfStatsHCInOctets;
242 uint32_t ipIfStatsInHdrErrors;
243 uint32_t ipIfStatsInNoRoutes;
244 uint32_t ipIfStatsInAddrErrors;
245 uint32_t ipIfStatsInUnknownProtos;
246 uint32_t ipIfStatsInTruncatedPkts;
247 uint32_t ipIfStatsInForwDatagrams;
248 uint64_t ipIfStatsHCInForwDatagrams;
249 uint32_t ipIfStatsReasmReqds;
250 uint32_t ipIfStatsReasmOKs;
251 uint32_t ipIfStatsReasmFails;
252 uint32_t ipIfStatsInDiscards;
253 uint32_t ipIfStatsInDelivers;
254 uint64_t ipIfStatsHCInDelivers;
255 uint32_t ipIfStatsOutRequests;
256 uint64_t ipIfStatsHCOutRequests;
257 uint32_t ipIfStatsOutForwDatagrams;
258 uint64_t ipIfStatsHCOutForwDatagrams;
259 uint32_t ipIfStatsOutDiscards;
260 uint32_t ipIfStatsOutFragReqds;
261 uint32_t ipIfStatsOutFragOKs;
262 uint32_t ipIfStatsOutFragFails;
263 uint32_t ipIfStatsOutFragCreates;
264 uint32_t ipIfStatsOutTransmits;
265 uint64_t ipIfStatsHCOutTransmits;
266 uint32_t ipIfStatsOutOctets;
267 uint64_t ipIfStatsHCOutOctets;
268 uint32_t ipIfStatsInMcastPkts;
269 uint64_t ipIfStatsHCInMcastPkts;
270 uint32_t ipIfStatsInMcastOctets;
271 uint64_t ipIfStatsHCInMcastOctets;
272 uint32_t ipIfStatsOutMcastPkts;
273 uint64_t ipIfStatsHCOutMcastPkts;
274 uint32_t ipIfStatsOutMcastOctets;
275 uint64_t ipIfStatsHCOutMcastOctets;
276 uint32_t ipIfStatsInBcastPkts;
277 uint64_t ipIfStatsHCInBcastPkts;
278 uint32_t ipIfStatsOutBcastPkts;
279 uint64_t ipIfStatsHCOutBcastPkts;
280 uint32_t ipIfStatsDiscontinuityTime;
281 uint32_t ipIfStatsRefreshRate;
283
284
289typedef struct
290{
291 uint32_t icmpStatsInMsgs;
292 uint32_t icmpStatsInErrors;
293 uint32_t icmpStatsOutMsgs;
294 uint32_t icmpStatsOutErrors;
296
297
302typedef struct
303{
304 uint32_t icmpMsgStatsInPkts[256];
305 uint32_t icmpMsgStatsOutPkts[256];
307
308
313typedef struct
314{
315 uint32_t ipIfStatsTableLastChange;
316 int32_t ipAddressSpinLock;
317#if (IPV4_SUPPORT == ENABLED)
318 int32_t ipForwarding;
319 int32_t ipDefaultTTL;
320 int32_t ipReasmTimeout;
321 uint32_t ipv4InterfaceTableLastChange;
322 IpMibIpSystemStatsEntry ipv4SystemStats;
323 IpMibIpIfStatsEntry ipv4IfStatsTable[NET_INTERFACE_COUNT];
324 IpMibIcmpStatsEntry icmpStats;
325 IpMibIcmpMsgStatsEntry icmpMsgStatsTable;
326#endif
327#if (IPV6_SUPPORT == ENABLED)
328 int32_t ipv6IpForwarding;
329 int32_t ipv6IpDefaultHopLimit;
330 uint32_t ipv6InterfaceTableLastChange;
331 IpMibIpSystemStatsEntry ipv6SystemStats;
332 IpMibIpIfStatsEntry ipv6IfStatsTable[NET_INTERFACE_COUNT];
333 int32_t ipv6RouterAdvertSpinLock;
334 IpMibIcmpStatsEntry icmpv6Stats;
335 IpMibIcmpMsgStatsEntry icmpv6MsgStatsTable;
336#endif
337} IpMibBase;
338
339
340//IP MIB related constants
341extern IpMibBase ipMibBase;
342extern const MibObject ipMibObjects[];
343extern const MibModule ipMibModule;
344
345//C++ guard
346#ifdef __cplusplus
347}
348#endif
349
350#endif
IpMibAddrOrigin
IP address origin.
Definition ip_mib_module.h:98
IpMibIpForwarding
IP forwarding state.
Definition ip_mib_module.h:64
IpMibIpStatus
IP status.
Definition ip_mib_module.h:75
IpMibNetToPhysType
Type of mapping.
Definition ip_mib_module.h:140
IpMibAddrType
IP address type.
Definition ip_mib_module.h:86
IpMibPrefixOrigin
Prefix origin.
Definition ip_mib_module.h:127
IpMibAddrStatus
IP address status.
Definition ip_mib_module.h:110
IpMibNetToPhysState
Entry state.
Definition ip_mib_module.h:154
IpMibRouterPreference
Router preferences.
Definition ip_mib_module.h:170
Common definitions for MIB modules.
IP MIB base.
Definition ip_mib_module.h:314
Per-message ICMP statistics.
Definition ip_mib_module.h:303
ICMP statistics.
Definition ip_mib_module.h:290
Per-interface IP statistics.
Definition ip_mib_module.h:237
System-wide IP statistics.
Definition ip_mib_module.h:183
MIB module.
Definition mib_common.h:288