aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/snmp/src')
-rw-r--r--lib/snmp/src/compile/snmpc.erl7
-rw-r--r--lib/snmp/src/compile/snmpc.hrl23
-rw-r--r--lib/snmp/src/compile/snmpc_mib_gram.yrl56
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,