andi.converters
Contents
Convert PCAPNG to ASC format
from andi.converters import convert infile='input.pcapng' # input file path outfile='output.asc' # output file path convert(infile, outfile)
Convert PCAPNG to ASC format with TECMP mapping
from andi.converters import convert infile='input.pcapng' # input file path outfile='output.asc' # output file path convert(infile, outfile, tecmp_mapping={0xca: 'MAPPED_BUS'})
Convert PCAPNG to PCAPNG format with removing encapsulation
To remove the gateway header from the pcapng file, use .unwrap before the .pcapng extension for the output file.
from andi.converters import convert infile='input.pcapng' # input file path outfile='output.unwrap.pcapng' # output file path convert(infile, outfile)
Archive PCAPNG to multiple formats with TECMP mapping
from andi.converters import archivize input_file = 'input.pcapng' # input file path output_formats = [".asc.gz", ".unwrap.pcapng.gz", ".pcapng.gz"] # output formats tecmp_mapping = {0xca: 'MAPPED_BUS'} archivize(input_file, output_formats, tecmp_mapping=tecmp_mapping)
Note
After archiving, the original input file will be removed.