MCPcopy Index your code
hub / github.com/secdev/scapy / layers

Method layers

scapy/packet.py:1279–1287  ·  view source on GitHub ↗

returns a list of layer classes (including subclasses) in this packet

(self)

Source from the content-addressed store, hash-verified

1277 return 0
1278
1279 def layers(self):
1280 # type: () -> List[Type[Packet]]
1281 """returns a list of layer classes (including subclasses) in this packet""" # noqa: E501
1282 layers = []
1283 lyr = self # type: Optional[Packet]
1284 while lyr:
1285 layers.append(lyr.__class__)
1286 lyr = lyr.payload.getlayer(0, _subclass=True)
1287 return layers
1288
1289 def haslayer(self, cls, _subclass=None):
1290 # type: (Union[Type[Packet], str], Optional[bool]) -> int

Callers 7

exploreFunction · 0.45
is_modifier_pktMethod · 0.45
__update_logMethod · 0.45
post_buildMethod · 0.45
post_buildMethod · 0.45
post_buildMethod · 0.45

Calls 2

appendMethod · 0.45
getlayerMethod · 0.45

Tested by

no test coverage detected