~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-05-10 22:20:23 UTC
  • mto: (1.4.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: james.westby@ubuntu.com-20070510222023-3fr07xb9i17xvq32
Tags: upstream-5.3.1
ImportĀ upstreamĀ versionĀ 5.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Note: this file originally auto-generated by mib2c using
3
 
 *       version : 1.12 $ of : mfd-data-access.m2c,v $ 
 
3
 *       version : 1.17 $ of : mfd-data-access.m2c,v $ 
4
4
 *
5
 
 * $Id: ipCidrRouteTable_data_access.c,v 1.14.2.1 2005/02/08 21:58:05 nba Exp $
 
5
 * $Id: ipCidrRouteTable_data_access.c,v 1.16.2.1 2006/01/25 16:26:38 dts12 Exp $
6
6
 */
7
7
/*
8
8
 * standard Net-SNMP includes 
20
20
#include "ipCidrRouteTable_data_access.h"
21
21
 
22
22
 
23
 
/** @defgroup data_access data_access: Routines to access data
 
23
/** @ingroup interface 
 
24
 * @addtogroup data_access data_access: Routines to access data
24
25
 *
25
26
 * These routines are used to locate the data used to satisfy
26
27
 * requests.
35
36
 **********************************************************************
36
37
 **********************************************************************/
37
38
/*
38
 
 * ipCidrRouteTable is subid 4 of ipForward.
 
39
 * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
39
40
 * Its status is Deprecated.
40
41
 * OID: .1.3.6.1.2.1.4.24.4, length: 9
41
42
 */
53
54
 * @retval MFD_ERROR   : unrecoverable error.
54
55
 */
55
56
int
56
 
ipCidrRouteTable_init_data(ipCidrRouteTable_registration_ptr
 
57
ipCidrRouteTable_init_data(ipCidrRouteTable_registration *
57
58
                           ipCidrRouteTable_reg)
58
59
{
59
60
    DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_init_data",
67
68
}                               /* ipCidrRouteTable_init_data */
68
69
 
69
70
/**
70
 
 * container-cached overview
 
71
 * container overview
71
72
 *
72
73
 */
73
74
 
74
 
/***********************************************************************
75
 
 *
76
 
 * cache
77
 
 *
78
 
 ***********************************************************************/
79
75
/**
80
76
 * container initialization
81
77
 *
103
99
 *  process that will supply the data, opening a database, etc.
104
100
 */
105
101
void
106
 
ipCidrRouteTable_container_init(netsnmp_container ** container_ptr_ptr,
 
102
ipCidrRouteTable_container_init(netsnmp_container **container_ptr_ptr,
107
103
                                netsnmp_cache * cache)
108
104
{
109
105
    DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_container_init",
110
106
                "called\n"));
111
107
 
112
 
    if ((NULL == cache) || (NULL == container_ptr_ptr)) {
 
108
    if (NULL == container_ptr_ptr) {
113
109
        snmp_log(LOG_ERR,
114
 
                 "bad params to ipCidrRouteTable_container_init\n");
 
110
                 "bad container param to ipCidrRouteTable_container_init\n");
115
111
        return;
116
112
    }
117
113
 
121
117
     */
122
118
    *container_ptr_ptr = NULL;
123
119
 
 
120
    if (NULL == cache) {
 
121
        snmp_log(LOG_ERR,
 
122
                 "bad cache param to ipCidrRouteTable_container_init\n");
 
123
        return;
 
124
    }
 
125
 
124
126
    /*
125
127
     * TODO:345:A: Set up ipCidrRouteTable cache properties.
126
128
     *
127
129
     * Also for advanced users, you can set parameters for the
128
130
     * cache. Do not change the magic pointer, as it is used
129
 
     * by the MFD helper.
 
131
     * by the MFD helper. To completely disable caching, set
 
132
     * cache->enabled to 0.
130
133
     */
131
134
    cache->timeout = IPCIDRROUTETABLE_CACHE_TIMEOUT;    /* seconds */
132
135
}                               /* ipCidrRouteTable_container_init */
136
139
 *
137
140
 */
138
141
static void
139
 
_snarf_route_entry(netsnmp_route_entry * route_entry,
140
 
                   netsnmp_container * container)
 
142
_snarf_route_entry(netsnmp_route_entry *route_entry,
 
143
                   netsnmp_container *container)
141
144
{
142
145
    ipCidrRouteTable_rowreq_ctx *rowreq_ctx;
143
146
 
150
153
     * allocate an row context and set the index(es), then add it to
151
154
     * the container
152
155
     */
153
 
    rowreq_ctx = ipCidrRouteTable_allocate_rowreq_ctx(route_entry);
 
156
    rowreq_ctx = ipCidrRouteTable_allocate_rowreq_ctx(route_entry, NULL);
154
157
    if ((NULL != rowreq_ctx) &&
155
158
        (MFD_SUCCESS == ipCidrRouteTable_indexes_set
156
159
         (rowreq_ctx, *((u_long *) route_entry->rt_dest),
169
172
}
170
173
 
171
174
/**
172
 
 * load cache data
173
 
 *
174
 
 * TODO:350:M: Implement ipCidrRouteTable cache load
 
175
 * container shutdown
 
176
 *
 
177
 * @param container_ptr A pointer to the container.
 
178
 *
 
179
 *  This function is called at shutdown to allow you to customize certain
 
180
 *  aspects of the access method. For the most part, it is for advanced
 
181
 *  users. The default code should suffice for most cases.
 
182
 *
 
183
 *  This function is called before ipCidrRouteTable_container_free().
 
184
 *
 
185
 * @remark
 
186
 *  This would also be a good place to do any cleanup needed
 
187
 *  for you data source. For example, closing a connection to another
 
188
 *  process that supplied the data, closing a database, etc.
 
189
 */
 
190
void
 
191
ipCidrRouteTable_container_shutdown(netsnmp_container *container_ptr)
 
192
{
 
193
    DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_container_shutdown", "called\n"));
 
194
 
 
195
    if (NULL == container_ptr) {
 
196
        snmp_log(LOG_ERR,
 
197
                 "bad params to ipCidrRouteTable_container_shutdown\n");
 
198
        return;
 
199
    }
 
200
 
 
201
}                               /* ipCidrRouteTable_container_shutdown */
 
202
 
 
203
/**
 
204
 * load initial data
 
205
 *
 
206
 * TODO:350:M: Implement ipCidrRouteTable data load
 
207
 * This function will also be called by the cache helper to load
 
208
 * the container again (after the container free function has been
 
209
 * called to free the previous contents).
175
210
 *
176
211
 * @param container container to which items should be inserted
177
212
 *
179
214
 * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
180
215
 * @retval MFD_ERROR                : other error.
181
216
 *
182
 
 *  This function is called to cache the index(es) (and data, optionally)
 
217
 *  This function is called to load the index(es) (and data, optionally)
183
218
 *  for the every row in the data set.
184
219
 *
185
220
 * @remark
186
 
 *  While loading the cache, the only important thing is the indexes.
 
221
 *  While loading the data, the only important thing is the indexes.
187
222
 *  If access to your data is cheap/fast (e.g. you have a pointer to a
188
223
 *  structure in memory), it would make sense to update the data here.
189
224
 *  If, however, the accessing the data invovles more work (e.g. parsing
199
234
 *
200
235
 */
201
236
int
202
 
ipCidrRouteTable_cache_load(netsnmp_container * container)
 
237
ipCidrRouteTable_container_load(netsnmp_container *container)
203
238
{
204
239
    netsnmp_container *route_container;
205
240
 
237
272
               "%d records\n", CONTAINER_SIZE(container)));
238
273
 
239
274
    return MFD_SUCCESS;
240
 
}                               /* ipCidrRouteTable_cache_load */
 
275
}                               /* ipCidrRouteTable_container_load */
241
276
 
242
277
/**
243
 
 * cache clean up
 
278
 * container clean up
244
279
 *
245
280
 * @param container container with all current items
246
281
 *
253
288
 *
254
289
 */
255
290
void
256
 
ipCidrRouteTable_cache_free(netsnmp_container * container)
 
291
ipCidrRouteTable_container_free(netsnmp_container *container)
257
292
{
258
 
    DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_cache_free",
 
293
    DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_container_free",
259
294
                "called\n"));
