diff options
Diffstat (limited to 'examples/py-flow-info')
-rwxr-xr-x | examples/py-flow-info/flow-info.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/py-flow-info/flow-info.py b/examples/py-flow-info/flow-info.py index 638c76581..61f25429d 100755 --- a/examples/py-flow-info/flow-info.py +++ b/examples/py-flow-info/flow-info.py @@ -11,10 +11,12 @@ from nDPIsrvd import nDPIsrvdSocket, TermColor def parse_json_str(json_str): j = nDPIsrvd.JsonParseBytes(json_str[0]) - - event_str = validateEventName(j) - if event_str is None: - raise RuntimeError('unknown flow event name: {}'.format(event)) + event_str = nDPIsrvd.validateFlowEventName(j) + if event_str is 'Unknown': + if nDPIsrvd.validatePacketEventName(j) is 'Unknown': + raise RuntimeError('Missing flow_event_name in the JSON string.') + else: + return ndpi_proto_categ = '' ndpi_frisk = '' |