File: __init__.py

package info (click to toggle)
python-pysnmp4 7.1.21-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,564 kB
  • sloc: python: 33,654; makefile: 166; javascript: 4
file content (28 lines) | stat: -rw-r--r-- 1,022 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2020, Ilya Etingof <etingof@gmail.com>
# License: https://www.pysnmp.com/pysnmp/license.html
#
"""
This module initializes the SNMP protocol API for different versions.

It imports the necessary submodules for SNMP version 1 and version 2c, and
defines constants for these versions. It also provides a mapping of protocol
modules to their respective versions and exposes a function to decode the
message version.

Attributes:
 * SNMP_VERSION_1 (int): Constant for SNMP version 1.
 * SNMP_VERSION_2C (int): Constant for SNMP version 2c.
 * PROTOCOL_MODULES (dict): Mapping of SNMP version constants to their
        respective protocol modules.
 * decodeMessageVersion (function): Function to decode the message version.
"""
from pysnmp.proto.api import v1, v2c, verdec

# Protocol versions
SNMP_VERSION_1 = 0
SNMP_VERSION_2C = 1
PROTOCOL_MODULES = {SNMP_VERSION_1: v1, SNMP_VERSION_2C: v2c}

decodeMessageVersion = verdec.decode_message_version  # noqa: N816