--- lib/snmp/src/compile/snmpc_mib_gram.yrl.orig 2008-06-27 13:00:23.744070000 -0400 +++ lib/snmp/src/compile/snmpc_mib_gram.yrl 2008-06-27 11:38:22.890684000 -0400 @@ -463,7 +463,7 @@ statusv1 -> atom : statusv1('$1'). -referpart -> 'REFERENCE' string. +referpart -> 'REFERENCE' string : lists:reverse(val('$2')). referpart -> '$empty'. %%---------------------------------------------------------------------- --- lib/snmp/src/compile/snmpc.erl.orig 2008-06-27 13:00:23.736085000 -0400 +++ lib/snmp/src/compile/snmpc.erl 2008-06-27 14:02:14.852324000 -0400 @@ -109,6 +109,7 @@ %% {warnings, bool()} true %% {outdir, string()} "./" %% description +%% reference %% imports %% module_identity %% {module, string()} @@ -188,6 +189,10 @@ get_options(Opts, ["~n description: ~w"|Formats], [Val|Args]); get_options([description|Opts], Formats, Args) -> get_options(Opts, ["~n description"|Formats], Args); +get_options([{reference, Val}|Opts], Formats, Args) -> + get_options(Opts, ["~n reference: ~w"|Formats], [Val|Args]); +get_options([reference|Opts], Formats, Args) -> + get_options(Opts, ["~n reference"|Formats], Args); get_options([{warnings, Val}|Opts], Formats, Args) -> get_options(Opts, ["~n warnings: ~w"|Formats], [Val|Args]); get_options([{verbosity, Val}|Opts], Formats, Args) -> @@ -263,6 +268,11 @@ check_options(T); check_options([description| T]) -> %% same as {description, true} check_options(T); +check_options([{reference, Bool}| T]) -> + check_bool(reference, Bool), + check_options(T); +check_options([reference| T]) -> %% same as {reference, true} + check_options(T); check_options([{verbosity, V} | T]) when atom(V) -> snmpc_lib:vvalidate(V), check_options(T); @@ -294,9 +304,12 @@ snmpc_lib:key1search(deprecated, Options, true). get_description(Options) -> - case lists:member(description,Options) of + get_bool_option(description, Options). + +get_bool_option(Option, Options) -> + case lists:member(Option,Options) of false -> - snmpc_lib:key1search(description,Options,false); + snmpc_lib:key1search(Option,Options,false); true -> true end. @@ -309,7 +322,13 @@ undefined end. - +make_reference(Reference) -> + case get(reference) of + true -> + [{reference, Reference}]; + _ -> + [] + end. %%---------------------------------------------------------------------- %% verbosity stuff @@ -363,6 +382,7 @@ put(options, Options), put(verbosity, get_verbosity(Options)), put(description, get_description(Options)), + put(reference, get_bool_option(reference, Options)), File = filename:rootname(MibFileName, ".mib"), put(filename, filename:basename(File ++ ".mib")), R = case catch c_impl(File) of @@ -441,6 +461,7 @@ status = Tstatus, description = Desc1, units = Tunits, + reference = Ref, name_assign = Tindex}, Tline}, {#mc_object_type{name = NameOfEntry, @@ -470,12 +491,13 @@ " IndexingInfo: ~p~n" " Estatus: ~p~n" " Eunits: ~p~n" + " Ref: ~p~n" " Eline: ~p~n" " FieldList: ~p~n" " Sline: ~p", [NameOfTable,SeqName,Taccess,Kind,Tstatus, Tindex,Tunits,Tline, - NameOfEntry,TEline,IndexingInfo,Estatus,Eunits,Eline, + NameOfEntry,TEline,IndexingInfo,Estatus,Eunits,Ref,Eline, FieldList,Sline]), update_status(NameOfTable, Tstatus), update_status(NameOfEntry, Estatus), @@ -504,9 +526,8 @@ IndexingInfo, ColMEs), snmpc_lib:add_cdata(#cdata.mes, [TableEntryME, - TableME#me{assocList=[{table_info, - TableInfo}]} | - ColMEs]), + TableME#me{assocList=[{table_info, TableInfo}] ++ make_reference(Ref)} + | ColMEs]), definitions_loop(RestObjs, Deprecated); definitions_loop([{#mc_object_type{name = NameOfTable, @@ -516,6 +537,7 @@ status = Tstatus, description = Desc1, units = Tunits, + reference = Ref, name_assign = Tindex}, Tline}, {#mc_object_type{name = NameOfEntry, syntax = {{type, SeqName},_}, @@ -543,12 +565,13 @@ " Estatus: ~p~n" " BadOID: ~p~n" " Eunits: ~p~n" + " Ref: ~p~n" " Eline: ~p~n" " FieldList: ~p~n" " Sline: ~p", [NameOfTable,SeqName,Taccess,Kind,Tstatus, Tindex,Tunits,Tline, - NameOfEntry,IndexingInfo,Estatus,BadOID,Eunits,Eline, + NameOfEntry,IndexingInfo,Estatus,BadOID,Eunits,Ref,Eline, FieldList,Sline]), update_status(NameOfTable, Tstatus), update_status(NameOfEntry, Estatus), @@ -578,9 +601,8 @@ IndexingInfo, ColMEs), snmpc_lib:add_cdata(#cdata.mes, [TableEntryME, - TableME#me{assocList=[{table_info, - TableInfo}]} | - ColMEs]), + TableME#me{assocList=[{table_info, TableInfo}] ++ make_reference(Ref)} + | ColMEs]), definitions_loop(RestObjs, Deprecated); definitions_loop([{#mc_new_type{name = NewTypeName,