[go: up one dir, main page]

File: if-mib.h

package info (click to toggle)
scli 0.3.1-3.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,872 kB
  • ctags: 8,627
  • sloc: ansic: 32,657; sh: 7,388; makefile: 321
file content (359 lines) | stat: -rw-r--r-- 12,787 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
/*							-- DO NOT EDIT --
 * Generated by smidump version 0.4.3:
 *   smidump -f scli --scli-set --scli-create --scli-delete \
 *     --scli-exclude='ifTestEntry' IF-MIB
 *
 * Derived from IF-MIB:
 *   The MIB module to describe generic objects for network
 *   interface sub-layers.  This MIB is an updated version of
 *   MIB-II's ifTable, and incorporates the extensions defined in
 *   RFC 1229.
 *
 * Revision 2000-06-14 00:00:
 *   Clarifications agreed upon by the Interfaces MIB WG, and
 *   published as RFC 2863.
 *
 * Revision 1996-02-28 21:55:
 *   Revisions made by the Interfaces MIB WG, and published in
 *   RFC 2233.
 *
 * Revision 1993-11-08 21:55:
 *   Initial revision, published as part of RFC 1573.
 *
 * $Id: if-mib.h 732 2004-11-05 09:21:08Z schoenw $
 */

#ifndef _IF_MIB_H_
#define _IF_MIB_H_

#include "gsnmp.h"

G_BEGIN_DECLS

/*
 * Tables to map enumerations to strings and vice versa.
 */

#define IF_MIB_IFADMINSTATUS_UP      1
#define IF_MIB_IFADMINSTATUS_DOWN    2
#define IF_MIB_IFADMINSTATUS_TESTING 3

extern GNetSnmpEnum const if_mib_enums_ifAdminStatus[];

#define IF_MIB_IFOPERSTATUS_UP             1
#define IF_MIB_IFOPERSTATUS_DOWN           2
#define IF_MIB_IFOPERSTATUS_TESTING        3
#define IF_MIB_IFOPERSTATUS_UNKNOWN        4
#define IF_MIB_IFOPERSTATUS_DORMANT        5
#define IF_MIB_IFOPERSTATUS_NOTPRESENT     6
#define IF_MIB_IFOPERSTATUS_LOWERLAYERDOWN 7

extern GNetSnmpEnum const if_mib_enums_ifOperStatus[];

#define IF_MIB_IFLINKUPDOWNTRAPENABLE_ENABLED  1
#define IF_MIB_IFLINKUPDOWNTRAPENABLE_DISABLED 2

extern GNetSnmpEnum const if_mib_enums_ifLinkUpDownTrapEnable[];

#define IF_MIB_IFRCVADDRESSTYPE_OTHER       1
#define IF_MIB_IFRCVADDRESSTYPE_VOLATILE    2
#define IF_MIB_IFRCVADDRESSTYPE_NONVOLATILE 3

extern GNetSnmpEnum const if_mib_enums_ifRcvAddressType[];


/*
 * Tables to map notifications to strings and vice versa.
 */

#define IF_MIB_LINKDOWN	1,3,6,1,6,3,1,1,5,3
#define IF_MIB_LINKUP	1,3,6,1,6,3,1,1,5,4

extern GNetSnmpIdentity const if_mib_notifications[];

/*
 * C type definitions for IF-MIB::interfaces.
 */

#define IF_MIB_IFNUMBER (1 << 0) 

typedef struct {
    gint32   *ifNumber;     /* ro Integer32 */
} if_mib_interfaces_t;

extern if_mib_interfaces_t *
if_mib_new_interfaces(void);

extern void
if_mib_get_interfaces(GNetSnmp *s, if_mib_interfaces_t **interfaces, gint64 mask);

extern void
if_mib_free_interfaces(if_mib_interfaces_t *interfaces);

/*
 * C type definitions for IF-MIB::ifEntry.
 */

#define IF_MIB_IFINDEX           (1 << 0) 
#define IF_MIB_IFDESCR           (1 << 1) 
#define IF_MIB_IFTYPE            (1 << 2) 
#define IF_MIB_IFMTU             (1 << 3) 
#define IF_MIB_IFSPEED           (1 << 4) 
#define IF_MIB_IFPHYSADDRESS     (1 << 5) 
#define IF_MIB_IFADMINSTATUS     (1 << 6) 
#define IF_MIB_IFOPERSTATUS      (1 << 7) 
#define IF_MIB_IFLASTCHANGE      (1 << 8) 
#define IF_MIB_IFINOCTETS        (1 << 9) 
#define IF_MIB_IFINUCASTPKTS     (1 << 10) 
#define IF_MIB_IFINNUCASTPKTS    (1 << 11) 
#define IF_MIB_IFINDISCARDS      (1 << 12) 
#define IF_MIB_IFINERRORS        (1 << 13) 
#define IF_MIB_IFINUNKNOWNPROTOS (1 << 14) 
#define IF_MIB_IFOUTOCTETS       (1 << 15) 
#define IF_MIB_IFOUTUCASTPKTS    (1 << 16) 
#define IF_MIB_IFOUTNUCASTPKTS   (1 << 17) 
#define IF_MIB_IFOUTDISCARDS     (1 << 18) 
#define IF_MIB_IFOUTERRORS       (1 << 19) 
#define IF_MIB_IFOUTQLEN         (1 << 20) 
#define IF_MIB_IFSPECIFIC        (1 << 21) 

typedef struct {
    gint32   ifIndex;                /* ro IF-MIB::InterfaceIndex */
    guchar   *ifDescr;               /* ro */
#define IF_MIB_IFDESCRMINLENGTH 0
#define IF_MIB_IFDESCRMAXLENGTH 255
    guint16  _ifDescrLength;
    gint32   *ifType;                /* ro IANAifType-MIB::IANAifType */
    gint32   *ifMtu;                 /* ro Integer32 */
    guint32  *ifSpeed;               /* ro SNMPv2-SMI::Gauge32 */
    guchar   *ifPhysAddress;         /* ro SNMPv2-TC::PhysAddress */
#define IF_MIB_IFPHYSADDRESSMINLENGTH 0
#define IF_MIB_IFPHYSADDRESSMAXLENGTH 65535
    guint16  _ifPhysAddressLength;
    gint32   *ifAdminStatus;         /* rw */
    gint32   *ifOperStatus;          /* ro */
    guint32  *ifLastChange;          /* ro SNMPv2-SMI::TimeTicks */
    guint32  *ifInOctets;            /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifInUcastPkts;         /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifInNUcastPkts;        /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifInDiscards;          /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifInErrors;            /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifInUnknownProtos;     /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifOutOctets;           /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifOutUcastPkts;        /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifOutNUcastPkts;       /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifOutDiscards;         /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifOutErrors;           /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifOutQLen;             /* ro SNMPv2-SMI::Gauge32 */
    guint32  *ifSpecific;            /* ro ObjectIdentifier */
#define IF_MIB_IFSPECIFICMINLENGTH 0
#define IF_MIB_IFSPECIFICMAXLENGTH 128
    guint16  _ifSpecificLength;
} if_mib_ifEntry_t;

extern void
if_mib_get_ifTable(GNetSnmp *s, if_mib_ifEntry_t ***ifEntry, gint64 mask);

extern void
if_mib_free_ifTable(if_mib_ifEntry_t **ifEntry);

extern if_mib_ifEntry_t *
if_mib_new_ifEntry(void);

extern void
if_mib_get_ifEntry(GNetSnmp *s, if_mib_ifEntry_t **ifEntry, gint32 ifIndex, gint64 mask);

extern void
if_mib_set_ifEntry(GNetSnmp *s, if_mib_ifEntry_t *ifEntry, gint64 mask);

extern void
if_mib_free_ifEntry(if_mib_ifEntry_t *ifEntry);

extern void
if_mib_set_ifAdminStatus(GNetSnmp *s, gint32 ifIndex, gint32 ifAdminStatus);

/*
 * C type definitions for IF-MIB::ifMIBObjects.
 */

#define IF_MIB_IFTABLELASTCHANGE (1 << 0) 
#define IF_MIB_IFSTACKLASTCHANGE (1 << 1) 

typedef struct {
    guint32  *ifTableLastChange;     /* ro SNMPv2-SMI::TimeTicks */
    guint32  *ifStackLastChange;     /* ro SNMPv2-SMI::TimeTicks */
} if_mib_ifMIBObjects_t;

extern if_mib_ifMIBObjects_t *
if_mib_new_ifMIBObjects(void);

extern void
if_mib_get_ifMIBObjects(GNetSnmp *s, if_mib_ifMIBObjects_t **ifMIBObjects, gint64 mask);

extern void
if_mib_free_ifMIBObjects(if_mib_ifMIBObjects_t *ifMIBObjects);

/*
 * C type definitions for IF-MIB::ifXEntry.
 */

