diff options
author | Micael Karlberg <[email protected]> | 2010-12-03 16:40:27 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2010-12-03 16:40:27 +0100 |
commit | c5c4c480f559b805a73d31448e211235da1a2098 (patch) | |
tree | 08e914cf84b59a617cbe9f20c0b88646b8a16f6e /lib/snmp/src/compile | |
parent | 314e80f58bbee2924bf61bdc7b987750d58ca2ef (diff) | |
download | otp-c5c4c480f559b805a73d31448e211235da1a2098.tar.gz otp-c5c4c480f559b805a73d31448e211235da1a2098.tar.bz2 otp-c5c4c480f559b805a73d31448e211235da1a2098.zip |
The parser exports even more of the module-complience data for future use.
In later stages, the compiler curently dropps this info.
Diffstat (limited to 'lib/snmp/src/compile')
-rw-r--r-- | lib/snmp/src/compile/snmpc.erl | 7 | ||||
-rw-r--r-- | lib/snmp/src/compile/snmpc.hrl | 23 | ||||
-rw-r--r-- | lib/snmp/src/compile/snmpc_mib_gram.yrl | 56 |
3 files changed, 52 insertions, 34 deletions
diff --git a/lib/snmp/src/compile/snmpc.erl b/lib/snmp/src/compile/snmpc.erl index d6abf273a1..af6e39d058 100644 --- a/lib/snmp/src/compile/snmpc.erl +++ b/lib/snmp/src/compile/snmpc.erl @@ -933,18 +933,19 @@ definitions_loop([{#mc_agent_capabilities{name = Name, "~n Parent: ~p" "~n SubIndex: ~p", [Name, Status, Desc, Parent, SubIdx], Line), + update_status(Name, Status), ensure_macro_imported('AGENT-CAPABILITIES', Line), snmpc_lib:register_oid(Line, Name, Parent, SubIdx), - NewME = snmpc_lib:makeInternalNode2(false, Name), + NewME = snmpc_lib:makeInternalNode2(false, Name), Description = make_description(Desc), - Reference = + Reference = case Ref of undefined -> []; _ -> [{reference, Ref}] end, - Modules = + Modules = case Mods of undefined -> []; diff --git a/lib/snmp/src/compile/snmpc.hrl b/lib/snmp/src/compile/snmpc.hrl index 76508486fd..f349cae3f2 100644 --- a/lib/snmp/src/compile/snmpc.hrl +++ b/lib/snmp/src/compile/snmpc.hrl @@ -114,6 +114,13 @@ } ). +-record(mc_ac_module, + {name, + groups, + variation + } + ). + -record(mc_ac_object_variation, {name, syntax, @@ -132,13 +139,6 @@ } ). --record(mc_ac_module, - {name, - groups, - variation - } - ). - -record(mc_module_compliance, {name, @@ -156,6 +156,15 @@ } ). +-record(mc_mc_object, + {name, + syntax, + write_syntax, + access, + description + } + ). + -record(mc_mc_module, {name, mandatory, diff --git a/lib/snmp/src/compile/snmpc_mib_gram.yrl b/lib/snmp/src/compile/snmpc_mib_gram.yrl index 5b91cb5d01..18e9b4f1f2 100644 --- a/lib/snmp/src/compile/snmpc_mib_gram.yrl +++ b/lib/snmp/src/compile/snmpc_mib_gram.yrl @@ -102,6 +102,17 @@ textualconvention objectgroup notificationgroup modulecompliance +mc_modulepart +mc_modules +mc_module +mc_modulenamepart +mc_mandatorypart +mc_compliancepart +mc_compliances +mc_compliance +mc_compliancegroup +mc_object +mc_accesspart agentcapabilities ac_status ac_modulepart @@ -114,19 +125,8 @@ ac_variation ac_accesspart ac_access ac_creationpart -mc_modulepart -mc_modules -mc_module -mc_modulenamepart -mc_mandatorypart -mc_compliancepart -mc_compliances -mc_compliance -mc_compliancegroup -object syntaxpart writesyntaxpart -accesspart fsyntax defbitsvalue defbitsnames @@ -622,28 +622,29 @@ mc_modulenamepart -> '$empty' : undefined. mc_mandatorypart -> 'MANDATORY-GROUPS' '{' objects '}' : lists:reverse('$3'). mc_mandatorypart -> '$empty' : []. -mc_compliancepart -> mc_compliances. -mc_compliancepart -> '$empty'. +mc_compliancepart -> mc_compliances : lists:reverse('$1'). +mc_compliancepart -> '$empty' : []. -mc_compliances -> mc_compliance. -mc_compliances -> mc_compliances mc_compliance. +mc_compliances -> mc_compliance : '$1'. +mc_compliances -> mc_compliances mc_compliance : ['$2' | '$1']. -mc_compliance -> mc_compliancegroup. -mc_compliance -> object. +mc_compliance -> mc_compliancegroup : '$1'. +mc_compliance -> mc_object : '$1'. mc_compliancegroup -> 'GROUP' objectname description : make_mc_compliance_group('$2', '$3'). -object -> 'OBJECT' objectname syntaxpart writesyntaxpart accesspart description. +mc_object -> 'OBJECT' objectname syntaxpart writesyntaxpart mc_accesspart description : + make_mc_object('$2', '$3', '$4', '$5', '$6'). -syntaxpart -> 'SYNTAX' syntax. -syntaxpart -> '$empty'. +syntaxpart -> 'SYNTAX' syntax : '$2'. +syntaxpart -> '$empty' : undefined. -writesyntaxpart -> 'WRITE-SYNTAX' syntax. -writesyntaxpart -> '$empty'. +writesyntaxpart -> 'WRITE-SYNTAX' syntax : '$2'. +writesyntaxpart -> '$empty' : undefined. -accesspart -> 'MIN-ACCESS' accessv2. -accesspart -> '$empty'. +mc_accesspart -> 'MIN-ACCESS' accessv2 : '$2'. +mc_accesspart -> '$empty' : undefined. objecttypev2 -> objectname 'OBJECT-TYPE' 'SYNTAX' syntax @@ -899,6 +900,13 @@ make_mc_compliance_group(Name, Desc) -> #mc_mc_compliance_group{name = Name, description = Desc}. +make_mc_object(Name, Syntax, WriteSyntax, Access, Desc) -> + #mc_mc_object{name = Name, + syntax = Syntax, + write_syntax = WriteSyntax, + access = Access, + description = Desc}. + make_object_group(Name, Objs, Status, Desc, Ref, NA) -> #mc_object_group{name = Name, objects = Objs, |