scapy.plist

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

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

Bases: scapy.plist._PacketList[scapy.packet.Packet], scapy.base_classes.BasePacketList[scapy.packet.Packet], scapy.base_classes._CanvasDumpExtended

sr(multi: bool = False, lookahead: Optional[int] = None) Tuple[scapy.plist.SndRcvList, scapy.plist.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: tuple

answer: scapy.packet.Packet

Alias for field number 1

query: scapy.packet.Packet

Alias for field number 0

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

Bases: scapy.plist._PacketList[scapy.plist.QueryAnswer], scapy.base_classes.BasePacketList[scapy.plist.QueryAnswer], scapy.base_classes._CanvasDumpExtended