1 /*
2  * Note: this file originally auto-generated by mib2c using
3  *       version : 1.48 $ of : mfd-top.m2c,v $
4  *
5  * $Id$
6  */
7 #ifndef INETCIDRROUTETABLE_H
8 #define INETCIDRROUTETABLE_H
9 
10 #ifdef __cplusplus
11 extern          "C" {
12 #endif
13 
14 
15 /** @addtogroup misc misc: Miscellaneous routines
16  *
17  * @{
18  */
19 #include <net-snmp/library/asn1.h>
20 #include <net-snmp/data_access/route.h>
21 
22     /*
23      * other required module components
24      */
25     /* *INDENT-OFF*  */
26 config_require(ip-forward-mib/data_access/route)
27 config_require(ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface)
28 config_require(ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access)
29     /* *INDENT-ON*  */
30 
31     /*
32      * OID, column number and enum definions for inetCidrRouteTable
33      */
34 #include "inetCidrRouteTable_constants.h"
35 
36     /*
37      *********************************************************************
38      * function declarations
39      */
40     void            init_inetCidrRouteTable(void);
41     void            shutdown_inetCidrRouteTable(void);
42 
43     /*
44      *********************************************************************
45      * Table declarations
46      */
47 /**********************************************************************
48  **********************************************************************
49  ***
50  *** Table inetCidrRouteTable
51  ***
52  **********************************************************************
53  **********************************************************************/
54     /*
55      * IP-FORWARD-MIB::inetCidrRouteTable is subid 7 of ipForward.
56      * Its status is Current.
57      * OID: .1.3.6.1.2.1.4.24.7, length: 9
58      */
59     /*
60      *********************************************************************
61      * When you register your mib, you get to provide a generic
62      * pointer that will be passed back to you for most of the
63      * functions calls.
64      *
65      * TODO:100:r: Review all context structures
66      */
67     /*
68      * TODO:101:o: |-> Review inetCidrRouteTable registration context.
69      */
70     typedef netsnmp_data_list inetCidrRouteTable_registration;
71 
72 /**********************************************************************/
73     /*
74      * TODO:110:r: |-> Review inetCidrRouteTable data context structure.
75      * This structure is used to represent the data for inetCidrRouteTable.
76      */
77     typedef netsnmp_route_entry inetCidrRouteTable_data;
78 
79 
80     /*
81      *********************************************************************
82      * TODO:115:o: |-> Review inetCidrRouteTable undo context.
83      * We're just going to use the same data structure for our
84      * undo_context. If you want to do something more efficent,
85      * define your typedef here.
86      */
87     typedef inetCidrRouteTable_data inetCidrRouteTable_undo_data;
88 
89     /*
90      * TODO:120:r: |-> Review inetCidrRouteTable mib index.
91      * This structure is used to represent the index for inetCidrRouteTable.
92      */
93     typedef struct inetCidrRouteTable_mib_index_s {
94 
95         /*
96          * inetCidrRouteDestType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
97          */
98         u_long          inetCidrRouteDestType;
99 
100         /*
101          * inetCidrRouteDest(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
102          */
103         char
104                      inetCidrRouteDest[NETSNMP_ACCESS_ROUTE_ADDR_BUF_SIZE];
105         size_t          inetCidrRouteDest_len;
106 
107         /*
108          * inetCidrRoutePfxLen(3)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
109          */
110         u_long          inetCidrRoutePfxLen;
111 
112         /*
113          * inetCidrRoutePolicy(4)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
114          */
115         oid             inetCidrRoutePolicy[NETSNMP_POLICY_OID_MAX_LEN];
116         size_t          inetCidrRoutePolicy_len;
117 
118         /*
119          * inetCidrRouteNextHopType(5)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
120          */
121         u_long          inetCidrRouteNextHopType;
122 
123         /*
124          * inetCidrRouteNextHop(6)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
125          */
126         char
127                   inetCidrRouteNextHop[NETSNMP_ACCESS_ROUTE_ADDR_BUF_SIZE];
128         size_t          inetCidrRouteNextHop_len;
129 
130 
131     } inetCidrRouteTable_mib_index;
132 
133     /*
134      * TODO:121:r: |   |-> Review inetCidrRouteTable max index length.
135      * If you KNOW that your indexes will never exceed a certain
136      * length, update this macro to that length.
137      *
138      * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
139      * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
140      */
141 #define MAX_inetCidrRouteTable_IDX_LEN (((NETSNMP_ACCESS_ROUTE_ADDR_BUF_SIZE+1)*2)+ 3 + (NETSNMP_POLICY_OID_MAX_LEN + 1))
142 
143 
144     /*
145      *********************************************************************
146      * TODO:130:o: |-> Review inetCidrRouteTable Row request (rowreq) context.
147      * When your functions are called, you will be passed a
148      * inetCidrRouteTable_rowreq_ctx pointer.
149      */
150     typedef struct inetCidrRouteTable_rowreq_ctx_s {
151 
152     /** this must be first for container compare to work */
153         netsnmp_index   oid_idx;
154         oid             oid_tmp[MAX_inetCidrRouteTable_IDX_LEN];
155 
156         inetCidrRouteTable_mib_index tbl_idx;
157 
158         inetCidrRouteTable_data *data;
159         inetCidrRouteTable_undo_data *undo;
160         unsigned int    column_set_flags;       /* flags for set columns */
161 
162 
163         /*
164          * flags per row. Currently, the first (lower) 8 bits are reserved
165          * for the user. See mfd.h for other flags.
166          */
167         u_int           rowreq_flags;
168 
169         /*
170          * TODO:131:o: |   |-> Add useful data to inetCidrRouteTable rowreq context.
171          */
172         u_char          row_status;
173         u_char          row_status_undo;
174 
175         /*
176          * storage for future expansion
177          */
178         netsnmp_data_list *inetCidrRouteTable_data_list;
179 
180     } inetCidrRouteTable_rowreq_ctx;
181 
182     typedef struct inetCidrRouteTable_ref_rowreq_ctx_s {
183         inetCidrRouteTable_rowreq_ctx *rowreq_ctx;
184     } inetCidrRouteTable_ref_rowreq_ctx;
185 
186     /*
187      *********************************************************************
188      * function prototypes
189      */
190     int
191         inetCidrRouteTable_pre_request(inetCidrRouteTable_registration *
192                                        user_context);
193     int
194         inetCidrRouteTable_post_request(inetCidrRouteTable_registration *
195                                         user_context, int rc);
196 
197     int
198         inetCidrRouteTable_rowreq_ctx_init(inetCidrRouteTable_rowreq_ctx *
199                                            rowreq_ctx,
200                                            void *user_init_ctx);
201     void
202         inetCidrRouteTable_rowreq_ctx_cleanup(inetCidrRouteTable_rowreq_ctx
203                                               * rowreq_ctx);
204 
205     inetCidrRouteTable_data *inetCidrRouteTable_allocate_data(void);
206     void            inetCidrRouteTable_release_data(inetCidrRouteTable_data
207                                                     * data);
208 
209     int
210         inetCidrRouteTable_check_dependencies(inetCidrRouteTable_rowreq_ctx
211                                               * rowreq_ctx);
212     int             inetCidrRouteTable_commit(inetCidrRouteTable_rowreq_ctx
213                                               * rowreq_ctx);
214 
215 
216     inetCidrRouteTable_rowreq_ctx
217         * inetCidrRouteTable_row_find_by_mib_index
218         (inetCidrRouteTable_mib_index * mib_idx);
219 
220     extern const oid      inetCidrRouteTable_oid[];
221     extern const int      inetCidrRouteTable_oid_size;
222 
223 
224 #include "inetCidrRouteTable_interface.h"
225 #include "inetCidrRouteTable_data_access.h"
226     /*
227      *********************************************************************
228      * GET function declarations
229      */
230 
231     /*
232      *********************************************************************
233      * GET Table declarations
234      */
235 /**********************************************************************
236  **********************************************************************
237  ***
238  *** Table inetCidrRouteTable
239  ***
240  **********************************************************************
241  **********************************************************************/
242     /*
243      * IP-FORWARD-MIB::inetCidrRouteTable is subid 7 of ipForward.
244      * Its status is Current.
245      * OID: .1.3.6.1.2.1.4.24.7, length: 9
246      */
247     /*
248      * indexes
249      */
250 
251     int             inetCidrRouteIfIndex_get(inetCidrRouteTable_rowreq_ctx
252                                              * rowreq_ctx, long
253                                              *inetCidrRouteIfIndex_val_ptr);
254     int             inetCidrRouteType_get(inetCidrRouteTable_rowreq_ctx *
255                                           rowreq_ctx,
256                                           u_long *
257                                           inetCidrRouteType_val_ptr);
258     int             inetCidrRouteProto_get(inetCidrRouteTable_rowreq_ctx *
259                                            rowreq_ctx,
260                                            u_long *
261                                            inetCidrRouteProto_val_ptr);
262     int             inetCidrRouteAge_get(inetCidrRouteTable_rowreq_ctx *
263                                          rowreq_ctx,
264                                          u_long *
265                                          inetCidrRouteAge_val_ptr);
266     int
267         inetCidrRouteNextHopAS_get(inetCidrRouteTable_rowreq_ctx *
268                                    rowreq_ctx,
269                                    u_long *
270                                    inetCidrRouteNextHopAS_val_ptr);
271     int             inetCidrRouteMetric1_get(inetCidrRouteTable_rowreq_ctx
272                                              * rowreq_ctx, long
273                                              *inetCidrRouteMetric1_val_ptr);
274     int             inetCidrRouteMetric2_get(inetCidrRouteTable_rowreq_ctx
275                                              * rowreq_ctx, long
276                                              *inetCidrRouteMetric2_val_ptr);
277     int             inetCidrRouteMetric3_get(inetCidrRouteTable_rowreq_ctx
278                                              * rowreq_ctx, long
279                                              *inetCidrRouteMetric3_val_ptr);
280     int             inetCidrRouteMetric4_get(inetCidrRouteTable_rowreq_ctx
281                                              * rowreq_ctx, long
282                                              *inetCidrRouteMetric4_val_ptr);
283     int             inetCidrRouteMetric5_get(inetCidrRouteTable_rowreq_ctx
284                                              * rowreq_ctx, long
285                                              *inetCidrRouteMetric5_val_ptr);
286     int             inetCidrRouteStatus_get(inetCidrRouteTable_rowreq_ctx *
287                                             rowreq_ctx,
288                                             u_long *
289                                             inetCidrRouteStatus_val_ptr);
290 
291 
292     int
293         inetCidrRouteTable_indexes_set_tbl_idx(inetCidrRouteTable_mib_index
294                                                * tbl_idx,
295                                                u_long
296                                                inetCidrRouteDestType_val,
297                                                char
298                                                *inetCidrRouteDest_val_ptr,
299                                                size_t
300                                                inetCidrRouteDest_val_ptr_len,
301                                                u_long
302                                                inetCidrRoutePfxLen_val,
303                                                oid *
304                                                inetCidrRoutePolicy_val_ptr,
305                                                size_t
306                                                inetCidrRoutePolicy_val_ptr_len,
307                                                u_long
308                                                inetCidrRouteNextHopType_val,
309                                                char
310                                                *inetCidrRouteNextHop_val_ptr,
311                                                size_t
312                                                inetCidrRouteNextHop_val_ptr_len);
313     int
314         inetCidrRouteTable_indexes_set(inetCidrRouteTable_rowreq_ctx *
315                                        rowreq_ctx,
316                                        u_long inetCidrRouteDestType_val,
317                                        char *inetCidrRouteDest_val_ptr,
318                                        size_t
319                                        inetCidrRouteDest_val_ptr_len,
320                                        u_long inetCidrRoutePfxLen_val,
321                                        oid * inetCidrRoutePolicy_val_ptr,
322                                        size_t
323                                        inetCidrRoutePolicy_val_ptr_len,
324                                        u_long inetCidrRouteNextHopType_val,
325                                        char *inetCidrRouteNextHop_val_ptr,
326                                        size_t
327                                        inetCidrRouteNextHop_val_ptr_len);
328 
329 
330 
331     /*
332      *********************************************************************
333      * SET function declarations
334      */
335 
336     /*
337      *********************************************************************
338      * SET Table declarations
339      */
340 /**********************************************************************
341  **********************************************************************
342  ***
343  *** Table inetCidrRouteTable
344  ***
345  **********************************************************************
346  **********************************************************************/
347     /*
348      * IP-FORWARD-MIB::inetCidrRouteTable is subid 7 of ipForward.
349      * Its status is Current.
350      * OID: .1.3.6.1.2.1.4.24.7, length: 9
351      */
352 
353 
354     int
355         inetCidrRouteTable_undo_setup(inetCidrRouteTable_rowreq_ctx *
356                                       rowreq_ctx);
357     int
358         inetCidrRouteTable_undo_cleanup(inetCidrRouteTable_rowreq_ctx *
359                                         rowreq_ctx);
360     int             inetCidrRouteTable_undo(inetCidrRouteTable_rowreq_ctx *
361                                             rowreq_ctx);
362     int             inetCidrRouteTable_commit(inetCidrRouteTable_rowreq_ctx
363                                               * rowreq_ctx);
364     int
365         inetCidrRouteTable_undo_commit(inetCidrRouteTable_rowreq_ctx *
366                                        rowreq_ctx);
367 
368 
369     int
370         inetCidrRouteIfIndex_check_value(inetCidrRouteTable_rowreq_ctx *
371                                          rowreq_ctx,
372                                          long inetCidrRouteIfIndex_val);
373     int
374         inetCidrRouteIfIndex_undo_setup(inetCidrRouteTable_rowreq_ctx *
375                                         rowreq_ctx);
376     int             inetCidrRouteIfIndex_set(inetCidrRouteTable_rowreq_ctx
377                                              * rowreq_ctx, long
378                                              inetCidrRouteIfIndex_val);
379     int             inetCidrRouteIfIndex_undo(inetCidrRouteTable_rowreq_ctx
380                                               * rowreq_ctx);
381 
382     int
383         inetCidrRouteType_check_value(inetCidrRouteTable_rowreq_ctx *
384                                       rowreq_ctx,
385                                       u_long inetCidrRouteType_val);
386     int
387         inetCidrRouteType_undo_setup(inetCidrRouteTable_rowreq_ctx *
388                                      rowreq_ctx);
389     int             inetCidrRouteType_set(inetCidrRouteTable_rowreq_ctx *
390                                           rowreq_ctx,
391                                           u_long inetCidrRouteType_val);
392     int             inetCidrRouteType_undo(inetCidrRouteTable_rowreq_ctx *
393                                            rowreq_ctx);
394 
395     int
396         inetCidrRouteProto_check_value(inetCidrRouteTable_rowreq_ctx *
397                                        rowreq_ctx,
398                                        u_long inetCidrRouteProto_val);
399     int
400         inetCidrRouteProto_undo_setup(inetCidrRouteTable_rowreq_ctx *
401                                       rowreq_ctx);
402     int             inetCidrRouteProto_set(inetCidrRouteTable_rowreq_ctx *
403                                            rowreq_ctx,
404                                            u_long inetCidrRouteProto_val);
405     int             inetCidrRouteProto_undo(inetCidrRouteTable_rowreq_ctx *
406                                             rowreq_ctx);
407 
408     int
409         inetCidrRouteAge_check_value(inetCidrRouteTable_rowreq_ctx *
410                                      rowreq_ctx,
411                                      u_long inetCidrRouteAge_val);
412     int
413         inetCidrRouteAge_undo_setup(inetCidrRouteTable_rowreq_ctx *
414                                     rowreq_ctx);
415     int             inetCidrRouteAge_set(inetCidrRouteTable_rowreq_ctx *
416                                          rowreq_ctx,
417                                          u_long inetCidrRouteAge_val);
418     int             inetCidrRouteAge_undo(inetCidrRouteTable_rowreq_ctx *
419                                           rowreq_ctx);
420 
421     int
422         inetCidrRouteNextHopAS_check_value(inetCidrRouteTable_rowreq_ctx *
423                                            rowreq_ctx,
424                                            u_long
425                                            inetCidrRouteNextHopAS_val);
426     int
427         inetCidrRouteNextHopAS_undo_setup(inetCidrRouteTable_rowreq_ctx *
428                                           rowreq_ctx);
429     int
430         inetCidrRouteNextHopAS_set(inetCidrRouteTable_rowreq_ctx *
431                                    rowreq_ctx,
432                                    u_long inetCidrRouteNextHopAS_val);
433     int
434         inetCidrRouteNextHopAS_undo(inetCidrRouteTable_rowreq_ctx *
435                                     rowreq_ctx);
436 
437     int
438         inetCidrRouteMetric1_check_value(inetCidrRouteTable_rowreq_ctx *
439                                          rowreq_ctx,
440                                          long inetCidrRouteMetric1_val);
441     int
442         inetCidrRouteMetric1_undo_setup(inetCidrRouteTable_rowreq_ctx *
443                                         rowreq_ctx);
444     int             inetCidrRouteMetric1_set(inetCidrRouteTable_rowreq_ctx
445                                              * rowreq_ctx, long
446                                              inetCidrRouteMetric1_val);
447     int             inetCidrRouteMetric1_undo(inetCidrRouteTable_rowreq_ctx
448                                               * rowreq_ctx);
449 
450     int
451         inetCidrRouteMetric2_check_value(inetCidrRouteTable_rowreq_ctx *
452                                          rowreq_ctx,
453                                          long inetCidrRouteMetric2_val);
454     int
455         inetCidrRouteMetric2_undo_setup(inetCidrRouteTable_rowreq_ctx *
456                                         rowreq_ctx);
457     int             inetCidrRouteMetric2_set(inetCidrRouteTable_rowreq_ctx
458                                              * rowreq_ctx, long
459                                              inetCidrRouteMetric2_val);
460     int             inetCidrRouteMetric2_undo(inetCidrRouteTable_rowreq_ctx
461                                               * rowreq_ctx);
462 
463     int
464         inetCidrRouteMetric3_check_value(inetCidrRouteTable_rowreq_ctx *
465                                          rowreq_ctx,
466                                          long inetCidrRouteMetric3_val);
467     int
468         inetCidrRouteMetric3_undo_setup(inetCidrRouteTable_rowreq_ctx *
469                                         rowreq_ctx);
470     int             inetCidrRouteMetric3_set(inetCidrRouteTable_rowreq_ctx
471                                              * rowreq_ctx, long
472                                              inetCidrRouteMetric3_val);
473     int             inetCidrRouteMetric3_undo(inetCidrRouteTable_rowreq_ctx
474                                               * rowreq_ctx);
475 
476     int
477         inetCidrRouteMetric4_check_value(inetCidrRouteTable_rowreq_ctx *
478                                          rowreq_ctx,
479                                          long inetCidrRouteMetric4_val);
480     int
481         inetCidrRouteMetric4_undo_setup(inetCidrRouteTable_rowreq_ctx *
482                                         rowreq_ctx);
483     int             inetCidrRouteMetric4_set(inetCidrRouteTable_rowreq_ctx
484                                              * rowreq_ctx, long
485                                              inetCidrRouteMetric4_val);
486     int             inetCidrRouteMetric4_undo(inetCidrRouteTable_rowreq_ctx
487                                               * rowreq_ctx);
488 
489     int
490         inetCidrRouteMetric5_check_value(inetCidrRouteTable_rowreq_ctx *
491                                          rowreq_ctx,
492                                          long inetCidrRouteMetric5_val);
493     int
494         inetCidrRouteMetric5_undo_setup(inetCidrRouteTable_rowreq_ctx *
495                                         rowreq_ctx);
496     int             inetCidrRouteMetric5_set(inetCidrRouteTable_rowreq_ctx
497                                              * rowreq_ctx, long
498                                              inetCidrRouteMetric5_val);
499     int             inetCidrRouteMetric5_undo(inetCidrRouteTable_rowreq_ctx
500                                               * rowreq_ctx);
501 
502     int
503         inetCidrRouteStatus_check_value(inetCidrRouteTable_rowreq_ctx *
504                                         rowreq_ctx,
505                                         u_long inetCidrRouteStatus_val);
506     int
507         inetCidrRouteStatus_undo_setup(inetCidrRouteTable_rowreq_ctx *
508                                        rowreq_ctx);
509     int             inetCidrRouteStatus_set(inetCidrRouteTable_rowreq_ctx *
510                                             rowreq_ctx,
511                                             u_long
512                                             inetCidrRouteStatus_val);
513     int             inetCidrRouteStatus_undo(inetCidrRouteTable_rowreq_ctx
514                                              * rowreq_ctx);
515 
516 
517     int
518         inetCidrRouteTable_check_dependencies(inetCidrRouteTable_rowreq_ctx
519                                               * ctx);
520 
521 
522     /*
523      * DUMMY markers, ignore
524      *
525      * TODO:099:x: *************************************************************
526      * TODO:199:x: *************************************************************
527      * TODO:299:x: *************************************************************
528      * TODO:399:x: *************************************************************
529      * TODO:499:x: *************************************************************
530      */
531 
532 #ifdef __cplusplus
533 }
534 #endif
535 #endif                          /* INETCIDRROUTETABLE_H */
536 /**  @} */
537 
538