scapy.layers.ppi
CACE Per-Packet Information (PPI) header.
A method for adding metadata to link-layer packets.
For example, one can tag an 802.11 packet with GPS coordinates of where it was captured, and include it in the PCAP file.
New PPI types should:
Make their packet a subclass of
PPI_ElementCall
bind_layers(PPI_Hdr, ExamplePPI, pfh_type=0xffff)
See layers/contrib/ppi_cace.py for an example.
- class scapy.layers.ppi.PPI(_pkt, /, *, version=0, flags=0, len=None, dlt=None, headers=[])[source]
Bases:
Packet- aliastypes = [<class 'scapy.layers.ppi.PPI'>, <class 'scapy.packet.Packet'>]
- class scapy.layers.ppi.PPI_Element(_pkt, /)[source]
Bases:
PacketSuperclass for all PPI types.
- aliastypes = [<class 'scapy.layers.ppi.PPI_Element'>, <class 'scapy.packet.Packet'>]
- class scapy.layers.ppi.PPI_Hdr(_pkt, /, *, pfh_type=0, pfh_length=None)[source]
Bases:
Packet- aliastypes = [<class 'scapy.layers.ppi.PPI_Hdr'>, <class 'scapy.packet.Packet'>]
- fields_desc: ClassVar[List[Field[Any, Any] | _FieldContainer]] = [<LEShortEnumField (PPI_Hdr).pfh_type>, <LenField (PPI_Hdr).pfh_length>]
- payload_guess: List[Tuple[Dict[str, Any], Type[Packet]]] = [({'pfh_type': 30006}, <class 'scapy.layers.bluetooth4LE.BTLE_PPI'>), ({'pfh_type': 2}, <class 'scapy.contrib.ppi_cace.PPI_Dot11Common'>), ({'pfh_type': 30002}, <class 'scapy.contrib.ppi_geotag.PPI_Geotag_GPS'>), ({'pfh_type': 30003}, <class 'scapy.contrib.ppi_geotag.PPI_Geotag_Vector'>), ({'pfh_type': 30004}, <class 'scapy.contrib.ppi_geotag.PPI_Geotag_Sensor'>), ({'pfh_type': 30005}, <class 'scapy.contrib.ppi_geotag.PPI_Geotag_Antenna'>)]