diff --git a/README.md b/README.md index 761ef8f..9c7b711 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,14 @@ --- +## 物语 + +**本项目是我的毕业设计,最终凭借它,我的毕业答辩取得了优。** + +**另外,由于一些不想提及的原因,我的研究生方向最终确定为区块链算法及应用,网安从此变成本人的一个爱好,因此,此项目就此荒废。** + +**再见,网安。再见,青春。再见,学生时代。** + ## 目录 - [基本信息](#基本信息) diff --git a/doc/bug.md b/doc/bug.md index 921dc9f..62c4a7c 100644 --- a/doc/bug.md +++ b/doc/bug.md @@ -6,4 +6,5 @@ - 捕获、过滤、发送配置在编辑之后需要重新点击选中一次才会生效:解决-调整配置逻辑 - 分析界面出现加载上次分析结果的情况:解决-为每次分析定制json文件名称(由于·webEngine 加载上次的缓存,因此也可通过禁用缓存来解决) - 底部状态栏捕获配置不会自动更名 -- 配置界面点击ok按钮无反应 \ No newline at end of file +- 配置界面点击ok按钮无反应 +- 由于大多数网卡没有物理地址,因此转发数据包时会失效。:使无地址网卡无法作为目标网卡。 \ No newline at end of file diff --git a/pkit/res/config/filter.json b/pkit/res/config/filter.json index f6a5cb1..dc1702b 100644 --- a/pkit/res/config/filter.json +++ b/pkit/res/config/filter.json @@ -1 +1 @@ -[{"name":"default","expression":"","comment":"default config"}] \ No newline at end of file +[{"name":"default","expression":"","comment":"default config"},{"name":"ip dst loopback addr","expression":"ip dst 127.0.0.1","comment":"dst loopback addr"}] \ No newline at end of file diff --git a/pkit/res/history/filter.json b/pkit/res/history/filter.json index 7a50495..a98c54c 100644 --- a/pkit/res/history/filter.json +++ b/pkit/res/history/filter.json @@ -1 +1 @@ -{"history":["tcp","udp","ip src 192.168.2.107","ip dst 47.112.175.110","ip","dns","udp ","dst ff:ff:ff:ff:ff:ff","eth dst 00:00:00:00:00:01","DHCP","ip src 192.168.2.105","ip src 47.112.175.110","ip src 192.168.0.1","ip dst 127.0.0.1","ipv4","port 10408","port 11408","ip 192.168.2.105","tcp port 10408","ip src 192.168.2.107 and ip dst 239.255.255.250","arp","DHC"],"name":"filterHistory"} \ No newline at end of file +{"history":["udp","src port 8000","udp ","dst ff:ff:ff:ff:ff:ff","eth dst 00:00:00:00:00:01","ipv4","port 10408","src port 80","ip src 192.168.2.107 and ip dst 239.255.255.250","arp","tcp","ip src 192.168.2.107","ip dst 47.112.175.110","ip","dns","DHCP","ip src 192.168.2.105","ip dst 127.0.0.2","ip src 47.112.175.110","ip src 192.168.0.1","ip dst 127.0.0.1","port 11408","ip 192.168.2.105","tcp port 10408","DHC"],"name":"filterHistory"} \ No newline at end of file diff --git a/pkit/res/temp/tmp.pcapng b/pkit/res/temp/tmp.pcapng index 89eaea0..36ea725 100644 Binary files a/pkit/res/temp/tmp.pcapng and b/pkit/res/temp/tmp.pcapng differ diff --git a/pkit/res/web/api/ioLineChart.json b/pkit/res/web/api/ioLineChart.json index 9b60d28..ad7b16e 100644 --- a/pkit/res/web/api/ioLineChart.json +++ b/pkit/res/web/api/ioLineChart.json @@ -1 +1 @@ -{"pointStart":1588846543517,"pointInterval":1000,"dataLength":30,"data":[[6,0,1,0,4,0,8,0,2,0,2,0,3,0,1,0,6,0,5,0,8,0,21,0,32,0,25,0,17,0,1],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]} \ No newline at end of file +{"pointStart":1591432010269,"pointInterval":1000,"dataLength":68,"data":[[2,0,1,0,2,0,4,0,1,0,1,0,3,0,3,0,4,0,4,0,5,0,0,12,0,0,12,0,19,0,6,0,5,0,26,0,0,0,3,0,3,0,7,0,0,0,0,4,0,4,0,0,0,4,0,5,0,0,0,0,5,0,4,0,0,0,18,0,9],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]} \ No newline at end of file diff --git a/pkit/res/web/api/ipv4StatBarChart.json b/pkit/res/web/api/ipv4StatBarChart.json index 1df699c..14b93a2 100644 --- a/pkit/res/web/api/ipv4StatBarChart.json +++ b/pkit/res/web/api/ipv4StatBarChart.json @@ -1 +1 @@ -{"data":{"125.39.132.162":11.185546875,"192.168.2.107":6.55078125,"47.112.175.110":2.3837890625,"220.194.95.147":0.5029296875,"118.178.135.232":0.15234375,"203.119.169.76":0.111328125,"128.16.39.218":0.08984375,"101.71.154.241":0.064453125,"54.222.174.10":0.064453125,"220.194.95.218":0.052734375,"128.16.39.217":0.044921875,"128.16.39.216":0.044921875}} \ No newline at end of file +{"data":{"139.226.172.190":17.2529296875,"192.168.43.12":7.6650390625,"183.232.93.22":2.67578125,"128.24.39.245":1.119140625,"128.24.39.247":1.0185546875,"120.241.186.91":0.888671875,"128.24.39.139":0.5595703125,"160.18.255.255":0.421875,"128.24.39.242":0.373046875,"118.178.135.232":0.3125,"183.220.199.249":0.193359375,"192.168.43.1":0.103515625,"223.252.199.69":0.076171875,"112.13.122.1":0.064453125,"218.201.36.35":0.064453125,"52.80.12.51":0.064453125,"128.16.39.139":0.044921875,"128.16.39.244":0.044921875,"128.16.39.243":0.044921875,"80.4.0.0":0.033203125}} \ No newline at end of file diff --git a/pkit/res/web/api/networkChart.json b/pkit/res/web/api/networkChart.json index 8a0e9a3..2022e53 100644 --- a/pkit/res/web/api/networkChart.json +++ b/pkit/res/web/api/networkChart.json @@ -1 +1 @@ -{"data":{"192.168.2.107:118.178.135.232":110,"192.168.2.107:101.71.154.241":66,"118.178.135.232:192.168.2.107":156,"101.71.154.241:192.168.2.107":66,"192.168.2.107:47.112.175.110":1461,"47.112.175.110:192.168.2.107":2441,"125.39.132.162:192.168.2.107":11454,"192.168.2.107:125.39.132.162":3895,"203.119.169.76:192.168.2.107":114,"192.168.2.107:203.119.169.76":108,"192.168.2.107:220.194.95.218":108,"192.168.2.107:220.194.95.147":894,"220.194.95.147:192.168.2.107":515,"220.194.95.218:192.168.2.107":54,"54.222.174.10:192.168.2.107":66,"192.168.2.107:54.222.174.10":66}} \ No newline at end of file +{"data":{"192.168.43.12:239.255.255.250":430,"192.168.43.12:52.80.12.51":120,"192.168.43.12:112.13.122.1":66,"112.13.122.1:192.168.43.12":66,"192.168.43.12:183.220.199.249":165,"183.220.199.249:192.168.43.12":198,"192.168.43.12:139.226.172.190":3772,"139.226.172.190:192.168.43.12":17667,"192.168.43.12:183.232.93.22":890,"183.232.93.22:192.168.43.12":2740,"192.168.43.12:118.178.135.232":280,"118.178.135.232:192.168.43.12":320,"192.168.43.12:192.168.43.255":552,"192.168.43.12:120.241.186.91":1316,"120.241.186.91:192.168.43.12":910,"192.168.43.12:218.201.36.35":55,"218.201.36.35:192.168.43.12":66,"52.80.12.51:192.168.43.12":66,"192.168.43.12:223.252.199.69":55,"223.252.199.69:192.168.43.12":78,"192.168.43.12:192.168.43.1":148,"192.168.43.1:192.168.43.12":106}} \ No newline at end of file diff --git a/pkit/res/web/api/o2sSankeyChart.json b/pkit/res/web/api/o2sSankeyChart.json index e255c52..847a6aa 100644 --- a/pkit/res/web/api/o2sSankeyChart.json +++ b/pkit/res/web/api/o2sSankeyChart.json @@ -1 +1 @@ -{"data":{"118.178.135.232:443(TCP)":156,"443(TCP):192.168.2.107":156,"101.71.154.241:80(TCP)":66,"80(TCP):192.168.2.107":11754,"47.112.175.110:8888(TCP)":2441,"8888(TCP):192.168.2.107":2441,"125.39.132.162:80(TCP)":11454,"203.119.169.76:80(TCP)":114,"220.194.95.147:8080(TCP)":515,"8080(TCP):192.168.2.107":515,"220.194.95.218:80(TCP)":54,"54.222.174.10:80(TCP)":66}} \ No newline at end of file +{"data":{"112.13.122.1:80(TCP)":66,"80(TCP):192.168.43.12":1042,"183.220.199.249:443(TCP)":198,"443(TCP):192.168.43.12":584,"139.226.172.190:10017(TCP)":17667,"10017(TCP):192.168.43.12":17667,"183.232.93.22:8000(UDP)":2740,"8000(UDP):192.168.43.12":2740,"118.178.135.232:443(TCP)":320,"192.168.43.12:137(UDP)":552,"137(UDP):192.168.43.255":552,"120.241.186.91:80(TCP)":910,"218.201.36.35:443(TCP)":66,"52.80.12.51:80(TCP)":66,"223.252.199.69:6003(TCP)":78,"6003(TCP):192.168.43.12":78,"192.168.43.12:59656(UDP)":148,"59656(UDP):192.168.43.1":148,"192.168.43.1:53(UDP)":106,"53(UDP):192.168.43.12":106}} \ No newline at end of file diff --git a/pkit/res/web/api/protocolPieChart.json b/pkit/res/web/api/protocolPieChart.json index 0a97ddf..3aea35a 100644 --- a/pkit/res/web/api/protocolPieChart.json +++ b/pkit/res/web/api/protocolPieChart.json @@ -1 +1 @@ -{"data":{"TCP":0.9647887323943662,"IPv4":0.028169014084507043,"ARP":0.007042253521126761}} \ No newline at end of file +{"data":{"UDP":0.1875,"TCP":0.6420454545454546,"IPv4":0.13636363636363635,"ARP":0.03409090909090909}} \ No newline at end of file diff --git a/pkit/res/web/api/s2oSankeyChart.json b/pkit/res/web/api/s2oSankeyChart.json index 7b3692c..9b2d991 100644 --- a/pkit/res/web/api/s2oSankeyChart.json +++ b/pkit/res/web/api/s2oSankeyChart.json @@ -1 +1 @@ -{"data":{"192.168.2.107:1788(TCP)":110,"1788(TCP):118.178.135.232":110,"192.168.2.107:12979(TCP)":66,"12979(TCP):101.71.154.241":66,"192.168.2.107:1786(TCP)":110,"1786(TCP):47.112.175.110":110,"192.168.2.107:12695(TCP)":262,"12695(TCP):47.112.175.110":262,"192.168.2.107:2912(TCP)":3895,"2912(TCP):125.39.132.162":3895,"192.168.2.107:11408(TCP)":751,"11408(TCP):47.112.175.110":751,"192.168.2.107:12752(TCP)":283,"12752(TCP):47.112.175.110":283,"192.168.2.107:1895(TCP)":55,"1895(TCP):47.112.175.110":55,"192.168.2.107:12943(TCP)":108,"12943(TCP):203.119.169.76":108,"192.168.2.107:12984(TCP)":108,"12984(TCP):220.194.95.218":108,"192.168.2.107:12980(TCP)":108,"12980(TCP):220.194.95.147":108,"192.168.2.107:12993(TCP)":786,"12993(TCP):220.194.95.147":786,"192.168.2.107:12897(TCP)":66,"12897(TCP):54.222.174.10":66}} \ No newline at end of file +{"data":{"192.168.43.12:57289(UDP)":430,"57289(UDP):239.255.255.250":430,"192.168.43.12:15318(TCP)":54,"15318(TCP):52.80.12.51":54,"192.168.43.12:15517(TCP)":66,"15517(TCP):112.13.122.1":66,"192.168.43.12:15402(TCP)":165,"15402(TCP):183.220.199.249":165,"192.168.43.12:14877(TCP)":2692,"14877(TCP):139.226.172.190":2692,"192.168.43.12:4026(UDP)":890,"4026(UDP):183.232.93.22":890,"192.168.43.12:14913(TCP)":280,"14913(TCP):118.178.135.232":280,"192.168.43.12:14967(TCP)":1080,"14967(TCP):139.226.172.190":1080,"192.168.43.12:137(UDP)":552,"137(UDP):192.168.43.255":552,"192.168.43.12:15353(TCP)":378,"15353(TCP):120.241.186.91":378,"192.168.43.12:15525(TCP)":938,"15525(TCP):120.241.186.91":938,"192.168.43.12:15394(TCP)":55,"15394(TCP):218.201.36.35":55,"192.168.43.12:15508(TCP)":66,"15508(TCP):52.80.12.51":66,"192.168.43.12:10160(TCP)":55,"10160(TCP):223.252.199.69":55,"192.168.43.12:59656(UDP)":148,"59656(UDP):192.168.43.1":148,"192.168.43.1:53(UDP)":106,"53(UDP):192.168.43.12":106}} \ No newline at end of file diff --git a/pkit/res/web/api/s2sSankeyChart.json b/pkit/res/web/api/s2sSankeyChart.json index 42dd337..20f52cd 100644 --- a/pkit/res/web/api/s2sSankeyChart.json +++ b/pkit/res/web/api/s2sSankeyChart.json @@ -1 +1 @@ -{"data":{}} \ No newline at end of file +{"data":{"192.168.43.12:137(UDP)":552,"137(UDP):192.168.43.255":552,"192.168.43.12:59656(UDP)":148,"59656(UDP):192.168.43.1":148,"192.168.43.1:53(UDP)":106,"53(UDP):192.168.43.12":106}} \ No newline at end of file diff --git a/pkit/src/main/java/gui/ctrl/bar/CaptureMenuBar.java b/pkit/src/main/java/gui/ctrl/bar/CaptureMenuBar.java index 05f7412..8295e76 100644 --- a/pkit/src/main/java/gui/ctrl/bar/CaptureMenuBar.java +++ b/pkit/src/main/java/gui/ctrl/bar/CaptureMenuBar.java @@ -37,6 +37,7 @@ public class CaptureMenuBar { IndexView view; + // 文件菜单项目 @FXML Menu fileMenu; @@ -67,16 +68,14 @@ public class CaptureMenuBar { @FXML MenuItem quitItem; - /* - Tool - */ - + // 工具菜单项目 @FXML MenuItem sendItem; @FXML MenuItem analysisItem; + // 关于菜单项目 @FXML MenuItem websiteItem; @@ -102,6 +101,7 @@ public void initialize() { recentMenu.getItems().add(new SeparatorMenuItem()); ViewHandle.InitializeCapturePcapFileMenu(SettingProperty.capturePcapFileHistory, recentMenu); + // 初始化历史记录菜单的列表 for (int i = 2; i < recentMenu.getItems().size(); i++) { RadioMenuItem item = (RadioMenuItem) recentMenu.getItems().get(i); item.setOnAction(new EventHandler() { diff --git a/pkit/src/main/java/gui/ctrl/bar/FilterBar.java b/pkit/src/main/java/gui/ctrl/bar/FilterBar.java index 6ac1860..dd633fa 100644 --- a/pkit/src/main/java/gui/ctrl/bar/FilterBar.java +++ b/pkit/src/main/java/gui/ctrl/bar/FilterBar.java @@ -151,6 +151,7 @@ public void handle(ActionEvent actionEvent) { if (item.getText().equals(property.getName())) { filterBox.setValue(property.getExpression()); view.setFilterProperty(property); + // TODO: 2020/6/1 点击选择配置,应用过滤器 break; } } diff --git a/pkit/src/main/java/util/ViewHandle.java b/pkit/src/main/java/util/ViewHandle.java index e7a2fd7..244f929 100644 --- a/pkit/src/main/java/util/ViewHandle.java +++ b/pkit/src/main/java/util/ViewHandle.java @@ -39,65 +39,85 @@ public class ViewHandle { - public static void InitializeCaptureTop(IndexView indexView) { - VBox box = indexView.getTopBox(); + /* + 传入首页视图控制器 + 初始化首页顶部 + */ + public static void InitializeCaptureTop(IndexView view) { + VBox box = view.getTopBox(); + if (box.getChildren().size()>0) return; try { FXMLLoader menuBarLoader = new FXMLLoader(); AnchorPane menuBarPane = menuBarLoader.load(menuBarLoader.getClassLoader().getResourceAsStream(SettingProperty.captureMenuBar)); menuBarPane.setMaxWidth(Double.MAX_VALUE); CaptureMenuBar captureMenuBar = menuBarLoader.getController(); - captureMenuBar.setView(indexView); - indexView.setCaptureMenuBarCtrl(captureMenuBar); + captureMenuBar.setView(view); + view.setCaptureMenuBarCtrl(captureMenuBar); + FXMLLoader toolBarLoader = new FXMLLoader(); AnchorPane toolBarPane = toolBarLoader.load(toolBarLoader.getClassLoader().getResourceAsStream(SettingProperty.captureToolBar)); toolBarPane.setMaxWidth(Double.MAX_VALUE); CaptureToolBar captureToolBar = toolBarLoader.getController(); - captureToolBar.setView(indexView); - indexView.setCaptureToolBarCtrl(captureToolBar); + captureToolBar.setView(view); + view.setCaptureToolBarCtrl(captureToolBar); + FXMLLoader filterBarLoader = new FXMLLoader(); AnchorPane filterBarPane = filterBarLoader.load(filterBarLoader.getClassLoader().getResourceAsStream(SettingProperty.filterBar)); filterBarPane.setMaxWidth(Double.MAX_VALUE); FilterBar filterBar = filterBarLoader.getController(); - filterBar.setView(indexView); - indexView.setFilterBarCtrl(filterBar); + filterBar.setView(view); + view.setFilterBarCtrl(filterBar); + box.getChildren().addAll(menuBarPane, toolBarPane, filterBarPane); box.setSpacing(0); + } catch (IOException e) { e.printStackTrace(); } } + /* + 传入首页视图控制器 + 初始化首页中部 + */ public static void InitializeCaptureCenter(IndexView view) { + // 如果界面类型为首页, 初始化文件和网卡列表 if (view.getType().equals(ViewType.IndexView)) { try { VBox centerBox = view.getCenterBox(); view.getPane().setCenter(centerBox); - if (centerBox.getChildren().size()>0) - return; + // 当中部已初始化时直接返回 + if (centerBox.getChildren().size()>0) return; + FXMLLoader nifListLoader = new FXMLLoader(); AnchorPane nifListPane = nifListLoader.load(nifListLoader.getClassLoader().getResourceAsStream(SettingProperty.nifList)); nifListPane.setMaxWidth(Double.MAX_VALUE); NIFList nifList = nifListLoader.getController(); nifList.setView(view); view.setNifListCtrl(nifList); + FXMLLoader fileListLoader = new FXMLLoader(); AnchorPane fileListPane = fileListLoader.load(fileListLoader.getClassLoader().getResourceAsStream(SettingProperty.fileList)); fileListPane.setMaxWidth(Double.MAX_VALUE); FileList fileList = fileListLoader.getController(); fileList.setView(view); view.setFileListCtrl(fileList); + centerBox.getChildren().addAll(fileListPane, nifListPane); centerBox.setSpacing(10); } catch (IOException e) { e.printStackTrace(); } - } else { + } + // 如果界面类型为捕获页, 初始化包浏览器 + else { try { SplitPane browserPane = view.getBrowserPane(); view.getPane().setCenter(browserPane); if (browserPane.getItems().size()>0) return; + // detail 面板显示一个数据包的详情 SplitPane detailPane = new SplitPane(); detailPane.setOrientation(Orientation.HORIZONTAL); @@ -107,6 +127,7 @@ public static void InitializeCaptureCenter(IndexView view) { PacketList packetList = packetListLoader.getController(); packetList.setView(view); view.setPacketListCtrl(packetList); + FXMLLoader packetHeaderLoader = new FXMLLoader(); AnchorPane packetHeaderPane = packetHeaderLoader.load(packetHeaderLoader.getClassLoader().getResourceAsStream(SettingProperty.packetHeader)); packetHeaderPane.setMaxWidth(Double.MAX_VALUE); @@ -114,6 +135,7 @@ public static void InitializeCaptureCenter(IndexView view) { packetHeader.setView(view); view.setPacketHeaderCtrl(packetHeader); + // 包首部是一个树形表格, 存放 field 数据模型 TreeItem root = packetHeader.getRoot(); packetHeader.getHeaderTreeTable().setRoot(root); packetHeader.getHeaderTreeTable().setShowRoot(false); @@ -130,7 +152,7 @@ public static void InitializeCaptureCenter(IndexView view) { browserPane.getItems().addAll(packetListPane, detailPane); - + // 设置分割面板的比例 for (int i = 0; i < browserPane.getDividers().size(); i++) { browserPane.getDividers().get(i).setPosition((i + 1.0) / browserPane.getItems().size()); } @@ -140,6 +162,10 @@ public static void InitializeCaptureCenter(IndexView view) { } } + /* + 传入首页视图控制器 + 初始化首页底部 + */ public static void InitializeCaptureBottom(IndexView view) { BorderPane pane = view.getPane(); try { @@ -226,19 +252,24 @@ public static void InitializeSendBottom(SendView view) { } } + /* + 初始化离线文件打开记录列表 + */ public static void InitializePcapFileList(String path, ListView list) { - SettingProperty settingProperty = new SettingProperty(); JsonMapper mapper = new JsonMapper(); try { CapturePcapFileHistoryProperty property = mapper.readValue(new File(path), CapturePcapFileHistoryProperty.class); + + // 使用 hashset 保证历史记录不重复 HashSet hashSet; hashSet = property.getHistory(); + // 向 list view 添加记录 ObservableList ob = FXCollections.observableArrayList(); int num = 0; for (String f : hashSet) { - if (num < settingProperty.maxPcapFileHistory) { + if (num < SettingProperty.maxPcapFileHistory) { File file1 = new File(f); FileInputStream fis1 = new FileInputStream(file1); String item; @@ -255,9 +286,10 @@ public static void InitializePcapFileList(String path, ListView list) { } } + /* + 初始化离线文件打开记录菜单 + */ public static void InitializeCapturePcapFileMenu(String path, Menu menu) { - - SettingProperty settingProperty = new SettingProperty(); menu.getItems().remove(2,menu.getItems().size()); JsonMapper mapper = new JsonMapper(); try { @@ -268,7 +300,7 @@ public static void InitializeCapturePcapFileMenu(String path, Menu menu) { int num = 0; ToggleGroup group = new ToggleGroup(); for (String f : hashSet) { - if (num < settingProperty.maxPcapFileHistory) { + if (num < SettingProperty.maxPcapFileHistory) { File file1 = new File(f); if (!file1.exists()) FileHandle.RemoveHistory(path, f, CapturePcapFileHistoryProperty.class); FileInputStream fis1 = new FileInputStream(file1); @@ -288,9 +320,10 @@ public static void InitializeCapturePcapFileMenu(String path, Menu menu) { } } + /* + 初始化离线文件打开记录列表 + */ public static void InitializeSendPcapFileMenu(String path, Menu menu) { - - SettingProperty settingProperty = new SettingProperty(); menu.getItems().remove(2,menu.getItems().size()); JsonMapper mapper = new JsonMapper(); try { @@ -301,7 +334,7 @@ public static void InitializeSendPcapFileMenu(String path, Menu menu) { int num = 0; ToggleGroup group = new ToggleGroup(); for (String f : hashSet) { - if (num < settingProperty.maxPcapFileHistory) { + if (num < SettingProperty.maxPcapFileHistory) { File file1 = new File(f); if (!file1.exists()) FileHandle.RemoveHistory(path, f, SendPcapFileHistoryProperty.class); FileInputStream fis1 = new FileInputStream(file1); @@ -321,6 +354,9 @@ public static void InitializeSendPcapFileMenu(String path, Menu menu) { } } + /* + 初始化发送界面目标网卡选择框 + */ public static void InitializeNifComboBox(ComboBox box) { List pcapNifList = ViewHandle.GetPcapNIFList(); @@ -332,11 +368,13 @@ public static void InitializeNifComboBox(ComboBox box) { box.setValue(""); } + /* + 初始化过滤器历史记录选择框 + */ public static void InitializeFilterComboBox(String path, ComboBox box) { String s = box.getValue(); if (box.getItems().size()==0) { - SettingProperty settingProperty = new SettingProperty(); JsonMapper mapper = new JsonMapper(); try { FilterHistoryProperty property = mapper.readValue(new File(path), FilterHistoryProperty.class); @@ -346,7 +384,7 @@ public static void InitializeFilterComboBox(String path, ComboBox box) { ObservableList ob = FXCollections.observableArrayList(); int num = 0; for (String f : hashSet) { - if (num < settingProperty.maxFilterHistory) { + if (num < SettingProperty.maxFilterHistory) { ob.add(f); num++; } @@ -363,6 +401,9 @@ public static void InitializeFilterComboBox(String path, ComboBox box) { box.setValue(s); } + /* + 获取 pcap 网卡列表 + */ public static List GetPcapNIFList() { List pcapNifList = null; try { @@ -374,6 +415,9 @@ public static List GetPcapNIFList() { return pcapNifList; } + /* + 初始化传入的 table view 的 columns + */ public static void InitializeTable(Property property, TableView table) { JsonMapper mapper = new JsonMapper(); try { @@ -393,6 +437,9 @@ public static void InitializeTable(Property property, TableView table) } } + /* + 更新传入的配置 table view + */ public static void UpdateConfigTable(String configPath, Property property, TableView table) { List list = FileHandle.ReadConfig(configPath, property.getClass()); @@ -402,6 +449,9 @@ public static void UpdateConfigTable(String configPath, Property property, Table }); } + /* + 初始化树形菜单 + */ public static TreeView InitializeMenuTree(Property property) { JsonMapper mapper = new JsonMapper(); try {