260
295
 
261
296
    /*
262
 
     * TODO:380:M: Free ipCidrRouteTable cache.
 
297
     * TODO:380:M: Free ipCidrRouteTable container data.
263
298
     */
264
 
}                               /* ipCidrRouteTable_cache_free */
 
299
}                               /* ipCidrRouteTable_container_free */
265
300
 
266
301
/**
267
302
 * prepare row for processing.
293
328
    return MFD_SUCCESS;
294
329
}                               /* ipCidrRouteTable_row_prep */
295
330
 
 
331
/*
 
332
 * TODO:420:r: Implement ipCidrRouteTable index validation.
 
333
 */
 
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
 
339
 * Description:
 
340
The destination IP address of this route. 
 
341
 
 
342
                This object may not take a Multicast (Class D) address 
 
343
                value. 
 
344
 
 
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  
 
349
                not equal to x.
 
350
 *
 
351
 * Attributes:
 
352
 *   accessible 1     isscalar 0     enums  0      hasdefval 0
 
353
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 
354
 *   settable   0
 
355
 *
 
356
 *
 
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)
 
359
 */
 
360
/**
 
361
 * check validity of ipCidrRouteDest index portion
 
362
 *
 
363
 * @retval MFD_SUCCESS   : the incoming value is legal
 
364
 * @retval MFD_ERROR     : the incoming value is NOT legal
 
365
 *
 
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.
 
369
 *
 
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
 
376
 *       available then.
 
377
 *
 
378
 * The following checks have already been done for you:
 
379
 *
 
380
 * If there a no other checks you need to do, simply return MFD_SUCCESS.
 
381
 */
 
