aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-07-22 13:15:21 +0200
committerToni Uhlig <matzeton@googlemail.com>2023-07-22 13:16:13 +0200
commitcdd3aba8da368b2447c3a38a883f9302c7a7e7b7 (patch)
treebd207d8e03204a97cb8b4e877e7f11a3b254389f /src/include
parent6831187d6288d6482d99ec2c72c7d0794e4020cf (diff)
Allow init of app protocols w/o any hostnames set.improved/empty-app-protos
* fixes `[NDPI] INTERNAL ERROR missing protoName initialization for [protoId=339]: recovering` * still possible for app logic to make use of "empty" app protocols Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ndpi_api.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h
index e48fc013e..653510e82 100644
--- a/src/include/ndpi_api.h
+++ b/src/include/ndpi_api.h
@@ -167,14 +167,36 @@ extern "C" {
u_int16_t port /* network byte order */);
/**
- * Init single protocol match
+ * Creates a protocol match that does not contain any hostnames.
+ *
+ * @par hostname_list = the desired hostname list form which the first entry is used to create the match
+ * @par empty_app_protocol = the resulting protocol match that does contain all information except the hostname
+ *
+ * @return 0 on success, 1 otherwise
+ */
+ int ndpi_init_empty_app_protocol(ndpi_protocol_match const * const hostname_list,
+ ndpi_protocol_match * const empty_app_protocol);
+
+ /**
+ * Init single protocol match.
+ *
+ * @par ndpi_mod = the struct created for the protocol detection
+ * @par match = the struct passed to match the protocol
+ *
+ * @return 0 on success, 1 otherwise
+ */
+ int ndpi_init_app_protocol(struct ndpi_detection_module_struct *ndpi_str,
+ ndpi_protocol_match const * const match);
+
+ /**
+ * Init single protocol match and adds it to the Aho-Corasick automata.
*
* @par ndpi_mod = the struct created for the protocol detection
* @par match = the struct passed to match the protocol
*
*/
void ndpi_init_protocol_match(struct ndpi_detection_module_struct *ndpi_mod,
- ndpi_protocol_match *match);
+ ndpi_protocol_match const * const match);
/**
* Returns a new initialized detection module