add cvs id tag; add comment documenting nonindex; indexes loop will now
include index for tables using augments


git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@8596 06827809-a52a-0410-b366-d66718629ded
diff --git a/local/mib2c b/local/mib2c
index bec924a..a83eb4b 100755
--- a/local/mib2c
+++ b/local/mib2c
@@ -2,6 +2,8 @@
 #!/usr/bin/perl -w
 
 #
+# $Id$
+#
 # Description: 
 #
 # This program, given an OID reference as an argument, creates some
@@ -257,6 +259,10 @@
 #     repeat iterate over code until @end@ setting $VAR to all known
 #     columns within a given table.  Obviously this must be called
 #     within a foreach-table clause.
+#   @foreach $VAR nonindex@
+#     repeat iterate over code until @end@ setting $VAR to all known
+#     non-index columns within a given table.  Obviously this must be called
+#     within a foreach-table clause.
 #   @foreach $VAR index@
 #     repeat iterate over code until @end@ setting $VAR to all known
 #     indexes within a given table.  Obviously this must be called
@@ -680,6 +686,21 @@
 	my $tablename = $mib->{label};
 	my $entry = $mib->{children};
 	my $columns = $entry->[0]{children};
+        my $augments = $entry->[0]{'augments'};
+        if ($augments) {
+           my $mib = $SNMP::MIB{$augments} || 
+		die "can't find info about augmented table $augments in table $tablename\n";
+           $mib = $mib->{parent} || 
+		die "can't find info about augmented table $augments in table $tablename\n";
+	   my $entry = $mib->{children};
+	   foreach my $index (@{$entry->[0]{'indexes'}}) {
+	       my $node = $SNMP::MIB{$index} || 
+		   die "can't find info about index $index in table $tablename\n";
+	       push @{$tables{$tablename}{'index'}}, $index;
+               $indexes = "$indexes $index"
+	   }
+           my $columns = $entry->[0]{children};
+        }
 	foreach my $index (@{$entry->[0]{'indexes'}}) {
 	    my $node = $SNMP::MIB{$index} || 
 		die "can't find info about index $index in table $tablename\n";