diff --git a/lib/modules/Protocols.pmod/SNMP.pmod/protocol.pike b/lib/modules/Protocols.pmod/SNMP.pmod/protocol.pike index fab879b9b9f33d11980eadc56c8b0eb7ba61ac6d..cdef4a9985e5681d5d00af30a7a775b9288d676a 100644 --- a/lib/modules/Protocols.pmod/SNMP.pmod/protocol.pike +++ b/lib/modules/Protocols.pmod/SNMP.pmod/protocol.pike @@ -24,23 +24,25 @@ inherit Stdio.UDP : snmp; import Standards.ASN1.Types; +#define U(x) make_combined_tag(0, (x)) + protected mapping snmp_type_proc = ([ // from RFC-1065 : - 64 : OctetString, // ipaddress - 65 : Integer, // counter - 66 : Integer, // gauge - 67 : Integer, // timeticks - 68 : OctetString, // opaque + U(64) : OctetString, // ipaddress + U(65) : Integer, // counter + U(66) : Integer, // gauge + U(67) : Integer, // timeticks + U(68) : OctetString, // opaque // v2 - 70 : Integer, // counter64 + U(70) : Integer, // counter64 // context PDU - 128 : Sequence, - 129 : Sequence, - 130 : Sequence, - 131 : Sequence, + U(128) : Sequence, + U(129) : Sequence, + U(130) : Sequence, + U(131) : Sequence, ]); diff --git a/lib/modules/Standards.pmod/ASN1.pmod/Decode.pmod b/lib/modules/Standards.pmod/ASN1.pmod/Decode.pmod index 7d0e8841d33a01619e0adea12a0c7b2654218757..e936ecfb1dc2b1a1cf843c98b06a2d4f3336dd55 100644 --- a/lib/modules/Standards.pmod/ASN1.pmod/Decode.pmod +++ b/lib/modules/Standards.pmod/ASN1.pmod/Decode.pmod @@ -207,8 +207,11 @@ mapping(int:program(.Types.Object)) universal_types = //! a DER encoded object //! //! @param types -//! An optional set of application-specific types. -//! This set is used to extend @[universal_types]. +//! An optional set of application-specific types. Should map +//! combined tag numbers to classes from or derived from +//! @[Standards.ASN1.Types]. Combined tag numbers may be generated +//! using @[Standards.ASN1.Types.make_combined_tag]. This set is +//! used to extend @[universal_types]. //! //! @returns //! an object from @[Standards.ASN1.Types] or