Add new Protocol
I'm working on nDPI For a while, and I add some protocols, I start my custom Protocol ID with 300 to avoid any conflict in future, and everything working good.
after the last update of nDPI @lucaderi commit "Major code cleanup" and he changed a lot of thing in the code, like adding ndpi_validate_protocol_initialization function, so know I can't add custom protocol with ID more the 255, I got this error:
[NDPI] INTERNAL ERROR missing protoName initialization for [protoId=243]: recovering
[NDPI] INTERNAL ERROR missing protoName initialization for [protoId=244]: recovering
[NDPI] INTERNAL ERROR missing protoName initialization for [protoId=245]: recovering
[NDPI] INTERNAL ERROR missing protoName initialization for [protoId=246]: recovering
[NDPI] INTERNAL ERROR missing protoName initialization for [protoId=247]: recovering
.
.
.
and ndpiReader failed in detecting my protocols
I know that there are some of NDPI_PROTOCOL_FREE_X that we can use, but what about adding a custom protocol with ID more the 255?
@zablah These protocols from NDPI_LAST_IMPLEMENTED_PROTOCOL and up are not implemented and thus the error is normal. You cannot implement id 300 as protocols must be consecutive. Note that unless you develop a real protocol, you need to use a new category for runtime configuration as otherwise we pollute the code with user-specific domain names. Awaiting the pull request for your new protocol
@lucaderi , I added a free protocol ascending to ID 256, like
NDPI_PROTOCOL_FREE_243 = 243,
NDPI_PROTOCOL_FREE_244 = 244,
NDPI_PROTOCOL_FREE_245 = 245,
NDPI_PROTOCOL_FREE_246 = 246,
..
..
NDPI_PROTOCOL_FREE_255 = 255,
NDPI_PROTOCOL_NEW_PRTOCOL = 256,
during compiling I got this warning:
ndpi_content_match.c.inc:7963:40: warning: large integer implicitly truncated to unsigned type [-Woverflow]
{0x08080808/*8.8.8.8/32*/,32, NDPI_PROTOCOL_NEW_PRTOCOL},
and ndpiReader can't detect my new protocol, I got [proto: 0/Unknown] but then I put the id less than 255, during compiling there is no warning and ndpiReader detecting my new protocol. Why?
when u added the id to 254 did ndpiReader detected you protocol ? what did u set to make this happen .. ?
Im working to add a new custom protocol but ndpiReader can't detect my protocol ?