#define IF_MIB_IFNAME                     (1 << 0) 
#define IF_MIB_IFINMULTICASTPKTS          (1 << 1) 
#define IF_MIB_IFINBROADCASTPKTS          (1 << 2) 
#define IF_MIB_IFOUTMULTICASTPKTS         (1 << 3) 
#define IF_MIB_IFOUTBROADCASTPKTS         (1 << 4) 
#define IF_MIB_IFHCINOCTETS               (1 << 5) 
#define IF_MIB_IFHCINUCASTPKTS            (1 << 6) 
#define IF_MIB_IFHCINMULTICASTPKTS        (1 << 7) 
#define IF_MIB_IFHCINBROADCASTPKTS        (1 << 8) 
#define IF_MIB_IFHCOUTOCTETS              (1 << 9) 
#define IF_MIB_IFHCOUTUCASTPKTS           (1 << 10) 
#define IF_MIB_IFHCOUTMULTICASTPKTS       (1 << 11) 
#define IF_MIB_IFHCOUTBROADCASTPKTS       (1 << 12) 
#define IF_MIB_IFLINKUPDOWNTRAPENABLE     (1 << 13) 
#define IF_MIB_IFHIGHSPEED                (1 << 14) 
#define IF_MIB_IFPROMISCUOUSMODE          (1 << 15) 
#define IF_MIB_IFCONNECTORPRESENT         (1 << 16) 
#define IF_MIB_IFALIAS                    (1 << 17) 
#define IF_MIB_IFCOUNTERDISCONTINUITYTIME (1 << 18) 

typedef struct {
    gint32   ifIndex;                         /* ro IF-MIB::InterfaceIndex */
    guchar   *ifName;                         /* ro SNMPv2-TC::DisplayString */
#define IF_MIB_IFNAMEMINLENGTH 0
#define IF_MIB_IFNAMEMAXLENGTH 255
    guint16  _ifNameLength;
    guint32  *ifInMulticastPkts;              /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifInBroadcastPkts;              /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifOutMulticastPkts;             /* ro SNMPv2-SMI::Counter32 */
    guint32  *ifOutBroadcastPkts;             /* ro SNMPv2-SMI::Counter32 */
    guint64  *ifHCInOctets;                   /* ro SNMPv2-SMI::Counter64 */
    guint64  *ifHCInUcastPkts;                /* ro SNMPv2-SMI::Counter64 */
    guint64  *ifHCInMulticastPkts;            /* ro SNMPv2-SMI::Counter64 */
    guint64  *ifHCInBroadcastPkts;            /* ro SNMPv2-SMI::Counter64 */
    guint64  *ifHCOutOctets;                  /* ro SNMPv2-SMI::Counter64 */
    guint64  *ifHCOutUcastPkts;               /* ro SNMPv2-SMI::Counter64 */
    guint64  *ifHCOutMulticastPkts;           /* ro SNMPv2-SMI::Counter64 */
    guint64  *ifHCOutBroadcastPkts;           /* ro SNMPv2-SMI::Counter64 */
    gint32   *ifLinkUpDownTrapEnable;         /* rw */
    guint32  *ifHighSpeed;                    /* ro SNMPv2-SMI::Gauge32 */
    gint32   *ifPromiscuousMode;              /* rw SNMPv2-TC::TruthValue */
    gint32   *ifConnectorPresent;             /* ro SNMPv2-TC::TruthValue */
    guchar   *ifAlias;                        /* rw */
#define IF_MIB_IFALIASMINLENGTH 0
#define IF_MIB_IFALIASMAXLENGTH 64
    guint16  _ifAliasLength;
    guint32  *ifCounterDiscontinuityTime;     /* ro SNMPv2-TC::TimeStamp */
} if_mib_ifXEntry_t;

extern void
if_mib_get_ifXTable(GNetSnmp *s, if_mib_ifXEntry_t ***ifXEntry, gint64 mask);

extern void
if_mib_free_ifXTable(if_mib_ifXEntry_t **ifXEntry);

extern if_mib_ifXEntry_t *
if_mib_new_ifXEntry(void);

extern void
if_mib_get_ifXEntry(GNetSnmp *s, if_mib_ifXEntry_t **ifXEntry, gint32 ifIndex, gint64 mask);

extern void
if_mib_set_ifXEntry(GNetSnmp *s, if_mib_ifXEntry_t *ifXEntry, gint64 mask);

extern void
if_mib_free_ifXEntry(if_mib_ifXEntry_t *ifXEntry);

extern void
if_mib_set_ifLinkUpDownTrapEnable(GNetSnmp *s, gint32 ifIndex, gint32 ifLinkUpDownTrapEnable);

