Functions | Variables
pcap_json_converter Namespace Reference

Functions

def appendToCppfile (cpp_filename, payload, is_cola_ascii)
 
def appendToJsonfile (json_filename, relative_timestamp, payload, pcap_filename)
 
def closeCppfile (cpp_filename)
 
def closeJsonfile (json_filename)
 
def isJsonPrintable (b)
 
def parseColaPayloadLength (payload)
 

Variables

 arg_parser = argparse.ArgumentParser()
 
 block_data = Ether(block.packet_data)
 
 block_decoded = block_data
 
 cli_args = arg_parser.parse_args()
 
bool cola_ascii = False
 
string cpp_filename = pcap_filename + ".cpp"
 
 default
 
 help
 
string is_cola_ascii = payload.startswith(b'\x02\x73')
 
string is_cola_binary = payload.startswith(b'\x02\x02\x02\x02')
 
string json_filename = pcap_filename + ".json"
 
string payload = b''
 
 payload_chunk = bytes(block_decoded.payload)
 
bool payload_completed = False
 
string pcap_filename = "example.pcapng"
 
 pcap_scanner = FileScanner(pcap_file)
 
float relative_timestamp = block.timestamp - start_timestamp
 
float start_timestamp = -1.0
 
 type
 

Detailed Description

    pcap_json_converter converts TiM781S pcap files to json

    Usage:

    pip install scapy
    pip install pypcapfile
    pip install python-pcapng

    python pcap_json_converter.py --pcap_filename=<filepath.pcapng>

Function Documentation

◆ appendToCppfile()

def pcap_json_converter.appendToCppfile (   cpp_filename,
  payload,
  is_cola_ascii 
)

Definition at line 67 of file pcap_json_converter.py.

◆ appendToJsonfile()

def pcap_json_converter.appendToJsonfile (   json_filename,
  relative_timestamp,
  payload,
  pcap_filename 
)

Definition at line 30 of file pcap_json_converter.py.

◆ closeCppfile()

def pcap_json_converter.closeCppfile (   cpp_filename)

Definition at line 100 of file pcap_json_converter.py.

◆ closeJsonfile()

def pcap_json_converter.closeJsonfile (   json_filename)

Definition at line 61 of file pcap_json_converter.py.

◆ isJsonPrintable()

def pcap_json_converter.isJsonPrintable (   b)

Definition at line 27 of file pcap_json_converter.py.

◆ parseColaPayloadLength()

def pcap_json_converter.parseColaPayloadLength (   payload)

Definition at line 107 of file pcap_json_converter.py.

Variable Documentation

◆ arg_parser

pcap_json_converter.arg_parser = argparse.ArgumentParser()

Definition at line 116 of file pcap_json_converter.py.

◆ block_data

pcap_json_converter.block_data = Ether(block.packet_data)

Definition at line 141 of file pcap_json_converter.py.

◆ block_decoded

string pcap_json_converter.block_decoded = block_data

Definition at line 142 of file pcap_json_converter.py.

◆ cli_args

pcap_json_converter.cli_args = arg_parser.parse_args()

Definition at line 118 of file pcap_json_converter.py.

◆ cola_ascii

bool pcap_json_converter.cola_ascii = False

Definition at line 132 of file pcap_json_converter.py.

◆ cpp_filename

string pcap_json_converter.cpp_filename = pcap_filename + ".cpp"

Definition at line 123 of file pcap_json_converter.py.

◆ default

pcap_json_converter.default

Definition at line 117 of file pcap_json_converter.py.

◆ help

pcap_json_converter.help

Definition at line 117 of file pcap_json_converter.py.

◆ is_cola_ascii

string pcap_json_converter.is_cola_ascii = payload.startswith(b'\x02\x73')

Definition at line 173 of file pcap_json_converter.py.

◆ is_cola_binary

string pcap_json_converter.is_cola_binary = payload.startswith(b'\x02\x02\x02\x02')

Definition at line 174 of file pcap_json_converter.py.

◆ json_filename

string pcap_json_converter.json_filename = pcap_filename + ".json"

Definition at line 124 of file pcap_json_converter.py.

◆ payload

string pcap_json_converter.payload = b''

Definition at line 130 of file pcap_json_converter.py.

◆ payload_chunk

pcap_json_converter.payload_chunk = bytes(block_decoded.payload)

Definition at line 155 of file pcap_json_converter.py.

◆ payload_completed

bool pcap_json_converter.payload_completed = False

Definition at line 131 of file pcap_json_converter.py.

◆ pcap_filename

string pcap_json_converter.pcap_filename = "example.pcapng"

Definition at line 115 of file pcap_json_converter.py.

◆ pcap_scanner

pcap_json_converter.pcap_scanner = FileScanner(pcap_file)

Definition at line 134 of file pcap_json_converter.py.

◆ relative_timestamp

float pcap_json_converter.relative_timestamp = block.timestamp - start_timestamp

Definition at line 158 of file pcap_json_converter.py.

◆ start_timestamp

pcap_json_converter.start_timestamp = -1.0

Definition at line 129 of file pcap_json_converter.py.

◆ type

pcap_json_converter.type

Definition at line 117 of file pcap_json_converter.py.



sick_scan
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Thu Sep 8 2022 02:30:19