diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2025-06-03 10:22:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-03 10:22:15 +0200 |
commit | ed210577101af311e70d6ddcde1b0282a76f6031 (patch) | |
tree | 2be00d2596b052ede26a9849a7c75c1828ca089c /src/include/ndpi_api.h | |
parent | 70a72f163800dd37dca1ec586ae0a58a6cef8206 (diff) |
First step into a dynamic number of protocols (#2857)
We want to get rid of the defines `NDPI_MAX_SUPPORTED_PROTOCOLS` and
`NDPI_MAX_NUM_CUSTOM_PROTOCOLS`.
You can use:
```
ndpi_get_num_protocols()
```
See #2136
Removed some unused functions from public API
Diffstat (limited to 'src/include/ndpi_api.h')
-rw-r--r-- | src/include/ndpi_api.h | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h index a59a0925e..675d79b40 100644 --- a/src/include/ndpi_api.h +++ b/src/include/ndpi_api.h @@ -574,11 +574,12 @@ extern "C" { * Check if subprotocols of the specified master protocol are just * informative (and not real) * + * @par ndpi_mod = the detection module * @par protoId = the (master) protocol identifier to query * @return 1 = the subprotocol is informative, 0 otherwise. * */ - u_int8_t ndpi_is_subprotocol_informative(u_int16_t protoId); + u_int8_t ndpi_is_subprotocol_informative(struct ndpi_detection_module_struct *ndpi_mod, u_int16_t protoId); /** * Set hostname-based protocol @@ -891,13 +892,15 @@ extern "C" { char *tcp_fingerprint); /** - * Get the total number of the supported protocols + * Get the total number of the defined protocols (internals and custom). + * It can be called only with finalized context, i.e. after having called + * ndpi_finalize_initialization() * * @par ndpi_mod = the detection module * @return the number of protocols * */ - u_int ndpi_get_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_mod); + u_int ndpi_get_num_protocols(struct ndpi_detection_module_struct *ndpi_mod); /** * Get the nDPI version release @@ -917,34 +920,6 @@ extern "C" { void ndpi_set_automa(struct ndpi_detection_module_struct *ndpi_struct, void* automa); - /* NDPI_PROTOCOL_HTTP */ - /** - * Retrieve information for HTTP flows - * - * @par flow = the detected flow - * @return the HTTP method information about the flow - * - */ - ndpi_http_method ndpi_get_http_method(struct ndpi_flow_struct *flow); - - /** - * Get the HTTP url - * - * @par flow = the detected flow - * @return the HTTP method information about the flow - * - */ - char* ndpi_get_http_url(struct ndpi_flow_struct *flow); - - /** - * Get the HTTP content-type - * - * @par flow = the detected flow - * @return the HTTP method information about the flow - * - */ - char* ndpi_get_http_content_type(struct ndpi_flow_struct *flow); - /* NDPI_PROTOCOL_TOR */ /** * Check if the flow could be detected as TOR protocol @@ -1086,8 +1061,6 @@ extern "C" { bool ndpi_is_proto_equals(ndpi_master_app_protocol to_check, ndpi_master_app_protocol to_match, bool exact_match_only); ndpi_proto_defaults_t* ndpi_get_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod); - u_int ndpi_get_ndpi_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_mod); - u_int ndpi_get_ndpi_num_custom_protocols(struct ndpi_detection_module_struct *ndpi_mod); u_int ndpi_get_ndpi_detection_module_size(void); /* Simple helper to get current time, in sec */ @@ -1229,7 +1202,6 @@ extern "C" { u_int8_t ndpi_is_public_ipv4(u_int32_t a /* host byte order */); u_int64_t ndpi_htonll(u_int64_t v); u_int64_t ndpi_ntohll(u_int64_t v); - u_int8_t ndpi_is_valid_protoId(u_int16_t protoId); u_int8_t ndpi_is_encrypted_proto(struct ndpi_detection_module_struct *ndpi_str, ndpi_protocol proto); /* DGA */ |