Commit d6c7a438 authored by Federico Sismondi's avatar Federico Sismondi

added hanlder to process also TAP interface messages

parent ad5379a3
Pipeline #2702 passed with stage
in 0 seconds
......@@ -226,7 +226,31 @@ class AmqpDataPacketDumper:
elif 'tun' in message.interface_name:
self.logger.info(
'Dumping packet found in %s interface of %s bytes' % (message.interface_name, len(message.data))
'Dumping TUN packet, sniffed in %s interface of %s bytes' % (message.interface_name, len(message.data))
)
raw_packet = bytes(message.data)
# lets build pcap header for packet
pcap_packet_header = Pkthdr(
ts_sec=t_s,
ts_usec=t_u_delta,
incl_len=len(raw_packet),
orig_len=len(raw_packet),
)
self.pcap_dumper.dump(pcap_packet_header, raw_packet)
self.messages_dumped += 1
# copy filename.pcap~ to filename.pcap
shutil.copyfile(
os.path.join(self.dump_dir, self.pcap_filename_wr),
os.path.join(self.dump_dir, self.pcap_filename)
)
elif 'tap' in message.interface_name:
self.logger.info(
'Dumping TAP packet, sniffed in %s interface of %s bytes' % (message.interface_name, len(message.data))
)
raw_packet = bytes(message.data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment