File: rfc1901.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 (20 lines) | stat: -rw-r--r-- 616 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2020, Ilya Etingof <etingof@gmail.com>
# License: https://www.pysnmp.com/pysnmp/license.html
#
from pyasn1.type import namedtype, namedval, univ
from pysnmp.proto import rfc1905

version = univ.Integer(namedValues=namedval.NamedValues(("version-2c", 1)))


class Message(univ.Sequence):
    """Create a new SNMP message."""

    componentType = namedtype.NamedTypes(  # noqa: N815
        namedtype.NamedType("version", version),
        namedtype.NamedType("community", univ.OctetString()),
        namedtype.NamedType("data", rfc1905.PDUs()),
    )