293
328
return MFD_SUCCESS;
294
329
} /* ipCidrRouteTable_row_prep */
332
* TODO:420:r: Implement ipCidrRouteTable index validation.
334
/*---------------------------------------------------------------------
335
* IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteDest
336
* ipCidrRouteDest is subid 1 of ipCidrRouteEntry.
337
* Its status is Deprecated, and its access level is ReadOnly.
338
* OID: .1.3.6.1.2.1.4.24.4.1.1
340
The destination IP address of this route.
342
This object may not take a Multicast (Class D) address
345
Any assignment (implicit or otherwise) of an instance
346
of this object to a value x must be rejected if the
347
bitwise logical-AND of x with the value of the
348
corresponding instance of the ipCidrRouteMask object is
352
* accessible 1 isscalar 0 enums 0 hasdefval 0
353
* readable 1 iscolumn 1 ranges 0 hashint 0
357
* Its syntax is IPADDR (based on perltype IPADDR)
358
* The net-snmp type is ASN_IPADDRESS. The C type decl is u_long (u_long)
361
* check validity of ipCidrRouteDest index portion
363
* @retval MFD_SUCCESS : the incoming value is legal
364
* @retval MFD_ERROR : the incoming value is NOT legal
366
* @note this is not the place to do any checks for the sanity
367
* of multiple indexes. Those types of checks should be done in the
368
* ipCidrRouteTable_validate_index() function.
370
* @note Also keep in mind that if the index refers to a row in this or
371
* some other table, you can't check for that row here to make
372
* decisions, since that row might not be created yet, but may
373
* be created during the processing this request. If you have
374
* such checks, they should be done in the check_dependencies
375
* function, because any new/deleted/changed rows should be
378
* The following checks have already been done for you:
380
* If there a no other checks you need to do, simply return MFD_SUCCESS.
383
ipCidrRouteDest_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
385
DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteDest_check_index",
388
netsnmp_assert(NULL != rowreq_ctx);
391
* TODO:426:M: |-> Check ipCidrRouteTable index ipCidrRouteDest.
392
* check that index value in the table context is legal.
393
* (rowreq_ctx->tbl_index.ipCidrRouteDest)
396
return MFD_SUCCESS; /* ipCidrRouteDest index ok */
397
} /* ipCidrRouteDest_check_index */
399
/*---------------------------------------------------------------------
400
* IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMask
401
* ipCidrRouteMask is subid 2 of ipCidrRouteEntry.
402
* Its status is Deprecated, and its access level is ReadOnly.
403
* OID: .1.3.6.1.2.1.4.24.4.1.2
405
Indicate the mask to be logical-ANDed with the
406
destination address before being compared to the value
407
in the ipCidrRouteDest field. For those systems that
408
do not support arbitrary subnet masks, an agent
409
constructs the value of the ipCidrRouteMask by
410
reference to the IP Address Class.
412
Any assignment (implicit or otherwise) of an instance
413
of this object to a value x must be rejected if the
414
bitwise logical-AND of x with the value of the
415
corresponding instance of the ipCidrRouteDest object is
418
not equal to ipCidrRouteDest.
421
* accessible 1 isscalar 0 enums 0 hasdefval 0
422
* readable 1 iscolumn 1 ranges 0 hashint 0
426
* Its syntax is IPADDR (based on perltype IPADDR)
427
* The net-snmp type is ASN_IPADDRESS. The C type decl is u_long (u_long)
430
* check validity of ipCidrRouteMask index portion
432
* @retval MFD_SUCCESS : the incoming value is legal
433
* @retval MFD_ERROR : the incoming value is NOT legal
435
* @note this is not the place to do any checks for the sanity
436
* of multiple indexes. Those types of checks should be done in the
437
* ipCidrRouteTable_validate_index() function.
439
* @note Also keep in mind that if the index refers to a row in this or
440
* some other table, you can't check for that row here to make
441
* decisions, since that row might not be created yet, but may
442
* be created during the processing this request. If you have
443
* such checks, they should be done in the check_dependencies
444
* function, because any new/deleted/changed rows should be
447
* The following checks have already been done for you:
449
* If there a no other checks you need to do, simply return MFD_SUCCESS.
452
ipCidrRouteMask_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
454
DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMask_check_index",
457
netsnmp_assert(NULL != rowreq_ctx);
460
* TODO:426:M: |-> Check ipCidrRouteTable index ipCidrRouteMask.
461
* check that index value in the table context is legal.
462
* (rowreq_ctx->tbl_index.ipCidrRouteMask)
465
return MFD_SUCCESS; /* ipCidrRouteMask index ok */
466
} /* ipCidrRouteMask_check_index */
468
/*---------------------------------------------------------------------
469
* IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteTos
470
* ipCidrRouteTos is subid 3 of ipCidrRouteEntry.
471
* Its status is Deprecated, and its access level is ReadOnly.
472
* OID: .1.3.6.1.2.1.4.24.4.1.3
474
The policy specifier is the IP TOS Field. The encoding
475
of IP TOS is as specified by the following convention.
476
Zero indicates the default path if no more specific
479
+-----+-----+-----+-----+-----+-----+-----+-----+
481
| PRECEDENCE | TYPE OF SERVICE | 0 |
483
+-----+-----+-----+-----+-----+-----+-----+-----+
486
Field Policy Field Policy
487
Contents Code Contents Code
488
0 0 0 0 ==> 0 0 0 0 1 ==> 2
489
0 0 1 0 ==> 4 0 0 1 1 ==> 6
490
0 1 0 0 ==> 8 0 1 0 1 ==> 10
491
0 1 1 0 ==> 12 0 1 1 1 ==> 14
492
1 0 0 0 ==> 16 1 0 0 1 ==> 18
493
1 0 1 0 ==> 20 1 0 1 1 ==> 22
494
1 1 0 0 ==> 24 1 1 0 1 ==> 26
495
1 1 1 0 ==> 28 1 1 1 1 ==> 30
498
* accessible 1 isscalar 0 enums 0 hasdefval 0
499
* readable 1 iscolumn 1 ranges 1 hashint 0
502
* Ranges: 0 - 2147483647;
504
* Its syntax is INTEGER32 (based on perltype INTEGER32)
505
* The net-snmp type is ASN_INTEGER. The C type decl is long (long)
508
* check validity of ipCidrRouteTos index portion
510
* @retval MFD_SUCCESS : the incoming value is legal
511
* @retval MFD_ERROR : the incoming value is NOT legal
513
* @note this is not the place to do any checks for the sanity
514
* of multiple indexes. Those types of checks should be done in the
515
* ipCidrRouteTable_validate_index() function.
517
* @note Also keep in mind that if the index refers to a row in this or
518
* some other table, you can't check for that row here to make
519
* decisions, since that row might not be created yet, but may
520
* be created during the processing this request. If you have
521
* such checks, they should be done in the check_dependencies
522
* function, because any new/deleted/changed rows should be
525
* The following checks have already been done for you:
526
* The value is in (one of) the range set(s): 0 - 2147483647
528
* If there a no other checks you need to do, simply return MFD_SUCCESS.
531
ipCidrRouteTos_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
533
DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTos_check_index",
536
netsnmp_assert(NULL != rowreq_ctx);
539
* TODO:426:M: |-> Check ipCidrRouteTable index ipCidrRouteTos.
540
* check that index value in the table context is legal.
541
* (rowreq_ctx->tbl_index.ipCidrRouteTos)
544
return MFD_SUCCESS; /* ipCidrRouteTos index ok */
545
} /* ipCidrRouteTos_check_index */
547
/*---------------------------------------------------------------------
548
* IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteNextHop
549
* ipCidrRouteNextHop is subid 4 of ipCidrRouteEntry.
550
* Its status is Deprecated, and its access level is ReadOnly.
551
* OID: .1.3.6.1.2.1.4.24.4.1.4
553
On remote routes, the address of the next system en
554
route; Otherwise, 0.0.0.0.
557
* accessible 1 isscalar 0 enums 0 hasdefval 0
558
* readable 1 iscolumn 1 ranges 0 hashint 0
562
* Its syntax is IPADDR (based on perltype IPADDR)
563
* The net-snmp type is ASN_IPADDRESS. The C type decl is u_long (u_long)
566
* check validity of ipCidrRouteNextHop index portion
568
* @retval MFD_SUCCESS : the incoming value is legal
569
* @retval MFD_ERROR : the incoming value is NOT legal
571
* @note this is not the place to do any checks for the sanity
572
* of multiple indexes. Those types of checks should be done in the
573
* ipCidrRouteTable_validate_index() function.
575
* @note Also keep in mind that if the index refers to a row in this or
576
* some other table, you can't check for that row here to make
577
* decisions, since that row might not be created yet, but may
578
* be created during the processing this request. If you have
579
* such checks, they should be done in the check_dependencies
580
* function, because any new/deleted/changed rows should be
583
* The following checks have already been done for you:
585
* If there a no other checks you need to do, simply return MFD_SUCCESS.
588
ipCidrRouteNextHop_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
590
DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHop_check_index",
593
netsnmp_assert(NULL != rowreq_ctx);
596
* TODO:426:M: |-> Check ipCidrRouteTable index ipCidrRouteNextHop.
597
* check that index value in the table context is legal.
598
* (rowreq_ctx->tbl_index.ipCidrRouteNextHop)
601
return MFD_SUCCESS; /* ipCidrRouteNextHop index ok */
602
} /* ipCidrRouteNextHop_check_index */
605
* verify specified index is valid.
607
* This check is independent of whether or not the values specified for
608
* the columns of the new row are valid. Column values and row consistency
609
* will be checked later. At this point, only the index values should be
612
* All of the individual index validation functions have been called, so this
613
* is the place to make sure they are valid as a whole when combined. If
614
* you only have one index, then you probably don't need to do anything else
617
* @note Keep in mind that if the indexes refer to a row in this or
618
* some other table, you can't check for that row here to make
619
* decisions, since that row might not be created yet, but may
620
* be created during the processing this request. If you have
621
* such checks, they should be done in the check_dependencies
622
* function, because any new/deleted/changed rows should be
626
* @param ipCidrRouteTable_reg
627
* Pointer to the user registration data
629
* Pointer to the users context.
630
* @retval MFD_SUCCESS : success
631
* @retval MFD_CANNOT_CREATE_NOW : index not valid right now
632
* @retval MFD_CANNOT_CREATE_EVER : index never valid
635
ipCidrRouteTable_validate_index(ipCidrRouteTable_registration *
636
ipCidrRouteTable_reg,
637
ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
639
int rc = MFD_SUCCESS;
641
DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_validate_index",
644
/** we should have a non-NULL pointer */
645
netsnmp_assert(NULL != rowreq_ctx);
648
* TODO:430:M: |-> Validate potential ipCidrRouteTable index.
651
snmp_log(LOG_WARNING, "invalid index for a new row in the "
652
"ipCidrRouteTable table.\n");
654
* determine failure type.
656
* If the index could not ever be created, return MFD_NOT_EVER
657
* If the index can not be created under the present circumstances
658
* (even though it could be created under other circumstances),
659
* return MFD_NOT_NOW.
662
return MFD_CANNOT_CREATE_EVER;
664
return MFD_CANNOT_CREATE_NOW;
669
} /* ipCidrRouteTable_validate_index */