MCPcopy Create free account
hub / github.com/secdev/scapy / RadioTapTLV

Class RadioTapTLV

scapy/layers/dot11.py:267–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265# This is still unimplemented in Wireshark
266# https://www.radiotap.org/fields/TLV.html
267class RadioTapTLV(Packet):
268 fields_desc = [
269 LEShortEnumField("type", 0, _rt_present),
270 LEShortField("length", None),
271 ConditionalField(
272 OUIField("oui", 0),
273 lambda pkt: pkt.type == 30 # VendorNS
274 ),
275 ConditionalField(
276 ByteField("subtype", 0),
277 lambda pkt: pkt.type == 30
278 ),
279 ConditionalField(
280 LEShortField("presence_type", 0),
281 lambda pkt: pkt.type == 30
282 ),
283 ConditionalField(
284 LEShortField("reserved", 0),
285 lambda pkt: pkt.type == 30
286 ),
287 StrLenField("data", b"",
288 length_from=lambda pkt: pkt.length),
289 StrLenField("pad", None, length_from=lambda pkt: -pkt.length % 4)
290 ]
291
292 def post_build(self, pkt, pay):
293 if self.length is None:
294 pkt = pkt[:2] + struct.pack("<H", len(self.data)) + pkt[4:]
295 if self.pad is None:
296 pkt += b"\x00" * (-len(self.data) % 4)
297 return pkt + pay
298
299 def extract_padding(self, s):
300 return "", s
301
302
303# RADIOTAP

Callers

nothing calls this directly

Calls 6

LEShortEnumFieldClass · 0.90
LEShortFieldClass · 0.90
ConditionalFieldClass · 0.90
OUIFieldClass · 0.90
ByteFieldClass · 0.90
StrLenFieldClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…