rfc1901.py 594 B

1234567891011121314151617181920
  1. #
  2. # This file is part of pyasn1-modules software.
  3. #
  4. # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
  5. # License: http://pyasn1.sf.net/license.html
  6. #
  7. # SNMPv2c message syntax
  8. #
  9. # ASN.1 source from:
  10. # http://www.ietf.org/rfc/rfc1901.txt
  11. #
  12. from pyasn1.type import univ, namedtype, namedval
  13. class Message(univ.Sequence):
  14. componentType = namedtype.NamedTypes(
  15. namedtype.NamedType('version', univ.Integer(namedValues=namedval.NamedValues(('version-2c', 1)))),
  16. namedtype.NamedType('community', univ.OctetString()),
  17. namedtype.NamedType('data', univ.Any())
  18. )