tshark.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:ecel 作者: ARL-UTEP-OC 项目源码 文件源码
def build_commands(self):
        # get additional options from the config file
        mode = self.config.get_collector_custom_data()["interfaces"]["mode"]
        ifaces = self.config.get_collector_custom_data()["interfaces"]["interfaces"]
        if mode == "inclusive":
            self.interfaces = ifaces
        else:
            self.interfaces = [iface for iface in netifaces.interfaces() if iface not in ifaces]

        # build commands
        for iface in self.interfaces:
            out_file_name = definitions.TIMESTAMP_PLACEHOLDER + "_" + iface
            self.output_filenames.append(out_file_name)
            out_file_path = os.path.join(self.output_dir, out_file_name + ".pcap")
            cmd = "dumpcap " \
                  + "-i " + str(iface) + " " \
                  + "-w " + str(out_file_path)
            self.commands.append(cmd)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号