~ubuntu-branches/debian/lenny/net-snmp/lenny

« back to all changes in this revision

Viewing changes to local/mib2c-conf.d/generic-table-oids.m2c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-05-10 22:20:23 UTC
  • 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
#############################################################  -*- c -*-
2
2
## generic include for XXX. Do not use directly.
3
3
##
4
 
## $Id: generic-table-oids.m2c,v 1.10 2004/10/08 23:39:17 rstory Exp $
 
4
## $Id: generic-table-oids.m2c,v 1.14 2005/09/27 15:56:08 rstory Exp $
5
5
########################################################################
6
6
@if $m2c_create_fewer_files != 1@
7
7
@eval $hack = "Id"@
10
10
@open ${name}.h@
11
11
/*
12
12
 * Note: this file originally auto-generated by mib2c using
13
 
 *  $Id: generic-table-oids.m2c,v 1.10 2004/10/08 23:39:17 rstory Exp $
 
13
 *  $Id: generic-table-oids.m2c,v 1.14 2005/09/27 15:56:08 rstory Exp $
14
14
 *
15
15
 * $$hack:$
16
16
 */
19
19
@end@ // m2c_create_fewer_files
20
20
########################################################################
21
21
@if $m2c_mark_boundary == 1@
22
 
/** START header generated by $RCSfile: generic-table-oids.m2c,v $ $Revision: 1.10 $ */
 
22
/** START header generated by $RCSfile: generic-table-oids.m2c,v $ $Revision: 1.14 $ */
23
23
@end@
24
24
##
25
25
 
26
26
/* column number definitions for table $context */
27
27
#define $context.uc_OID              $context.commaoid
 
28
 
28
29
    @eval $minv = 0xffffffff@
29
30
    @eval $maxv = 0@
 
31
    @eval $gto_flag_req = ""@
 
32
    @eval $gto_flag_set = ""@
30
33
    @foreach $node column@
31
 
#define COLUMN_$node.uc         $node.subid
 
34
#define COLUMN_$node.uc         $node.subid
32
35
        @if $node.accessible == 1@
 
36
           @if ($node.settable == 1) || ($m2c_table_sparse == 1)@
 
37
@             eval $m2c_tmp_gto = ($node.subid - 1)@
 
38
@             if "x$gto_flag_set" eq "x"@
 
39
@               eval $gto_flag_set = "COLUMN_$node.uc_FLAG"@
 
40
@             else@
 
41
@               eval $gto_flag_set = "$gto_flag_set | COLUMN_$node.uc_FLAG"@
 
42
@             end@
 
43
#define COLUMN_$node.uc_FLAG    (0x1 << $m2c_tmp_gto)
 
44
           @end@
 
45
           @if ($m2c_table_row_creation == 1) && ($node.settable == 1) && ("x$node.defval" eq "x")@
 
46
              @if "x$gto_flag_req" eq "x"@
 
47
                 @eval $gto_flag_req = "COLUMN_$node.uc_FLAG"@
 
48
              @else@
 
49
                 @eval $gto_flag_req = "$gto_flag_req | COLUMN_$node.uc_FLAG"@
 
50
              @end@
 
51
           @end@
33
52
          @if $node.subid < $minv@
34
53
             @eval $minv = $node.subid@
35
54
             @eval $minn = "COLUMN_$node.uc"@
39
58
             @eval $maxn = "COLUMN_$node.uc"@
40
59
          @end@
41
60
        @end@
 
61
    
42
62
    @end@ # column
43
63
 
44
 
#define $context.uc_MIN_COL             $minn
45
 
#define $context.uc_MAX_COL             $maxn
 
64
#define $context.uc_MIN_COL   $minn
 
65
#define $context.uc_MAX_COL   $maxn
 
66
##
 
67
## column_set_flags and column_exist_flags are unsigned ints, to 32 is
 
68
## the limit. Could try something with a 'long long' to see if that
 
69
## can get us to 64, or do something like FD_SET, which would let us
 
70
## be pretty unlimited.
 
71
##
 
72
    @if $maxn > 31@
 
73
    @   print ERROR: more than 32 columns not supported yet.@
 
74
    @   exit@
 
75
    @end@
 
76
    
46
77
 
47
78
@   if $m2c_table_settable@
 
79
  @if "x$gto_flag_set" ne "x"@
48
80
    /*
49
 
     * change flags for writable columns
 
81
     * TODO:405:r: Review $context.uc_SETTABLE_COLS macro.
 
82
     * OR together all the writable cols.
50
83
     */
51
 
    @eval $gto_flag_idx = 0@
52
 
    @eval $gto_flag_req = ""@
53
 
    @foreach $node column@
54
 
        @if $node.settable == 1@
55
 
#define FLAG_$node.uc       (0x1 << $gto_flag_idx)
56
 
           @eval $gto_flag_idx = $gto_flag_idx + 1@
57
 
           @if ($m2c_table_row_creation == 1) && ("x$node.defval" eq "x")@
58
 
              @if "x$gto_flag_req" eq "x"@
59
 
                 @eval $gto_flag_req = "FLAG_$node.uc"@
60
 
              @else@
61
 
                 @eval $gto_flag_req = "$gto_flag_req | FLAG_$node.uc"@
62
 
              @end@
63
 
           @end@
64
 
        @end@
65
 
    @end@ # column
66
 
 
67
 
#define FLAG_MAX_$context.uc $gto_flag_idx
68
 
 
69
 
    @if $m2c_table_row_creation == 1@
70
 
      @if "x$gto_flag_req" ne "x"@
 
84
#define $context.uc_SETTABLE_COLS ($gto_flag_set)
 
85
  @end@
 
86
  @if $m2c_table_row_creation@
 
87
    @if "x$gto_flag_req" ne "x"@
71
88
    /*
72
89
     * TODO:405:r: Review $context.uc_REQUIRED_COLS macro.
73
90
     * OR together all the required rows for row creation.
77
94
    
78
95
      @end@
79
96
    @end@
80
 
    @if $gto_flag_idx > 31@
81
 
    @   print ERROR: more then 32 settable columns not supported yet.@
82
 
    @   exit@
83
 
    @end@
84
 
    
85
97
@   end@ # settable
86
98
@if $m2c_create_fewer_files != 1@
87
99
@eval $m2c_save = "$name"@
88
100
@eval $name = "${m2c_save}_oids"@
89
101
@include generic-header-bottom.m2i@
90
 
@eval $name = $m2c_save@
 
102
@eval $name = "$m2c_save"@
91
103
@end@
92
104
########################################################################
93
105
@if $m2c_mark_boundary == 1@
94
 
/** END header generated by $RCSfile: generic-table-oids.m2c,v $ $Revision: 1.10 $ */
 
106
/** END header generated by $RCSfile: generic-table-oids.m2c,v $ $Revision: 1.14 $ */
95
107
@end@