382
int
 
383
ipCidrRouteDest_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
 
384
{
 
385
    DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteDest_check_index",
 
386
                "called\n"));
 
387
 
 
388
    netsnmp_assert(NULL != rowreq_ctx);
 
389
 
 
390
    /*
 
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)
 
394
     */
 
395
 
 
396
    return MFD_SUCCESS;         /* ipCidrRouteDest index ok */
 
397
}                               /* ipCidrRouteDest_check_index */
 
398
 
 
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
 
404
 * Description:
 
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. 
 
411
 
 
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  
 
416
 
 
417
 
 
418
                not equal to ipCidrRouteDest.
 
419
 *
 
420
 * Attributes:
 
421
 *   accessible 1     isscalar 0     enums  0      hasdefval 0
 
422
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 
423
 *   settable   0
 
424
 *
 
425
 *
 
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)
 
428
 */
 
429
/**
 
430
 * check validity of ipCidrRouteMask index portion
 
431
 *
 
432
 * @retval MFD_SUCCESS   : the incoming value is legal
 
433
 * @retval MFD_ERROR     : the incoming value is NOT legal
 
434
 *
 
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.
 
438
 *
 
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
 
445
 *       available then.
 
446
 *
 
447
 * The following checks have already been done for you:
 
448
 *
 
449
 * If there a no other checks you need to do, simply return MFD_SUCCESS.
 
450
 */
 
451
int
 
452
ipCidrRouteMask_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
 
453
{
 
454
    DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMask_check_index",
 
455
                "called\n"));
 
456
 
 
457
    netsnmp_assert(NULL != rowreq_ctx);
 
458
 
 
459
    /*
 
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)
 
463
     */
 
464
 
 
465
    return MFD_SUCCESS;         /* ipCidrRouteMask index ok */
 
466
}                               /* ipCidrRouteMask_check_index */
 
467
 
 
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
 
473
 * Description:
 
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 
 
477
                policy applies. 
 
478
 
 
479
                +-----+-----+-----+-----+-----+-----+-----+-----+ 
 
480
                |                 |                       |     | 
 
481
                |   PRECEDENCE    |    TYPE OF SERVICE    |  0  | 
 
482
                |                 |                       |     | 
 
483
                +-----+-----+-----+-----+-----+-----+-----+-----+ 
 
484
 
 
485
                             IP TOS                IP TOS 
 
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
 
496
 *
 
497
 * Attributes:
 
498
 *   accessible 1     isscalar 0     enums  0      hasdefval 0
 
499
 *   readable   1     iscolumn 1     ranges 1      hashint   0
 
500
 *   settable   0
 
501
 *
 
502
 * Ranges:  0 - 2147483647;
 
503
 *
 
