aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/snmp
diff options
context:
space:
mode:
authorPascal Quantin <pascal@wireshark.org>2019-11-07 16:15:03 +0100
committerPascal Quantin <pascal@wireshark.org>2019-11-07 18:40:25 +0000
commite0239089525e904e3f11206f6296addf138a9125 (patch)
tree4ad49ea9c2428490701d62f835fd7027482a2a91 /epan/dissectors/asn1/snmp
parent04e400d7f719d2f2132704ab125cb469b560a9be (diff)
SNMP: do not modify the ASN.1 source for request/response tracking
Follow-up of g14d398fe67 Change-Id: Ic6c4966d8a9a1a53c8d7daeeda7fd71779f9b07d Reviewed-on: https://code.wireshark.org/review/35025 Petri-Dish: Pascal Quantin <pascal@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Diffstat (limited to 'epan/dissectors/asn1/snmp')
-rw-r--r--epan/dissectors/asn1/snmp/snmp.asn19
-rw-r--r--epan/dissectors/asn1/snmp/snmp.cnf6
2 files changed, 14 insertions, 11 deletions
diff --git a/epan/dissectors/asn1/snmp/snmp.asn b/epan/dissectors/asn1/snmp/snmp.asn
index 0361783a97..9b214472a3 100644
--- a/epan/dissectors/asn1/snmp/snmp.asn
+++ b/epan/dissectors/asn1/snmp/snmp.asn
@@ -1,5 +1,5 @@
RFC1157-SNMP DEFINITIONS ::= BEGIN
-
+
-- IMPORTS
-- ObjectName, ObjectSyntax, NetworkAddress, IpAddress, TimeTicks
-- FROM RFC1155-SMI;
@@ -38,7 +38,7 @@ RFC1157-SNMP DEFINITIONS ::= BEGIN
--Empty ::= NULL
-- hundredths of seconds since an event, usualy the last restart
---TimeTicks ::= [APPLICATION 3] IMPLICIT INTEGER (0..4294967295)
+--TimeTicks ::= [APPLICATION 3] IMPLICIT INTEGER (0..4294967295)
--Opaque ::= [APPLICATION 4] IMPLICIT OCTET STRING
@@ -60,6 +60,7 @@ NotificationName ::= OBJECT IDENTIFIER
EnterpriseOID ::= OBJECT IDENTIFIER
NetworkAddress ::= [APPLICATION 0] IMPLICIT OCTET STRING (SIZE (4))
TimeTicks ::= [APPLICATION 3] IMPLICIT INTEGER (0..4294967295)
+Integer32 ::= INTEGER (-2147483648..2147483647)
ObjectName ::= OBJECT IDENTIFIER
--Counter32 ::= [APPLICATION 1] IMPLICIT INTEGER (0..4294967295)
--Gauge32 ::= [APPLICATION 2] IMPLICIT INTEGER (0..4294967295)
@@ -115,7 +116,7 @@ SNMPv3Message ::= SEQUENCE {
-- this element is in same position as in SNMPv1
-- and SNMPv2c, allowing recognition
-- the value 3 is used for snmpv3
- msgVersion Version,
+ msgVersion Version,
-- INTEGER ( 0 .. 2147483647 ),
-- administrative parameters
msgGlobalData HeaderData,
@@ -152,7 +153,7 @@ ScopedPDU ::= SEQUENCE {
contextEngineID SnmpEngineID,
contextName OCTET STRING,
data PDUs
- -- ANY
+ -- ANY
-- e.g., PDUs as defined in RFC 1905
}
@@ -168,7 +169,7 @@ PDUs ::= CHOICE {
getBulkRequest GetBulkRequest-PDU,
informRequest InformRequest-PDU,
snmpV2-trap SNMPv2-Trap-PDU,
- report Report-PDU
+ report Report-PDU
}
-- PDUs
@@ -192,7 +193,7 @@ Report-PDU ::= [8] IMPLICIT PDU
PDU ::= SEQUENCE {
- request-id RequestID,
+ request-id INTEGER,
error-status INTEGER {
noError(0),
tooBig(1),
@@ -218,11 +219,9 @@ PDU ::= SEQUENCE {
variable-bindings VarBindList
}
-RequestID ::= INTEGER
-
-- v2
BulkPDU ::= SEQUENCE { -- MUST be identical in structure to PDU
- request-id RequestID,
+ request-id Integer32,
non-repeaters INTEGER (0..2147483647),
max-repetitions INTEGER (0..2147483647),
variable-bindings VarBindList
@@ -324,7 +323,7 @@ RReqPDU ::= [APPLICATION 2] IMPLICIT SEQUENCE {
subtree ObjectName,
priority INTEGER (-1..2147483647), -- the lower the better, "-1" means default
- operation INTEGER {
+ operation INTEGER {
delete(0), -- remove registration
readOnly(1), -- add registration, objects are RO
readWrite(2) -- .., objects are RW
diff --git a/epan/dissectors/asn1/snmp/snmp.cnf b/epan/dissectors/asn1/snmp/snmp.cnf
index a0f823f3d0..cf22403dc9 100644
--- a/epan/dissectors/asn1/snmp/snmp.cnf
+++ b/epan/dissectors/asn1/snmp/snmp.cnf
@@ -47,7 +47,11 @@ BulkPDU/request-id bulkPDU_request-id
#.END
-#.FN_BODY RequestID VAL_PTR = &RequestID
+#.FN_BODY PDU/request-id VAL_PTR = &RequestID
+
+%(DEFAULT_BODY)s
+
+#.FN_BODY Integer32 VAL_PTR = &RequestID
%(DEFAULT_BODY)s