Ejemplo n.º 1
0
    def __init__(self):
        self.d_packets_counts = {
            "TCP": 0,
            "UDP": 0,
            "ICMP": 0,
            "ARP": 0,
            "Others": 0,
            "Total": 0
        }
        self.d_configuration = OrderedDict()
        self.d_configuration["TCP"], self.d_configuration[
            "UDP"], self.d_configuration["ICMP"], self.d_configuration[
                "ARP"], self.d_configuration["Others"], self.d_configuration[
                    "Promisc"] = True, True, True, True, True, True

        # 嗅探线程
        self.my_sniffer_thread = MySnifferThread()

        ### 主窗口
        self.root = tkinter.Tk()
        self._initialize_root(self.root)

        ## 菜单栏
        menu_frame = tkinter.Frame(self.root)
        self._initialize_menu(menu_frame)

        ## 功能实现区 Start
        # 列表帧, 包括包数量列表, 包列表区域 #TODO: 本来第一个是 IP 列表区域的,待定
        packets_frame = tkinter.LabelFrame(self.root)
        self._initialize_list_frame(packets_frame)

        # 内容显示帧, 包括图形化显示/其余功能选项区域, 内容显示区域
        content_frame = tkinter.LabelFrame(self.root)
        self._initialize_content_frame(content_frame)
        ## 功能实现区 End

        ## 状态栏, TODO: 没时间写这东西®
        # state_frame = tkinter.Frame(self.root)

        self.root.mainloop()