From 588b9b902d191d8010cb6b247fcb07887d59542c Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Sun, 10 Feb 2019 16:38:35 +0100 Subject: Uppercase global constants (#238) This is a massive patch essentially upper-casing global/class attributes that mean to be constants. Some previously exposed constants have been preserved for compatibility reasons (notably, in `hlapi`), though the rest might break user code relying on pysnmp 4. --- .../v3arch/asyncore/sync/agent/ntforg/v3-trap.py | 4 +-- .../cmdgen/get-table-object-by-multiple-indices.py | 4 +-- .../cmdgen/getnext-limit-number-of-variables.py | 4 +-- .../asyncore/sync/manager/cmdgen/usm-sha-aes128.py | 30 +++++++++++----------- 4 files changed, 21 insertions(+), 21 deletions(-) (limited to 'examples/hlapi') diff --git a/examples/hlapi/v3arch/asyncore/sync/agent/ntforg/v3-trap.py b/examples/hlapi/v3arch/asyncore/sync/agent/ntforg/v3-trap.py index 836e8d50..14501fb9 100644 --- a/examples/hlapi/v3arch/asyncore/sync/agent/ntforg/v3-trap.py +++ b/examples/hlapi/v3arch/asyncore/sync/agent/ntforg/v3-trap.py @@ -28,8 +28,8 @@ errorIndication, errorStatus, errorIndex, varBinds = next( sendNotification( SnmpEngine(OctetString(hexValue='8000000001020304')), UsmUserData('usr-sha-aes128', 'authkey1', 'privkey1', - authProtocol=usmHMACSHAAuthProtocol, - privProtocol=usmAesCfb128Protocol), + authProtocol=USM_AUTH_HMAC96_SHA, + privProtocol=USM_PRIV_CFB128_AES), UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData(), 'trap', diff --git a/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py b/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py index 672aea93..06302525 100644 --- a/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py +++ b/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py @@ -19,8 +19,8 @@ from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), UsmUserData('usr-sha-aes128', 'authkey1', 'privkey1', - authProtocol=usmHMACSHAAuthProtocol, - privProtocol=usmAesCfb128Protocol), + authProtocol=USM_AUTH_HMAC96_SHA, + privProtocol=USM_PRIV_CFB128_AES), UdpTransportTarget(('demo.snmplabs.com', 161)), ContextData(), ObjectType(ObjectIdentity('TCP-MIB', diff --git a/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/getnext-limit-number-of-variables.py b/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/getnext-limit-number-of-variables.py index f9fd70c1..d8a2b935 100644 --- a/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/getnext-limit-number-of-variables.py +++ b/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/getnext-limit-number-of-variables.py @@ -23,8 +23,8 @@ for (errorIndication, errorIndex, varBinds) in nextCmd(SnmpEngine(), UsmUserData('usr-sha-aes128', 'authkey1', 'privkey1', - authProtocol=usmHMACSHAAuthProtocol, - privProtocol=usmAesCfb128Protocol), + authProtocol=USM_AUTH_HMAC96_SHA, + privProtocol=USM_PRIV_CFB128_AES), UdpTransportTarget(('demo.snmplabs.com', 161)), ContextData(), ObjectType(ObjectIdentity('SNMPv2-MIB')), diff --git a/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/usm-sha-aes128.py b/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/usm-sha-aes128.py index 53d4f800..69262086 100644 --- a/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/usm-sha-aes128.py +++ b/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/usm-sha-aes128.py @@ -11,22 +11,22 @@ Send SNMP GET request using the following options: Available authentication protocols: -#. usmHMACMD5AuthProtocol -#. usmHMACSHAAuthProtocol -#. usmHMAC128SHA224AuthProtocol -#. usmHMAC192SHA256AuthProtocol -#. usmHMAC256SHA384AuthProtocol -#. usmHMAC384SHA512AuthProtocol -#. usmNoAuthProtocol +#. USM_AUTH_HMAC96_MD5 +#. USM_AUTH_HMAC96_SHA +#. USM_AUTH_HMAC128_SHA224 +#. USM_AUTH_HMAC192_SHA256 +#. USM_AUTH_HMAC256_SHA384 +#. USM_AUTH_HMAC384_SHA512 +#. USM_AUTH_NONE Available privacy protocols: -#. usmDESPrivProtocol -#. usm3DESEDEPrivProtocol -#. usmAesCfb128Protocol -#. usmAesCfb192Protocol -#. usmAesCfb256Protocol -#. usmNoPrivProtocol +#. USM_PRIV_CBC56_DES +#. USM_PRIV_CBC168_3DES +#. USM_PRIV_CFB128_AES +#. USM_PRIV_CFB192_AES +#. USM_PRIV_CFB256_AES +#. USM_PRIV_NONE Functionally similar to: @@ -38,8 +38,8 @@ from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), UsmUserData('usr-sha-aes', 'authkey1', 'privkey1', - authProtocol=usmHMACSHAAuthProtocol, - privProtocol=usmAesCfb128Protocol), + authProtocol=USM_AUTH_HMAC96_SHA, + privProtocol=USM_PRIV_CFB128_AES), UdpTransportTarget(('demo.snmplabs.com', 161)), ContextData(), ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysDescr', 0))) -- cgit v1.2.1