diff --git a/nfstream/__init__.py b/nfstream/__init__.py index 53f2bdb..596d360 100644 --- a/nfstream/__init__.py +++ b/nfstream/__init__.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- from nfstream import streamer @@ -9,4 +8,4 @@ from nfstream import streamer __author__ = """Zied Aouini""" __email__ = 'aouinizied@gmail.com' -__version__ = '1.1.7' \ No newline at end of file +__version__ = '1.1.7' diff --git a/nfstream/classifier.py b/nfstream/classifier.py index 7cb9499..f788fca 100644 --- a/nfstream/classifier.py +++ b/nfstream/classifier.py @@ -39,6 +39,7 @@ class NDPIClassifier(NFStreamClassifier): flow.classifiers[self.name]['dst_id'] = pointer(ndpi_id_struct()) flow.classifiers[self.name]['application_name'] = '' flow.classifiers[self.name]['category_name'] = '' + flow.classifiers[self.name]['guessed'] = 0 def on_flow_update(self, packet_information, flow, direction): NFStreamClassifier.on_flow_update(self, packet_information, flow, direction) @@ -68,6 +69,7 @@ class NDPIClassifier(NFStreamClassifier): 1, cast(addressof(c_uint8(0)), POINTER(c_uint8)) ) + flow.classifiers[self.name]['guessed'] = 1 # HERE you can change flow.export_reason to a value > 2 and the flow will be terminated automatically def on_flow_terminate(self, flow): diff --git a/nfstream/ndpi_bindings.py b/nfstream/ndpi_bindings.py index 49aa214..3793a25 100644 --- a/nfstream/ndpi_bindings.py +++ b/nfstream/ndpi_bindings.py @@ -1,10 +1,3 @@ -""" - This source code is part of nDPI python bindings - original source code is available here: https://github.com/ntop/nDPI/tree/dev/python - We keep it as part of nfstream in order to be independent as we plan to implement an abstration layer in case - we support several deep packet inspection engines. -""" - from ctypes import CDLL, Structure, c_uint16, c_int, c_ulong, c_uint32, CFUNCTYPE, c_void_p, POINTER, c_char_p, c_uint8 from ctypes import c_char, c_uint, c_int16, c_longlong, c_size_t, Union, c_ubyte, c_uint64, c_int32, c_ushort from os.path import abspath, dirname diff --git a/nfstream/streamer.py b/nfstream/streamer.py index d009a21..c0c9a5f 100644 --- a/nfstream/streamer.py +++ b/nfstream/streamer.py @@ -96,6 +96,7 @@ class Flow: 'ip_dst': self.ip_dst_str, 'dst_port': self.dst_port, 'ip_protocol': self.ip_protocol, + 'vlan_id': self.vlan_id, 'src_to_dst_pkts': self.src_to_dst_pkts, 'dst_to_src_pkts': self.dst_to_src_pkts, 'src_to_dst_bytes': self.src_to_dst_bytes,