ntop / nDPI

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

'ndpi_add_host_url_subprotocol', need custom category and breed #2594

Open UnveilTech opened 1 month ago

UnveilTech commented 1 month ago

Hello Ivan,

proposal of improvment: to be able to define a category and breed with the function 'ndpi_add_host_url_subprotocol'

it should be fine to use category and breed we need instead of NDPI_PROTOCOL_CATEGORY_UNSPECIFIED and NDPI_PROTOCOL_ACCEPTABLE as by default here.

what do you think ?

we understand it could modify the format of the proto.txt, but it'll be a great +

bye Fred

0xA50C1A1 commented 1 month ago

I've tried to implement this before, but didn't create a PR. I think the main issue with the new proto.txt format is: how to add category and breed in a way that doesn't make it ambiguous?

UnveilTech commented 1 month ago

Hi Vladimir, quick examples: 'host:"api-global.netflix.com"@Netflix=|Network|Safe' 'host:"api-global.netflix.com"@Netflix=1024|Network|Safe' 'host:"api-global.netflix.com"@Netflix=|Network' 'host:"api-global.netflix.com"@Netflix=1024||Safe' 'host:"api-global.netflix.com"@Netflix=1024,Network,Safe' 'host:"api-global.netflix.com"@Netflix,Network,Safe' (no number after the CustomProtocol means the next part is a category) etc...

there are dozens of scenarios here. you can use the mark you think it could be the best or the easiest to cut the string... :o)

another nice way could be to use a json format (ex.: proto.json) to define each host/values... maybe more complicated but much more powerful.

bye Fred