scapy.plist

PacketList: holds several packets and allows to do operations on them.

class scapy.plist.PacketList(res: _PacketList[_Inner] | List[_Inner] | None = None, name: str = 'PacketList', stats: List[Type[Packet]] | None = None)[source]

Bases: _PacketList[Packet], BasePacketList[Packet], _CanvasDumpExtended

sr(multi: bool = False, lookahead: int | None = None) Tuple[SndRcvList, PacketList][source]

Matches packets in the list

Parameters:
  • multi – True if a packet can have multiple answers

  • lookahead – Maximum number of packets between packet and answer. If 0 or None, full remaining list is scanned for answers

Returns:

( (matched couples), (unmatched packets) )

class scapy.plist.QueryAnswer(query, answer)[source]

Bases: NamedTuple

answer: Packet

Alias for field number 1

query: Packet

Alias for field number 0

class scapy.plist.SndRcvList(res: _PacketList[QueryAnswer] | List[QueryAnswer] | None = None, name: str = 'Results', stats: List[Type[Packet]] | None = None)[source]

Bases: _PacketList[QueryAnswer], BasePacketList[QueryAnswer], _CanvasDumpExtended