## ## USAGE: ## mib2c -c mib2c.genhtml.conf STARTINGNODE ## ## Optional extra arguments: ## ## -S cssfile=file.css (specifies an alternate CSS style ## file to include in the output) ## ## ## try to strip leading white space from text ## @define DO_FORMATED_TEXT@ @startperl@ my ($s) = ($vars{'x'} =~ /\n(\s+)/); $vars{'x'} =~ s/^$s//gm; 0; @endperl@
$x
@enddefine@ ## ## print a description clause (include TC info and references ## @define DO_DESCR@ @if "$i.perltype" ne "$i.syntax"@

@eval $tmpsyn = "$i.syntax"@ @perleval if (!defined($TCS{$vars{'tmpsyn'}})) { $TCS{$vars{'tmpsyn'}} = $vars{'i'}; }; 0;@ Note: this object is based on the $i.syntax TEXTUAL-CONVENTION.

@end@ @eval $x = "$i.description"@ @calldefine DO_FORMATED_TEXT@ ##@startperl@ ## my ($s) = ($vars{'x'} =~ /\n(\s+)/); ## $vars{'x'} =~ s/^$s//gm; ## 0; ##@endperl@ ##
##$x
##
@if "$i.reference" ne ""@ @eval $x = "$i.reference"@

Also see Reference: @calldefine DO_FORMATED_TEXT@

@end@ @enddefine@ ## ## print information (a row) about a given node ## @define NODE_INFO@ @if ("$i.status" eq "Current")@ @else@ @end@ @eval $tmpi = "$i.parent"@ @if "$doindexstuff" ne "" && "$tmpi.parent" ne "$t"@ (external from $tmpi.parent) @else@ $i.subid @end@
$i ## ## print the data type ## @if ("$i.status" ne "Current")@ DEPRECATED
@end@ $i.perltype ## ## print range information ## @if "$i.ranges"@ @if "$i.perltype" eq 'OCTETSTR' || "$i.perltype" eq 'OBJECTID'@
Legal Lengths: @else@
Legal values: @end@ @eval $tmpdidit = 0@ @foreach $st $end range $i@ @if "$tmpdidit" == "1"@ , @end@ @if "$st" eq "$end"@ $st @else@ $st .. $end @end@ @eval $tmpdidit = 1@ @end@ @end@ ## ## check for TC vs non-TC cases ## @if "$i.perltype" ne "$i.syntax"@
@eval $tmpsyn = "$i.syntax"@ @perleval if (!defined($TCS{$vars{'tmpsyn'}})) { $TCS{$vars{'tmpsyn'}} = $vars{'i'}; }; 0;@
$i.syntax @if $i.enums@
(ENUM list below) @end@ @else@ @if $i.enums@ @foreach $e $v enum@ @end@
ValueLabel/Meaning
$v$e
@end@ @end@ $i.access @if !"$dont_do_oids"@ $i.objectID @end@ @calldefine DO_DESCR@ @enddefine@ @open ${name}.html@ MIB information for $name

INTRODUCTION

## ## Table of contents ##

TABLE OF CONTENTS

## ## Start of definitions ## @foreach $Current stuff Current Deprecated@ @if "$Current" ne "Current"@ @eval $namestring = "notcurrent"@

DEPRECATED OR OBSOLETE OR HISTORIC OBJECTS


@else@ @eval $namestring = "current"@ @end@

SCALAR OBJECTS

    @foreach $i scalar@ @if ("$Current" eq "Current" && "$i.status" eq "Current") || ("$Current" ne "Current" && "$i.status" ne "Current")@ @calldefine NODE_INFO@ @end@ @end@
    NameTypeAccessOIDDescription

TABLE OBJECTS

@eval $dont_do_oids = 1@ @foreach $t table@ @if ("$Current" eq "Current" && "$t.status" eq "Current") || ("$Current" ne "Current" && "$t.status" ne "Current")@

Table $t

    @eval $i ="$t"@ @calldefine DO_DESCR@ @eval $tmpx = $t@ @perleval $vars{'tmpx'} =~ s/Table/Entry/; 0;@ @eval $i = "$tmpx"@ @calldefine DO_DESCR@
    Table Name$t
    In MIB$t.module
    Registered at OID$t.objectID
    Table Description
    Row Description

    $t Indexes:

    @foreach $i index@ @calldefine NODE_INFO@ @end@
    NameTypeAccessDescription

    Other $t Columns:

    @foreach $i nonindex@ @calldefine NODE_INFO@ @end@
    NameTypeAccessDescription
@end@ @end@ @end@

NOTIFICATIONS



TEXTUAL CONVENTIONS

TREE VIEW

@eval $mod = "$name.module"@

Tree view generated by running: snmptranslate -Tp $mod::$name

@startperl@
open(TREE,"snmptranslate -Tp $vars{mod}::$vars{name}|");
while() {
  s/(\+-- .*\s)(\w+)(\(\d+\))$/$1$2<\/a>$3/;
  s/\+--(\w+)/+--$1<\/a>/;
  s/Textual Convention: (\w+)/Textual Convention: $1<\/a>/;
  mib2c_output($_);
}
close(TREE);
return 0;
@endperl@