Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Side by Side Diff: third_party/google-endpoints/pyasn1_modules/rfc3412.py

Issue 2666783008: Add google-endpoints to third_party/. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #
2 # SNMPv3 message syntax
3 #
4 # ASN.1 source from:
5 # http://www.ietf.org/rfc/rfc3412.txt
6 #
7 from pyasn1.type import univ, namedtype, namedval, tag, constraint
8 from pyasn1_modules import rfc1905
9
10 class ScopedPDU(univ.Sequence):
11 componentType = namedtype.NamedTypes(
12 namedtype.NamedType('contextEngineId', univ.OctetString()),
13 namedtype.NamedType('contextName', univ.OctetString()),
14 namedtype.NamedType('data', rfc1905.PDUs())
15 )
16
17 class ScopedPduData(univ.Choice):
18 componentType = namedtype.NamedTypes(
19 namedtype.NamedType('plaintext', ScopedPDU()),
20 namedtype.NamedType('encryptedPDU', univ.OctetString()),
21 )
22
23 class HeaderData(univ.Sequence):
24 componentType = namedtype.NamedTypes(
25 namedtype.NamedType('msgID', univ.Integer().subtype(subtypeSpec=constrai nt.ValueRangeConstraint(0, 2147483647))),
26 namedtype.NamedType('msgMaxSize', univ.Integer().subtype(subtypeSpec=con straint.ValueRangeConstraint(484, 2147483647))),
27 namedtype.NamedType('msgFlags', univ.OctetString().subtype(subtypeSpec=c onstraint.ValueSizeConstraint(1, 1))),
28 namedtype.NamedType('msgSecurityModel', univ.Integer().subtype(subtypeSp ec=constraint.ValueRangeConstraint(1, 2147483647)))
29 )
30
31 class SNMPv3Message(univ.Sequence):
32 componentType = namedtype.NamedTypes(
33 namedtype.NamedType('msgVersion', univ.Integer().subtype(subtypeSpec=co nstraint.ValueRangeConstraint(0, 2147483647))),
34 namedtype.NamedType('msgGlobalData', HeaderData()),
35 namedtype.NamedType('msgSecurityParameters', univ.OctetString()),
36 namedtype.NamedType('msgData', ScopedPduData())
37 )
38
OLDNEW
« no previous file with comments | « third_party/google-endpoints/pyasn1_modules/rfc2560.py ('k') | third_party/google-endpoints/pyasn1_modules/rfc3414.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698