def _run_pcap_parser(self, rx_tcpdump, interface):
rx, tx = pipe()
# dupe pids for the child process
tcpdump, out = dup(rx_tcpdump), dup(tx)
close(tx)
close(rx_tcpdump)
pid = fork()
if pid:
close(out)
close(tcpdump)
self.child_parser = pid
self.rx = rx
else:
# get rid of unnecessary privileges
drop_privileges()
# start parsing packets
start_pcap_parser(tcpdump, out, interface)
评论列表
文章目录