extern void
if_mib_set_ifPromiscuousMode(GNetSnmp *s, gint32 ifIndex, gint32 ifPromiscuousMode);

extern void
if_mib_set_ifAlias(GNetSnmp *s, gint32 ifIndex, guchar *ifAlias, guint16 _ifAliasLength);

/*
 * C type definitions for IF-MIB::ifStackEntry.
 */

#define IF_MIB_IFSTACKSTATUS (1 << 0) 

typedef struct {
    gint32   ifStackHigherLayer; /* na IF-MIB::InterfaceIndexOrZero */
    gint32   ifStackLowerLayer;  /* na IF-MIB::InterfaceIndexOrZero */
    gint32   *ifStackStatus;     /* rw SNMPv2-TC::RowStatus */
} if_mib_ifStackEntry_t;

extern void
if_mib_get_ifStackTable(GNetSnmp *s, if_mib_ifStackEntry_t ***ifStackEntry, gint64 mask);

extern void
if_mib_free_ifStackTable(if_mib_ifStackEntry_t **ifStackEntry);

extern if_mib_ifStackEntry_t *
if_mib_new_ifStackEntry(void);

extern void
if_mib_get_ifStackEntry(GNetSnmp *s, if_mib_ifStackEntry_t **ifStackEntry, gint32 ifStackHigherLayer, gint32 ifStackLowerLayer, gint64 mask);

extern void
if_mib_set_ifStackEntry(GNetSnmp *s, if_mib_ifStackEntry_t *ifStackEntry, gint64 mask);

extern void
if_mib_free_ifStackEntry(if_mib_ifStackEntry_t *ifStackEntry);

extern void
if_mib_create_ifStackEntry(GNetSnmp *s, gint32 ifStackHigherLayer, gint32 ifStackLowerLayer);

extern void
if_mib_delete_ifStackEntry(GNetSnmp *s, gint32 ifStackHigherLayer, gint32 ifStackLowerLayer);

/*
 * C type definitions for IF-MIB::ifRcvAddressEntry.
 */

#define IF_MIB_IFRCVADDRESSSTATUS (1 << 0) 
#define IF_MIB_IFRCVADDRESSTYPE   (1 << 1) 

typedef struct {
    gint32   ifIndex;                 /* ro IF-MIB::InterfaceIndex */
    guchar   ifRcvAddressAddress[117]; /* na SNMPv2-TC::PhysAddress */
#define IF_MIB_IFRCVADDRESSADDRESSMINLENGTH 0
#define IF_MIB_IFRCVADDRESSADDRESSMAXLENGTH 117
    guint16  _ifRcvAddressAddressLength;
    gint32   *ifRcvAddressStatus;     /* rw SNMPv2-TC::RowStatus */
    gint32   *ifRcvAddressType;       /* rw */
} if_mib_ifRcvAddressEntry_t;

extern void
if_mib_get_ifRcvAddressTable(GNetSnmp *s, if_mib_ifRcvAddressEntry_t ***ifRcvAddressEntry, gint64 mask);

extern void
if_mib_free_ifRcvAddressTable(if_mib_ifRcvAddressEntry_t **ifRcvAddressEntry);

extern if_mib_ifRcvAddressEntry_t *
if_mib_new_ifRcvAddressEntry(void);

extern void
if_mib_get_ifRcvAddressEntry(GNetSnmp *s, if_mib_ifRcvAddressEntry_t **ifRcvAddressEntry, gint32 ifIndex, guchar *ifRcvAddressAddress, guint16 _ifRcvAddressAddressLength, gint64 mask);

extern void
if_mib_set_ifRcvAddressEntry(GNetSnmp *s, if_mib_ifRcvAddressEntry_t *ifRcvAddressEntry, gint64 mask);

extern void
if_mib_free_ifRcvAddressEntry(if_mib_ifRcvAddressEntry_t *ifRcvAddressEntry);

extern void
if_mib_create_ifRcvAddressEntry(GNetSnmp *s, gint32 ifIndex, guchar *ifRcvAddressAddress, guint16 _ifRcvAddressAddressLength);

extern void
if_mib_delete_ifRcvAddressEntry(GNetSnmp *s, gint32 ifIndex, guchar *ifRcvAddressAddress, guint16 _ifRcvAddressAddressLength);

extern void
if_mib_set_ifRcvAddressType(GNetSnmp *s, gint32 ifIndex, guchar *ifRcvAddressAddress, guint16 _ifRcvAddressAddressLength, gint32 ifRcvAddressType);


G_END_DECLS

#endif /* _IF_MIB_H_ */