@@ -43,15 +43,22 @@ class StatsDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
43
43
LAST_GROUP_BY = ""
44
44
45
45
# general
46
- COL_TIME = 0
47
- COL_NODE = 1
48
- COL_ACTION = 2
49
- COL_DSTIP = 3
50
- COL_PROTO = 4
51
- COL_PROCS = 5
52
- COL_CMDLINE = 6
53
- COL_RULES = 7
54
- GENERAL_COL_NUM = 8
46
+ COL_TIME = 0
47
+ COL_NODE = 1
48
+ COL_ACTION = 2
49
+ COL_SRCPORT = 3
50
+ COL_SRCIP = 4
51
+ COL_DSTIP = 5
52
+ COL_DSTHOST = 6
53
+ COL_DSTPORT = 7
54
+ COL_PROTO = 8
55
+ COL_UID = 9
56
+ COL_PID = 10
57
+ COL_PROCS = 11
58
+ COL_CMDLINE = 12
59
+ COL_RULES = 13
60
+ # total number of columns: cols + 1
61
+ GENERAL_COL_NUM = 14
55
62
56
63
# stats
57
64
COL_WHAT = 0
@@ -135,11 +142,14 @@ class StatsDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
135
142
"display_fields" : "time as Time, " \
136
143
"node as Node, " \
137
144
"action as Action, " \
138
- "CASE dst_host WHEN ''" \
139
- " THEN dst_ip || ' -> ' || dst_port " \
140
- " ELSE dst_host || ' -> ' || dst_port " \
141
- "END Destination, " \
145
+ "src_port as SrcPort, " \
146
+ "src_ip as SrcIP, " \
147
+ "dst_ip as DstIP, " \
148
+ "dst_host as DstHost, " \
149
+ "dst_port as DstPort, " \
142
150
"protocol as Protocol, " \
151
+ "uid as UID, " \
152
+ "pid as PID, " \
143
153
"process as Process, " \
144
154
"process_args as Cmdline, " \
145
155
"rule as Rule" ,
@@ -314,11 +324,14 @@ def __init__(self, parent=None, address=None, db=None, dbname="db", appicon=None
314
324
self .COL_STR_PROCESS = QC .translate ("stats" , "Process" , "This is a word, without spaces and symbols." ).replace (" " , "" )
315
325
self .COL_STR_PROC_CMDLINE = QC .translate ("stats" , "Cmdline" , "This is a word, without spaces and symbols." ).replace (" " , "" )
316
326
self .COL_STR_DESTINATION = QC .translate ("stats" , "Destination" , "This is a word, without spaces and symbols." ).replace (" " , "" )
327
+ self .COL_STR_SRC_PORT = QC .translate ("stats" , "SrcPort" , "This is a word, without spaces and symbols." ).replace (" " , "" )
328
+ self .COL_STR_SRC_IP = QC .translate ("stats" , "SrcIP" , "This is a word, without spaces and symbols." ).replace (" " , "" )
317
329
self .COL_STR_DST_IP = QC .translate ("stats" , "DstIP" , "This is a word, without spaces and symbols." ).replace (" " , "" )
318
330
self .COL_STR_DST_HOST = QC .translate ("stats" , "DstHost" , "This is a word, without spaces and symbols." ).replace (" " , "" )
319
331
self .COL_STR_DST_PORT = QC .translate ("stats" , "DstPort" , "This is a word, without spaces and symbols." ).replace (" " , "" )
320
332
self .COL_STR_RULE = QC .translate ("stats" , "Rule" , "This is a word, without spaces and symbols." ).replace (" " , "" )
321
333
self .COL_STR_UID = QC .translate ("stats" , "UserID" , "This is a word, without spaces and symbols." ).replace (" " , "" )
334
+ self .COL_STR_PID = QC .translate ("stats" , "UserID" , "This is a word, without spaces and symbols." ).replace (" " , "" )
322
335
self .COL_STR_LAST_CONNECTION = QC .translate ("stats" , "LastConnection" , "This is a word, without spaces and symbols." ).replace (" " , "" )
323
336
324
337
self .FIREWALL_STOPPED = QC .translate ("stats" , "Not running" )
@@ -467,9 +480,16 @@ def __init__(self, parent=None, address=None, db=None, dbname="db", appicon=None
467
480
self .COL_STR_TIME ,
468
481
self .COL_STR_NODE ,
469
482
self .COL_STR_ACTION ,
470
- self .COL_STR_DESTINATION ,
483
+ self .COL_STR_SRC_PORT ,
484
+ self .COL_STR_SRC_IP ,
485
+ self .COL_STR_DST_IP ,
486
+ self .COL_STR_DST_HOST ,
487
+ self .COL_STR_DST_PORT ,
471
488
self .COL_STR_PROTOCOL ,
489
+ self .COL_STR_UID ,
490
+ self .COL_STR_PID ,
472
491
self .COL_STR_PROCESS ,
492
+ self .COL_STR_PROC_CMDLINE ,
473
493
self .COL_STR_RULE ,
474
494
]),
475
495
verticalScrollBar = self .connectionsTableScrollBar ,
@@ -1526,14 +1546,44 @@ def _cb_main_table_double_clicked(self, row):
1526
1546
self ._set_rules_query (r_name , node )
1527
1547
1528
1548
elif idx == StatsDialog .COL_DSTIP :
1529
- cur_idx = self .TAB_HOSTS
1549
+ cur_idx = self .TAB_ADDRS
1530
1550
self .IN_DETAIL_VIEW [cur_idx ] = True
1531
1551
rowdata = row .model ().index (row .row (), self .COL_DSTIP ).data ()
1532
- hostip = rowdata .split (" " )[0 ]
1533
- self .LAST_SELECTED_ITEM = hostip
1552
+ ip = rowdata
1553
+ self .LAST_SELECTED_ITEM = ip
1554
+ self .tabWidget .setCurrentIndex (cur_idx )
1555
+ self ._set_active_widgets (prev_idx , True , ip )
1556
+ self ._set_addrs_query (ip )
1557
+
1558
+ elif idx == StatsDialog .COL_DSTHOST :
1559
+ cur_idx = self .TAB_HOSTS
1560
+ self .IN_DETAIL_VIEW [cur_idx ] = True
1561
+ rowdata = row .model ().index (row .row (), self .COL_DSTHOST ).data ()
1562
+ host = rowdata
1563
+ self .LAST_SELECTED_ITEM = host
1564
+ self .tabWidget .setCurrentIndex (cur_idx )
1565
+ self ._set_active_widgets (prev_idx , True , host )
1566
+ self ._set_hosts_query (host )
1567
+
1568
+ elif idx == StatsDialog .COL_DSTPORT :
1569
+ cur_idx = self .TAB_PORTS
1570
+ self .IN_DETAIL_VIEW [cur_idx ] = True
1571
+ rowdata = row .model ().index (row .row (), self .COL_DSTPORT ).data ()
1572
+ port = rowdata
1573
+ self .LAST_SELECTED_ITEM = port
1574
+ self .tabWidget .setCurrentIndex (cur_idx )
1575
+ self ._set_active_widgets (prev_idx , True , port )
1576
+ self ._set_ports_query (port )
1577
+
1578
+ elif idx == StatsDialog .COL_UID :
1579
+ cur_idx = self .TAB_USERS
1580
+ self .IN_DETAIL_VIEW [cur_idx ] = True
1581
+ rowdata = row .model ().index (row .row (), self .COL_UID ).data ()
1582
+ uid = rowdata
1583
+ self .LAST_SELECTED_ITEM = uid
1534
1584
self .tabWidget .setCurrentIndex (cur_idx )
1535
- self ._set_active_widgets (prev_idx , True , hostip )
1536
- self ._set_hosts_query ( hostip )
1585
+ self ._set_active_widgets (prev_idx , True , uid )
1586
+ self ._set_users_query ( uid )
1537
1587
1538
1588
else :
1539
1589
cur_idx = self .TAB_PROCS
0 commit comments