Debian Codegraph @

agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c

raw
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 /** \page MFD helper for ipCidrRouteTable
8 *
9 * \section intro Introduction
10 * Introductory text.
11 *
12 */
13 /*
14 * standard Net-SNMP includes
15 */
16 #include <net-snmp/net-snmp-config.h>
17 #include <net-snmp/net-snmp-includes.h>
18 #include <net-snmp/agent/net-snmp-agent-includes.h>
19
20 /*
21 * include our parent header
22 */
23 #include "ipCidrRouteTable.h"
24
25 #include <net-snmp/agent/mib_modules.h>
26
27 #include "ipCidrRouteTable_interface.h"
28
29 const oid ipCidrRouteTable_oid[] = { IPCIDRROUTETABLE_OID };
30 const int ipCidrRouteTable_oid_size =
31 OID_LENGTH(ipCidrRouteTable_oid);
32
33 ipCidrRouteTable_registration ipCidrRouteTable_user_context;
34 static ipCidrRouteTable_registration *ipCidrRouteTable_user_context_p;
35
36 void initialize_table_ipCidrRouteTable(void);
37 void shutdown_table_ipCidrRouteTable(void);
38
39
40 /**
41 * Initializes the ipCidrRouteTable module
42 */
43 void
44 init_ipCidrRouteTable(void)
45 {
46 DEBUGMSGTL(("verbose:ipCidrRouteTable:init_ipCidrRouteTable",
47 "called\n"));
48
49 /*
50 * TODO:300:o: Perform ipCidrRouteTable one-time module initialization.
51 */
52
53 /*
54 * here we initialize all the tables we're planning on supporting
55 */
56 if (should_init("ipCidrRouteTable"))
57 initialize_table_ipCidrRouteTable();
58
59 } /* init_ipCidrRouteTable */
60
61 /**
62 * Shut-down the ipCidrRouteTable module (agent is exiting)
63 */
64 void
65 shutdown_ipCidrRouteTable(void)
66 {
67 if (should_init("ipCidrRouteTable"))
68 shutdown_table_ipCidrRouteTable();
69
70 }
71
72 /**
73 * Initialize the table ipCidrRouteTable
74 * (Define its contents and how it's structured)
75 */
76 void
77 initialize_table_ipCidrRouteTable(void)
78 {
79 u_long flags;
80
81 DEBUGMSGTL(("verbose:ipCidrRouteTable:initialize_table_ipCidrRouteTable", "called\n"));
82
83 /*
84 * TODO:301:o: Perform ipCidrRouteTable one-time table initialization.
85 */
86
87 /*
88 * TODO:302:o: |->Initialize ipCidrRouteTable user context
89 * if you'd like to pass in a pointer to some data for this
90 * table, allocate or set it up here.
91 */
92 /*
93 * a netsnmp_data_list is a simple way to store void pointers. A simple
94 * string token is used to add, find or remove pointers.
95 */
96 ipCidrRouteTable_user_context_p
97 = netsnmp_create_data_list("ipCidrRouteTable", NULL, NULL);
98
99 /*
100 * No support for any flags yet, but in the future you would
101 * set any flags here.
102 */
103 flags = 0;
104
105 /*
106 * call interface initialization code
107 */
108 _ipCidrRouteTable_initialize_interface
109 (ipCidrRouteTable_user_context_p, flags);
110 } /* initialize_table_ipCidrRouteTable */
111
112 /**
113 * Shutdown the table ipCidrRouteTable
114 */
115 void
116 shutdown_table_ipCidrRouteTable(void)
117 {
118 /*
119 * call interface shutdown code
120 */
121 _ipCidrRouteTable_shutdown_interface(ipCidrRouteTable_user_context_p);
122 netsnmp_free_all_list_data(ipCidrRouteTable_user_context_p);
123 ipCidrRouteTable_user_context_p = NULL;
124 }
125
126 /**
127 * extra context initialization (eg default values)
128 *
129 * @param rowreq_ctx : row request context
130 * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
131 *
132 * @retval MFD_SUCCESS : no errors
133 * @retval MFD_ERROR : error (context allocate will fail)
134 */
135 int
136 ipCidrRouteTable_rowreq_ctx_init(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
137 void *user_init_ctx)
138 {
139 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_rowreq_ctx_init", "called\n"));
140
141 netsnmp_assert(NULL != rowreq_ctx);
142
143 /*
144 * TODO:210:o: |-> Perform extra ipCidrRouteTable rowreq initialization. (eg DEFVALS)
145 */
146
147
148 return MFD_SUCCESS;
149 } /* ipCidrRouteTable_rowreq_ctx_init */
150
151 /**
152 * extra context cleanup
153 *
154 */
155 void
156 ipCidrRouteTable_rowreq_ctx_cleanup(ipCidrRouteTable_rowreq_ctx *
157 rowreq_ctx)
158 {
159 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_rowreq_ctx_cleanup", "called\n"));
160
161 netsnmp_assert(NULL != rowreq_ctx);
162
163 /*
164 * TODO:211:o: |-> Perform extra ipCidrRouteTable rowreq cleanup.
165 */
166 if (NULL != rowreq_ctx->data) {
167 ipCidrRouteTable_release_data(rowreq_ctx->data);
168 rowreq_ctx->data = NULL;
169 }
170 } /* ipCidrRouteTable_rowreq_ctx_cleanup */
171
172 /**
173 * pre-request callback
174 *
175 * @param user_context
176 *
177 * @retval MFD_SUCCESS : success.
178 * @retval MFD_ERROR : other error
179 */
180 int
181 ipCidrRouteTable_pre_request(ipCidrRouteTable_registration * user_context)
182 {
183 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_pre_request",
184 "called\n"));
185
186 /*
187 * TODO:510:o: Perform ipCidrRouteTable pre-request actions.
188 */
189
190 return MFD_SUCCESS;
191 } /* ipCidrRouteTable_pre_request */
192
193 /**
194 * post-request callback
195 *
196 * Note:
197 * New rows have been inserted into the container, and
198 * deleted rows have been removed from the container and
199 * released.
200 * @param user_context
201 * @param rc : MFD_SUCCESS if all requests succeeded
202 *
203 * @retval MFD_SUCCESS : success.
204 * @retval MFD_ERROR : other error (ignored)
205 */
206 int
207 ipCidrRouteTable_post_request(ipCidrRouteTable_registration * user_context,
208 int rc)
209 {
210 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_post_request",
211 "called\n"));
212
213 /*
214 * TODO:511:o: Perform ipCidrRouteTable post-request actions.
215 */
216
217 /*
218 * check to set if any rows were changed.
219 */
220 if (ipCidrRouteTable_dirty_get()) {
221 /*
222 * check if request was successful. If so, this would be
223 * a good place to save data to its persistent store.
224 */
225 if (MFD_SUCCESS == rc) {
226 /*
227 * save changed rows, if you haven't already
228 */
229 }
230
231 ipCidrRouteTable_dirty_set(0); /* clear table dirty flag */
232 }
233
234 return MFD_SUCCESS;
235 } /* ipCidrRouteTable_post_request */
236
237
238 /**********************************************************************
239 **********************************************************************
240 ***
241 *** Table ipCidrRouteTable
242 ***
243 **********************************************************************
244 **********************************************************************/
245 /*
246 * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
247 * Its status is Deprecated.
248 * OID: .1.3.6.1.2.1.4.24.4, length: 9
249 */
250
251 /*
252 * ---------------------------------------------------------------------
253 * * TODO:200:r: Implement ipCidrRouteTable data context functions.
254 */
255 /*
256 * ipCidrRouteTable_allocate_data
257 *
258 * Purpose: create new ipCidrRouteTable_data.
259 */
260 ipCidrRouteTable_data *
261 ipCidrRouteTable_allocate_data(void)
262 {
263 /*
264 * TODO:201:r: |-> allocate memory for the ipCidrRouteTable data context.
265 */
266 ipCidrRouteTable_data *rtn = netsnmp_access_route_entry_create();
267
268 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_allocate_data",
269 "called\n"));
270
271 if (NULL == rtn) {
272 snmp_log(LOG_ERR, "unable to malloc memory for new "
273 "ipCidrRouteTable_data.\n");
274 }
275
276 return rtn;
277 } /* ipCidrRouteTable_allocate_data */
278
279 /*
280 * ipCidrRouteTable_release_data
281 *
282 * Purpose: release ipCidrRouteTable data.
283 */
284 void
285 ipCidrRouteTable_release_data(ipCidrRouteTable_data * data)
286 {
287 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_release_data",
288 "called\n"));
289
290 /*
291 * TODO:202:r: |-> release memory for the ipCidrRouteTable data context.
292 */
293 netsnmp_access_route_entry_free(data);
294 } /* ipCidrRouteTable_release_data */
295
296
297
298 /**
299 * set mib index(es)
300 *
301 * @param tbl_idx mib index structure
302 * @param ipCidrRouteDest_val
303 * @param ipCidrRouteMask_val
304 * @param ipCidrRouteTos_val
305 * @param ipCidrRouteNextHop_val
306 *
307 * @retval MFD_SUCCESS : success.
308 * @retval MFD_ERROR : other error.
309 *
310 * @remark
311 * This convenience function is useful for setting all the MIB index
312 * components with a single function call. It is assume that the C values
313 * have already been mapped from their native/rawformat to the MIB format.
314 */
315 int
316 ipCidrRouteTable_indexes_set_tbl_idx(ipCidrRouteTable_mib_index * tbl_idx,
317 in_addr_t ipCidrRouteDest_val,
318 in_addr_t ipCidrRouteMask_val,
319 long ipCidrRouteTos_val,
320 in_addr_t ipCidrRouteNextHop_val)
321 {
322 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_indexes_set_tbl_idx", "called\n"));
323
324 /*
325 * ipCidrRouteDest(1)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
326 */
327 tbl_idx->ipCidrRouteDest = ipCidrRouteDest_val;
328
329 /*
330 * ipCidrRouteMask(2)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
331 */
332 tbl_idx->ipCidrRouteMask = ipCidrRouteMask_val;
333
334 /*
335 * ipCidrRouteTos(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
336 */
337 tbl_idx->ipCidrRouteTos = ipCidrRouteTos_val;
338
339 /*
340 * ipCidrRouteNextHop(4)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
341 */
342 tbl_idx->ipCidrRouteNextHop = ipCidrRouteNextHop_val;
343
344
345 return MFD_SUCCESS;
346 } /* ipCidrRouteTable_indexes_set_tbl_idx */
347
348 /**
349 * @internal
350 * set row context indexes
351 *
352 * @param reqreq_ctx the row context that needs updated indexes
353 *
354 * @retval MFD_SUCCESS : success.
355 * @retval MFD_ERROR : other error.
356 *
357 * @remark
358 * This function sets the mib indexs, then updates the oid indexs
359 * from the mib index.
360 */
361 int
362 ipCidrRouteTable_indexes_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
363 in_addr_t ipCidrRouteDest_val,
364 in_addr_t ipCidrRouteMask_val,
365 long ipCidrRouteTos_val,
366 in_addr_t ipCidrRouteNextHop_val)
367 {
368 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_indexes_set",
369 "called\n"));
370
371 if (MFD_SUCCESS !=
372 ipCidrRouteTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
373 ipCidrRouteDest_val,
374 ipCidrRouteMask_val,
375 ipCidrRouteTos_val,
376 ipCidrRouteNextHop_val))
377 return MFD_ERROR;
378
379 /*
380 * convert mib index to oid index
381 */
382 rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
383 if (0 != ipCidrRouteTable_index_to_oid(&rowreq_ctx->oid_idx,
384 &rowreq_ctx->tbl_idx)) {
385 return MFD_ERROR;
386 }
387
388 return MFD_SUCCESS;
389 } /* ipCidrRouteTable_indexes_set */
390
391
392 /*---------------------------------------------------------------------
393 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteIfIndex
394 * ipCidrRouteIfIndex is subid 5 of ipCidrRouteEntry.
395 * Its status is Deprecated, and its access level is Create.
396 * OID: .1.3.6.1.2.1.4.24.4.1.5
397 * Description:
398 The ifIndex value which identifies the local interface
399
400
401 through which the next hop of this route should be
402 reached.
403 *
404 * Attributes:
405 * accessible 1 isscalar 0 enums 0 hasdefval 1
406 * readable 1 iscolumn 1 ranges 0 hashint 0
407 * settable 1
408 * defval: 0
409 *
410 *
411 * Its syntax is INTEGER32 (based on perltype INTEGER32)
412 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
413 */
414 /**
415 * Extract the current value of the ipCidrRouteIfIndex data.
416 *
417 * Set a value using the data context for the row.
418 *
419 * @param rowreq_ctx
420 * Pointer to the row request context.
421 * @param ipCidrRouteIfIndex_val_ptr
422 * Pointer to storage for a long variable
423 *
424 * @retval MFD_SUCCESS : success
425 * @retval MFD_SKIP : skip this node (no value for now)
426 * @retval MFD_ERROR : Any other error
427 */
428 int
429 ipCidrRouteIfIndex_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
430 long *ipCidrRouteIfIndex_val_ptr)
431 {
432 /** we should have a non-NULL pointer */
433 netsnmp_assert(NULL != ipCidrRouteIfIndex_val_ptr);
434
435
436 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_get",
437 "called\n"));
438
439 netsnmp_assert(NULL != rowreq_ctx);
440
441 /*
442 * TODO:231:o: |-> Extract the current value of the ipCidrRouteIfIndex data.
443 * copy (* ipCidrRouteIfIndex_val_ptr ) from rowreq_ctx->data
444 */
445 (*ipCidrRouteIfIndex_val_ptr) = rowreq_ctx->data->if_index;
446
447 return MFD_SUCCESS;
448 } /* ipCidrRouteIfIndex_get */
449
450 /*---------------------------------------------------------------------
451 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteType
452 * ipCidrRouteType is subid 6 of ipCidrRouteEntry.
453 * Its status is Deprecated, and its access level is Create.
454 * OID: .1.3.6.1.2.1.4.24.4.1.6
455 * Description:
456 The type of route. Note that local(3) refers to a
457 route for which the next hop is the final destination;
458 remote(4) refers to a route for which the next hop is
459 not the final destination.
460
461 Routes which do not result in traffic forwarding or
462 rejection should not be displayed even if the
463 implementation keeps them stored internally.
464
465 reject (2) refers to a route which, if matched,
466 discards the message as unreachable. This is used in
467 some protocols as a means of correctly aggregating
468 routes.
469 *
470 * Attributes:
471 * accessible 1 isscalar 0 enums 1 hasdefval 0
472 * readable 1 iscolumn 1 ranges 0 hashint 0
473 * settable 1
474 *
475 * Enum range: 3/8. Values: other(1), reject(2), local(3), remote(4)
476 *
477 * Its syntax is INTEGER (based on perltype INTEGER)
478 * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
479 */
480 /**
481 * Extract the current value of the ipCidrRouteType data.
482 *
483 * Set a value using the data context for the row.
484 *
485 * @param rowreq_ctx
486 * Pointer to the row request context.
487 * @param ipCidrRouteType_val_ptr
488 * Pointer to storage for a long variable
489 *
490 * @retval MFD_SUCCESS : success
491 * @retval MFD_SKIP : skip this node (no value for now)
492 * @retval MFD_ERROR : Any other error
493 */
494 int
495 ipCidrRouteType_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
496 u_long * ipCidrRouteType_val_ptr)
497 {
498 /** we should have a non-NULL pointer */
499 netsnmp_assert(NULL != ipCidrRouteType_val_ptr);
500
501
502 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteType_get",
503 "called\n"));
504
505 netsnmp_assert(NULL != rowreq_ctx);
506
507 /*
508 * TODO:231:o: |-> Extract the current value of the ipCidrRouteType data.
509 * copy (* ipCidrRouteType_val_ptr ) from rowreq_ctx->data
510 */
511 (*ipCidrRouteType_val_ptr) = rowreq_ctx->data->rt_type;
512
513 return MFD_SUCCESS;
514 } /* ipCidrRouteType_get */
515
516 /*---------------------------------------------------------------------
517 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteProto
518 * ipCidrRouteProto is subid 7 of ipCidrRouteEntry.
519 * Its status is Deprecated, and its access level is ReadOnly.
520 * OID: .1.3.6.1.2.1.4.24.4.1.7
521 * Description:
522 The routing mechanism via which this route was learned.
523 Inclusion of values for gateway routing protocols is
524 not intended to imply that hosts should support those
525 protocols.
526 *
527 * Attributes:
528 * accessible 1 isscalar 0 enums 1 hasdefval 0
529 * readable 1 iscolumn 1 ranges 0 hashint 0
530 * settable 0
531 *
532 * Enum range: 11/16. Values: other(1), local(2), netmgmt(3), icmp(4), egp(5), ggp(6), hello(7), rip(8), isIs(9), esIs(10), ciscoIgrp(11), bbnSpfIgp(12), ospf(13), bgp(14), idpr(15), ciscoEigrp(16)
533 *
534 * Its syntax is INTEGER (based on perltype INTEGER)
535 * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
536 */
537 /**
538 * Extract the current value of the ipCidrRouteProto data.
539 *
540 * Set a value using the data context for the row.
541 *
542 * @param rowreq_ctx
543 * Pointer to the row request context.
544 * @param ipCidrRouteProto_val_ptr
545 * Pointer to storage for a long variable
546 *
547 * @retval MFD_SUCCESS : success
548 * @retval MFD_SKIP : skip this node (no value for now)
549 * @retval MFD_ERROR : Any other error
550 */
551 int
552 ipCidrRouteProto_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
553 u_long * ipCidrRouteProto_val_ptr)
554 {
555 /** we should have a non-NULL pointer */
556 netsnmp_assert(NULL != ipCidrRouteProto_val_ptr);
557
558
559 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteProto_get",
560 "called\n"));
561
562 netsnmp_assert(NULL != rowreq_ctx);
563
564 /*
565 * TODO:231:o: |-> Extract the current value of the ipCidrRouteProto data.
566 * copy (* ipCidrRouteProto_val_ptr ) from rowreq_ctx->data
567 */
568 (*ipCidrRouteProto_val_ptr) = rowreq_ctx->data->rt_proto;
569
570 return MFD_SUCCESS;
571 } /* ipCidrRouteProto_get */
572
573 /*---------------------------------------------------------------------
574 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteAge
575 * ipCidrRouteAge is subid 8 of ipCidrRouteEntry.
576 * Its status is Deprecated, and its access level is ReadOnly.
577 * OID: .1.3.6.1.2.1.4.24.4.1.8
578 * Description:
579 The number of seconds since this route was last updated
580 or otherwise determined to be correct. Note that no
581 semantics of `too old' can be implied except through
582 knowledge of the routing protocol by which the route
583 was learned.
584 *
585 * Attributes:
586 * accessible 1 isscalar 0 enums 0 hasdefval 1
587 * readable 1 iscolumn 1 ranges 0 hashint 0
588 * settable 0
589 * defval: 0
590 *
591 *
592 * Its syntax is INTEGER32 (based on perltype INTEGER32)
593 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
594 */
595 /**
596 * Extract the current value of the ipCidrRouteAge data.
597 *
598 * Set a value using the data context for the row.
599 *
600 * @param rowreq_ctx
601 * Pointer to the row request context.
602 * @param ipCidrRouteAge_val_ptr
603 * Pointer to storage for a long variable
604 *
605 * @retval MFD_SUCCESS : success
606 * @retval MFD_SKIP : skip this node (no value for now)
607 * @retval MFD_ERROR : Any other error
608 */
609 int
610 ipCidrRouteAge_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
611 long *ipCidrRouteAge_val_ptr)
612 {
613 /** we should have a non-NULL pointer */
614 netsnmp_assert(NULL != ipCidrRouteAge_val_ptr);
615
616
617 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteAge_get",
618 "called\n"));
619
620 netsnmp_assert(NULL != rowreq_ctx);
621
622 /*
623 * TODO:231:o: |-> Extract the current value of the ipCidrRouteAge data.
624 * copy (* ipCidrRouteAge_val_ptr ) from rowreq_ctx->data
625 */
626 /*
627 * TODO:235:M: |-> Remove log message/SKIP once you've set ipCidrRouteAge data
628 */
629 return MFD_SKIP;
630
631 return MFD_SUCCESS;
632 } /* ipCidrRouteAge_get */
633
634 /*---------------------------------------------------------------------
635 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteInfo
636 * ipCidrRouteInfo is subid 9 of ipCidrRouteEntry.
637 * Its status is Deprecated, and its access level is Create.
638 * OID: .1.3.6.1.2.1.4.24.4.1.9
639 * Description:
640 A reference to MIB definitions specific to the
641 particular routing protocol which is responsible for
642 this route, as determined by the value specified in the
643 route's ipCidrRouteProto value. If this information is
644 not present, its value should be set to the OBJECT
645 IDENTIFIER { 0 0 }, which is a syntactically valid
646 object identifier, and any implementation conforming to
647 ASN.1 and the Basic Encoding Rules must be able to
648 generate and recognize this value.
649 *
650 * Attributes:
651 * accessible 1 isscalar 0 enums 0 hasdefval 0
652 * readable 1 iscolumn 1 ranges 0 hashint 0
653 * settable 1
654 *
655 *
656 * Its syntax is OBJECTID (based on perltype OBJECTID)
657 * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
658 * This data type requires a length. (Max )
659 */
660 /**
661 * Extract the current value of the ipCidrRouteInfo data.
662 *
663 * Set a value using the data context for the row.
664 *
665 * @param rowreq_ctx
666 * Pointer to the row request context.
667 * @param ipCidrRouteInfo_val_ptr_ptr
668 * Pointer to storage for a oid variable
669 * @param ipCidrRouteInfo_val_ptr_len_ptr
670 * Pointer to a size_t. On entry, it will contain the size (in bytes)
671 * pointed to by ipCidrRouteInfo.
672 * On exit, this value should contain the data size (in bytes).
673 *
674 * @retval MFD_SUCCESS : success
675 * @retval MFD_SKIP : skip this node (no value for now)
676 * @retval MFD_ERROR : Any other error
677 *
678 * @note If you need more than (*ipCidrRouteInfo_val_ptr_len_ptr) bytes of memory,
679 * allocate it using malloc() and update ipCidrRouteInfo_val_ptr_ptr.
680 * <b>DO NOT</b> free the previous pointer.
681 * The MFD helper will release the memory you allocate.
682 *
683 * @remark If you call this function yourself, you are responsible
684 * for checking if the pointer changed, and freeing any
685 * previously allocated memory. (Not necessary if you pass
686 * in a pointer to static memory, obviously.)
687 */
688 int
689 ipCidrRouteInfo_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
690 oid ** ipCidrRouteInfo_val_ptr_ptr,
691 size_t * ipCidrRouteInfo_val_ptr_len_ptr)
692 {
693 /** we should have a non-NULL pointer and enough storage */
694 netsnmp_assert((NULL != ipCidrRouteInfo_val_ptr_ptr)
695 && (NULL != *ipCidrRouteInfo_val_ptr_ptr));
696 netsnmp_assert(NULL != ipCidrRouteInfo_val_ptr_len_ptr);
697
698
699 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteInfo_get",
700 "called\n"));
701
702 netsnmp_assert(NULL != rowreq_ctx);
703
704 /*
705 * TODO:231:o: |-> Extract the current value of the ipCidrRouteInfo data.
706 * copy (* ipCidrRouteInfo_val_ptr_ptr ) data and (* ipCidrRouteInfo_val_ptr_len_ptr ) from rowreq_ctx->data
707 */
708 /** nullOidLen is in bytes, so not sizeof(oid) needed */
709 if ((*ipCidrRouteInfo_val_ptr_len_ptr) < (size_t)nullOidLen) {
710 (*ipCidrRouteInfo_val_ptr_ptr) = (oid*)malloc(nullOidLen);
711 if (NULL == (*ipCidrRouteInfo_val_ptr_ptr))
712 return MFD_ERROR;
713 }
714 (*ipCidrRouteInfo_val_ptr_len_ptr) = (size_t)nullOidLen;
715 memcpy((*ipCidrRouteInfo_val_ptr_ptr), nullOid, (size_t)nullOidLen);
716
717 return MFD_SUCCESS;
718 } /* ipCidrRouteInfo_get */
719
720 /*---------------------------------------------------------------------
721 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteNextHopAS
722 * ipCidrRouteNextHopAS is subid 10 of ipCidrRouteEntry.
723 * Its status is Deprecated, and its access level is Create.
724 * OID: .1.3.6.1.2.1.4.24.4.1.10
725 * Description:
726 The Autonomous System Number of the Next Hop. The
727 semantics of this object are determined by the routing-
728 protocol specified in the route's ipCidrRouteProto
729 value. When this object is unknown or not relevant its
730 value should be set to zero.
731 *
732 * Attributes:
733 * accessible 1 isscalar 0 enums 0 hasdefval 1
734 * readable 1 iscolumn 1 ranges 0 hashint 0
735 * settable 1
736 * defval: 0
737 *
738 *
739 * Its syntax is INTEGER32 (based on perltype INTEGER32)
740 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
741 */
742 /**
743 * Extract the current value of the ipCidrRouteNextHopAS data.
744 *
745 * Set a value using the data context for the row.
746 *
747 * @param rowreq_ctx
748 * Pointer to the row request context.
749 * @param ipCidrRouteNextHopAS_val_ptr
750 * Pointer to storage for a long variable
751 *
752 * @retval MFD_SUCCESS : success
753 * @retval MFD_SKIP : skip this node (no value for now)
754 * @retval MFD_ERROR : Any other error
755 */
756 int
757 ipCidrRouteNextHopAS_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
758 long *ipCidrRouteNextHopAS_val_ptr)
759 {
760 /** we should have a non-NULL pointer */
761 netsnmp_assert(NULL != ipCidrRouteNextHopAS_val_ptr);
762
763
764 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHopAS_get",
765 "called\n"));
766
767 netsnmp_assert(NULL != rowreq_ctx);
768
769 /*
770 * TODO:231:o: |-> Extract the current value of the ipCidrRouteNextHopAS data.
771 * copy (* ipCidrRouteNextHopAS_val_ptr ) from rowreq_ctx->data
772 */
773 (*ipCidrRouteNextHopAS_val_ptr) = rowreq_ctx->data->rt_nexthop_as;
774
775 return MFD_SUCCESS;
776 } /* ipCidrRouteNextHopAS_get */
777
778 /*---------------------------------------------------------------------
779 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric1
780 * ipCidrRouteMetric1 is subid 11 of ipCidrRouteEntry.
781 * Its status is Deprecated, and its access level is Create.
782 * OID: .1.3.6.1.2.1.4.24.4.1.11
783 * Description:
784 The primary routing metric for this route. The
785 semantics of this metric are determined by the routing-
786 protocol specified in the route's ipCidrRouteProto
787 value. If this metric is not used, its value should be
788 set to -1.
789 *
790 * Attributes:
791 * accessible 1 isscalar 0 enums 0 hasdefval 1
792 * readable 1 iscolumn 1 ranges 0 hashint 0
793 * settable 1
794 * defval: -1
795 *
796 *
797 * Its syntax is INTEGER32 (based on perltype INTEGER32)
798 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
799 */
800 /**
801 * Extract the current value of the ipCidrRouteMetric1 data.
802 *
803 * Set a value using the data context for the row.
804 *
805 * @param rowreq_ctx
806 * Pointer to the row request context.
807 * @param ipCidrRouteMetric1_val_ptr
808 * Pointer to storage for a long variable
809 *
810 * @retval MFD_SUCCESS : success
811 * @retval MFD_SKIP : skip this node (no value for now)
812 * @retval MFD_ERROR : Any other error
813 */
814 int
815 ipCidrRouteMetric1_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
816 long *ipCidrRouteMetric1_val_ptr)
817 {
818 /** we should have a non-NULL pointer */
819 netsnmp_assert(NULL != ipCidrRouteMetric1_val_ptr);
820
821
822 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric1_get",
823 "called\n"));
824
825 netsnmp_assert(NULL != rowreq_ctx);
826
827 /*
828 * TODO:231:o: |-> Extract the current value of the ipCidrRouteMetric1 data.
829 * copy (* ipCidrRouteMetric1_val_ptr ) from rowreq_ctx->data
830 */
831 (*ipCidrRouteMetric1_val_ptr) = rowreq_ctx->data->rt_metric1;
832
833 return MFD_SUCCESS;
834 } /* ipCidrRouteMetric1_get */
835
836 /*---------------------------------------------------------------------
837 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric2
838 * ipCidrRouteMetric2 is subid 12 of ipCidrRouteEntry.
839 * Its status is Deprecated, and its access level is Create.
840 * OID: .1.3.6.1.2.1.4.24.4.1.12
841 * Description:
842 An alternate routing metric for this route. The
843 semantics of this metric are determined by the routing-
844 protocol specified in the route's ipCidrRouteProto
845 value. If this metric is not used, its value should be
846 set to -1.
847 *
848 * Attributes:
849 * accessible 1 isscalar 0 enums 0 hasdefval 1
850 * readable 1 iscolumn 1 ranges 0 hashint 0
851 * settable 1
852 * defval: -1
853 *
854 *
855 * Its syntax is INTEGER32 (based on perltype INTEGER32)
856 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
857 */
858 /**
859 * Extract the current value of the ipCidrRouteMetric2 data.
860 *
861 * Set a value using the data context for the row.
862 *
863 * @param rowreq_ctx
864 * Pointer to the row request context.
865 * @param ipCidrRouteMetric2_val_ptr
866 * Pointer to storage for a long variable
867 *
868 * @retval MFD_SUCCESS : success
869 * @retval MFD_SKIP : skip this node (no value for now)
870 * @retval MFD_ERROR : Any other error
871 */
872 int
873 ipCidrRouteMetric2_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
874 long *ipCidrRouteMetric2_val_ptr)
875 {
876 /** we should have a non-NULL pointer */
877 netsnmp_assert(NULL != ipCidrRouteMetric2_val_ptr);
878
879
880 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric2_get",
881 "called\n"));
882
883 netsnmp_assert(NULL != rowreq_ctx);
884
885 /*
886 * TODO:231:o: |-> Extract the current value of the ipCidrRouteMetric2 data.
887 * copy (* ipCidrRouteMetric2_val_ptr ) from rowreq_ctx->data
888 */
889 (*ipCidrRouteMetric2_val_ptr) = rowreq_ctx->data->rt_metric2;
890
891 return MFD_SUCCESS;
892 } /* ipCidrRouteMetric2_get */
893
894 /*---------------------------------------------------------------------
895 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric3
896 * ipCidrRouteMetric3 is subid 13 of ipCidrRouteEntry.
897 * Its status is Deprecated, and its access level is Create.
898 * OID: .1.3.6.1.2.1.4.24.4.1.13
899 * Description:
900 An alternate routing metric for this route. The
901 semantics of this metric are determined by the routing-
902 protocol specified in the route's ipCidrRouteProto
903 value. If this metric is not used, its value should be
904 set to -1.
905 *
906 * Attributes:
907 * accessible 1 isscalar 0 enums 0 hasdefval 1
908 * readable 1 iscolumn 1 ranges 0 hashint 0
909 * settable 1
910 * defval: -1
911 *
912 *
913 * Its syntax is INTEGER32 (based on perltype INTEGER32)
914 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
915 */
916 /**
917 * Extract the current value of the ipCidrRouteMetric3 data.
918 *
919 * Set a value using the data context for the row.
920 *
921 * @param rowreq_ctx
922 * Pointer to the row request context.
923 * @param ipCidrRouteMetric3_val_ptr
924 * Pointer to storage for a long variable
925 *
926 * @retval MFD_SUCCESS : success
927 * @retval MFD_SKIP : skip this node (no value for now)
928 * @retval MFD_ERROR : Any other error
929 */
930 int
931 ipCidrRouteMetric3_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
932 long *ipCidrRouteMetric3_val_ptr)
933 {
934 /** we should have a non-NULL pointer */
935 netsnmp_assert(NULL != ipCidrRouteMetric3_val_ptr);
936
937
938 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric3_get",
939 "called\n"));
940
941 netsnmp_assert(NULL != rowreq_ctx);
942
943 /*
944 * TODO:231:o: |-> Extract the current value of the ipCidrRouteMetric3 data.
945 * copy (* ipCidrRouteMetric3_val_ptr ) from rowreq_ctx->data
946 */
947 (*ipCidrRouteMetric3_val_ptr) = rowreq_ctx->data->rt_metric3;
948
949 return MFD_SUCCESS;
950 } /* ipCidrRouteMetric3_get */
951
952 /*---------------------------------------------------------------------
953 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric4
954 * ipCidrRouteMetric4 is subid 14 of ipCidrRouteEntry.
955 * Its status is Deprecated, and its access level is Create.
956 * OID: .1.3.6.1.2.1.4.24.4.1.14
957 * Description:
958 An alternate routing metric for this route. The
959 semantics of this metric are determined by the routing-
960 protocol specified in the route's ipCidrRouteProto
961 value. If this metric is not used, its value should be
962 set to -1.
963 *
964 * Attributes:
965 * accessible 1 isscalar 0 enums 0 hasdefval 1
966 * readable 1 iscolumn 1 ranges 0 hashint 0
967 * settable 1
968 * defval: -1
969 *
970 *
971 * Its syntax is INTEGER32 (based on perltype INTEGER32)
972 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
973 */
974 /**
975 * Extract the current value of the ipCidrRouteMetric4 data.
976 *
977 * Set a value using the data context for the row.
978 *
979 * @param rowreq_ctx
980 * Pointer to the row request context.
981 * @param ipCidrRouteMetric4_val_ptr
982 * Pointer to storage for a long variable
983 *
984 * @retval MFD_SUCCESS : success
985 * @retval MFD_SKIP : skip this node (no value for now)
986 * @retval MFD_ERROR : Any other error
987 */
988 int
989 ipCidrRouteMetric4_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
990 long *ipCidrRouteMetric4_val_ptr)
991 {
992 /** we should have a non-NULL pointer */
993 netsnmp_assert(NULL != ipCidrRouteMetric4_val_ptr);
994
995
996 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric4_get",
997 "called\n"));
998
999 netsnmp_assert(NULL != rowreq_ctx);
1000
1001 /*
1002 * TODO:231:o: |-> Extract the current value of the ipCidrRouteMetric4 data.
1003 * copy (* ipCidrRouteMetric4_val_ptr ) from rowreq_ctx->data
1004 */
1005 (*ipCidrRouteMetric4_val_ptr) = rowreq_ctx->data->rt_metric4;
1006
1007 return MFD_SUCCESS;
1008 } /* ipCidrRouteMetric4_get */
1009
1010 /*---------------------------------------------------------------------
1011 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric5
1012 * ipCidrRouteMetric5 is subid 15 of ipCidrRouteEntry.
1013 * Its status is Deprecated, and its access level is Create.
1014 * OID: .1.3.6.1.2.1.4.24.4.1.15
1015 * Description:
1016 An alternate routing metric for this route. The
1017 semantics of this metric are determined by the routing-
1018
1019
1020 protocol specified in the route's ipCidrRouteProto
1021 value. If this metric is not used, its value should be
1022 set to -1.
1023 *
1024 * Attributes:
1025 * accessible 1 isscalar 0 enums 0 hasdefval 1
1026 * readable 1 iscolumn 1 ranges 0 hashint 0
1027 * settable 1
1028 * defval: -1
1029 *
1030 *
1031 * Its syntax is INTEGER32 (based on perltype INTEGER32)
1032 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
1033 */
1034 /**
1035 * Extract the current value of the ipCidrRouteMetric5 data.
1036 *
1037 * Set a value using the data context for the row.
1038 *
1039 * @param rowreq_ctx
1040 * Pointer to the row request context.
1041 * @param ipCidrRouteMetric5_val_ptr
1042 * Pointer to storage for a long variable
1043 *
1044 * @retval MFD_SUCCESS : success
1045 * @retval MFD_SKIP : skip this node (no value for now)
1046 * @retval MFD_ERROR : Any other error
1047 */
1048 int
1049 ipCidrRouteMetric5_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
1050 long *ipCidrRouteMetric5_val_ptr)
1051 {
1052 /** we should have a non-NULL pointer */
1053 netsnmp_assert(NULL != ipCidrRouteMetric5_val_ptr);
1054
1055
1056 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric5_get",
1057 "called\n"));
1058
1059 netsnmp_assert(NULL != rowreq_ctx);
1060
1061 /*
1062 * TODO:231:o: |-> Extract the current value of the ipCidrRouteMetric5 data.
1063 * copy (* ipCidrRouteMetric5_val_ptr ) from rowreq_ctx->data
1064 */
1065 (*ipCidrRouteMetric5_val_ptr) = rowreq_ctx->data->rt_metric5;
1066
1067 return MFD_SUCCESS;
1068 } /* ipCidrRouteMetric5_get */
1069
1070 /*---------------------------------------------------------------------
1071 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteStatus
1072 * ipCidrRouteStatus is subid 16 of ipCidrRouteEntry.
1073 * Its status is Deprecated, and its access level is Create.
1074 * OID: .1.3.6.1.2.1.4.24.4.1.16
1075 * Description:
1076 The row status variable, used according to row
1077 installation and removal conventions.
1078 *
1079 * Attributes:
1080 * accessible 1 isscalar 0 enums 1 hasdefval 0
1081 * readable 1 iscolumn 1 ranges 0 hashint 0
1082 * settable 1
1083 *
1084 * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
1085 *
1086 * Its syntax is RowStatus (based on perltype INTEGER)
1087 * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
1088 */
1089 /**
1090 * Extract the current value of the ipCidrRouteStatus data.
1091 *
1092 * Set a value using the data context for the row.
1093 *
1094 * @param rowreq_ctx
1095 * Pointer to the row request context.
1096 * @param ipCidrRouteStatus_val_ptr
1097 * Pointer to storage for a long variable
1098 *
1099 * @retval MFD_SUCCESS : success
1100 * @retval MFD_SKIP : skip this node (no value for now)
1101 * @retval MFD_ERROR : Any other error
1102 */
1103 int
1104 ipCidrRouteStatus_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
1105 u_long * ipCidrRouteStatus_val_ptr)
1106 {
1107 /** we should have a non-NULL pointer */
1108 netsnmp_assert(NULL != ipCidrRouteStatus_val_ptr);
1109
1110 (*ipCidrRouteStatus_val_ptr) = rowreq_ctx->ipCidrRouteStatus;
1111
1112 return MFD_SUCCESS;
1113 } /* ipCidrRouteStatus_get */
1114
1115
1116
1117 /** @} */
1118 /**********************************************************************
1119 **********************************************************************
1120 ***
1121 *** Table ipCidrRouteTable
1122 ***
1123 **********************************************************************
1124 **********************************************************************/
1125 /*
1126 * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
1127 * Its status is Deprecated.
1128 * OID: .1.3.6.1.2.1.4.24.4, length: 9
1129 */
1130 /*
1131 * NOTE: if you update this chart, please update the versions in
1132 * local/mib2c-conf.d/parent-set.m2i
1133 * agent/mibgroup/helpers/baby_steps.c
1134 * while you're at it.
1135 */
1136 /*
1137 ***********************************************************************
1138 * Baby Steps Flow Chart (2004.06.05) *
1139 * *
1140 * +--------------+ +================+ U = unconditional path *
1141 * |optional state| ||required state|| S = path for success *
1142 * +--------------+ +================+ E = path for error *
1143 ***********************************************************************
1144 *
1145 * +--------------+
1146 * | pre |
1147 * | request |
1148 * +--------------+
1149 * | U
1150 * +-------------+ +==============+
1151 * | row |f|<-------|| object ||
1152 * | create |1| E || lookup ||
1153 * +-------------+ +==============+
1154 * E | | S | S
1155 * | +------------------>|
1156 * | +==============+
1157 * | E || check ||
1158 * |<---------------|| values ||
1159 * | +==============+
1160 * | | S
1161 * | +==============+
1162 * | +<-------|| undo ||
1163 * | | E || setup ||
1164 * | | +==============+
1165 * | | | S
1166 * | | +==============+
1167 * | | || set ||-------------------------->+
1168 * | | || value || E |
1169 * | | +==============+ |
1170 * | | | S |
1171 * | | +--------------+ |
1172 * | | | check |-------------------------->|
1173 * | | | consistency | E |
1174 * | | +--------------+ |
1175 * | | | S |
1176 * | | +==============+ +==============+ |
1177 * | | || commit ||-------->|| undo || |
1178 * | | || || E || commit || |
1179 * | | +==============+ +==============+ |
1180 * | | | S U |<--------+
1181 * | | +--------------+ +==============+
1182 * | | | irreversible | || undo ||
1183 * | | | commit | || set ||
1184 * | | +--------------+ +==============+
1185 * | | | U U |
1186 * | +-------------->|<------------------------+
1187 * | +==============+
1188 * | || undo ||
1189 * | || cleanup ||
1190 * | +==============+
1191 * +---------------------->| U
1192 * |
1193 * (err && f1)------------------->+
1194 * | |
1195 * +--------------+ +--------------+
1196 * | post |<--------| row |
1197 * | request | U | release |
1198 * +--------------+ +--------------+
1199 *
1200 */
1201
1202 /**
1203 * Setup up context with information needed to undo a set request.
1204 *
1205 * This function will be called before the individual node undo setup
1206 * functions are called. If you need to do any undo setup that is not
1207 * related to a specific column, you can do it here.
1208 *
1209 * Note that the undo context has been allocated with
1210 * ipCidrRouteTable_allocate_data(), but may need extra
1211 * initialization similar to what you may have done in
1212 * ipCidrRouteTable_rowreq_ctx_init().
1213 * Note that an individual node's undo_setup function will only be called
1214 * if that node is being set to a new value.
1215 *
1216 * If there is any setup specific to a particular column (e.g. allocating
1217 * memory for a string), you should do that setup in the node's undo_setup
1218 * function, so it won't be done unless it is necessary.
1219 *
1220 * @param rowreq_ctx
1221 * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
1222 *
1223 * @retval MFD_SUCCESS : success
1224 * @retval MFD_ERROR : error. set will fail.
1225 */
1226 int
1227 ipCidrRouteTable_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
1228 {
1229 int rc = MFD_SUCCESS;
1230
1231 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_undo_setup",
1232 "called\n"));
1233
1234 /** we should have a non-NULL pointer */
1235 netsnmp_assert(NULL != rowreq_ctx);
1236
1237 /*
1238 * TODO:451:M: |-> Setup ipCidrRouteTable undo.
1239 * set up ipCidrRouteTable undo information, in preparation for a set.
1240 * Undo storage is in (* ipCidrRouteStatus_val_ptr )*
1241 */
1242
1243 return rc;
1244 } /* ipCidrRouteTable_undo_setup */
1245
1246 /**
1247 * Undo a set request.
1248 *
1249 * This function will be called before the individual node undo
1250 * functions are called. If you need to do any undo that is not
1251 * related to a specific column, you can do it here.
1252 *
1253 * Note that an individual node's undo function will only be called
1254 * if that node is being set to a new value.
1255 *
1256 * If there is anything specific to a particular column (e.g. releasing
1257 * memory for a string), you should do that setup in the node's undo
1258 * function, so it won't be done unless it is necessary.
1259 *
1260 * @param rowreq_ctx
1261 * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
1262 *
1263 * @retval MFD_SUCCESS : success
1264 * @retval MFD_ERROR : error. set will fail.
1265 */
1266 int
1267 ipCidrRouteTable_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
1268 {
1269 int rc = MFD_SUCCESS;
1270
1271 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_undo",
1272 "called\n"));
1273
1274 /** we should have a non-NULL pointer */
1275 netsnmp_assert(NULL != rowreq_ctx);
1276
1277 /*
1278 * TODO:451:M: |-> ipCidrRouteTable undo.
1279 * ipCidrRouteTable undo information, in response to a failed set.
1280 * Undo storage is in (* ipCidrRouteStatus_val_ptr )*
1281 */
1282
1283 return rc;
1284 } /* ipCidrRouteTable_undo_setup */
1285
1286 /**
1287 * Cleanup up context undo information.
1288 *
1289 * This function will be called after set/commit processing. If you
1290 * allocated any resources in undo_setup, this is the place to release
1291 * those resources.
1292 *
1293 * This function is called regardless of the success or failure of the set
1294 * request. If you need to perform different steps for cleanup depending
1295 * on success or failure, you can add a flag to the rowreq_ctx.
1296 *
1297 * @param rowreq_ctx
1298 * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
1299 *
1300 * @retval MFD_SUCCESS : success
1301 * @retval MFD_ERROR : error
1302 */
1303 int
1304 ipCidrRouteTable_undo_cleanup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
1305 {
1306 int rc = MFD_SUCCESS;
1307
1308 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_undo_cleanup",
1309 "called\n"));
1310
1311 /** we should have a non-NULL pointer */
1312 netsnmp_assert(NULL != rowreq_ctx);
1313
1314 /*
1315 * TODO:452:M: |-> Cleanup ipCidrRouteTable undo.
1316 * Undo storage is in (* ipCidrRouteStatus_val_ptr )*
1317 */
1318
1319 return rc;
1320 } /* ipCidrRouteTable_undo_cleanup */
1321
1322 /**
1323 * commit new values.
1324 *
1325 * At this point, you should have done everything you can to ensure that
1326 * this commit will not fail.
1327 *
1328 * Should you need different behavior depending on which columns were
1329 * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
1330 * set. The definitions for the COLUMN_*_FLAG bits can be found in
1331 * ipCidrRouteTable.h.
1332 * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
1333 *
1334 * @param rowreq_ctx
1335 * Pointer to the users context.
1336 *
1337 * @retval MFD_SUCCESS : success
1338 * @retval MFD_ERROR : error
1339 */
1340 int
1341 ipCidrRouteTable_commit(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
1342 {
1343 int rc = MFD_SUCCESS;
1344 int save_flags;
1345
1346 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_commit",
1347 "called\n"));
1348
1349 /** we should have a non-NULL pointer */
1350 netsnmp_assert(NULL != rowreq_ctx);
1351
1352 /*
1353 * save flags, then clear until we actually do something
1354 */
1355 save_flags = rowreq_ctx->column_set_flags;
1356 rowreq_ctx->column_set_flags = 0;
1357
1358 /*
1359 * commit ipCidrRouteTable data
1360 * 1) check the column's flag in save_flags to see if it was set.
1361 * 2) clear the flag when you handle that column
1362 * 3) set the column's flag in column_set_flags if it needs undo
1363 * processing in case of a failure.
1364 */
1365 if (save_flags & COLUMN_IPCIDRROUTEIFINDEX_FLAG) {
1366 save_flags &= ~COLUMN_IPCIDRROUTEIFINDEX_FLAG; /* clear ipCidrRouteIfIndex */
1367 /*
1368 * TODO:482:o: |-> commit column ipCidrRouteIfIndex.
1369 */
1370 rc = -1;
1371 if (-1 == rc) {
1372 snmp_log(LOG_ERR,
1373 "ipCidrRouteTable column ipCidrRouteIfIndex commit failed\n");
1374 } else {
1375 /*
1376 * set flag, in case we need to undo ipCidrRouteIfIndex
1377 */
1378 rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEIFINDEX_FLAG;
1379 }
1380 }
1381
1382 if (save_flags & COLUMN_IPCIDRROUTETYPE_FLAG) {
1383 save_flags &= ~COLUMN_IPCIDRROUTETYPE_FLAG; /* clear ipCidrRouteType */
1384 /*
1385 * TODO:482:o: |-> commit column ipCidrRouteType.
1386 */
1387 rc = -1;
1388 if (-1 == rc) {
1389 snmp_log(LOG_ERR,
1390 "ipCidrRouteTable column ipCidrRouteType commit failed\n");
1391 } else {
1392 /*
1393 * set flag, in case we need to undo ipCidrRouteType
1394 */
1395 rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTETYPE_FLAG;
1396 }
1397 }
1398
1399 if (save_flags & COLUMN_IPCIDRROUTEINFO_FLAG) {
1400 save_flags &= ~COLUMN_IPCIDRROUTEINFO_FLAG; /* clear ipCidrRouteInfo */
1401 /*
1402 * TODO:482:o: |-> commit column ipCidrRouteInfo.
1403 */
1404 rc = -1;
1405 if (-1 == rc) {
1406 snmp_log(LOG_ERR,
1407 "ipCidrRouteTable column ipCidrRouteInfo commit failed\n");
1408 } else {
1409 /*
1410 * set flag, in case we need to undo ipCidrRouteInfo
1411 */
1412 rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEINFO_FLAG;
1413 }
1414 }
1415
1416 if (save_flags & COLUMN_IPCIDRROUTENEXTHOPAS_FLAG) {
1417 save_flags &= ~COLUMN_IPCIDRROUTENEXTHOPAS_FLAG; /* clear ipCidrRouteNextHopAS */
1418 /*
1419 * TODO:482:o: |-> commit column ipCidrRouteNextHopAS.
1420 */
1421 rc = -1;
1422 if (-1 == rc) {
1423 snmp_log(LOG_ERR,
1424 "ipCidrRouteTable column ipCidrRouteNextHopAS commit failed\n");
1425 } else {
1426 /*
1427 * set flag, in case we need to undo ipCidrRouteNextHopAS
1428 */
1429 rowreq_ctx->column_set_flags |=
1430 COLUMN_IPCIDRROUTENEXTHOPAS_FLAG;
1431 }
1432 }
1433
1434 if (save_flags & COLUMN_IPCIDRROUTEMETRIC1_FLAG) {
1435 save_flags &= ~COLUMN_IPCIDRROUTEMETRIC1_FLAG; /* clear ipCidrRouteMetric1 */
1436 /*
1437 * TODO:482:o: |-> commit column ipCidrRouteMetric1.
1438 */
1439 rc = -1;
1440 if (-1 == rc) {
1441 snmp_log(LOG_ERR,
1442 "ipCidrRouteTable column ipCidrRouteMetric1 commit failed\n");
1443 } else {
1444 /*
1445 * set flag, in case we need to undo ipCidrRouteMetric1
1446 */
1447 rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC1_FLAG;
1448 }
1449 }
1450
1451 if (save_flags & COLUMN_IPCIDRROUTEMETRIC2_FLAG) {
1452 save_flags &= ~COLUMN_IPCIDRROUTEMETRIC2_FLAG; /* clear ipCidrRouteMetric2 */
1453 /*
1454 * TODO:482:o: |-> commit column ipCidrRouteMetric2.
1455 */
1456 rc = -1;
1457 if (-1 == rc) {
1458 snmp_log(LOG_ERR,
1459 "ipCidrRouteTable column ipCidrRouteMetric2 commit failed\n");
1460 } else {
1461 /*
1462 * set flag, in case we need to undo ipCidrRouteMetric2
1463 */
1464 rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC2_FLAG;
1465 }
1466 }
1467
1468 if (save_flags & COLUMN_IPCIDRROUTEMETRIC3_FLAG) {
1469 save_flags &= ~COLUMN_IPCIDRROUTEMETRIC3_FLAG; /* clear ipCidrRouteMetric3 */
1470 /*
1471 * TODO:482:o: |-> commit column ipCidrRouteMetric3.
1472 */
1473 rc = -1;
1474 if (-1 == rc) {
1475 snmp_log(LOG_ERR,
1476 "ipCidrRouteTable column ipCidrRouteMetric3 commit failed\n");
1477 } else {
1478 /*
1479 * set flag, in case we need to undo ipCidrRouteMetric3
1480 */
1481 rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC3_FLAG;
1482 }
1483 }
1484
1485 if (save_flags & COLUMN_IPCIDRROUTEMETRIC4_FLAG) {
1486 save_flags &= ~COLUMN_IPCIDRROUTEMETRIC4_FLAG; /* clear ipCidrRouteMetric4 */
1487 /*
1488 * TODO:482:o: |-> commit column ipCidrRouteMetric4.
1489 */
1490 rc = -1;
1491 if (-1 == rc) {
1492 snmp_log(LOG_ERR,
1493 "ipCidrRouteTable column ipCidrRouteMetric4 commit failed\n");
1494 } else {
1495 /*
1496 * set flag, in case we need to undo ipCidrRouteMetric4
1497 */
1498 rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC4_FLAG;
1499 }
1500 }
1501
1502 if (save_flags & COLUMN_IPCIDRROUTEMETRIC5_FLAG) {
1503 save_flags &= ~COLUMN_IPCIDRROUTEMETRIC5_FLAG; /* clear ipCidrRouteMetric5 */
1504 /*
1505 * TODO:482:o: |-> commit column ipCidrRouteMetric5.
1506 */
1507 rc = -1;
1508 if (-1 == rc) {
1509 snmp_log(LOG_ERR,
1510 "ipCidrRouteTable column ipCidrRouteMetric5 commit failed\n");
1511 } else {
1512 /*
1513 * set flag, in case we need to undo ipCidrRouteMetric5
1514 */
1515 rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC5_FLAG;
1516 }
1517 }
1518
1519 if (save_flags & COLUMN_IPCIDRROUTESTATUS_FLAG) {
1520 save_flags &= ~COLUMN_IPCIDRROUTESTATUS_FLAG; /* clear ipCidrRouteStatus */
1521 /*
1522 * TODO:482:o: |-> commit column ipCidrRouteStatus.
1523 */
1524 rc = -1;
1525 if (-1 == rc) {
1526 snmp_log(LOG_ERR,
1527 "ipCidrRouteTable column ipCidrRouteStatus commit failed\n");
1528 } else {
1529 /*
1530 * set flag, in case we need to undo ipCidrRouteStatus
1531 */
1532 rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTESTATUS_FLAG;
1533 }
1534 }
1535
1536 /*
1537 * if we successfully committed this row, set the dirty flag.
1538 */
1539 if (MFD_SUCCESS == rc) {
1540 rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
1541 }
1542
1543 if (save_flags) {
1544 snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
1545 save_flags);
1546 return MFD_ERROR;
1547 }
1548
1549 return rc;
1550 } /* ipCidrRouteTable_commit */
1551
1552 /**
1553 * undo commit new values.
1554 *
1555 * Should you need different behavior depending on which columns were
1556 * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
1557 * set. The definitions for the COLUMN_*_FLAG bits can be found in
1558 * ipCidrRouteTable.h.
1559 * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
1560 *
1561 * @param rowreq_ctx
1562 * Pointer to the users context.
1563 *
1564 * @retval MFD_SUCCESS : success
1565 * @retval MFD_ERROR : error
1566 */
1567 int
1568 ipCidrRouteTable_undo_commit(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
1569 {
1570 int rc = MFD_SUCCESS;
1571
1572 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_undo_commit",
1573 "called\n"));
1574
1575 /** we should have a non-NULL pointer */
1576 netsnmp_assert(NULL != rowreq_ctx);
1577
1578 /*
1579 * TODO:485:M: |-> Undo ipCidrRouteTable commit.
1580 * check the column's flag in rowreq_ctx->column_set_flags to see
1581 * if it was set during commit, then undo it.
1582 *
1583 * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
1584 */
1585
1586
1587 /*
1588 * if we successfully un-committed this row, clear the dirty flag.
1589 */
1590 if (MFD_SUCCESS == rc) {
1591 rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
1592 }
1593
1594 return rc;
1595 } /* ipCidrRouteTable_undo_commit */
1596
1597 /*
1598 * TODO:440:M: Implement ipCidrRouteTable node value checks.
1599 * TODO:450:M: Implement ipCidrRouteTable undo functions.
1600 * TODO:460:M: Implement ipCidrRouteTable set functions.
1601 * TODO:480:M: Implement ipCidrRouteTable commit functions.
1602 */
1603 /*---------------------------------------------------------------------
1604 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteIfIndex
1605 * ipCidrRouteIfIndex is subid 5 of ipCidrRouteEntry.
1606 * Its status is Deprecated, and its access level is Create.
1607 * OID: .1.3.6.1.2.1.4.24.4.1.5
1608 * Description:
1609 The ifIndex value which identifies the local interface
1610
1611
1612 through which the next hop of this route should be
1613 reached.
1614 *
1615 * Attributes:
1616 * accessible 1 isscalar 0 enums 0 hasdefval 1
1617 * readable 1 iscolumn 1 ranges 0 hashint 0
1618 * settable 1
1619 * defval: 0
1620 *
1621 *
1622 * Its syntax is INTEGER32 (based on perltype INTEGER32)
1623 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
1624 */
1625 /**
1626 * Check that the proposed new value is potentially valid.
1627 *
1628 * @param rowreq_ctx
1629 * Pointer to the row request context.
1630 * @param ipCidrRouteIfIndex_val
1631 * A long containing the new value.
1632 *
1633 * @retval MFD_SUCCESS : incoming value is legal
1634 * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
1635 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
1636 *
1637 * This is the place to check for requirements that are not
1638 * expressed in the mib syntax (for example, a requirement that
1639 * is detailed in the description for an object).
1640 *
1641 * You should check that the requested change between the undo value and the
1642 * new value is legal (ie, the transistion from one value to another
1643 * is legal).
1644 *
1645 *@note
1646 * This check is only to determine if the new value
1647 * is \b potentially valid. This is the first check of many, and
1648 * is one of the simplest ones.
1649 *
1650 *@note
1651 * this is not the place to do any checks for values
1652 * which depend on some other value in the mib. Those
1653 * types of checks should be done in the
1654 * ipCidrRouteTable_check_dependencies() function.
1655 *
1656 * The following checks have already been done for you:
1657 * The syntax is ASN_INTEGER
1658 *
1659 * If there a no other checks you need to do, simply return MFD_SUCCESS.
1660 *
1661 */
1662 int
1663 ipCidrRouteIfIndex_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
1664 long ipCidrRouteIfIndex_val)
1665 {
1666 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_check_value",
1667 "called\n"));
1668
1669 /** should never get a NULL pointer */
1670 netsnmp_assert(NULL != rowreq_ctx);
1671
1672 /*
1673 * TODO:441:o: |-> Check for valid ipCidrRouteIfIndex value.
1674 */
1675
1676 return MFD_SUCCESS; /* ipCidrRouteIfIndex value not illegal */
1677 } /* ipCidrRouteIfIndex_check_value */
1678
1679 /**
1680 * Save old value information
1681 *
1682 * @param rowreq_ctx
1683 * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
1684 *
1685 * @retval MFD_SUCCESS : success
1686 * @retval MFD_ERROR : error. set will fail.
1687 *
1688 * This function will be called after the table level undo setup function
1689 * ipCidrRouteTable_undo_setup has been called.
1690 *
1691 *@note
1692 * this function will only be called if a new value is set for this column.
1693 *
1694 * If there is any setup specific to a particular column (e.g. allocating
1695 * memory for a string), you should do that setup in this function, so it
1696 * won't be done unless it is necessary.
1697 */
1698 int
1699 ipCidrRouteIfIndex_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
1700 {
1701 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_undo_setup",
1702 "called\n"));
1703
1704 /** should never get a NULL pointer */
1705 netsnmp_assert(NULL != rowreq_ctx);
1706
1707 /*
1708 * TODO:455:o: |-> Setup ipCidrRouteIfIndex undo.
1709 */
1710 /*
1711 * copy ipCidrRouteIfIndex data
1712 * set rowreq_ctx->undo->ipCidrRouteIfIndex from rowreq_ctx->data->ipCidrRouteIfIndex
1713 */
1714
1715
1716 return MFD_SUCCESS;
1717 } /* ipCidrRouteIfIndex_undo_setup */
1718
1719 /**
1720 * Set the new value.
1721 *
1722 * @param rowreq_ctx
1723 * Pointer to the users context. You should know how to
1724 * manipulate the value from this object.
1725 * @param ipCidrRouteIfIndex_val
1726 * A long containing the new value.
1727 */
1728 int
1729 ipCidrRouteIfIndex_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
1730 long ipCidrRouteIfIndex_val)
1731 {
1732
1733 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_set",
1734 "called\n"));
1735
1736 /** should never get a NULL pointer */
1737 netsnmp_assert(NULL != rowreq_ctx);
1738
1739 /*
1740 * TODO:461:M: |-> Set ipCidrRouteIfIndex value.
1741 * set ipCidrRouteIfIndex value in rowreq_ctx->data
1742 */
1743
1744 return MFD_SUCCESS;
1745 } /* ipCidrRouteIfIndex_set */
1746
1747 /**
1748 * undo the previous set.
1749 *
1750 * @param rowreq_ctx
1751 * Pointer to the users context.
1752 */
1753 int
1754 ipCidrRouteIfIndex_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
1755 {
1756
1757 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_undo",
1758 "called\n"));
1759
1760 netsnmp_assert(NULL != rowreq_ctx);
1761
1762 /*
1763 * TODO:456:o: |-> Clean up ipCidrRouteIfIndex undo.
1764 */
1765 /*
1766 * copy ipCidrRouteIfIndex data
1767 * set rowreq_ctx->data->ipCidrRouteIfIndex from rowreq_ctx->undo->ipCidrRouteIfIndex
1768 */
1769
1770
1771 return MFD_SUCCESS;
1772 } /* ipCidrRouteIfIndex_undo */
1773
1774 /*---------------------------------------------------------------------
1775 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteType
1776 * ipCidrRouteType is subid 6 of ipCidrRouteEntry.
1777 * Its status is Deprecated, and its access level is Create.
1778 * OID: .1.3.6.1.2.1.4.24.4.1.6
1779 * Description:
1780 The type of route. Note that local(3) refers to a
1781 route for which the next hop is the final destination;
1782 remote(4) refers to a route for which the next hop is
1783 not the final destination.
1784
1785 Routes which do not result in traffic forwarding or
1786 rejection should not be displayed even if the
1787 implementation keeps them stored internally.
1788
1789 reject (2) refers to a route which, if matched,
1790 discards the message as unreachable. This is used in
1791 some protocols as a means of correctly aggregating
1792 routes.
1793 *
1794 * Attributes:
1795 * accessible 1 isscalar 0 enums 1 hasdefval 0
1796 * readable 1 iscolumn 1 ranges 0 hashint 0
1797 * settable 1
1798 *
1799 * Enum range: 3/8. Values: other(1), reject(2), local(3), remote(4)
1800 *
1801 * Its syntax is INTEGER (based on perltype INTEGER)
1802 * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
1803 */
1804 /**
1805 * Check that the proposed new value is potentially valid.
1806 *
1807 * @param rowreq_ctx
1808 * Pointer to the row request context.
1809 * @param ipCidrRouteType_val
1810 * A long containing the new value.
1811 *
1812 * @retval MFD_SUCCESS : incoming value is legal
1813 * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
1814 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
1815 *
1816 * This is the place to check for requirements that are not
1817 * expressed in the mib syntax (for example, a requirement that
1818 * is detailed in the description for an object).
1819 *
1820 * You should check that the requested change between the undo value and the
1821 * new value is legal (ie, the transistion from one value to another
1822 * is legal).
1823 *
1824 *@note
1825 * This check is only to determine if the new value
1826 * is \b potentially valid. This is the first check of many, and
1827 * is one of the simplest ones.
1828 *
1829 *@note
1830 * this is not the place to do any checks for values
1831 * which depend on some other value in the mib. Those
1832 * types of checks should be done in the
1833 * ipCidrRouteTable_check_dependencies() function.
1834 *
1835 * The following checks have already been done for you:
1836 * The syntax is ASN_INTEGER
1837 * The value is one of other(1), reject(2), local(3), remote(4)
1838 *
1839 * If there a no other checks you need to do, simply return MFD_SUCCESS.
1840 *
1841 */
1842 int
1843 ipCidrRouteType_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
1844 u_long ipCidrRouteType_val)
1845 {
1846 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteType_check_value",
1847 "called\n"));
1848
1849 /** should never get a NULL pointer */
1850 netsnmp_assert(NULL != rowreq_ctx);
1851
1852 /*
1853 * TODO:441:o: |-> Check for valid ipCidrRouteType value.
1854 */
1855
1856 return MFD_SUCCESS; /* ipCidrRouteType value not illegal */
1857 } /* ipCidrRouteType_check_value */
1858
1859 /**
1860 * Save old value information
1861 *
1862 * @param rowreq_ctx
1863 * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
1864 *
1865 * @retval MFD_SUCCESS : success
1866 * @retval MFD_ERROR : error. set will fail.
1867 *
1868 * This function will be called after the table level undo setup function
1869 * ipCidrRouteTable_undo_setup has been called.
1870 *
1871 *@note
1872 * this function will only be called if a new value is set for this column.
1873 *
1874 * If there is any setup specific to a particular column (e.g. allocating
1875 * memory for a string), you should do that setup in this function, so it
1876 * won't be done unless it is necessary.
1877 */
1878 int
1879 ipCidrRouteType_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
1880 {
1881 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteType_undo_setup",
1882 "called\n"));
1883
1884 /** should never get a NULL pointer */
1885 netsnmp_assert(NULL != rowreq_ctx);
1886
1887 /*
1888 * TODO:455:o: |-> Setup ipCidrRouteType undo.
1889 */
1890 /*
1891 * copy ipCidrRouteType data
1892 * set rowreq_ctx->undo->ipCidrRouteType from rowreq_ctx->data->ipCidrRouteType
1893 */
1894
1895
1896 return MFD_SUCCESS;
1897 } /* ipCidrRouteType_undo_setup */
1898
1899 /**
1900 * Set the new value.
1901 *
1902 * @param rowreq_ctx
1903 * Pointer to the users context. You should know how to
1904 * manipulate the value from this object.
1905 * @param ipCidrRouteType_val
1906 * A long containing the new value.
1907 */
1908 int
1909 ipCidrRouteType_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
1910 u_long ipCidrRouteType_val)
1911 {
1912
1913 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteType_set",
1914 "called\n"));
1915
1916 /** should never get a NULL pointer */
1917 netsnmp_assert(NULL != rowreq_ctx);
1918
1919 /*
1920 * TODO:461:M: |-> Set ipCidrRouteType value.
1921 * set ipCidrRouteType value in rowreq_ctx->data
1922 */
1923
1924 return MFD_SUCCESS;
1925 } /* ipCidrRouteType_set */
1926
1927 /**
1928 * undo the previous set.
1929 *
1930 * @param rowreq_ctx
1931 * Pointer to the users context.
1932 */
1933 int
1934 ipCidrRouteType_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
1935 {
1936
1937 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteType_undo",
1938 "called\n"));
1939
1940 netsnmp_assert(NULL != rowreq_ctx);
1941
1942 /*
1943 * TODO:456:o: |-> Clean up ipCidrRouteType undo.
1944 */
1945 /*
1946 * copy ipCidrRouteType data
1947 * set rowreq_ctx->data->ipCidrRouteType from rowreq_ctx->undo->ipCidrRouteType
1948 */
1949
1950
1951 return MFD_SUCCESS;
1952 } /* ipCidrRouteType_undo */
1953
1954 /*---------------------------------------------------------------------
1955 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteInfo
1956 * ipCidrRouteInfo is subid 9 of ipCidrRouteEntry.
1957 * Its status is Deprecated, and its access level is Create.
1958 * OID: .1.3.6.1.2.1.4.24.4.1.9
1959 * Description:
1960 A reference to MIB definitions specific to the
1961 particular routing protocol which is responsible for
1962 this route, as determined by the value specified in the
1963 route's ipCidrRouteProto value. If this information is
1964 not present, its value should be set to the OBJECT
1965 IDENTIFIER { 0 0 }, which is a syntactically valid
1966 object identifier, and any implementation conforming to
1967 ASN.1 and the Basic Encoding Rules must be able to
1968 generate and recognize this value.
1969 *
1970 * Attributes:
1971 * accessible 1 isscalar 0 enums 0 hasdefval 0
1972 * readable 1 iscolumn 1 ranges 0 hashint 0
1973 * settable 1
1974 *
1975 *
1976 * Its syntax is OBJECTID (based on perltype OBJECTID)
1977 * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
1978 * This data type requires a length. (Max )
1979 */
1980 /**
1981 * Check that the proposed new value is potentially valid.
1982 *
1983 * @param rowreq_ctx
1984 * Pointer to the row request context.
1985 * @param ipCidrRouteInfo_val_ptr
1986 * A oid containing the new value.
1987 * @param ipCidrRouteInfo_val_ptr_len
1988 * The size (in bytes) of the data pointed to by ipCidrRouteInfo_val_ptr
1989 *
1990 * @retval MFD_SUCCESS : incoming value is legal
1991 * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
1992 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
1993 *
1994 * This is the place to check for requirements that are not
1995 * expressed in the mib syntax (for example, a requirement that
1996 * is detailed in the description for an object).
1997 *
1998 * Since you aren't using a generated data context, you also need to
1999 * check the length, to make sure you don't overflow your storage space.
2000 *
2001 * You should check that the requested change between the undo value and the
2002 * new value is legal (ie, the transistion from one value to another
2003 * is legal).
2004 *
2005 *@note
2006 * This check is only to determine if the new value
2007 * is \b potentially valid. This is the first check of many, and
2008 * is one of the simplest ones.
2009 *
2010 *@note
2011 * this is not the place to do any checks for values
2012 * which depend on some other value in the mib. Those
2013 * types of checks should be done in the
2014 * ipCidrRouteTable_check_dependencies() function.
2015 *
2016 * The following checks have already been done for you:
2017 * The syntax is ASN_OBJECT_ID
2018 *
2019 * If there a no other checks you need to do, simply return MFD_SUCCESS.
2020 *
2021 */
2022 int
2023 ipCidrRouteInfo_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
2024 oid * ipCidrRouteInfo_val_ptr,
2025 size_t ipCidrRouteInfo_val_ptr_len)
2026 {
2027 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteInfo_check_value",
2028 "called\n"));
2029
2030 /** should never get a NULL pointer */
2031 netsnmp_assert(NULL != rowreq_ctx);
2032 netsnmp_assert(NULL != ipCidrRouteInfo_val_ptr);
2033
2034 /*
2035 * TODO:441:o: |-> Check for valid ipCidrRouteInfo value.
2036 */
2037
2038 return MFD_SUCCESS; /* ipCidrRouteInfo value not illegal */
2039 } /* ipCidrRouteInfo_check_value */
2040
2041 /**
2042 * Save old value information
2043 *
2044 * @param rowreq_ctx
2045 * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
2046 *
2047 * @retval MFD_SUCCESS : success
2048 * @retval MFD_ERROR : error. set will fail.
2049 *
2050 * This function will be called after the table level undo setup function
2051 * ipCidrRouteTable_undo_setup has been called.
2052 *
2053 *@note
2054 * this function will only be called if a new value is set for this column.
2055 *
2056 * If there is any setup specific to a particular column (e.g. allocating
2057 * memory for a string), you should do that setup in this function, so it
2058 * won't be done unless it is necessary.
2059 */
2060 int
2061 ipCidrRouteInfo_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
2062 {
2063 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteInfo_undo_setup",
2064 "called\n"));
2065
2066 /** should never get a NULL pointer */
2067 netsnmp_assert(NULL != rowreq_ctx);
2068
2069 /*
2070 * TODO:455:o: |-> Setup ipCidrRouteInfo undo.
2071 */
2072 /*
2073 * copy ipCidrRouteInfo and ipCidrRouteInfo_len data
2074 * set rowreq_ctx->undo->ipCidrRouteInfo from rowreq_ctx->data->ipCidrRouteInfo
2075 */
2076
2077
2078 return MFD_SUCCESS;
2079 } /* ipCidrRouteInfo_undo_setup */
2080
2081 /**
2082 * Set the new value.
2083 *
2084 * @param rowreq_ctx
2085 * Pointer to the users context. You should know how to
2086 * manipulate the value from this object.
2087 * @param ipCidrRouteInfo_val_ptr
2088 * A oid containing the new value.
2089 * @param ipCidrRouteInfo_val_ptr_len
2090 * The size (in bytes) of the data pointed to by ipCidrRouteInfo_val_ptr
2091 */
2092 int
2093 ipCidrRouteInfo_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
2094 oid * ipCidrRouteInfo_val_ptr,
2095 size_t ipCidrRouteInfo_val_ptr_len)
2096 {
2097
2098 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteInfo_set",
2099 "called\n"));
2100
2101 /** should never get a NULL pointer */
2102 netsnmp_assert(NULL != rowreq_ctx);
2103 netsnmp_assert(NULL != ipCidrRouteInfo_val_ptr);
2104
2105 /*
2106 * TODO:461:M: |-> Set ipCidrRouteInfo value.
2107 * set ipCidrRouteInfo value in rowreq_ctx->data
2108 */
2109
2110 return MFD_SUCCESS;
2111 } /* ipCidrRouteInfo_set */
2112
2113 /**
2114 * undo the previous set.
2115 *
2116 * @param rowreq_ctx
2117 * Pointer to the users context.
2118 */
2119 int
2120 ipCidrRouteInfo_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
2121 {
2122
2123 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteInfo_undo",
2124 "called\n"));
2125
2126 netsnmp_assert(NULL != rowreq_ctx);
2127
2128 /*
2129 * TODO:456:o: |-> Clean up ipCidrRouteInfo undo.
2130 */
2131 /*
2132 * copy ipCidrRouteInfo and ipCidrRouteInfo_len data
2133 * set rowreq_ctx->data->ipCidrRouteInfo from rowreq_ctx->undo->ipCidrRouteInfo
2134 */
2135
2136
2137 return MFD_SUCCESS;
2138 } /* ipCidrRouteInfo_undo */
2139
2140 /*---------------------------------------------------------------------
2141 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteNextHopAS
2142 * ipCidrRouteNextHopAS is subid 10 of ipCidrRouteEntry.
2143 * Its status is Deprecated, and its access level is Create.
2144 * OID: .1.3.6.1.2.1.4.24.4.1.10
2145 * Description:
2146 The Autonomous System Number of the Next Hop. The
2147 semantics of this object are determined by the routing-
2148 protocol specified in the route's ipCidrRouteProto
2149 value. When this object is unknown or not relevant its
2150 value should be set to zero.
2151 *
2152 * Attributes:
2153 * accessible 1 isscalar 0 enums 0 hasdefval 1
2154 * readable 1 iscolumn 1 ranges 0 hashint 0
2155 * settable 1
2156 * defval: 0
2157 *
2158 *
2159 * Its syntax is INTEGER32 (based on perltype INTEGER32)
2160 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
2161 */
2162 /**
2163 * Check that the proposed new value is potentially valid.
2164 *
2165 * @param rowreq_ctx
2166 * Pointer to the row request context.
2167 * @param ipCidrRouteNextHopAS_val
2168 * A long containing the new value.
2169 *
2170 * @retval MFD_SUCCESS : incoming value is legal
2171 * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
2172 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
2173 *
2174 * This is the place to check for requirements that are not
2175 * expressed in the mib syntax (for example, a requirement that
2176 * is detailed in the description for an object).
2177 *
2178 * You should check that the requested change between the undo value and the
2179 * new value is legal (ie, the transistion from one value to another
2180 * is legal).
2181 *
2182 *@note
2183 * This check is only to determine if the new value
2184 * is \b potentially valid. This is the first check of many, and
2185 * is one of the simplest ones.
2186 *
2187 *@note
2188 * this is not the place to do any checks for values
2189 * which depend on some other value in the mib. Those
2190 * types of checks should be done in the
2191 * ipCidrRouteTable_check_dependencies() function.
2192 *
2193 * The following checks have already been done for you:
2194 * The syntax is ASN_INTEGER
2195 *
2196 * If there a no other checks you need to do, simply return MFD_SUCCESS.
2197 *
2198 */
2199 int
2200 ipCidrRouteNextHopAS_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
2201 long ipCidrRouteNextHopAS_val)
2202 {
2203 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHopAS_check_value", "called\n"));
2204
2205 /** should never get a NULL pointer */
2206 netsnmp_assert(NULL != rowreq_ctx);
2207
2208 /*
2209 * TODO:441:o: |-> Check for valid ipCidrRouteNextHopAS value.
2210 */
2211
2212 return MFD_SUCCESS; /* ipCidrRouteNextHopAS value not illegal */
2213 } /* ipCidrRouteNextHopAS_check_value */
2214
2215 /**
2216 * Save old value information
2217 *
2218 * @param rowreq_ctx
2219 * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
2220 *
2221 * @retval MFD_SUCCESS : success
2222 * @retval MFD_ERROR : error. set will fail.
2223 *
2224 * This function will be called after the table level undo setup function
2225 * ipCidrRouteTable_undo_setup has been called.
2226 *
2227 *@note
2228 * this function will only be called if a new value is set for this column.
2229 *
2230 * If there is any setup specific to a particular column (e.g. allocating
2231 * memory for a string), you should do that setup in this function, so it
2232 * won't be done unless it is necessary.
2233 */
2234 int
2235 ipCidrRouteNextHopAS_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
2236 {
2237 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHopAS_undo_setup",
2238 "called\n"));
2239
2240 /** should never get a NULL pointer */
2241 netsnmp_assert(NULL != rowreq_ctx);
2242
2243 /*
2244 * TODO:455:o: |-> Setup ipCidrRouteNextHopAS undo.
2245 */
2246 /*
2247 * copy ipCidrRouteNextHopAS data
2248 * set rowreq_ctx->undo->ipCidrRouteNextHopAS from rowreq_ctx->data->ipCidrRouteNextHopAS
2249 */
2250
2251
2252 return MFD_SUCCESS;
2253 } /* ipCidrRouteNextHopAS_undo_setup */
2254
2255 /**
2256 * Set the new value.
2257 *
2258 * @param rowreq_ctx
2259 * Pointer to the users context. You should know how to
2260 * manipulate the value from this object.
2261 * @param ipCidrRouteNextHopAS_val
2262 * A long containing the new value.
2263 */
2264 int
2265 ipCidrRouteNextHopAS_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
2266 long ipCidrRouteNextHopAS_val)
2267 {
2268
2269 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHopAS_set",
2270 "called\n"));
2271
2272 /** should never get a NULL pointer */
2273 netsnmp_assert(NULL != rowreq_ctx);
2274
2275 /*
2276 * TODO:461:M: |-> Set ipCidrRouteNextHopAS value.
2277 * set ipCidrRouteNextHopAS value in rowreq_ctx->data
2278 */
2279
2280 return MFD_SUCCESS;
2281 } /* ipCidrRouteNextHopAS_set */
2282
2283 /**
2284 * undo the previous set.
2285 *
2286 * @param rowreq_ctx
2287 * Pointer to the users context.
2288 */
2289 int
2290 ipCidrRouteNextHopAS_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
2291 {
2292
2293 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHopAS_undo",
2294 "called\n"));
2295
2296 netsnmp_assert(NULL != rowreq_ctx);
2297
2298 /*
2299 * TODO:456:o: |-> Clean up ipCidrRouteNextHopAS undo.
2300 */
2301 /*
2302 * copy ipCidrRouteNextHopAS data
2303 * set rowreq_ctx->data->ipCidrRouteNextHopAS from rowreq_ctx->undo->ipCidrRouteNextHopAS
2304 */
2305
2306
2307 return MFD_SUCCESS;
2308 } /* ipCidrRouteNextHopAS_undo */
2309
2310 /*---------------------------------------------------------------------
2311 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric1
2312 * ipCidrRouteMetric1 is subid 11 of ipCidrRouteEntry.
2313 * Its status is Deprecated, and its access level is Create.
2314 * OID: .1.3.6.1.2.1.4.24.4.1.11
2315 * Description:
2316 The primary routing metric for this route. The
2317 semantics of this metric are determined by the routing-
2318 protocol specified in the route's ipCidrRouteProto
2319 value. If this metric is not used, its value should be
2320 set to -1.
2321 *
2322 * Attributes:
2323 * accessible 1 isscalar 0 enums 0 hasdefval 1
2324 * readable 1 iscolumn 1 ranges 0 hashint 0
2325 * settable 1
2326 * defval: -1
2327 *
2328 *
2329 * Its syntax is INTEGER32 (based on perltype INTEGER32)
2330 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
2331 */
2332 /**
2333 * Check that the proposed new value is potentially valid.
2334 *
2335 * @param rowreq_ctx
2336 * Pointer to the row request context.
2337 * @param ipCidrRouteMetric1_val
2338 * A long containing the new value.
2339 *
2340 * @retval MFD_SUCCESS : incoming value is legal
2341 * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
2342 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
2343 *
2344 * This is the place to check for requirements that are not
2345 * expressed in the mib syntax (for example, a requirement that
2346 * is detailed in the description for an object).
2347 *
2348 * You should check that the requested change between the undo value and the
2349 * new value is legal (ie, the transistion from one value to another
2350 * is legal).
2351 *
2352 *@note
2353 * This check is only to determine if the new value
2354 * is \b potentially valid. This is the first check of many, and
2355 * is one of the simplest ones.
2356 *
2357 *@note
2358 * this is not the place to do any checks for values
2359 * which depend on some other value in the mib. Those
2360 * types of checks should be done in the
2361 * ipCidrRouteTable_check_dependencies() function.
2362 *
2363 * The following checks have already been done for you:
2364 * The syntax is ASN_INTEGER
2365 *
2366 * If there a no other checks you need to do, simply return MFD_SUCCESS.
2367 *
2368 */
2369 int
2370 ipCidrRouteMetric1_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
2371 long ipCidrRouteMetric1_val)
2372 {
2373 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric1_check_value",
2374 "called\n"));
2375
2376 /** should never get a NULL pointer */
2377 netsnmp_assert(NULL != rowreq_ctx);
2378
2379 /*
2380 * TODO:441:o: |-> Check for valid ipCidrRouteMetric1 value.
2381 */
2382
2383 return MFD_SUCCESS; /* ipCidrRouteMetric1 value not illegal */
2384 } /* ipCidrRouteMetric1_check_value */
2385
2386 /**
2387 * Save old value information
2388 *
2389 * @param rowreq_ctx
2390 * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
2391 *
2392 * @retval MFD_SUCCESS : success
2393 * @retval MFD_ERROR : error. set will fail.
2394 *
2395 * This function will be called after the table level undo setup function
2396 * ipCidrRouteTable_undo_setup has been called.
2397 *
2398 *@note
2399 * this function will only be called if a new value is set for this column.
2400 *
2401 * If there is any setup specific to a particular column (e.g. allocating
2402 * memory for a string), you should do that setup in this function, so it
2403 * won't be done unless it is necessary.
2404 */
2405 int
2406 ipCidrRouteMetric1_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
2407 {
2408 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric1_undo_setup",
2409 "called\n"));
2410
2411 /** should never get a NULL pointer */
2412 netsnmp_assert(NULL != rowreq_ctx);
2413
2414 /*
2415 * TODO:455:o: |-> Setup ipCidrRouteMetric1 undo.
2416 */
2417 /*
2418 * copy ipCidrRouteMetric1 data
2419 * set rowreq_ctx->undo->ipCidrRouteMetric1 from rowreq_ctx->data->ipCidrRouteMetric1
2420 */
2421
2422
2423 return MFD_SUCCESS;
2424 } /* ipCidrRouteMetric1_undo_setup */
2425
2426 /**
2427 * Set the new value.
2428 *
2429 * @param rowreq_ctx
2430 * Pointer to the users context. You should know how to
2431 * manipulate the value from this object.
2432 * @param ipCidrRouteMetric1_val
2433 * A long containing the new value.
2434 */
2435 int
2436 ipCidrRouteMetric1_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
2437 long ipCidrRouteMetric1_val)
2438 {
2439
2440 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric1_set",
2441 "called\n"));
2442
2443 /** should never get a NULL pointer */
2444 netsnmp_assert(NULL != rowreq_ctx);
2445
2446 /*
2447 * TODO:461:M: |-> Set ipCidrRouteMetric1 value.
2448 * set ipCidrRouteMetric1 value in rowreq_ctx->data
2449 */
2450
2451 return MFD_SUCCESS;
2452 } /* ipCidrRouteMetric1_set */
2453
2454 /**
2455 * undo the previous set.
2456 *
2457 * @param rowreq_ctx
2458 * Pointer to the users context.
2459 */
2460 int
2461 ipCidrRouteMetric1_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
2462 {
2463
2464 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric1_undo",
2465 "called\n"));
2466
2467 netsnmp_assert(NULL != rowreq_ctx);
2468
2469 /*
2470 * TODO:456:o: |-> Clean up ipCidrRouteMetric1 undo.
2471 */
2472 /*
2473 * copy ipCidrRouteMetric1 data
2474 * set rowreq_ctx->data->ipCidrRouteMetric1 from rowreq_ctx->undo->ipCidrRouteMetric1
2475 */
2476
2477
2478 return MFD_SUCCESS;
2479 } /* ipCidrRouteMetric1_undo */
2480
2481 /*---------------------------------------------------------------------
2482 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric2
2483 * ipCidrRouteMetric2 is subid 12 of ipCidrRouteEntry.
2484 * Its status is Deprecated, and its access level is Create.
2485 * OID: .1.3.6.1.2.1.4.24.4.1.12
2486 * Description:
2487 An alternate routing metric for this route. The
2488 semantics of this metric are determined by the routing-
2489 protocol specified in the route's ipCidrRouteProto
2490 value. If this metric is not used, its value should be
2491 set to -1.
2492 *
2493 * Attributes:
2494 * accessible 1 isscalar 0 enums 0 hasdefval 1
2495 * readable 1 iscolumn 1 ranges 0 hashint 0
2496 * settable 1
2497 * defval: -1
2498 *
2499 *
2500 * Its syntax is INTEGER32 (based on perltype INTEGER32)
2501 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
2502 */
2503 /**
2504 * Check that the proposed new value is potentially valid.
2505 *
2506 * @param rowreq_ctx
2507 * Pointer to the row request context.
2508 * @param ipCidrRouteMetric2_val
2509 * A long containing the new value.
2510 *
2511 * @retval MFD_SUCCESS : incoming value is legal
2512 * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
2513 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
2514 *
2515 * This is the place to check for requirements that are not
2516 * expressed in the mib syntax (for example, a requirement that
2517 * is detailed in the description for an object).
2518 *
2519 * You should check that the requested change between the undo value and the
2520 * new value is legal (ie, the transistion from one value to another
2521 * is legal).
2522 *
2523 *@note
2524 * This check is only to determine if the new value
2525 * is \b potentially valid. This is the first check of many, and
2526 * is one of the simplest ones.
2527 *
2528 *@note
2529 * this is not the place to do any checks for values
2530 * which depend on some other value in the mib. Those
2531 * types of checks should be done in the
2532 * ipCidrRouteTable_check_dependencies() function.
2533 *
2534 * The following checks have already been done for you:
2535 * The syntax is ASN_INTEGER
2536 *
2537 * If there a no other checks you need to do, simply return MFD_SUCCESS.
2538 *
2539 */
2540 int
2541 ipCidrRouteMetric2_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
2542 long ipCidrRouteMetric2_val)
2543 {
2544 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric2_check_value",
2545 "called\n"));
2546
2547 /** should never get a NULL pointer */
2548 netsnmp_assert(NULL != rowreq_ctx);
2549
2550 /*
2551 * TODO:441:o: |-> Check for valid ipCidrRouteMetric2 value.
2552 */
2553 /*
2554 * does any os use metric 2-5? if so, update to deal with it.
2555 * otherwise, only accept same value we have.
2556 */
2557 if (ipCidrRouteMetric2_val != rowreq_ctx->data->rt_metric2)
2558 return MFD_NOT_VALID_EVER;
2559
2560 return MFD_SUCCESS; /* ipCidrRouteMetric2 value not illegal */
2561 } /* ipCidrRouteMetric2_check_value */
2562
2563 /**
2564 * Save old value information
2565 *
2566 * @param rowreq_ctx
2567 * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
2568 *
2569 * @retval MFD_SUCCESS : success
2570 * @retval MFD_ERROR : error. set will fail.
2571 *
2572 * This function will be called after the table level undo setup function
2573 * ipCidrRouteTable_undo_setup has been called.
2574 *
2575 *@note
2576 * this function will only be called if a new value is set for this column.
2577 *
2578 * If there is any setup specific to a particular column (e.g. allocating
2579 * memory for a string), you should do that setup in this function, so it
2580 * won't be done unless it is necessary.
2581 */
2582 int
2583 ipCidrRouteMetric2_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
2584 {
2585 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric2_undo_setup",
2586 "called\n"));
2587
2588 /** should never get a NULL pointer */
2589 netsnmp_assert(NULL != rowreq_ctx);
2590
2591 /*
2592 * TODO:455:o: |-> Setup ipCidrRouteMetric2 undo.
2593 */
2594 /*
2595 * copy ipCidrRouteMetric2 data
2596 * set rowreq_ctx->undo->ipCidrRouteMetric2 from rowreq_ctx->data->ipCidrRouteMetric2
2597 */
2598
2599
2600 return MFD_SUCCESS;
2601 } /* ipCidrRouteMetric2_undo_setup */
2602
2603 /**
2604 * Set the new value.
2605 *
2606 * @param rowreq_ctx
2607 * Pointer to the users context. You should know how to
2608 * manipulate the value from this object.
2609 * @param ipCidrRouteMetric2_val
2610 * A long containing the new value.
2611 */
2612 int
2613 ipCidrRouteMetric2_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
2614 long ipCidrRouteMetric2_val)
2615 {
2616
2617 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric2_set",
2618 "called\n"));
2619
2620 /** should never get a NULL pointer */
2621 netsnmp_assert(NULL != rowreq_ctx);
2622
2623 /*
2624 * TODO:461:M: |-> Set ipCidrRouteMetric2 value.
2625 * set ipCidrRouteMetric2 value in rowreq_ctx->data
2626 */
2627
2628 return MFD_SUCCESS;
2629 } /* ipCidrRouteMetric2_set */
2630
2631 /**
2632 * undo the previous set.
2633 *
2634 * @param rowreq_ctx
2635 * Pointer to the users context.
2636 */
2637 int
2638 ipCidrRouteMetric2_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
2639 {
2640
2641 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric2_undo",
2642 "called\n"));
2643
2644 netsnmp_assert(NULL != rowreq_ctx);
2645
2646 /*
2647 * TODO:456:o: |-> Clean up ipCidrRouteMetric2 undo.
2648 */
2649 /*
2650 * copy ipCidrRouteMetric2 data
2651 * set rowreq_ctx->data->ipCidrRouteMetric2 from rowreq_ctx->undo->ipCidrRouteMetric2
2652 */
2653
2654
2655 return MFD_SUCCESS;
2656 } /* ipCidrRouteMetric2_undo */
2657
2658 /*---------------------------------------------------------------------
2659 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric3
2660 * ipCidrRouteMetric3 is subid 13 of ipCidrRouteEntry.
2661 * Its status is Deprecated, and its access level is Create.
2662 * OID: .1.3.6.1.2.1.4.24.4.1.13
2663 * Description:
2664 An alternate routing metric for this route. The
2665 semantics of this metric are determined by the routing-
2666 protocol specified in the route's ipCidrRouteProto
2667 value. If this metric is not used, its value should be
2668 set to -1.
2669 *
2670 * Attributes:
2671 * accessible 1 isscalar 0 enums 0 hasdefval 1
2672 * readable 1 iscolumn 1 ranges 0 hashint 0
2673 * settable 1
2674 * defval: -1
2675 *
2676 *
2677 * Its syntax is INTEGER32 (based on perltype INTEGER32)
2678 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
2679 */
2680 /**
2681 * Check that the proposed new value is potentially valid.
2682 *
2683 * @param rowreq_ctx
2684 * Pointer to the row request context.
2685 * @param ipCidrRouteMetric3_val
2686 * A long containing the new value.
2687 *
2688 * @retval MFD_SUCCESS : incoming value is legal
2689 * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
2690 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
2691 *
2692 * This is the place to check for requirements that are not
2693 * expressed in the mib syntax (for example, a requirement that
2694 * is detailed in the description for an object).
2695 *
2696 * You should check that the requested change between the undo value and the
2697 * new value is legal (ie, the transistion from one value to another
2698 * is legal).
2699 *
2700 *@note
2701 * This check is only to determine if the new value
2702 * is \b potentially valid. This is the first check of many, and
2703 * is one of the simplest ones.
2704 *
2705 *@note
2706 * this is not the place to do any checks for values
2707 * which depend on some other value in the mib. Those
2708 * types of checks should be done in the
2709 * ipCidrRouteTable_check_dependencies() function.
2710 *
2711 * The following checks have already been done for you:
2712 * The syntax is ASN_INTEGER
2713 *
2714 * If there a no other checks you need to do, simply return MFD_SUCCESS.
2715 *
2716 */
2717 int
2718 ipCidrRouteMetric3_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
2719 long ipCidrRouteMetric3_val)
2720 {
2721 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric3_check_value",
2722 "called\n"));
2723
2724 /** should never get a NULL pointer */
2725 netsnmp_assert(NULL != rowreq_ctx);
2726
2727 /*
2728 * TODO:441:o: |-> Check for valid ipCidrRouteMetric3 value.
2729 */
2730 /*
2731 * does any os use metric 2-5? if so, update to deal with it.
2732 * otherwise, only accept same value we have.
2733 */
2734 if (ipCidrRouteMetric3_val != rowreq_ctx->data->rt_metric3)
2735 return MFD_NOT_VALID_EVER;
2736
2737 return MFD_SUCCESS; /* ipCidrRouteMetric3 value not illegal */
2738 } /* ipCidrRouteMetric3_check_value */
2739
2740 /**
2741 * Save old value information
2742 *
2743 * @param rowreq_ctx
2744 * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
2745 *
2746 * @retval MFD_SUCCESS : success
2747 * @retval MFD_ERROR : error. set will fail.
2748 *
2749 * This function will be called after the table level undo setup function
2750 * ipCidrRouteTable_undo_setup has been called.
2751 *
2752 *@note
2753 * this function will only be called if a new value is set for this column.
2754 *
2755 * If there is any setup specific to a particular column (e.g. allocating
2756 * memory for a string), you should do that setup in this function, so it
2757 * won't be done unless it is necessary.
2758 */
2759 int
2760 ipCidrRouteMetric3_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
2761 {
2762 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric3_undo_setup",
2763 "called\n"));
2764
2765 /** should never get a NULL pointer */
2766 netsnmp_assert(NULL != rowreq_ctx);
2767
2768 /*
2769 * TODO:455:o: |-> Setup ipCidrRouteMetric3 undo.
2770 */
2771 /*
2772 * copy ipCidrRouteMetric3 data
2773 * set rowreq_ctx->undo->ipCidrRouteMetric3 from rowreq_ctx->data->ipCidrRouteMetric3
2774 */
2775
2776
2777 return MFD_SUCCESS;
2778 } /* ipCidrRouteMetric3_undo_setup */
2779
2780 /**
2781 * Set the new value.
2782 *
2783 * @param rowreq_ctx
2784 * Pointer to the users context. You should know how to
2785 * manipulate the value from this object.
2786 * @param ipCidrRouteMetric3_val
2787 * A long containing the new value.
2788 */
2789 int
2790 ipCidrRouteMetric3_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
2791 long ipCidrRouteMetric3_val)
2792 {
2793
2794 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric3_set",
2795 "called\n"));
2796
2797 /** should never get a NULL pointer */
2798 netsnmp_assert(NULL != rowreq_ctx);
2799
2800 /*
2801 * TODO:461:M: |-> Set ipCidrRouteMetric3 value.
2802 * set ipCidrRouteMetric3 value in rowreq_ctx->data
2803 */
2804
2805 return MFD_SUCCESS;
2806 } /* ipCidrRouteMetric3_set */
2807
2808 /**
2809 * undo the previous set.
2810 *
2811 * @param rowreq_ctx
2812 * Pointer to the users context.
2813 */
2814 int
2815 ipCidrRouteMetric3_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
2816 {
2817
2818 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric3_undo",
2819 "called\n"));
2820
2821 netsnmp_assert(NULL != rowreq_ctx);
2822
2823 /*
2824 * TODO:456:o: |-> Clean up ipCidrRouteMetric3 undo.
2825 */
2826 /*
2827 * copy ipCidrRouteMetric3 data
2828 * set rowreq_ctx->data->ipCidrRouteMetric3 from rowreq_ctx->undo->ipCidrRouteMetric3
2829 */
2830
2831
2832 return MFD_SUCCESS;
2833 } /* ipCidrRouteMetric3_undo */
2834
2835 /*---------------------------------------------------------------------
2836 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric4
2837 * ipCidrRouteMetric4 is subid 14 of ipCidrRouteEntry.
2838 * Its status is Deprecated, and its access level is Create.
2839 * OID: .1.3.6.1.2.1.4.24.4.1.14
2840 * Description:
2841 An alternate routing metric for this route. The
2842 semantics of this metric are determined by the routing-
2843 protocol specified in the route's ipCidrRouteProto
2844 value. If this metric is not used, its value should be
2845 set to -1.
2846 *
2847 * Attributes:
2848 * accessible 1 isscalar 0 enums 0 hasdefval 1
2849 * readable 1 iscolumn 1 ranges 0 hashint 0
2850 * settable 1
2851 * defval: -1
2852 *
2853 *
2854 * Its syntax is INTEGER32 (based on perltype INTEGER32)
2855 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
2856 */
2857 /**
2858 * Check that the proposed new value is potentially valid.
2859 *
2860 * @param rowreq_ctx
2861 * Pointer to the row request context.
2862 * @param ipCidrRouteMetric4_val
2863 * A long containing the new value.
2864 *
2865 * @retval MFD_SUCCESS : incoming value is legal
2866 * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
2867 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
2868 *
2869 * This is the place to check for requirements that are not
2870 * expressed in the mib syntax (for example, a requirement that
2871 * is detailed in the description for an object).
2872 *
2873 * You should check that the requested change between the undo value and the
2874 * new value is legal (ie, the transistion from one value to another
2875 * is legal).
2876 *
2877 *@note
2878 * This check is only to determine if the new value
2879 * is \b potentially valid. This is the first check of many, and
2880 * is one of the simplest ones.
2881 *
2882 *@note
2883 * this is not the place to do any checks for values
2884 * which depend on some other value in the mib. Those
2885 * types of checks should be done in the
2886 * ipCidrRouteTable_check_dependencies() function.
2887 *
2888 * The following checks have already been done for you:
2889 * The syntax is ASN_INTEGER
2890 *
2891 * If there a no other checks you need to do, simply return MFD_SUCCESS.
2892 *
2893 */
2894 int
2895 ipCidrRouteMetric4_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
2896 long ipCidrRouteMetric4_val)
2897 {
2898 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric4_check_value",
2899 "called\n"));
2900
2901 /** should never get a NULL pointer */
2902 netsnmp_assert(NULL != rowreq_ctx);
2903
2904 /*
2905 * TODO:441:o: |-> Check for valid ipCidrRouteMetric4 value.
2906 */
2907 /*
2908 * does any os use metric 2-5? if so, update to deal with it.
2909 * otherwise, only accept same value we have.
2910 */
2911 if (ipCidrRouteMetric4_val != rowreq_ctx->data->rt_metric4)
2912 return MFD_NOT_VALID_EVER;
2913
2914 return MFD_SUCCESS; /* ipCidrRouteMetric4 value not illegal */
2915 } /* ipCidrRouteMetric4_check_value */
2916
2917 /**
2918 * Save old value information
2919 *
2920 * @param rowreq_ctx
2921 * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
2922 *
2923 * @retval MFD_SUCCESS : success
2924 * @retval MFD_ERROR : error. set will fail.
2925 *
2926 * This function will be called after the table level undo setup function
2927 * ipCidrRouteTable_undo_setup has been called.
2928 *
2929 *@note
2930 * this function will only be called if a new value is set for this column.
2931 *
2932 * If there is any setup specific to a particular column (e.g. allocating
2933 * memory for a string), you should do that setup in this function, so it
2934 * won't be done unless it is necessary.
2935 */
2936 int
2937 ipCidrRouteMetric4_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
2938 {
2939 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric4_undo_setup",
2940 "called\n"));
2941
2942 /** should never get a NULL pointer */
2943 netsnmp_assert(NULL != rowreq_ctx);
2944
2945 /*
2946 * TODO:455:o: |-> Setup ipCidrRouteMetric4 undo.
2947 */
2948 /*
2949 * copy ipCidrRouteMetric4 data
2950 * set rowreq_ctx->undo->ipCidrRouteMetric4 from rowreq_ctx->data->ipCidrRouteMetric4
2951 */
2952
2953
2954 return MFD_SUCCESS;
2955 } /* ipCidrRouteMetric4_undo_setup */
2956
2957 /**
2958 * Set the new value.
2959 *
2960 * @param rowreq_ctx
2961 * Pointer to the users context. You should know how to
2962 * manipulate the value from this object.
2963 * @param ipCidrRouteMetric4_val
2964 * A long containing the new value.
2965 */
2966 int
2967 ipCidrRouteMetric4_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
2968 long ipCidrRouteMetric4_val)
2969 {
2970
2971 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric4_set",
2972 "called\n"));
2973
2974 /** should never get a NULL pointer */
2975 netsnmp_assert(NULL != rowreq_ctx);
2976
2977 /*
2978 * TODO:461:M: |-> Set ipCidrRouteMetric4 value.
2979 * set ipCidrRouteMetric4 value in rowreq_ctx->data
2980 */
2981
2982 return MFD_SUCCESS;
2983 } /* ipCidrRouteMetric4_set */
2984
2985 /**
2986 * undo the previous set.
2987 *
2988 * @param rowreq_ctx
2989 * Pointer to the users context.
2990 */
2991 int
2992 ipCidrRouteMetric4_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
2993 {
2994
2995 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric4_undo",
2996 "called\n"));
2997
2998 netsnmp_assert(NULL != rowreq_ctx);
2999
3000 /*
3001 * TODO:456:o: |-> Clean up ipCidrRouteMetric4 undo.
3002 */
3003 /*
3004 * copy ipCidrRouteMetric4 data
3005 * set rowreq_ctx->data->ipCidrRouteMetric4 from rowreq_ctx->undo->ipCidrRouteMetric4
3006 */
3007
3008
3009 return MFD_SUCCESS;
3010 } /* ipCidrRouteMetric4_undo */
3011
3012 /*---------------------------------------------------------------------
3013 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric5
3014 * ipCidrRouteMetric5 is subid 15 of ipCidrRouteEntry.
3015 * Its status is Deprecated, and its access level is Create.
3016 * OID: .1.3.6.1.2.1.4.24.4.1.15
3017 * Description:
3018 An alternate routing metric for this route. The
3019 semantics of this metric are determined by the routing-
3020
3021
3022 protocol specified in the route's ipCidrRouteProto
3023 value. If this metric is not used, its value should be
3024 set to -1.
3025 *
3026 * Attributes:
3027 * accessible 1 isscalar 0 enums 0 hasdefval 1
3028 * readable 1 iscolumn 1 ranges 0 hashint 0
3029 * settable 1
3030 * defval: -1
3031 *
3032 *
3033 * Its syntax is INTEGER32 (based on perltype INTEGER32)
3034 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
3035 */
3036 /**
3037 * Check that the proposed new value is potentially valid.
3038 *
3039 * @param rowreq_ctx
3040 * Pointer to the row request context.
3041 * @param ipCidrRouteMetric5_val
3042 * A long containing the new value.
3043 *
3044 * @retval MFD_SUCCESS : incoming value is legal
3045 * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
3046 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
3047 *
3048 * This is the place to check for requirements that are not
3049 * expressed in the mib syntax (for example, a requirement that
3050 * is detailed in the description for an object).
3051 *
3052 * You should check that the requested change between the undo value and the
3053 * new value is legal (ie, the transistion from one value to another
3054 * is legal).
3055 *
3056 *@note
3057 * This check is only to determine if the new value
3058 * is \b potentially valid. This is the first check of many, and
3059 * is one of the simplest ones.
3060 *
3061 *@note
3062 * this is not the place to do any checks for values
3063 * which depend on some other value in the mib. Those
3064 * types of checks should be done in the
3065 * ipCidrRouteTable_check_dependencies() function.
3066 *
3067 * The following checks have already been done for you:
3068 * The syntax is ASN_INTEGER
3069 *
3070 * If there a no other checks you need to do, simply return MFD_SUCCESS.
3071 *
3072 */
3073 int
3074 ipCidrRouteMetric5_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
3075 long ipCidrRouteMetric5_val)
3076 {
3077 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric5_check_value",
3078 "called\n"));
3079
3080 /** should never get a NULL pointer */
3081 netsnmp_assert(NULL != rowreq_ctx);
3082
3083 /*
3084 * TODO:441:o: |-> Check for valid ipCidrRouteMetric5 value.
3085 */
3086 /*
3087 * does any os use metric 2-5? if so, update to deal with it.
3088 * otherwise, only accept same value we have.
3089 */
3090 if (ipCidrRouteMetric5_val != rowreq_ctx->data->rt_metric5)
3091 return MFD_NOT_VALID_EVER;
3092
3093 return MFD_SUCCESS; /* ipCidrRouteMetric5 value not illegal */
3094 } /* ipCidrRouteMetric5_check_value */
3095
3096 /**
3097 * Save old value information
3098 *
3099 * @param rowreq_ctx
3100 * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
3101 *
3102 * @retval MFD_SUCCESS : success
3103 * @retval MFD_ERROR : error. set will fail.
3104 *
3105 * This function will be called after the table level undo setup function
3106 * ipCidrRouteTable_undo_setup has been called.
3107 *
3108 *@note
3109 * this function will only be called if a new value is set for this column.
3110 *
3111 * If there is any setup specific to a particular column (e.g. allocating
3112 * memory for a string), you should do that setup in this function, so it
3113 * won't be done unless it is necessary.
3114 */
3115 int
3116 ipCidrRouteMetric5_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
3117 {
3118 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric5_undo_setup",
3119 "called\n"));
3120
3121 /** should never get a NULL pointer */
3122 netsnmp_assert(NULL != rowreq_ctx);
3123
3124 /*
3125 * TODO:455:o: |-> Setup ipCidrRouteMetric5 undo.
3126 */
3127 /*
3128 * copy ipCidrRouteMetric5 data
3129 * set rowreq_ctx->undo->ipCidrRouteMetric5 from rowreq_ctx->data->ipCidrRouteMetric5
3130 */
3131
3132
3133 return MFD_SUCCESS;
3134 } /* ipCidrRouteMetric5_undo_setup */
3135
3136 /**
3137 * Set the new value.
3138 *
3139 * @param rowreq_ctx
3140 * Pointer to the users context. You should know how to
3141 * manipulate the value from this object.
3142 * @param ipCidrRouteMetric5_val
3143 * A long containing the new value.
3144 */
3145 int
3146 ipCidrRouteMetric5_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
3147 long ipCidrRouteMetric5_val)
3148 {
3149
3150 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric5_set",
3151 "called\n"));
3152
3153 /** should never get a NULL pointer */
3154 netsnmp_assert(NULL != rowreq_ctx);
3155
3156 /*
3157 * TODO:461:M: |-> Set ipCidrRouteMetric5 value.
3158 * set ipCidrRouteMetric5 value in rowreq_ctx->data
3159 */
3160
3161 return MFD_SUCCESS;
3162 } /* ipCidrRouteMetric5_set */
3163
3164 /**
3165 * undo the previous set.
3166 *
3167 * @param rowreq_ctx
3168 * Pointer to the users context.
3169 */
3170 int
3171 ipCidrRouteMetric5_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
3172 {
3173
3174 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric5_undo",
3175 "called\n"));
3176
3177 netsnmp_assert(NULL != rowreq_ctx);
3178
3179 /*
3180 * TODO:456:o: |-> Clean up ipCidrRouteMetric5 undo.
3181 */
3182 /*
3183 * copy ipCidrRouteMetric5 data
3184 * set rowreq_ctx->data->ipCidrRouteMetric5 from rowreq_ctx->undo->ipCidrRouteMetric5
3185 */
3186
3187
3188 return MFD_SUCCESS;
3189 } /* ipCidrRouteMetric5_undo */
3190
3191 /*---------------------------------------------------------------------
3192 * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteStatus
3193 * ipCidrRouteStatus is subid 16 of ipCidrRouteEntry.
3194 * Its status is Deprecated, and its access level is Create.
3195 * OID: .1.3.6.1.2.1.4.24.4.1.16
3196 * Description:
3197 The row status variable, used according to row
3198 installation and removal conventions.
3199 *
3200 * Attributes:
3201 * accessible 1 isscalar 0 enums 1 hasdefval 0
3202 * readable 1 iscolumn 1 ranges 0 hashint 0
3203 * settable 1
3204 *
3205 * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
3206 *
3207 * Its syntax is RowStatus (based on perltype INTEGER)
3208 * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
3209 */
3210 /**
3211 * Check that the proposed new value is potentially valid.
3212 *
3213 * @param rowreq_ctx
3214 * Pointer to the row request context.
3215 * @param ipCidrRouteStatus_val
3216 * A long containing the new value.
3217 *
3218 * @retval MFD_SUCCESS : incoming value is legal
3219 * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
3220 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
3221 *
3222 * This is the place to check for requirements that are not
3223 * expressed in the mib syntax (for example, a requirement that
3224 * is detailed in the description for an object).
3225 *
3226 * You should check that the requested change between the undo value and the
3227 * new value is legal (ie, the transistion from one value to another
3228 * is legal).
3229 *
3230 *@note
3231 * This check is only to determine if the new value
3232 * is \b potentially valid. This is the first check of many, and
3233 * is one of the simplest ones.
3234 *
3235 *@note
3236 * this is not the place to do any checks for values
3237 * which depend on some other value in the mib. Those
3238 * types of checks should be done in the
3239 * ipCidrRouteTable_check_dependencies() function.
3240 *
3241 * The following checks have already been done for you:
3242 * The syntax is ASN_INTEGER
3243 * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
3244 *
3245 * If there a no other checks you need to do, simply return MFD_SUCCESS.
3246 *
3247 */
3248 int
3249 ipCidrRouteStatus_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
3250 u_long ipCidrRouteStatus_val)
3251 {
3252 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteStatus_check_value",
3253 "called\n"));
3254
3255 /** should never get a NULL pointer */
3256 netsnmp_assert(NULL != rowreq_ctx);
3257
3258 /*
3259 * TODO:441:o: |-> Check for valid ipCidrRouteStatus value.
3260 */
3261
3262 return MFD_SUCCESS; /* ipCidrRouteStatus value not illegal */
3263 } /* ipCidrRouteStatus_check_value */
3264
3265 /**
3266 * Save old value information
3267 *
3268 * @param rowreq_ctx
3269 * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
3270 *
3271 * @retval MFD_SUCCESS : success
3272 * @retval MFD_ERROR : error. set will fail.
3273 *
3274 * This function will be called after the table level undo setup function
3275 * ipCidrRouteTable_undo_setup has been called.
3276 *
3277 *@note
3278 * this function will only be called if a new value is set for this column.
3279 *
3280 * If there is any setup specific to a particular column (e.g. allocating
3281 * memory for a string), you should do that setup in this function, so it
3282 * won't be done unless it is necessary.
3283 */
3284 int
3285 ipCidrRouteStatus_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
3286 {
3287 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteStatus_undo_setup",
3288 "called\n"));
3289
3290 /** should never get a NULL pointer */
3291 netsnmp_assert(NULL != rowreq_ctx);
3292
3293 /*
3294 * TODO:455:o: |-> Setup ipCidrRouteStatus undo.
3295 */
3296 /*
3297 * copy ipCidrRouteStatus data
3298 * set rowreq_ctx->undo->ipCidrRouteStatus from rowreq_ctx->data->ipCidrRouteStatus
3299 */
3300
3301
3302 return MFD_SUCCESS;
3303 } /* ipCidrRouteStatus_undo_setup */
3304
3305 /**
3306 * Set the new value.
3307 *
3308 * @param rowreq_ctx
3309 * Pointer to the users context. You should know how to
3310 * manipulate the value from this object.
3311 * @param ipCidrRouteStatus_val
3312 * A long containing the new value.
3313 */
3314 int
3315 ipCidrRouteStatus_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
3316 u_long ipCidrRouteStatus_val)
3317 {
3318
3319 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteStatus_set",
3320 "called\n"));
3321
3322 /** should never get a NULL pointer */
3323 netsnmp_assert(NULL != rowreq_ctx);
3324
3325 /*
3326 * TODO:461:M: |-> Set ipCidrRouteStatus value.
3327 * set ipCidrRouteStatus value in rowreq_ctx->data
3328 */
3329
3330 return MFD_SUCCESS;
3331 } /* ipCidrRouteStatus_set */
3332
3333 /**
3334 * undo the previous set.
3335 *
3336 * @param rowreq_ctx
3337 * Pointer to the users context.
3338 */
3339 int
3340 ipCidrRouteStatus_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
3341 {
3342
3343 DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteStatus_undo",
3344 "called\n"));
3345
3346 netsnmp_assert(NULL != rowreq_ctx);
3347
3348 /*
3349 * TODO:456:o: |-> Clean up ipCidrRouteStatus undo.
3350 */
3351 /*
3352 * copy ipCidrRouteStatus data
3353 * set rowreq_ctx->data->ipCidrRouteStatus from rowreq_ctx->undo->ipCidrRouteStatus
3354 */
3355
3356
3357 return MFD_SUCCESS;
3358 } /* ipCidrRouteStatus_undo */
3359
3360 /** @} */
3361 /** @{ */