# SPDX-License-Identifier: GPL-2.0-or-later # This file is part of Scapy # See https://scapy.net/ for more information # Original PPI author: # scapy.contrib.description = CACE Per-Packet Information (PPI) header # scapy.contrib.status = loads """ 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_Element`` * Call ``bind_layers(PPI_Hdr, ExamplePPI, pfh_type=0xffff)`` See ``layers/contrib/ppi_cace.py`` for an example. """ from scapy.config import conf from scapy.data import DLT_PPI, PPI_TYPES from scapy.error import warning from scapy.packet import Packet from scapy.fields import ByteField, FieldLenField, LEIntField, \ PacketListField, LEShortEnumField, LenField class PPI_Hdr(Packet): name = 'PPI Header' fields_desc = [ LEShortEnumField('pfh_type', 0, PPI_TYPES), LenField('pfh_length', None, fmt='