aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2024-12-09 11:09:34 +0100
committerToni Uhlig <matzeton@googlemail.com>2024-12-09 11:09:34 +0100
commitacd9e871b6815d279e277c269ea58316673c816a (patch)
tree6d5fbd462c3b406c2b11dc4df464124b2b8f775d
parentb9465c09d8edd630d1c857c238c9a15d0ad5aaa2 (diff)
Added `--no-blink` and `--hide-risk-info`
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r--dependencies/nDPIsrvd.py4
-rwxr-xr-xexamples/py-flow-info/flow-info.py9
2 files changed, 12 insertions, 1 deletions
diff --git a/dependencies/nDPIsrvd.py b/dependencies/nDPIsrvd.py
index 23bd86257..4dab9318f 100644
--- a/dependencies/nDPIsrvd.py
+++ b/dependencies/nDPIsrvd.py
@@ -64,6 +64,10 @@ class TermColor:
USE_COLORAMA = False
@staticmethod
+ def disableBlink():
+ TermColor.BLINK = ''
+
+ @staticmethod
def calcColorHash(string):
h = 0
for char in string:
diff --git a/examples/py-flow-info/flow-info.py b/examples/py-flow-info/flow-info.py
index 5732bf980..5a2c0707c 100755
--- a/examples/py-flow-info/flow-info.py
+++ b/examples/py-flow-info/flow-info.py
@@ -380,7 +380,7 @@ def onJsonLineRecvd(json_dict, instance, current_flow, global_user_data):
return True
ndpi_proto_categ_breed += '[' + str(json_dict['ndpi']['breed']) + ']'
- if 'flow_risk' in json_dict['ndpi']:
+ if 'flow_risk' in json_dict['ndpi'] and args.hide_risk_info == False:
severity = 0
cnt = 0
@@ -562,10 +562,14 @@ if __name__ == '__main__':
argparser = nDPIsrvd.defaultArgumentParser('Prettify and print events using the nDPIsrvd Python interface.', True)
argparser.add_argument('--no-color', action='store_true', default=False,
help='Disable all terminal colors.')
+ argparser.add_argument('--no-blink', action='store_true', default=False,
+ help='Disable all blink effects.')
argparser.add_argument('--no-statusbar', action='store_true', default=False,
help='Disable informational status bar.')
argparser.add_argument('--hide-instance-info', action='store_true', default=False,
help='Hide instance Alias/Source prefixed every line.')
+ argparser.add_argument('--hide-risk-info', action='store_true', default=False,
+ help='Skip printing risks.')
argparser.add_argument('--print-timestamp', action='store_true', default=False,
help='Print received event timestamps.')
argparser.add_argument('--print-first-seen', action='store_true', default=False,
@@ -605,6 +609,9 @@ if __name__ == '__main__':
if args.no_color is True:
TermColor.disableColor()
+ if args.no_blink is True:
+ TermColor.disableBlink()
+
if args.ipwhois is True:
import dns, ipwhois
whois_db = dict()