ntop / nDPI

Open Source Deep Packet Inspection Software Toolkit
http://www.ntop.org
GNU Lesser General Public License v3.0
3.83k stars 896 forks source link

Custom ip/port rules #1728

Open IvanNardi opened 2 years ago

IvanNardi commented 2 years ago

ndpi allow the users to define some custom rules via proto.txt" files. Among these rules, I am interested in talking about the ip/port rules (only).

There are 4 kind of these rules, at least:

2) these rules as used as fallback, only if "internal engine" doesn't found any classification (as suggested in #1322). In other words, these rules are checked "last".

3) Something else?

Current implementation (in ndpi_do_guess()) is a bit confused and these 4 cases are handled in quite different ways. I fear that these differences are historical, though.

How should we handle ip/port custom rules? @utoni , @lucaderi

utoni commented 2 years ago
2. these rules as used as fallback, only if "internal engine" doesn't found any classification (as suggested in [Custom Applications added into protos.txt file gets matched first, before the actual application detection happens #1322](https://github.com/ntop/nDPI/issues/1322)). In other words, these rules are checked "last".

I would prefer this solution, although it might be up to the user how much she trusts the correctness of the engine.

3. Something else?

What about a combination of 1. and 2. meaning that the user can specify in the protos.txt if it should matched before or after the engine tries to detect something?