Commit Graph

1172 Commits (master)

Author SHA1 Message Date
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 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
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 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 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
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
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 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
Ilya Etingof 7f65dde49a Fix typos 2018-07-03 08:05:23 +02:00
Ilya Etingof da4539e34c
Overhaul SMI/MIB instrumentation API (#161)
Overhaul SMI/MIB instrumentation API

SMI/MIB managed objects API overhauled for simplicity and
flexibility breaking backward compatibility.

This change would allow way more control over custom MIB
managed objects and also is the prerequisite for
asynchronous MIB instrumentation.
2018-06-30 20:14:57 +02:00
Ilya Etingof f1e9f13141 fix potential infinite loop in GETBULK response builder 2018-04-21 23:16:34 +02:00
Ilya Etingof 8935532ee7 Merge branch 'master' of github.com:etingof/pysnmp 2018-04-21 18:46:34 +02:00
Cameron 2b27b49db7 asyncio.async deprecated since 3.4.4 (#143)
* asyncio.async deprecated since 3.4.4
2018-04-21 18:43:45 +02:00
Ilya Etingof 2346e0a9af fixed zero boots/time values put into SNMPv3 TRAP 2018-04-21 17:46:28 +02:00
Ilya Etingof 04f1fa8476 better InetAddressType rendering fix 2018-04-21 17:46:09 +02:00
Ilya Etingof 551e4c9a69 fix InetAddressType rendering 2018-04-19 01:13:55 +02:00
Ilya Etingof 9bac440607 typo fix in RFC1158::snmpOutReadOnlys 2018-04-13 08:58:49 +02:00
Ilya Etingof 4d57bdbbfe fix to MibBuilder.version format 2018-02-25 22:54:16 +01:00
Ilya Etingof 0a29dd1f35 many backward-compatibility aids dropped 2018-02-25 00:08:01 +01:00
Ilya Etingof 24a7988766 strong crypto moved to pysnmpcrypto 2018-02-19 00:41:28 +01:00
mattsb42-aws eed17d7cf8 reworking DES module to fit the same pattern a DES3 and AES modules 2018-02-14 11:19:29 -08:00
mattsb42-aws 5907ed57cc fixing copy-paste docstring typo in AES module 2018-02-14 11:18:54 -08:00
mattsb42-aws 36b2c64ba3 fixing typo in "crypto.CRYPTOGRAPHY" variable name 2018-02-12 13:34:13 -08:00
mattsb42-aws a4442ba387 adding docstrings, cleaning up generic_*crypt missing backend handling, and fixing copy-pasted parameter names on decyrpt methods 2018-02-09 11:12:29 -08:00
mattsb42-aws 9306d4b040 initial migration to backend-selecting crypto 2018-02-09 11:12:29 -08:00
Mike C. Fletcher 3760e7b638 Some documentation clarifications (#125)
* Doc Update: in resolveWithMib docstring, document getting controller

* Expand on the "use mibbuilder" comment as to *how* to use it

Basically how to make the modules you compile with mibbuilder
available to your application via MibBuilder settings

* Add a note explaining that "ASN.1 MIB" means the textual format

Users of the library seeing "ASN.1" may assume (as I did) that
the meaning is "ASN.1 encoded binary version of the MIB" (i.e.
a precompiled version of the MIB in compact internal format).

* Describe how to configure all OIDs to use the ASN.1 mib directories
2018-01-13 19:09:10 +01:00
Ilya Etingof 0ab27d2c38 copyright notice extended 2018-01-03 13:33:05 +01:00
Ilya Etingof 87dee74cac fixed 3DES key localization bug 2017-12-30 15:55:13 +01:00