MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / RawPayloadDecoder

Class RawPayloadDecoder

pager_lib/pyasn1/codec/ber/decoder.py:89–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87
88
89class RawPayloadDecoder(AbstractSimplePayloadDecoder):
90 protoComponent = univ.Any('')
91
92 def valueDecoder(self, substrate, asn1Spec,
93 tagSet=None, length=None, state=None,
94 decodeFun=None, substrateFun=None,
95 **options):
96 if substrateFun:
97 asn1Object = self._createComponent(asn1Spec, tagSet, '', **options)
98
99 for chunk in substrateFun(asn1Object, substrate, length, options):
100 yield chunk
101
102 return
103
104 for value in decodeFun(substrate, asn1Spec, tagSet, length, **options):
105 yield value
106
107 def indefLenValueDecoder(self, substrate, asn1Spec,
108 tagSet=None, length=None, state=None,
109 decodeFun=None, substrateFun=None,
110 **options):
111 if substrateFun:
112 asn1Object = self._createComponent(asn1Spec, tagSet, '', **options)
113
114 for chunk in substrateFun(asn1Object, substrate, length, options):
115 yield chunk
116
117 return
118
119 while True:
120 for value in decodeFun(
121 substrate, asn1Spec, tagSet, length,
122 allowEoo=True, **options):
123
124 if value is eoo.endOfOctets:
125 return
126
127 yield value
128
129
130rawPayloadDecoder = RawPayloadDecoder()

Callers 1

decoder.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected