# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Scapy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # any later version. # # Scapy is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Scapy. If not, see . # 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 co-ordinates 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='