File: ASN1.py

package info (click to toggle)
python-pysnmp4 4.1.6a-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,016 kB
  • ctags: 1,826
  • sloc: python: 9,809; sh: 60; makefile: 11
file content (20 lines) | stat: -rw-r--r-- 579 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# ASN.1 objects used in SNMP
from pyasn1.type import univ
from pysnmp.proto import rfc1902

Integer = rfc1902.Integer32
OctetString = rfc1902.OctetString

# Instead of using base ASN,1 types we use SNMPv2 SMI ones to make
# SMI objects type-compatible with SNMP protocol values

# Integer = univ.Integer
# OctetString = univ.OctetString
BitString = univ.BitString
Null = univ.Null
ObjectIdentifier = univ.ObjectIdentifier

mibBuilder.exportSymbols(
    'ASN1', Integer=Integer, OctetString=OctetString,
    BitString=BitString, Null=Null, ObjectIdentifier=ObjectIdentifier
    )