MCPcopy
hub / github.com/fortra/impacket / unpackOptions

Method unpackOptions

impacket/dhcp.py:169–185  ·  view source on GitHub ↗
(self, options)

Source from the content-addressed store, hash-verified

167 return optionCode, ':'
168
169 def unpackOptions(self, options):
170 # options is a string
171
172 # print '%r' % options
173 answer = []
174 i = 0
175 options = bytearray(options)
176 while i < len(options)-1:
177 name, format = self.getOptionNameAndFormat(options[i])
178 # size = self.calcUnpackSize(format, options[i+1:])
179 size = options[i+1]
180 # print i, name, format, size
181 value = self.unpack(format, bytes(options[i+2:i+2+size]))
182 answer.append((name, value))
183 i += 2+size
184
185 return answer
186
187 def unpackParameterRequestList(self, options):
188 return [self.getOptionNameAndFormat(ord(opt))[0] for opt in options]

Callers

nothing calls this directly

Calls 3

appendMethod · 0.80
unpackMethod · 0.45

Tested by

no test coverage detected