if_mib_module.h
Go to the documentation of this file.
1 /**
2  * @file if_mib_module.h
3  * @brief Interfaces Group 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 _IF_MIB_MODULE_H
30 #define _IF_MIB_MODULE_H
31 
32 //Dependencies
33 #include "mibs/mib_common.h"
34 
35 //Interfaces Group MIB module support
36 #ifndef IF_MIB_SUPPORT
37  #define IF_MIB_SUPPORT DISABLED
38 #elif (IF_MIB_SUPPORT != ENABLED && IF_MIB_SUPPORT != DISABLED)
39  #error IF_MIB_SUPPORT parameter is not valid
40 #endif
41 
42 //Macro definitions
43 #if (IF_MIB_SUPPORT == ENABLED)
44  #define IF_MIB_SET_TIME_TICKS(name, value) ifMibBase.name = value
45  #define IF_MIB_INC_COUNTER32(name, value) ifMibBase.name += value
46  #define IF_MIB_INC_COUNTER64(name, value) ifMibBase.name += value
47 #else
48  #define IF_MIB_SET_TIME_TICKS(name, value)
49  #define IF_MIB_INC_COUNTER32(name, value)
50  #define IF_MIB_INC_COUNTER64(name, value)
51 #endif
52 
53 //C++ guard
54 #ifdef __cplusplus
55  extern "C" {
56 #endif
57 
58 
59 /**
60  * @brief Interface types
61  **/
62 
63 typedef enum
64 {
76 } IfMibIfType;
77 
78 
79 /**
80  * @brief The desired state of the interface
81  **/
82 
83 typedef enum
84 {
89 
90 
91 /**
92  * @brief The operational state of the interface
93  **/
94 
95 typedef enum
96 {
101 
102 
103 /**
104  * @brief Enable linkUp/linkDown traps
105  **/
106 
107 typedef enum
108 {
112 
113 
114 /**
115  * @brief Address type
116  **/
117 
118 typedef enum
119 {
124 
125 
126 /**
127  * @brief Interfaces table entry
128  **/
129 
130 typedef struct
131 {
132  uint32_t ifLastChange;
133  uint32_t ifInOctets;
134  uint32_t ifInUcastPkts;
135  uint32_t ifInDiscards;
136  uint32_t ifInErrors;
138  uint32_t ifOutOctets;
139  uint32_t ifOutUcastPkts;
140  uint32_t ifOutDiscards;
141  uint32_t ifOutErrors;
142 } IfMibIfEntry;
143 
144 
145 /**
146  * @brief Extension to the interface table
147  **/
148 
149 typedef struct
150 {
155  uint64_t ifHCInOctets;
156  uint64_t ifHCInUcastPkts;
159  uint64_t ifHCOutOctets;
166 } IfMibIfXEntry;
167 
168 
169 /**
170  * @brief Interfaces Group MIB base
171  **/
172 
173 typedef struct
174 {
175  int32_t ifNumber;
180 } IfMibBase;
181 
182 
183 //Interfaces Group MIB related constants
184 extern IfMibBase ifMibBase;
185 extern const MibObject ifMibObjects[];
186 extern const MibModule ifMibModule;
187 
188 //C++ guard
189 #ifdef __cplusplus
190  }
191 #endif
192 
193 #endif
Interfaces Group MIB base.
uint32_t ifLastChange
IfMibBase ifMibBase
Interfaces Group MIB base.
Definition: if_mib_module.c:57
uint64_t ifHCInBroadcastPkts
IfMibIfOperStatus
The operational state of the interface.
Definition: if_mib_module.h:95
#define MibObject
Definition: mib_common.h:44
IfMibRcvAddressType
Address type.
IfMibIfLinkUpDownEnable
Enable linkUp/linkDown traps.
uint32_t ifOutErrors
uint64_t ifHCOutOctets
uint32_t ifOutMulticastPkts
uint32_t ifInErrors
uint64_t ifHCOutBroadcastPkts
IfMibIfType
Interface types.
Definition: if_mib_module.h:63
uint32_t ifTableLastChange
int32_t ifConnectorPresent
uint32_t ifInUnknownProtos
IfMibIfAdminStatus
The desired state of the interface.
Definition: if_mib_module.h:83
uint32_t ifOutUcastPkts
uint32_t ifOutBroadcastPkts
uint64_t ifHCInUcastPkts
#define NET_INTERFACE_COUNT
Definition: net.h:108
uint32_t ifInMulticastPkts
uint32_t ifInBroadcastPkts
Interfaces table entry.
uint32_t ifStackLastChange
uint64_t ifHCInMulticastPkts
uint64_t ifHCInOctets
uint64_t ifHCOutMulticastPkts
uint32_t ifInDiscards
const MibObject ifMibObjects[]
Interfaces Group MIB objects.
Definition: if_mib_module.c:64
uint32_t ifInOctets
int32_t ifLinkUpDownTrapEnable
Common definitions for MIB modules.
Extension to the interface table.
uint32_t ifOutOctets
uint32_t ifOutDiscards
int32_t ifNumber
MIB module.
Definition: mib_common.h:285
uint32_t ifInUcastPkts
int32_t ifPromiscuousMode
const MibModule ifMibModule
Interfaces Group MIB module.
uint64_t ifHCOutUcastPkts