mirror of
https://github.com/vel21ripn/nDPI.git
synced 2026-04-28 15:09:47 +00:00
Add support for flow client/server information (#1671)
In a lot of places in ndPI we use *packet* source/dest info (address/port/direction) when we are interested in *flow* client/server info, instead. Add basic logic to autodetect this kind of information. nDPI doesn't perform any "flow management" itself but this task is delegated to the external application. It is then likely that the application might provide more reliable hints about flow client/server direction and about the TCP handshake presence: in that case, these information might be (optionally) passed to the library, disabling the internal "autodetect" logic. These new fields have been used in some LRU caches and in the "guessing" algorithm. It is quite likely that some other code needs to be updated.
This commit is contained in:
parent
523f22b942
commit
e6b332aa4a
41 changed files with 267 additions and 165 deletions
|
|
@ -13,7 +13,7 @@ If not, see <http://www.gnu.org/licenses/>.
|
|||
------------------------------------------------------------------------------------------------------------------------
|
||||
"""
|
||||
|
||||
from ndpi import NDPI, NDPIFlow
|
||||
from ndpi import NDPI, NDPIFlow, ffi
|
||||
import time
|
||||
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ if __name__ == '__main__':
|
|||
try:
|
||||
nDPI = NDPI()
|
||||
ndpi_flow = NDPIFlow()
|
||||
nDPI.process_packet(ndpi_flow, b'', time.time())
|
||||
nDPI.process_packet(ndpi_flow, b'', time.time(), ffi.NULL)
|
||||
nDPI.giveup(ndpi_flow)
|
||||
print("nDPI Python bindings: OK")
|
||||
except Exception:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue