Commit Graph

1836 Commits (master)

Author SHA1 Message Date
Ilya Etingof acd16a65f8 Disable pypy build in Travis
Because it stopped working.
2018-11-03 19:44:02 +01:00
Ilya Etingof e425da2a0f Disable Travis builds for py 2.6, 3.2 & 3.3
Seems like they discontinued those.
2018-11-03 14:18:59 +01:00
Ilya Etingof 4994111b2b Fix hlapi LCD to include `contextName` (#217)
Fixed hlapi LCD configurator to include `contextName`.
Prior to this fix sending SNMPv3 TRAP with non-default
`contextName` would fail.

This change modifies the signature of the internal
LCD methods.
2018-11-03 12:55:51 +01:00
Ilya Etingof 9ebd0c0fab Expose ASN.1 `Null` type through `rfc1902` module 2018-10-26 08:45:56 +02:00
Ilya Etingof 4aac8b23d5 Use `compile()` before `exec` of MIB modules
This change attaches the file name to the stack frames
what is helpful when reading traceback or debugging
interactively.
2018-10-26 08:45:46 +02:00
Ilya Etingof 602c4dd304 Merge branch 'master' of github.com:etingof/pysnmp 2018-10-26 08:20:37 +02:00
Ilya Etingof 0c0d054e8e
Refactor MIB state machine into asynchronous operations (#210)
Convert to async MIB instrumentation API (#210)

MIB instrumentation API changed to allow for asynchronous
managed objects access. The MIB instrumentation methods
called by the state machine now return immediately and
resume once the callback is called.

The built-in SNMPv2-SMI objects are still synchronous.

This change is a prerequisite for fully asynchronous managed objects
implementation.
2018-10-24 10:14:33 +02:00
Ilya Etingof 40cfd938c4 Fix typos 2018-10-17 23:28:26 +02:00
Ilya Etingof 534a5bb810
Convert to async MIB instrumentation API (#209)
MIB instrumentation API changed to allow for asynchronous
managed objects access. Although built-in SNMPv2-SMI objects
are still synchronous, the MIB instrumentation API is async
what allows users to replace default MIB instrumentation
with their own, potentially asynchronous.

CommandResponder refactored to facilitate asynchronous
MIB instrumentation routines. The `readVars`, `readNextVars`
and `writeVars` MIB controller methods return immediately and
deliver their results via a call back.

SMI/MIB managed objects API overhauled for simplicity and
flexibility breaking backward compatibility.
2018-10-13 20:21:31 +02:00
Ilya Etingof 12138b182c Fix Sphinx markup for USM crypto algorithm IDs 2018-10-06 20:15:39 +02:00
Ilya Etingof 593ff19283 Reformat `isAccessAllowed()` for clarity 2018-10-06 09:32:23 +02:00
Fabrizio Vanni 35e9c6f7a6 Avoid deprecation warnings for asyncio.async() in server mode (#202)
This is actually needed for Python 3.7 which introduces async and await
as  reserved keywords, see https://docs.python.org/3/whatsnew/3.7.html
2018-09-26 11:12:30 +02:00
Ilya Etingof 53e67f9533 Ensure distinct transports if timeout/retries differ
Fix hlapi/v3arch transport target caching to ensure transport targets
are different even if just timeout/retries options differ.
2018-09-20 10:45:38 +02:00
Ilya Etingof da7582db99 Register missing v1arch.asyncore.sync sub-package 2018-09-14 01:30:35 +02:00
Ilya Etingof b334f5cf63 Accommodate changed `.writeVars` signature 2018-09-14 00:53:45 +02:00
Ilya Etingof 6e30bc0457 Release 4.4.6 2018-09-13 23:53:35 +02:00
Ilya Etingof bdc0ac2977
Tolerate non-initialised entries in SNMP community table (#195)
It can happen that SNMP community table contains uninitialized entries.
These entries may stop internal SNMP community table indexing which
is done in rfc2576 to speed up SNMP engine operations when SNMPv1/v2c
is involved. Once a bad entry gets into SNMP community table, all
the rest queries would start failing.

This patch ignores incomplete SNMP community table entries in the
course of building indices.
2018-09-13 23:51:43 +02:00
Ilya Etingof 74434d710c Tolerate duplicate enumerations
Possible duplicate enumerations in `Bits` and `Integer` SMI types
causes pyasn1 exception. This fix reduces duplicates prior to
passing them to pyasn1.
2018-09-09 12:24:39 +02:00
Ilya Etingof b2b10e75c5 Add a CHANGELOG entry for previous fix 2018-09-09 09:40:04 +02:00
Ryan Van Gilder 7cd0b148b1 Fix lcd.unconfigure not removing cached addr value preventing the same target being re-configured (#194) 2018-09-09 09:29:32 +02:00
Ilya Etingof 1537699336 Simplify SNMPv3 TRAP receiver example 2018-09-02 08:45:31 +02:00
Ilya Etingof ac0b956d00
Add `hlapi.v1arch` API (#186)
* Add `hlapi.v1arch` API

Introduce new sub-package `pysnmp.hlapi.v1arch` which
wraps otherwise very detailed packet-level SNMP
messaging into a handful of convenience functions.

As a side effect, the `pysnmp.hlapi.*` sub-packages
moved under `pysnmp.hlapi.v3arch` though `pysnmp.hlapi`
still exposes `pysnmp.hlappi.v3arch.*` symbols to
retain some degree of backward compatibility.

The signature of the hlapi `.sendNotification()` call
has changed to accept `*varBinds` instead of a sequence
of `varBinds`. The rationale is to unify this method
call with similar methods of CommandGenerator.

* Add v1arch docs and reshuffle hlapi docs
2018-08-12 17:22:58 +02:00
Ilya Etingof 488ec26798 Recover missing LICENSE in tarball 2018-08-08 07:56:35 +02:00
Ilya Etingof 1b240862ed Improve long description in Trove 2018-08-06 23:38:15 +02:00
Ilya Etingof d662c557a7 Improve package build and dependency tracking 2018-08-06 23:37:07 +02:00
Ilya Etingof 861d28f200 enable py3.2 build in Travis 2018-08-06 16:56:55 +02:00
Ilya Etingof 9a81eaa1ee Rename LICENSE.txt -> LICENSE.rst 2018-08-06 09:23:25 +02:00
Ilya Etingof 6898b225d2 VACM contextName memory leak fix followup 2018-08-06 09:16:50 +02:00
Ilya Etingof a57dc32430 VACM contextName memory leak fix 2018-08-06 09:16:50 +02:00
Ilya Etingof 3b514f9aec Fix PySnmpError implementation
This is a follow up fix to make PySnmpError properly
overriding base Exception call signature
2018-08-06 09:16:50 +02:00
Ilya Etingof 853ba0bbf5 Add PySnmpError.cause attribute
To convey parent exception information on re-raise
2018-08-06 09:16:50 +02:00
Ilya Etingof 797b4fe627 Fix out-of-scope OID leak in hlapi table
Fixed out-of-scope OIDs possibly leaking at the end of
SNMP table at hlapi `nextCmd` and `bulkCmd` calls when
`lexicographicMode = False`.
2018-08-06 09:16:50 +02:00
Ilya Etingof 7b28a4822c Fix crash on wrong SNMPv3 security model
Fixed crash caused by incoming SNMPv3 message
requesting SNMPv1/v2c security model
2018-08-06 09:16:50 +02:00
Ilya Etingof 54ff456e9c VACM contextName memory leak fix followup 2018-08-06 00:17:24 +02:00
Ilya Etingof 8aa1636fa1 VACM contextName memory leak fix 2018-08-06 00:16:58 +02:00
Ilya Etingof 59281af344 Rename LICENSE.txt -> LICENSE.rst 2018-08-05 21:29:10 +02:00
Ilya Etingof 3bae7dcc6c Fix PySnmpError implementation
This is a follow up fix to make PySnmpError properly
overriding base Exception call signature
2018-08-05 10:25:12 +02:00
Ilya Etingof cf68c25ca8 Add PySnmpError.cause attribute
To convey parent exception information on re-raise
2018-08-05 09:56:11 +02:00
Ilya Etingof 6559ebe1ea Fix out-of-scope OID leak in hlapi table
Fixed out-of-scope OIDs possibly leaking at the end of
SNMP table at hlapi `nextCmd` and `bulkCmd` calls when
`lexicographicMode = False`.
2018-08-05 09:51:52 +02:00
Ilya Etingof 8d4b25841d Fix crash on wrong SNMPv3 security model
Fixed crash caused by incoming SNMPv3 message
requesting SNMPv1/v2c security model
2018-08-04 21:37:10 +02:00
Michal Arbet 0fba331b55 Fix py3.7 syntax error caused by async keyword (#180)
As async is the keyword since Python 3.7, let's use gettattr
built-in function to call async function from asyncio.
2018-07-31 14:48:23 +02:00
Vincent Bernat 2048a92303 Ensure tests run through tox are using the expected Python executable (#175)
Otherwise, they are likely to use the system python.
2018-07-31 08:41:55 +02:00
Ilya Etingof 3e8fd37ee1 Fix `Bits` initialization with `namedValues` 2018-07-20 09:57:16 +02:00
Ilya Etingof a93241007b
Remove `pysnmp.carrier.asynsock` sub-package (#166)
Legacy `pysnmp.carrier.asynsock` backward-compatible
wrapper over `pysnmp.carrier.asyncore` is gone
2018-07-08 12:59:49 +02:00
Ilya Etingof 5168479e42
Add extra-requirements.txt (#165)
* Add extra-requirements.txt

In grand schema of things we now have `requirements.txt`
that list mandatory dependencies, then we have
`extra-requirements.txt` for optional dependencies enabling
all pysnmp features and finally `devel-requirements.txt`
for things required solely for testing.

Strangely, Travis pulls pysnmpcrypto which then pulls
Cryptography while according to pysnmpcrypyo requirement
it should really pull pycryptodomex (which is does in its
own CI job)
2018-07-08 12:05:59 +02:00
Ilya Etingof 8dbc28d360 Fix BULKWALK examples
Avoid sending out extra GETBULK on EOM condition
2018-07-08 09:49:44 +02:00
Ilya Etingof 212e1b54c3 Revert "Fix var-bind initialization from ObjectIdentity at hlapi"
This reverts commit 23d1aa7bf5.
2018-07-05 13:40:32 +02:00
Ilya Etingof dc34f140e3 Fix typo in docstring 2018-07-05 10:42:21 +02:00
Ilya Etingof c950f407ea Fix var-bind initialization from ObjectIdentity at hlapi 2018-07-05 10:42:03 +02:00
Ilya Etingof 91fe21ab60 Fix scoping bug in asyncio wrapper
Probably introduced by commit 2b27b49db7
2018-07-04 09:31:03 +02:00