504
 * Its syntax is INTEGER32 (based on perltype INTEGER32)
 
505
 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
 
506
 */
 
507
/**
 
508
 * check validity of ipCidrRouteTos index portion
 
509
 *
 
510
 * @retval MFD_SUCCESS   : the incoming value is legal
 
511
 * @retval MFD_ERROR     : the incoming value is NOT legal
 
512
 *
 
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.
 
516
 *
 
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
 
523
 *       available then.
 
524
 *
 
525
 * The following checks have already been done for you:
 
526
 *    The value is in (one of) the range set(s):  0 - 2147483647
 
527
 *
 
528
 * If there a no other checks you need to do, simply return MFD_SUCCESS.
 
529
 */
 
530
int
 
531
ipCidrRouteTos_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
 
532
{
 
533
    DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTos_check_index",
 
534
                "called\n"));
 
535
 
 
536
    netsnmp_assert(NULL != rowreq_ctx);
 
537
 
 
538
    /*
 
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)
 
542
     */
 
543
 
 
544
    return MFD_SUCCESS;         /* ipCidrRouteTos index ok */
 
545
}                               /* ipCidrRouteTos_check_index */
 
546
 
 
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
 
552
 * Description:
 
553
On remote routes, the address of the next system en  
 
554
                route; Otherwise, 0.0.0.0.
 
555
 *
 
556
 * Attributes:
 
557
 *   accessible 1     isscalar 0     enums  0      hasdefval 0
 
558
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 
559
 *   settable   0
 
560
 *
 
561
 *
 
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)
 
564
 */
 
565
/**
 
566
 * check validity of ipCidrRouteNextHop index portion
 
567
 *
 
568
 * @retval MFD_SUCCESS   : the incoming value is legal
 
569
 * @retval MFD_ERROR     : the incoming value is NOT legal
 
570
 *
 
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.
 
574
 *
 
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
 
581
 *       available then.
 
582
 *
 
583
 * The following checks have already been done for you:
 
584
 *
 
585
 * If there a no other checks you need to do, simply return MFD_SUCCESS.
 
586
 */
 
587
int
 
588
ipCidrRouteNextHop_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
 
589
{
 
590
    DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHop_check_index",
 
591
                "called\n"));
 
592
 
 
593
    netsnmp_assert(NULL != rowreq_ctx);
 
594
 
 
595
    /*
 
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)
 
599
     */
 
600
 
 
601
    return MFD_SUCCESS;         /* ipCidrRouteNextHop index ok */
 
602
}                               /* ipCidrRouteNextHop_check_index */
 
603
 
 
604
/**
 
605
 * verify specified index is valid.
 
606
 *
 
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
 
610
 * checked.
 
611
 *
 
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
 
615
 * here.
 
616
 * 
 
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
 
623
 *       available then.
 
624
 *
 
625
 *
 
626
 * @param ipCidrRouteTable_reg
 
627
 *        Pointer to the user registration data
 
628
 * @param rowreq_ctx
 
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
 
633
 */
 
634
int
 
635
ipCidrRouteTable_validate_index(ipCidrRouteTable_registration *
 
636
                                ipCidrRouteTable_reg,
 
637
                                ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
 
638
{
 
639
    int             rc = MFD_SUCCESS;
 
640
 
 
641
    DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_validate_index",
 
642
                "called\n"));
 
643
 
 
644
    /** we should have a non-NULL pointer */
 
645
    netsnmp_assert(NULL != rowreq_ctx);
 
646
 
 
647
    /*
 
648
     * TODO:430:M: |-> Validate potential ipCidrRouteTable index.
 
649
     */
 
650
    if (1) {
 
651
        snmp_log(LOG_WARNING, "invalid index for a new row in the "
 
652
                 "ipCidrRouteTable table.\n");
 
653
        /*
 
654
         * determine failure type.
 
655
         *
 
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.
 
660
         */
 
661
        if (0) {
 
662
            return MFD_CANNOT_CREATE_EVER;
 
663
        } else {
 
664
            return MFD_CANNOT_CREATE_NOW;
 
665
        }
 
666
    }
 
667
 
 
668
    return rc;
 
669
}                               /* ipCidrRouteTable_validate_index */
 
670
 
296
671
/** @} */