mikroSDK Reference Manual
if_mib_module.h
Go to the documentation of this file.
1
31#ifndef _IF_MIB_MODULE_H
32#define _IF_MIB_MODULE_H
33
34//Dependencies
35#include "mibs/mib_common.h"
36
37//Interfaces Group MIB module support
38#ifndef IF_MIB_SUPPORT
39 #define IF_MIB_SUPPORT DISABLED
40#elif (IF_MIB_SUPPORT != ENABLED && IF_MIB_SUPPORT != DISABLED)
41 #error IF_MIB_SUPPORT parameter is not valid
42#endif
43
44//Macro definitions
45#if (IF_MIB_SUPPORT == ENABLED)
46 #define IF_MIB_SET_TIME_TICKS(name, value) ifMibBase.name = value
47 #define IF_MIB_INC_COUNTER32(name, value) ifMibBase.name += value
48 #define IF_MIB_INC_COUNTER64(name, value) ifMibBase.name += value
49#else
50 #define IF_MIB_SET_TIME_TICKS(name, value)
51 #define IF_MIB_INC_COUNTER32(name, value)
52 #define IF_MIB_INC_COUNTER64(name, value)
53#endif
54
55//C++ guard
56#ifdef __cplusplus
57extern "C" {
58#endif
59
60
65typedef enum
66{
67 IF_MIB_IF_TYPE_OTHER = 1,
68 IF_MIB_IF_TYPE_ETHERNET_CSMACD = 6,
69 IF_MIB_IF_TYPE_PROP_PTP_SERIAL = 22,
70 IF_MIB_IF_TYPE_PPP = 23,
71 IF_MIB_IF_TYPE_SOFT_LOOPBACK = 24,
72 IF_MIB_IF_TYPE_SLIP = 28,
73 IF_MIB_IF_TYPE_RS232 = 33,
74 IF_MIB_IF_TYPE_PARA = 34,
75 IF_MIB_IF_TYPE_IEEE_802_11 = 71,
76 IF_MIB_IF_TYPE_HDLC = 118,
77 IF_MIB_IF_TYPE_TUNNEL = 131,
78 IF_MIB_IF_TYPE_L2_VLAN = 135,
79 IF_MIB_IF_TYPE_USB = 160,
80 IF_MIB_IF_TYPE_PLC = 174,
81 IF_MIB_IF_TYPE_BRIDGE = 209,
82 IF_MIB_IF_TYPE_IEEE_802_15_4 = 259
84
85
90typedef enum
91{
92 IF_MIB_IF_ADMIN_STATUS_UP = 1,
93 IF_MIB_IF_ADMIN_STATUS_DOWN = 2,
94 IF_MIB_IF_ADMIN_STATUS_TESTING = 3
96
97
102typedef enum
103{
104 IF_MIB_IF_OPER_STATUS_UP = 1,
105 IF_MIB_IF_OPER_STATUS_DOWN = 2,
106 IF_MIB_IF_OPER_STATUS_TESTING = 3
108
109
114typedef enum
115{
116 IF_MIB_IF_LINK_UP_DOWN_TRAP_ENABLED = 1,
117 IF_MIB_IF_LINK_UP_DOWN_TRAP_DISABLED = 2
119
120
125typedef enum
126{
127 IF_MIB_RCV_ADDRESS_TYPE_OTHER = 1,
128 IF_MIB_RCV_ADDRESS_TYPE_VOLATILE = 2,
129 IF_MIB_RCV_ADDRESS_TYPE_NON_VOLATILE = 3
131
132
137typedef struct
138{
139 uint32_t ifLastChange;
140 uint32_t ifInOctets;
141 uint32_t ifInUcastPkts;
142 uint32_t ifInDiscards;
143 uint32_t ifInErrors;
144 uint32_t ifInUnknownProtos;
145 uint32_t ifOutOctets;
146 uint32_t ifOutUcastPkts;
147 uint32_t ifOutDiscards;
148 uint32_t ifOutErrors;
150
151
156typedef struct
157{
158 uint32_t ifInMulticastPkts;
159 uint32_t ifInBroadcastPkts;
160 uint32_t ifOutMulticastPkts;
161 uint32_t ifOutBroadcastPkts;
162 uint64_t ifHCInOctets;
163 uint64_t ifHCInUcastPkts;
164 uint64_t ifHCInMulticastPkts;
165 uint64_t ifHCInBroadcastPkts;
166 uint64_t ifHCOutOctets;
167 uint64_t ifHCOutUcastPkts;
168 uint64_t ifHCOutMulticastPkts;
169 uint64_t ifHCOutBroadcastPkts;
170 int32_t ifLinkUpDownTrapEnable;
171 int32_t ifPromiscuousMode;
172 int32_t ifConnectorPresent;
174
175
180typedef struct
181{
182 int32_t ifNumber;
183 IfMibIfEntry ifTable[NET_INTERFACE_COUNT];
184 IfMibIfXEntry ifXTable[NET_INTERFACE_COUNT];
185 uint32_t ifTableLastChange;
186 uint32_t ifStackLastChange;
187} IfMibBase;
188
189
190//Interfaces Group MIB related constants
191extern IfMibBase ifMibBase;
192extern const MibObject ifMibObjects[];
193extern const MibModule ifMibModule;
194
195//C++ guard
196#ifdef __cplusplus
197}
198#endif
199
200#endif
IfMibIfAdminStatus
The desired state of the interface.
Definition if_mib_module.h:91
IfMibIfLinkUpDownEnable
Enable linkUp/linkDown traps.
Definition if_mib_module.h:115
IfMibRcvAddressType
Address type.
Definition if_mib_module.h:126
IfMibIfOperStatus
The operational state of the interface.
Definition if_mib_module.h:103
IfMibIfType
Interface types.
Definition if_mib_module.h:66
Common definitions for MIB modules.
Interfaces Group MIB base.
Definition if_mib_module.h:181
Interfaces table entry.
Definition if_mib_module.h:138
Extension to the interface table.
Definition if_mib_module.h:157
MIB module.
Definition mib_common.h:288