This file is indexed.

/etc/snmp/mib2c.check_values_local.conf is in libsnmp-dev 5.7.3+dfsg-1.8ubuntu3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
## -*- c -*-
######################################################################
## Do the .h file
######################################################################
@open ${name}_checkfns_local.h@
/*
 * Note: this file originally auto-generated by mib2c using
 *        : $Id$
 * 
 */
#ifndef $name.uc_CHECKFNS_H
#define $name.uc_CHECKFNS_H

@foreach $t table@
/* these functions are designed to check incoming values for 
columns in the $t table for legality with respect to 
datatype and value according to local conventions.  You should modify
them as appropriate.  They will be called from parent check_value
functions that are auto-generated using mib2c and the parent functions
should NOT be modified.
 */

  @foreach $i column@
    @if $i.access =~ /(Write|Create)/@
    int check_${i}_local(int type, $i.decl *val, size_t val_len, $i.decl *old_val, size_t old_val_len);
    @end@
  @end@
@end@

#endif /* $name.uc_CHECKFNS_H */

######################################################################
## Do the .c file
######################################################################
@open ${name}_checkfns_local.c@
/*
 * Note: this file originally auto-generated by mib2c using
 *        $Id$
 */

/* standard headers */
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include "${name}_checkfns.h"
#include "${name}_enums.h"
@run mib2c.column_enums.conf@

@foreach $t table@
  @foreach $i column@
    @if $i.access =~ /(Write|Create)/@
/** Decides if an incoming value for the $i mib node is legal, from a local implementation specific viewpoint.
 *  @param type    The incoming data type.
 *  @param val     The value to be checked.
 *  @param val_len The length of data stored in val (in bytes).
 *  @return 0 if the incoming value is legal, an SNMP error code otherwise.
 */
    int
    check_${i}_local(int type, $i.decl *val, size_t val_len, $i.decl *old_val, size_t old_val_len) {

    /** XXX: you may want to check aspects of the new value that
       were not covered by the automatic checks by the parent function. */

    /** XXX: you make want to check that the requested change from
        the old value to the new value is legal (ie, the transistion
        from one value to another is legal */
      
    /** if everything looks ok, return SNMP_ERR_NOERROR */
      return SNMP_ERR_NOERROR;
    }
    @end@
  @end@
@end@