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 | |
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>
def pcap_json_converter.appendToCppfile | ( | cpp_filename, | |
payload, | |||
is_cola_ascii | |||
) |
Definition at line 67 of file pcap_json_converter.py.
def pcap_json_converter.appendToJsonfile | ( | json_filename, | |
relative_timestamp, | |||
payload, | |||
pcap_filename | |||
) |
Definition at line 30 of file pcap_json_converter.py.
def pcap_json_converter.closeCppfile | ( | cpp_filename | ) |
Definition at line 100 of file pcap_json_converter.py.
def pcap_json_converter.closeJsonfile | ( | json_filename | ) |
Definition at line 61 of file pcap_json_converter.py.
def pcap_json_converter.isJsonPrintable | ( | b | ) |
Definition at line 27 of file pcap_json_converter.py.
def pcap_json_converter.parseColaPayloadLength | ( | payload | ) |
Definition at line 107 of file pcap_json_converter.py.
pcap_json_converter.arg_parser = argparse.ArgumentParser() |
Definition at line 116 of file pcap_json_converter.py.
pcap_json_converter.block_data = Ether(block.packet_data) |
Definition at line 141 of file pcap_json_converter.py.
string pcap_json_converter.block_decoded = block_data |
Definition at line 142 of file pcap_json_converter.py.
pcap_json_converter.cli_args = arg_parser.parse_args() |
Definition at line 118 of file pcap_json_converter.py.
bool pcap_json_converter.cola_ascii = False |
Definition at line 132 of file pcap_json_converter.py.
string pcap_json_converter.cpp_filename = pcap_filename + ".cpp" |
Definition at line 123 of file pcap_json_converter.py.
pcap_json_converter.default |
Definition at line 117 of file pcap_json_converter.py.
pcap_json_converter.help |
Definition at line 117 of file pcap_json_converter.py.
string pcap_json_converter.is_cola_ascii = payload.startswith(b'\x02\x73') |
Definition at line 173 of file pcap_json_converter.py.
string pcap_json_converter.is_cola_binary = payload.startswith(b'\x02\x02\x02\x02') |
Definition at line 174 of file pcap_json_converter.py.
string pcap_json_converter.json_filename = pcap_filename + ".json" |
Definition at line 124 of file pcap_json_converter.py.
string pcap_json_converter.payload = b'' |
Definition at line 130 of file pcap_json_converter.py.
pcap_json_converter.payload_chunk = bytes(block_decoded.payload) |
Definition at line 155 of file pcap_json_converter.py.
bool pcap_json_converter.payload_completed = False |
Definition at line 131 of file pcap_json_converter.py.
string pcap_json_converter.pcap_filename = "example.pcapng" |
Definition at line 115 of file pcap_json_converter.py.
pcap_json_converter.pcap_scanner = FileScanner(pcap_file) |
Definition at line 134 of file pcap_json_converter.py.
float pcap_json_converter.relative_timestamp = block.timestamp - start_timestamp |
Definition at line 158 of file pcap_json_converter.py.
pcap_json_converter.start_timestamp = -1.0 |
Definition at line 129 of file pcap_json_converter.py.
pcap_json_converter.type |
Definition at line 117 of file pcap_json_converter.py.