Commit Graph

1836 Commits (master)

Author SHA1 Message Date
Ilya Etingof 72f3878be0 added missing SHA2 support for Blumenthal key localization 2017-12-03 20:46:25 +01:00
Ilya Etingof 114e90414d skip printing out non-initialized MIB objects in example MIB walk 2017-12-03 20:21:05 +01:00
Ilya Etingof 0294172286 named bits fix at rfc1902.Bits 2017-12-03 14:06:57 +01:00
Ilya Etingof 5f7e552690
migrated references from SourceForge (#110) 2017-11-17 11:01:14 +01:00
Ilya Etingof b6a19e8fb6 fixed typo in the changelog 2017-11-11 14:29:26 +01:00
Ilya Etingof c1ede44061 4.4.2 release 2017-11-11 14:24:39 +01:00
Ilya Etingof bb48699267 missing get/setReference() added to SNMPv2-SMI::NotificationType 2017-11-11 13:05:47 +01:00
Ilya Etingof 0645fc6151
fixed SNMPv3 retries algorithm inconsistencies (#106) 2017-11-11 10:31:30 +01:00
Ilya Etingof 9f6230113e
encode IPv6 requirement into example scripts names (#102) 2017-11-06 14:32:00 +01:00
Ilya Etingof be4f6ed73b added support for some more fields of SMIv2 MACRO types 2017-11-06 00:32:15 +01:00
Ilya Etingof 57186559dc fix to pysnmp version type at MibBuilder 2017-11-06 00:27:54 +01:00
Ilya Etingof 1739070fb0 make pysnmp version available at MibBuilder 2017-11-05 16:14:21 +01:00
Ilya Etingof 408fe6c6ac the `append` option added to .setObjects() 2017-11-05 13:03:18 +01:00
Ilya Etingof 77b15bf6ca updates to Alabaster theme options 2017-11-05 13:02:38 +01:00
Ilya Etingof 6aeb434cf3 fixes to travis 2017-10-26 14:42:30 +02:00
Ilya Etingof 522cb710db fixes to Alabaster theme options 2017-10-26 13:58:28 +02:00
Ilya Etingof 6aad6ec9f6 Alabaster theme options 2017-10-23 12:50:00 +02:00
Ilya Etingof 7ff147b5e0 CHANGELOG updated 2017-10-23 12:26:38 +02:00
Eugene M. Kim f6f0bb9e51 Fix non-implied-OID-to-index conversion (#98)
Non-implied OIDs, when laid in index, should be prefixed with the length
of the OID, but the current code erroneously uses len(self.name), that
is, the length of the MibTableRow's name instead.
2017-10-23 12:24:22 +02:00
Ilya Etingof a5420fd95d 4.4.2 2017-10-23 12:23:49 +02:00
Ilya Etingof 9fd74a00f6 4.4.1 2017-10-23 12:04:33 +02:00
Ilya Etingof 7a3a504d54 make sure to pass an initializer to ASN.1 Null()-based objects 2017-10-19 00:40:56 +02:00
Ilya Etingof fff063aba9 fixed non-translated PDU version retries at CommandGenerator 2017-10-18 12:14:53 +02:00
Ilya Etingof 05df34cc3a make sure not to pass `None` to SMI .setValue()
This is a prerequisite for pyasn1 0.4.x
2017-10-18 11:48:50 +02:00
Ilya Etingof 1065d25a16 make sure to pass an initializer to ASN.1 Null()
This is a prerequisite for pyasn1 0.4.x
2017-10-18 11:45:02 +02:00
Ilya Etingof 2d75ac5da1 fixed TestAndIncr implementation 2017-10-18 10:18:21 +02:00
Ilya Etingof 5127dc10e7 thanks to astralblue 2017-10-18 00:18:42 +02:00
Ilya Etingof 7926d10748 note fixed error 2017-10-18 00:17:40 +02:00
Eugene M. Kim 78ee2edfce Fix InetAddress-to-InetAddressIPv{4,6} index cast (#97)
* Fix InetAddress-to-InetAddressIPv{4,6} index cast

Previously, the pretty value of the InetAddress instance was being used.
Since InetAddress does not know how to format the raw octets to
protocol-specific syntax (IPv4 or IPv6), the pretty value was something
like u'\x00\x00\x00\x00' instead of u'0.0.0.0', which in turn caused
parse error in the protocol-specific subclass.

Passing the raw value (4- or 16-byte octet string) itself works as the
protocol-specific subclasses know how to handle these.
2017-10-18 00:13:50 +02:00
Ilya Etingof a6abfd8266 documentation typo fix 2017-10-17 00:52:10 +02:00
Ilya Etingof 527ad7f98f note NetworkAddress in SNMP table indices fix 2017-10-14 11:31:31 +02:00
Eugene M. Kim 82bba95407 Let NetworkAddress be cloned from another NetworkAddress (#93)
This is to meet the basic clone() contract and unbreak round-trip index
conversions.  Previously only IPAddress values were allowed as the clone
source.
2017-10-14 10:45:22 +02:00
Eugene M. Kim cd8d66f8a1 Do not cache indices with a mutable index value (#94)
NetworkAddress is one such index value.
2017-10-14 10:42:28 +02:00
Eugene M. Kim 37551d9271 Improve documentation of varBindTable returned by bulkCmd() (#91)
* Clarify varBindTable returned by bulkCmd() in docs
* Fix bulkCmd() examples
* Abbreviate endOfMibView
* Fix fixed-width markup of Get{BulkRequest,Response}-PDU
2017-10-12 09:24:11 +02:00
Ilya Etingof 3c4c1ccf46 note a fix in changelog 2017-10-10 11:36:44 +02:00
Eugene M. Kim c954431ecc Fix OID type matching in ObjectType.resolveWithMib (#90)
That is, reverse the supertype-subtype direction in the type matching
call: Previously it was checking if the value was a supertype of OID,
whereas the correct check should be whether the value is a subtype of
OID.  This had gone undetected so far because all values were of simple,
tagged types, and if a value is not an OID, their tag set differed, i.e.
neither is a subtype of the other.

Recent introduction of NetworkAddress revealed this bug: Being an
untagged Choice type, NetworkAddress's tag set is empty, and it counts
as a supertype of OID: resolveWithMib() then erroneously treated it as
an OID.
2017-10-10 11:33:47 +02:00
Eugene M. Kim 1d5af2afc0 Render NetworkAddress indices (#87)
* Add OID-index roundtrip methods to NetworkAddress

This enables use of NetworkAddress as a table index.

* Use NetworkAddress for RFC1213-MIB::atNetAddress

Previously atNetAddress defined to be an IpAddress, whose table index
mapping was different from that of NetworkAddress.  This prevented
proper use of RFC1213-MIB::atTable instances, because:

- OID-to-symbol resolution was failing;
- Symbol-to-OID mapping result was invalid.

* Move clone() from Choice to NetworkAddress

Previously it was implemented in pyasn1.type.univ.Choice in case there
may be more Choice-based types—such as NetworkAddress—used as a table
index.  However, SMIv2 (RFC 2578) limits the SYNTAX of an OBJECT-TYPE to
be only PyASN1 “simple” types, and NetworkAddress is the only known
Choice-based type used as a table index in MIB-I, so there is little
reason to clutter PyASN1 with the one-off logic in anticipation of
something will probably never happen.

Having NetworkAddress's own clone() method also allows use of string
literals as the value, so the following invocations are all valid:

    na = NetworkAddress()
    na1234 = na.clone('1.2.3.4')
    na1234_2 = na1234.clone()
    na1234_3 = na.clone(na1234)
    na4321 = na.clone(IpAddress('4.3.2.1'))

To elaborate on simple types, SMIv2 limits the object syntax to be:

- a base type (or its refinement)
- a textual convention (or its refinement); or
- a BITS pseudo-type.

All base types descend from ASN.1 integer, octet string, or OID, all of
which are simple types.  PySNMP defines SMIv2 BITS as a subclass of
OctetString, which is again a simple type.  Finally, a SMIv2 textual
convention (RFC 2579) is simply a syntactic sugar applied on top of
either a base type a BITS type, so it is a simple type.
2017-10-09 13:10:49 +02:00
Ilya Etingof c383f2de5b Sphinx theme changed to Alabaster, minor documentation tweaks 2017-10-06 18:39:51 +02:00
Ilya Etingof 0f32c00d89 fixed Bits.clone()/subtype() 2017-10-06 01:16:56 +02:00
Ilya Etingof 9d35779f1c NotificationReceiver reports SNMPv1 TRAP community string 2017-10-05 23:21:30 +02:00
Ilya Etingof 82e5946101 pycryptodome replaced with pycryptodomex 2017-10-05 15:51:39 +02:00
Ilya Etingof 01605e794e Catch and pass exceptions to Twisted deferred 2017-10-05 12:38:27 +02:00
Eugene M. Kim b05edd892d Catch and pass exceptions to asyncio futures (#82)
Previously an exceptions raised by vbProcessor.unmakeVarBinds() fell
through, and asyncio base event loop caught and reported it on stderr,
while the original cmdgen's future went unfinished, causing the call to
hang forever.  Match the synchronous version's behavior, which is to
raise the exception for the caller of the cmdgen to catch.
2017-10-05 12:14:14 +02:00
Eugene M. Kim b8187b8c1c Fix implied string index rendering (#84)
Commit 30167082cd fixed string index
rendering except for implied string types, which were left broken.
Close that gap by applying the same workaround.
2017-10-05 11:51:36 +02:00
Ilya Etingof 7404925300 fixed Bits.prettyPrint() crash 2017-09-18 14:10:08 +02:00
Ilya Etingof d5a0891999 better partial SNMP message decoding 2017-08-25 08:37:03 +02:00
Ilya Etingof 30167082cd fixed indices rendering for InetAddressIPv6 type
Also added a workaround to pyasn1 constraints
relationships resolution bug that affected SNMP table
indices rendering.
2017-08-13 10:49:18 +02:00
Ilya Etingof 33c6f6ecc6 fix to .setFromName() to preserve its arg type 2017-08-12 10:23:32 +02:00
Ilya Etingof dc3ff5fe11 unnecessary OctetString.prettyOut override removed 2017-08-11 00:45:54 +02:00
Ilya Etingof 9c55a5293c fail gracefully when sha2 suite is not available 2017-08-03 23:52:48 +02:00