MCPcopy Create free account
hub / github.com/fortra/impacket / decode

Method decode

impacket/ImpactDecoder.py:435–463  ·  view source on GitHub ↗
(self, aBuffer)

Source from the content-addressed store, hash-verified

433 self.__FCS_at_end=not not fcs_at_end
434
435 def decode(self, aBuffer):
436 d = dot11.Dot11(aBuffer, self.__FCS_at_end)
437 self.set_decoded_protocol(d)
438
439 self.subtype = d.get_subtype()
440 if self.subtype is dot11.Dot11Types.DOT11_SUBTYPE_CONTROL_CLEAR_TO_SEND:
441 self.ctrl_cts_decoder = Dot11ControlFrameCTSDecoder()
442 packet = self.ctrl_cts_decoder.decode(d.body_string)
443 elif self.subtype is dot11.Dot11Types.DOT11_SUBTYPE_CONTROL_ACKNOWLEDGMENT:
444 self.ctrl_ack_decoder = Dot11ControlFrameACKDecoder()
445 packet = self.ctrl_ack_decoder.decode(d.body_string)
446 elif self.subtype is dot11.Dot11Types.DOT11_SUBTYPE_CONTROL_REQUEST_TO_SEND:
447 self.ctrl_rts_decoder = Dot11ControlFrameRTSDecoder()
448 packet = self.ctrl_rts_decoder.decode(d.body_string)
449 elif self.subtype is dot11.Dot11Types.DOT11_SUBTYPE_CONTROL_POWERSAVE_POLL:
450 self.ctrl_pspoll_decoder = Dot11ControlFramePSPollDecoder()
451 packet = self.ctrl_pspoll_decoder.decode(d.body_string)
452 elif self.subtype is dot11.Dot11Types.DOT11_SUBTYPE_CONTROL_CF_END:
453 self.ctrl_cfend_decoder = Dot11ControlFrameCFEndDecoder()
454 packet = self.ctrl_cfend_decoder.decode(d.body_string)
455 elif self.subtype is dot11.Dot11Types.DOT11_SUBTYPE_CONTROL_CF_END_CF_ACK:
456 self.ctrl_cfendcfack_decoder = Dot11ControlFrameCFEndCFACKDecoder()
457 packet = self.ctrl_cfendcfack_decoder.decode(d.body_string)
458 else:
459 data_decoder = DataDecoder()
460 packet = data_decoder.decode(d.body_string)
461
462 d.contains(packet)
463 return d
464
465class Dot11ControlFrameCTSDecoder(BaseDot11Decoder):
466 def __init__(self):

Callers 1

decodeMethod · 0.95

Calls 12

get_subtypeMethod · 0.95
decodeMethod · 0.95
DataDecoderClass · 0.85
set_decoded_protocolMethod · 0.80
decodeMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected