summaryrefslogtreecommitdiff
path: root/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
blob: 95767e08607c3e4a430b4870e3430b85a2f4500b (plain)
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
/*
 * Note: this file originally auto-generated by mib2c using
 *       version : 1.48 $ of : mfd-top.m2c,v $
 *
 * $Id$
 */
#ifndef IPCIDRROUTETABLE_H
#define IPCIDRROUTETABLE_H

#ifdef __cplusplus
extern          "C" {
#endif


/** @addtogroup misc misc: Miscellaneous routines
 *
 * @{
 */
#include <net-snmp/library/asn1.h>
#include <net-snmp/data_access/route.h>

#include "mibII/route_headers.h"

    /*
     * other required module components 
     */
    /* *INDENT-OFF*  */
config_require(ip-forward-mib/data_access/route)
config_require(ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface)
config_require(ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access)
    /* *INDENT-ON*  */

    /*
     * OID, column number and enum definions for ipCidrRouteTable 
     */
#include "ipCidrRouteTable_constants.h"

    /*
     *********************************************************************
     * function declarations
     */
    void            init_ipCidrRouteTable(void);
    void            shutdown_ipCidrRouteTable(void);

    /*
     *********************************************************************
     * Table declarations
     */
/**********************************************************************
 **********************************************************************
 ***
 *** Table ipCidrRouteTable
 ***
 **********************************************************************
 **********************************************************************/
    /*
     * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
     * Its status is Deprecated.
     * OID: .1.3.6.1.2.1.4.24.4, length: 9
     */
    /*
     *********************************************************************
     * When you register your mib, you get to provide a generic
     * pointer that will be passed back to you for most of the
     * functions calls.
     *
     * TODO:100:r: Review all context structures
     */
    /*
     * TODO:101:o: |-> Review ipCidrRouteTable registration context.
     */
    typedef netsnmp_data_list ipCidrRouteTable_registration;

/**********************************************************************/
    /*
     * TODO:110:r: |-> Review ipCidrRouteTable data context structure.
     * This structure is used to represent the data for ipCidrRouteTable.
     */
    typedef netsnmp_route_entry ipCidrRouteTable_data;


    /*
     *********************************************************************
     * TODO:115:o: |-> Review ipCidrRouteTable undo context.
     * We're just going to use the same data structure for our
     * undo_context. If you want to do something more efficent,
     * define your typedef here.
     */
    typedef ipCidrRouteTable_data ipCidrRouteTable_undo_data;

    /*
     * TODO:120:r: |-> Review ipCidrRouteTable mib index.
     * This structure is used to represent the index for ipCidrRouteTable.
     */
    typedef struct ipCidrRouteTable_mib_index_s {

        /*
         * ipCidrRouteDest(1)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
         */
        uint32_t        ipCidrRouteDest;

        /*
         * ipCidrRouteMask(2)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
         */
        uint32_t        ipCidrRouteMask;

        /*
         * ipCidrRouteTos(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
         */
        long            ipCidrRouteTos;

        /*
         * ipCidrRouteNextHop(4)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
         */
        uint32_t        ipCidrRouteNextHop;


    } ipCidrRouteTable_mib_index;

    /*
     * TODO:121:r: |   |-> Review ipCidrRouteTable max index length.
     * If you KNOW that your indexes will never exceed a certain
     * length, update this macro to that length.
     */
#define MAX_ipCidrRouteTable_IDX_LEN     13


    /*
     *********************************************************************
     * TODO:130:o: |-> Review ipCidrRouteTable Row request (rowreq) context.
     * When your functions are called, you will be passed a
     * ipCidrRouteTable_rowreq_ctx pointer.
     */
    typedef struct ipCidrRouteTable_rowreq_ctx_s {

    /** this must be first for container compare to work */
        netsnmp_index   oid_idx;
        oid             oid_tmp[MAX_ipCidrRouteTable_IDX_LEN];

        ipCidrRouteTable_mib_index tbl_idx;

        ipCidrRouteTable_data *data;
        ipCidrRouteTable_undo_data *undo;
        unsigned int    column_set_flags;       /* flags for set columns */


        /*
         * flags per row. Currently, the first (lower) 8 bits are reserved
         * for the user. See mfd.h for other flags.
         */
        u_int           rowreq_flags;

        /*
         * TODO:131:o: |   |-> Add useful data to ipCidrRouteTable rowreq context.
         */
        u_char          ipCidrRouteStatus;

        /*
         * storage for future expansion
         */
        netsnmp_data_list *ipCidrRouteTable_data_list;

    } ipCidrRouteTable_rowreq_ctx;

    typedef struct ipCidrRouteTable_ref_rowreq_ctx_s {
        ipCidrRouteTable_rowreq_ctx *rowreq_ctx;
    } ipCidrRouteTable_ref_rowreq_ctx;

    /*
     *********************************************************************
     * function prototypes
     */
    int
        ipCidrRouteTable_pre_request(ipCidrRouteTable_registration *
                                     user_context);
    int
        ipCidrRouteTable_post_request(ipCidrRouteTable_registration *
                                      user_context, int rc);

    int
        ipCidrRouteTable_rowreq_ctx_init(ipCidrRouteTable_rowreq_ctx *
                                         rowreq_ctx, void *user_init_ctx);
    void
        ipCidrRouteTable_rowreq_ctx_cleanup(ipCidrRouteTable_rowreq_ctx *
                                            rowreq_ctx);

    ipCidrRouteTable_data *ipCidrRouteTable_allocate_data(void);
    void            ipCidrRouteTable_release_data(ipCidrRouteTable_data *
                                                  data);

    int             ipCidrRouteTable_commit(ipCidrRouteTable_rowreq_ctx *
                                            rowreq_ctx);
    ipCidrRouteTable_rowreq_ctx
        * ipCidrRouteTable_row_find_by_mib_index(ipCidrRouteTable_mib_index
                                                 * mib_idx);

    extern const oid      ipCidrRouteTable_oid[];
    extern const int      ipCidrRouteTable_oid_size;


#include "ipCidrRouteTable_interface.h"
#include "ipCidrRouteTable_data_access.h"
    /*
     *********************************************************************
     * GET function declarations
     */

    /*
     *********************************************************************
     * GET Table declarations
     */
/**********************************************************************
 **********************************************************************
 ***
 *** Table ipCidrRouteTable
 ***
 **********************************************************************
 **********************************************************************/
    /*
     * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
     * Its status is Deprecated.
     * OID: .1.3.6.1.2.1.4.24.4, length: 9
     */
    /*
     * indexes
     */

    int             ipCidrRouteIfIndex_get(ipCidrRouteTable_rowreq_ctx *
                                           rowreq_ctx, long
                                           *ipCidrRouteIfIndex_val_ptr);
    int             ipCidrRouteType_get(ipCidrRouteTable_rowreq_ctx *
                                        rowreq_ctx,
                                        u_long * ipCidrRouteType_val_ptr);
    int             ipCidrRouteProto_get(ipCidrRouteTable_rowreq_ctx *
                                         rowreq_ctx,
                                         u_long *
                                         ipCidrRouteProto_val_ptr);
    int             ipCidrRouteAge_get(ipCidrRouteTable_rowreq_ctx *
                                       rowreq_ctx,
                                       long *ipCidrRouteAge_val_ptr);
    int             ipCidrRouteInfo_get(ipCidrRouteTable_rowreq_ctx *
                                        rowreq_ctx,
                                        oid ** ipCidrRouteInfo_val_ptr_ptr,
                                        size_t
                                        * ipCidrRouteInfo_val_ptr_len_ptr);
    int             ipCidrRouteNextHopAS_get(ipCidrRouteTable_rowreq_ctx *
                                             rowreq_ctx, long
                                             *ipCidrRouteNextHopAS_val_ptr);
    int             ipCidrRouteMetric1_get(ipCidrRouteTable_rowreq_ctx *
                                           rowreq_ctx, long
                                           *ipCidrRouteMetric1_val_ptr);
    int             ipCidrRouteMetric2_get(ipCidrRouteTable_rowreq_ctx *
                                           rowreq_ctx, long
                                           *ipCidrRouteMetric2_val_ptr);
    int             ipCidrRouteMetric3_get(ipCidrRouteTable_rowreq_ctx *
                                           rowreq_ctx, long
                                           *ipCidrRouteMetric3_val_ptr);
    int             ipCidrRouteMetric4_get(ipCidrRouteTable_rowreq_ctx *
                                           rowreq_ctx, long
                                           *ipCidrRouteMetric4_val_ptr);
    int             ipCidrRouteMetric5_get(ipCidrRouteTable_rowreq_ctx *
                                           rowreq_ctx, long
                                           *ipCidrRouteMetric5_val_ptr);
    int             ipCidrRouteStatus_get(ipCidrRouteTable_rowreq_ctx *
                                          rowreq_ctx,
                                          u_long *
                                          ipCidrRouteStatus_val_ptr);


    int
        ipCidrRouteTable_indexes_set_tbl_idx(ipCidrRouteTable_mib_index *
                                             tbl_idx,
                                             u_long ipCidrRouteDest_val,
                                             u_long ipCidrRouteMask_val,
                                             long ipCidrRouteTos_val,
                                             u_long
                                             ipCidrRouteNextHop_val);
    int
        ipCidrRouteTable_indexes_set(ipCidrRouteTable_rowreq_ctx *
                                     rowreq_ctx,
                                     u_long ipCidrRouteDest_val,
                                     u_long ipCidrRouteMask_val,
                                     long ipCidrRouteTos_val,
                                     u_long ipCidrRouteNextHop_val);



    /*
     *********************************************************************
     * SET function declarations
     */

    /*
     *********************************************************************
     * SET Table declarations
     */
/**********************************************************************
 **********************************************************************
 ***
 *** Table ipCidrRouteTable
 ***
 **********************************************************************
 **********************************************************************/
    /*
     * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
     * Its status is Deprecated.
     * OID: .1.3.6.1.2.1.4.24.4, length: 9
     */


    int             ipCidrRouteTable_undo_setup(ipCidrRouteTable_rowreq_ctx
                                                * rowreq_ctx);
    int
        ipCidrRouteTable_undo_cleanup(ipCidrRouteTable_rowreq_ctx *
                                      rowreq_ctx);
    int             ipCidrRouteTable_undo(ipCidrRouteTable_rowreq_ctx *
                                          rowreq_ctx);
    int             ipCidrRouteTable_commit(ipCidrRouteTable_rowreq_ctx *
                                            rowreq_ctx);
    int
        ipCidrRouteTable_undo_commit(ipCidrRouteTable_rowreq_ctx *
                                     rowreq_ctx);


    int
        ipCidrRouteIfIndex_check_value(ipCidrRouteTable_rowreq_ctx *
                                       rowreq_ctx,
                                       long ipCidrRouteIfIndex_val);
    int
        ipCidrRouteIfIndex_undo_setup(ipCidrRouteTable_rowreq_ctx *
                                      rowreq_ctx);
    int             ipCidrRouteIfIndex_set(ipCidrRouteTable_rowreq_ctx *
                                           rowreq_ctx,
                                           long ipCidrRouteIfIndex_val);
    int             ipCidrRouteIfIndex_undo(ipCidrRouteTable_rowreq_ctx *
                                            rowreq_ctx);

    int             ipCidrRouteType_check_value(ipCidrRouteTable_rowreq_ctx
                                                * rowreq_ctx,
                                                u_long
                                                ipCidrRouteType_val);
    int             ipCidrRouteType_undo_setup(ipCidrRouteTable_rowreq_ctx
                                               * rowreq_ctx);
    int             ipCidrRouteType_set(ipCidrRouteTable_rowreq_ctx *
                                        rowreq_ctx,
                                        u_long ipCidrRouteType_val);
    int             ipCidrRouteType_undo(ipCidrRouteTable_rowreq_ctx *
                                         rowreq_ctx);

    int
        ipCidrRouteProto_check_value(ipCidrRouteTable_rowreq_ctx *
                                     rowreq_ctx,
                                     u_long ipCidrRouteProto_val);
    int             ipCidrRouteProto_undo_setup(ipCidrRouteTable_rowreq_ctx
                                                * rowreq_ctx);
    int             ipCidrRouteProto_set(ipCidrRouteTable_rowreq_ctx *
                                         rowreq_ctx,
                                         u_long ipCidrRouteProto_val);
    int             ipCidrRouteProto_undo(ipCidrRouteTable_rowreq_ctx *
                                          rowreq_ctx);

    int             ipCidrRouteAge_check_value(ipCidrRouteTable_rowreq_ctx
                                               * rowreq_ctx,
                                               long ipCidrRouteAge_val);
    int             ipCidrRouteAge_undo_setup(ipCidrRouteTable_rowreq_ctx *
                                              rowreq_ctx);
    int             ipCidrRouteAge_set(ipCidrRouteTable_rowreq_ctx *
                                       rowreq_ctx,
                                       long ipCidrRouteAge_val);
    int             ipCidrRouteAge_undo(ipCidrRouteTable_rowreq_ctx *
                                        rowreq_ctx);

    int             ipCidrRouteInfo_check_value(ipCidrRouteTable_rowreq_ctx
                                                * rowreq_ctx,
                                                oid *
                                                ipCidrRouteInfo_val_ptr,
                                                size_t
                                                ipCidrRouteInfo_val_ptr_len);
    int             ipCidrRouteInfo_undo_setup(ipCidrRouteTable_rowreq_ctx
                                               * rowreq_ctx);
    int             ipCidrRouteInfo_set(ipCidrRouteTable_rowreq_ctx *
                                        rowreq_ctx,
                                        oid * ipCidrRouteInfo_val_ptr,
                                        size_t
                                        ipCidrRouteInfo_val_ptr_len);
    int             ipCidrRouteInfo_undo(ipCidrRouteTable_rowreq_ctx *
                                         rowreq_ctx);

    int
        ipCidrRouteNextHopAS_check_value(ipCidrRouteTable_rowreq_ctx *
                                         rowreq_ctx,
                                         long ipCidrRouteNextHopAS_val);
    int
        ipCidrRouteNextHopAS_undo_setup(ipCidrRouteTable_rowreq_ctx *
                                        rowreq_ctx);
    int             ipCidrRouteNextHopAS_set(ipCidrRouteTable_rowreq_ctx *
                                             rowreq_ctx, long
                                             ipCidrRouteNextHopAS_val);
    int             ipCidrRouteNextHopAS_undo(ipCidrRouteTable_rowreq_ctx *
                                              rowreq_ctx);

    int
        ipCidrRouteMetric1_check_value(ipCidrRouteTable_rowreq_ctx *
                                       rowreq_ctx,
                                       long ipCidrRouteMetric1_val);
    int
        ipCidrRouteMetric1_undo_setup(ipCidrRouteTable_rowreq_ctx *
                                      rowreq_ctx);
    int             ipCidrRouteMetric1_set(ipCidrRouteTable_rowreq_ctx *
                                           rowreq_ctx,
                                           long ipCidrRouteMetric1_val);
    int             ipCidrRouteMetric1_undo(ipCidrRouteTable_rowreq_ctx *
                                            rowreq_ctx);

    int
        ipCidrRouteMetric2_check_value(ipCidrRouteTable_rowreq_ctx *
                                       rowreq_ctx,
                                       long ipCidrRouteMetric2_val);
    int
        ipCidrRouteMetric2_undo_setup(ipCidrRouteTable_rowreq_ctx *
                                      rowreq_ctx);
    int             ipCidrRouteMetric2_set(ipCidrRouteTable_rowreq_ctx *
                                           rowreq_ctx,
                                           long ipCidrRouteMetric2_val);
    int             ipCidrRouteMetric2_undo(ipCidrRouteTable_rowreq_ctx *
                                            rowreq_ctx);

    int
        ipCidrRouteMetric3_check_value(ipCidrRouteTable_rowreq_ctx *
                                       rowreq_ctx,
                                       long ipCidrRouteMetric3_val);
    int
        ipCidrRouteMetric3_undo_setup(ipCidrRouteTable_rowreq_ctx *
                                      rowreq_ctx);
    int             ipCidrRouteMetric3_set(ipCidrRouteTable_rowreq_ctx *
                                           rowreq_ctx,
                                           long ipCidrRouteMetric3_val);
    int             ipCidrRouteMetric3_undo(ipCidrRouteTable_rowreq_ctx *
                                            rowreq_ctx);

    int
        ipCidrRouteMetric4_check_value(ipCidrRouteTable_rowreq_ctx *
                                       rowreq_ctx,
                                       long ipCidrRouteMetric4_val);
    int
        ipCidrRouteMetric4_undo_setup(ipCidrRouteTable_rowreq_ctx *
                                      rowreq_ctx);
    int             ipCidrRouteMetric4_set(ipCidrRouteTable_rowreq_ctx *
                                           rowreq_ctx,
                                           long ipCidrRouteMetric4_val);
    int             ipCidrRouteMetric4_undo(ipCidrRouteTable_rowreq_ctx *
                                            rowreq_ctx);

    int
        ipCidrRouteMetric5_check_value(ipCidrRouteTable_rowreq_ctx *
                                       rowreq_ctx,
                                       long ipCidrRouteMetric5_val);
    int
        ipCidrRouteMetric5_undo_setup(ipCidrRouteTable_rowreq_ctx *
                                      rowreq_ctx);
    int             ipCidrRouteMetric5_set(ipCidrRouteTable_rowreq_ctx *
                                           rowreq_ctx,
                                           long ipCidrRouteMetric5_val);
    int             ipCidrRouteMetric5_undo(ipCidrRouteTable_rowreq_ctx *
                                            rowreq_ctx);

    int
        ipCidrRouteStatus_check_value(ipCidrRouteTable_rowreq_ctx *
                                      rowreq_ctx,
                                      u_long ipCidrRouteStatus_val);
    int
        ipCidrRouteStatus_undo_setup(ipCidrRouteTable_rowreq_ctx *
                                     rowreq_ctx);
    int             ipCidrRouteStatus_set(ipCidrRouteTable_rowreq_ctx *
                                          rowreq_ctx,
                                          u_long ipCidrRouteStatus_val);
    int             ipCidrRouteStatus_undo(ipCidrRouteTable_rowreq_ctx *
                                           rowreq_ctx);


    int
        ipCidrRouteTable_check_dependencies(ipCidrRouteTable_rowreq_ctx *
                                            ctx);


    /*
     * DUMMY markers, ignore
     *
     * TODO:099:x: *************************************************************
     * TODO:199:x: *************************************************************
     * TODO:299:x: *************************************************************
     * TODO:399:x: *************************************************************
     * TODO:499:x: *************************************************************
     */

#ifdef __cplusplus
}
#endif
#endif                          /* IPCIDRROUTETABLE_H */
/**  @} */