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  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2019 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 1.9.6
29  **/
30 
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
57 extern "C" {
58 #endif
59 
60 
61 /**
62  * @brief Interface types
63  **/
64 
65 typedef enum
66 {
78 } IfMibIfType;
79 
80 
81 /**
82  * @brief The desired state of the interface
83  **/
84 
85 typedef enum
86 {
91 
92 
93 /**
94  * @brief The operational state of the interface
95  **/
96 
97 typedef enum
98 {
103 
104 
105 /**
106  * @brief Enable linkUp/linkDown traps
107  **/
108 
109 typedef enum
110 {
114 
115 
116 /**
117  * @brief Address type
118  **/
119 
120 typedef enum
121 {
126 
127 
128 /**
129  * @brief Interfaces table entry
130  **/
131 
132 typedef struct
133 {
134  uint32_t ifLastChange;
135  uint32_t ifInOctets;
136  uint32_t ifInUcastPkts;
137  uint32_t ifInDiscards;
138  uint32_t ifInErrors;
140  uint32_t ifOutOctets;
141  uint32_t ifOutUcastPkts;
142  uint32_t ifOutDiscards;
143  uint32_t ifOutErrors;
144 } IfMibIfEntry;
145 
146 
147 /**
148  * @brief Extension to the interface table
149  **/
150 
151 typedef struct
152 {
157  uint64_t ifHCInOctets;
158  uint64_t ifHCInUcastPkts;
161  uint64_t ifHCOutOctets;
168 } IfMibIfXEntry;
169 
170 
171 /**
172  * @brief Interfaces Group MIB base
173  **/
174 
175 typedef struct
176 {
177  int32_t ifNumber;
182 } IfMibBase;
183 
184 
185 //Interfaces Group MIB related constants
186 extern IfMibBase ifMibBase;
187 extern const MibObject ifMibObjects[];
188 extern const MibModule ifMibModule;
189 
190 //C++ guard
191 #ifdef __cplusplus
192 }
193 #endif
194 
195 #endif
uint64_t ifHCInUcastPkts
uint32_t ifLastChange
uint64_t ifHCInMulticastPkts
uint64_t ifHCInOctets
IfMibIfAdminStatus
The desired state of the interface.
Definition: if_mib_module.h:85
IfMibIfType
Interface types.
Definition: if_mib_module.h:65
int32_t ifNumber
const MibModule ifMibModule
Interfaces Group MIB module.
int32_t ifLinkUpDownTrapEnable
uint32_t ifOutErrors
#define NET_INTERFACE_COUNT
Definition: net.h:109
uint32_t ifInErrors
int32_t ifPromiscuousMode
IfMibRcvAddressType
Address type.
uint32_t ifInUnknownProtos
Extension to the interface table.
uint32_t ifInMulticastPkts
uint64_t ifHCInBroadcastPkts
uint64_t ifHCOutMulticastPkts
uint32_t ifTableLastChange
uint32_t ifOutUcastPkts
uint64_t ifHCOutUcastPkts
MIB module.
Definition: mib_common.h:287
int32_t ifConnectorPresent
uint32_t ifOutMulticastPkts
uint32_t ifStackLastChange
uint64_t ifHCOutBroadcastPkts
uint32_t ifInDiscards
Common definitions for MIB modules.
uint32_t ifInOctets
IfMibIfLinkUpDownEnable
Enable linkUp/linkDown traps.
const MibObject ifMibObjects[]
Interfaces Group MIB objects.
Definition: if_mib_module.c:66
#define MibObject
Definition: mib_common.h:46
Interfaces table entry.
uint32_t ifInBroadcastPkts
uint32_t ifOutDiscards
uint32_t ifOutBroadcastPkts
uint32_t ifInUcastPkts
uint32_t ifOutOctets
Interfaces Group MIB base.
IfMibIfOperStatus
The operational state of the interface.
Definition: if_mib_module.h:97
IfMibBase ifMibBase
Interfaces Group MIB base.
Definition: if_mib_module.c:59
uint64_t ifHCOutOctets