Skip to content

Commit 4471562

Browse files
committed
Provide an explicit state for the flow classification process
Application should keep calling nDPI until flow state became `NDPI_STATE_CLASSIFIED`. The main loop in the application is simplified to something like: ``` res = ndpi_detection_process_packet(...); if(res->state == NDPI_STATE_CLASSIFIED) { /* Done: you can get finale classification and all metadata. nDPI doesn't need more packets for this flow */ } else { /* nDPI needs more packets for this flow. The provided classification is not final and more metadata might be extracted. Partial classification (if any) is available in `flow->detected_protocol_stack[]` as usual but it can be updated later. */ } /* Example A: pkt 1: proto QUIC state NDPI_STATE_INSPECTING pkt 2: proto QUIC/Youtube state NDPI_STATE_CLASSIFIED Example B: pkt 1: proto STUN state NDPI_STATE_INSPECTING pkt N: proto DTLS state NDPI_STATE_INSPECTING pkt N+M: proto DTLS/GoogleCall state NDPI_STATE_CLASSIFIED */ } ``` You can take a look at `ndpiReader` for a slightly more complex example. API changes: * remove the third parameter from `ndpi_detection_giveup()`. If you need to know if the classification flow has been guessed, you can access `flow->protocol_was_guessed` * remove `ndpi_extra_dissection_possible()` * change some prototypes from accepting `ndpi_protocol foo` to `ndpi_master_app_protocol bar`. The update is trivial: from `foo` to `foo.proto`
1 parent e1c0d8b commit 4471562

File tree

91 files changed

+337
-361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+337
-361
lines changed

example/ndpiReader.c

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ void ndpiCheckHostStringMatch(char *testChar) {
460460
detected_protocol.proto.master_protocol = 0;
461461
detected_protocol.category = match.protocol_category;
462462

463-
ndpi_protocol2name(ndpi_str, detected_protocol, appBufStr,
463+
ndpi_protocol2name(ndpi_str, detected_protocol.proto, appBufStr,
464464
sizeof(appBufStr));
465465

466466
printf("Match Found for string [%s] -> P(%d) B(%d) C(%d) => %s %s %s\n",
@@ -559,7 +559,7 @@ static void ndpiCheckIPMatch(char *testChar) {
559559
memset(&detected_protocol, 0, sizeof(ndpi_protocol));
560560
detected_protocol.proto.app_protocol = ndpi_map_ndpi_id_to_user_proto_id(ndpi_str, ret);
561561

562-
ndpi_protocol2name(ndpi_str, detected_protocol, appBufStr,
562+
ndpi_protocol2name(ndpi_str, detected_protocol.proto, appBufStr,
563563
sizeof(appBufStr));
564564

565565
printf("Match Found for IP %s, port %d -> %s (%d)\n",
@@ -1776,11 +1776,11 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa
17761776
);
17771777

17781778
fprintf(csv_fp, "%s|",
1779-
ndpi_protocol2id(flow->detected_protocol, buf, sizeof(buf)));
1779+
ndpi_protocol2id(flow->detected_protocol.proto, buf, sizeof(buf)));
17801780

17811781
fprintf(csv_fp, "%s|%s|%s|%s|",
17821782
ndpi_protocol2name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
1783-
flow->detected_protocol, buf, sizeof(buf)),
1783+
flow->detected_protocol.proto, buf, sizeof(buf)),
17841784
ndpi_stack2str(ndpi_thread_info[thread_id].workflow->ndpi_struct,
17851785
&flow->detected_protocol.protocol_stack, buf2, sizeof(buf2)),
17861786
ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
@@ -1919,7 +1919,7 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa
19191919
flow->detected_protocol.proto.master_protocol,
19201920
flow->detected_protocol.proto.app_protocol,
19211921
ndpi_protocol2name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
1922-
flow->detected_protocol, buf1, sizeof(buf1))
1922+
flow->detected_protocol.proto, buf1, sizeof(buf1))
19231923
);
19241924
}
19251925
}
@@ -1961,14 +1961,14 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa
19611961

19621962
#ifdef NDPI_EXTENDED_SANITY_CHECKS
19631963
/* Be sure new stack logic is compatible with legacy code */
1964-
assert(ndpi_stack_get_upper_proto(&flow->detected_protocol.protocol_stack) == ndpi_get_upper_proto(flow->detected_protocol));
1965-
assert(ndpi_stack_get_lower_proto(&flow->detected_protocol.protocol_stack) == ndpi_get_lower_proto(flow->detected_protocol));
1964+
assert(ndpi_stack_get_upper_proto(&flow->detected_protocol.protocol_stack) == ndpi_get_upper_proto(flow->detected_protocol.proto));
1965+
assert(ndpi_stack_get_lower_proto(&flow->detected_protocol.protocol_stack) == ndpi_get_lower_proto(flow->detected_protocol.proto));
19661966
#endif
19671967

19681968
fprintf(out, "%s/%s][Stack: %s][IP: %u/%s]",
1969-
ndpi_protocol2id(flow->detected_protocol, buf, sizeof(buf)),
1969+
ndpi_protocol2id(flow->detected_protocol.proto, buf, sizeof(buf)),
19701970
ndpi_protocol2name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
1971-
flow->detected_protocol, buf1, sizeof(buf1)),
1971+
flow->detected_protocol.proto, buf1, sizeof(buf1)),
19721972
ndpi_stack2str(ndpi_thread_info[thread_id].workflow->ndpi_struct,
19731973
&flow->detected_protocol.protocol_stack, buf2, sizeof(buf2)),
19741974
flow->detected_protocol.protocol_by_ip,
@@ -2002,7 +2002,7 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa
20022002

20032003
fprintf(out, "[%s]",
20042004
ndpi_is_encrypted_proto(ndpi_thread_info[thread_id].workflow->ndpi_struct,
2005-
flow->detected_protocol) ? "Encrypted" : "ClearText");
2005+
flow->detected_protocol.proto) ? "Encrypted" : "ClearText");
20062006

20072007
fprintf(out, "[Confidence: %s]", ndpi_confidence_get_name(flow->confidence));
20082008

@@ -2567,14 +2567,13 @@ static void node_proto_guess_walker(const void *node, ndpi_VISIT which, int dept
25672567

25682568
if((which == ndpi_preorder) || (which == ndpi_leaf)) { /* Avoid walking the same node multiple times */
25692569
if((!flow->detection_completed) && flow->ndpi_flow) {
2570-
u_int8_t proto_guessed;
25712570

25722571
malloc_size_stats = 1;
25732572
flow->detected_protocol = ndpi_detection_giveup(ndpi_thread_info[thread_id].workflow->ndpi_struct,
2574-
flow->ndpi_flow, &proto_guessed);
2573+
flow->ndpi_flow);
25752574
malloc_size_stats = 0;
25762575

2577-
if(proto_guessed) ndpi_thread_info[thread_id].workflow->stats.guessed_flow_protocols++;
2576+
if(flow->ndpi_flow->protocol_was_guessed) ndpi_thread_info[thread_id].workflow->stats.guessed_flow_protocols++;
25782577
}
25792578

25802579
process_ndpi_collected_info(ndpi_thread_info[thread_id].workflow, flow);
@@ -2976,7 +2975,7 @@ static void port_stats_walker(const void *node, ndpi_VISIT which, int depth, voi
29762975
/* get app level protocol */
29772976
if(flow->detected_protocol.proto.master_protocol) {
29782977
ndpi_protocol2name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
2979-
flow->detected_protocol, proto, sizeof(proto));
2978+
flow->detected_protocol.proto, proto, sizeof(proto));
29802979
} else {
29812980
strncpy(proto, ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
29822981
flow->detected_protocol.proto.app_protocol),sizeof(proto) - 1);
@@ -3084,7 +3083,7 @@ static void dump_realtime_protocol(struct ndpi_workflow * workflow, struct ndpi_
30843083
snprintf(dstip, sizeof(dstip), "[%s]", flow->dst_name ? flow->dst_name : "");
30853084
}
30863085

3087-
ndpi_protocol2name(workflow->ndpi_struct, flow->detected_protocol, app_name, sizeof(app_name));
3086+
ndpi_protocol2name(workflow->ndpi_struct, flow->detected_protocol.proto, app_name, sizeof(app_name));
30883087

30893088
if (ret == 1) {
30903089
fprintf(out, "Detected Realtime protocol %s --> [%s] %s:%d <--> %s:%d app=%s <%s>\n",
@@ -3994,7 +3993,7 @@ static void printFlowsStats() {
39943993
fprintf(out, "\t%u\t%-10s\t%s:%u <-> %s:%u\t[",
39953994
i,
39963995
ndpi_protocol2name(ndpi_thread_info[0].workflow->ndpi_struct,
3997-
all_flows[i].flow->detected_protocol, buf, sizeof(buf)),
3996+
all_flows[i].flow->detected_protocol.proto, buf, sizeof(buf)),
39983997
all_flows[i].flow->src_name ? all_flows[i].flow->src_name : "",
39993998
ntohs(all_flows[i].flow->src_port),
40003999
all_flows[i].flow->dst_name ? all_flows[i].flow->dst_name : "",
@@ -4942,7 +4941,7 @@ static void ndpi_process_packet(u_char *args,
49424941
}
49434942
trailer->flow_risk_info[sizeof(trailer->flow_risk_info) - 1] = '\0';
49444943
trailer->proto.master_protocol = htons(p.proto.master_protocol), trailer->proto.app_protocol = htons(p.proto.app_protocol);
4945-
ndpi_protocol2name(ndpi_thread_info[thread_id].workflow->ndpi_struct, p, trailer->name, sizeof(trailer->name));
4944+
ndpi_protocol2name(ndpi_thread_info[thread_id].workflow->ndpi_struct, p.proto, trailer->name, sizeof(trailer->name));
49464945

49474946
/* Metadata */
49484947
/* Metadata are (all) available in `flow` only after nDPI completed its work!

example/ndpiSimpleIntegration.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -876,12 +876,10 @@ static void ndpi_process_packet(uint8_t * const args,
876876
return;
877877
} else if (flow_to_process->ndpi_flow->num_processed_pkts == 0xFE) {
878878
/* last chance to guess something, better then nothing */
879-
uint8_t protocol_was_guessed = 0;
880879
flow_to_process->guessed_protocol =
881880
ndpi_detection_giveup(workflow->ndpi_struct,
882-
flow_to_process->ndpi_flow,
883-
&protocol_was_guessed);
884-
if (protocol_was_guessed != 0) {
881+
flow_to_process->ndpi_flow);
882+
if (flow_to_process->ndpi_flow->protocol_was_guessed != 0) {
885883
printf("[%8llu, %d, %4d][GUESSED] protocol: %s | app protocol: %s | category: %s\n",
886884
workflow->packets_captured,
887885
reader_thread->array_index,

example/reader_util.c

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ static void dump_flow_fingerprint(struct ndpi_workflow * workflow,
11451145
ndpi_serialize_string_uint32(&serializer, "srv_port", ntohs(flow->dst_port));
11461146
ndpi_serialize_string_string(&serializer, "proto",
11471147
ndpi_protocol2name(workflow->ndpi_struct,
1148-
flow->detected_protocol,
1148+
flow->detected_protocol.proto,
11491149
buf, sizeof(buf)));
11501150

11511151
if(flow->server_hostname)
@@ -1192,7 +1192,7 @@ static void process_ndpi_monitoring_info(struct ndpi_flow_info *flow) {
11921192
return;
11931193

11941194
if(flow->monitoring_state == 0 &&
1195-
flow->ndpi_flow->monitoring) {
1195+
flow->ndpi_flow->state == NDPI_STATE_MONITORING) {
11961196
/* We just moved to monitoring state */
11971197
flow->monitoring_state = 1;
11981198
flow->num_packets_before_monitoring = flow->ndpi_flow->packet_direction_complete_counter[0] + flow->ndpi_flow->packet_direction_complete_counter[1];
@@ -1704,7 +1704,7 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
17041704
ndpi_serialize_string_uint32(&flow->ndpi_flow_serializer, "detection_completed", flow->detection_completed);
17051705
ndpi_serialize_string_uint32(&flow->ndpi_flow_serializer, "check_extra_packets", flow->check_extra_packets);
17061706

1707-
if(flow->ndpi_flow->monitoring) {
1707+
if(flow->ndpi_flow->state == NDPI_STATE_MONITORING) {
17081708
serialize_monitoring_metadata(flow);
17091709
}
17101710

@@ -2018,26 +2018,19 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
20182018
ipsize, time_ms, &input_info);
20192019
if(monitoring_enabled)
20202020
process_ndpi_monitoring_info(flow);
2021-
enough_packets |= ndpi_flow->fail_with_unknown;
2022-
if(enough_packets || (flow->detected_protocol.proto.app_protocol != NDPI_PROTOCOL_UNKNOWN)) {
2023-
if((!enough_packets)
2024-
&& ndpi_extra_dissection_possible(workflow->ndpi_struct, ndpi_flow))
2025-
; /* Wait for further metadata */
2026-
else {
2027-
/* New protocol detected or give up */
2028-
flow->detection_completed = 1;
2029-
2030-
if(flow->detected_protocol.proto.app_protocol == NDPI_PROTOCOL_UNKNOWN) {
2031-
u_int8_t proto_guessed;
2032-
2033-
flow->detected_protocol = ndpi_detection_giveup(workflow->ndpi_struct, flow->ndpi_flow,
2034-
&proto_guessed);
2035-
if(proto_guessed) workflow->stats.guessed_flow_protocols++;
2036-
}
2021+
if(flow->detected_protocol.state == NDPI_STATE_CLASSIFIED ||
2022+
enough_packets) {
2023+
2024+
flow->detection_completed = 1;
20372025

2038-
process_ndpi_collected_info(workflow, flow);
2026+
if(flow->detected_protocol.state != NDPI_STATE_CLASSIFIED) {
2027+
flow->detected_protocol = ndpi_detection_giveup(workflow->ndpi_struct, flow->ndpi_flow);
20392028
}
2029+
2030+
if(flow->ndpi_flow->protocol_was_guessed) workflow->stats.guessed_flow_protocols++;
2031+
process_ndpi_collected_info(workflow, flow);
20402032
}
2033+
20412034
/* Let's try to save client-server direction */
20422035
flow->current_pkt_from_client_to_server = input_info.in_pkt_dir;
20432036

fuzz/fuzz_config.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
1212
FuzzedDataProvider fuzzed_data(data, size);
1313
struct ndpi_detection_module_struct *ndpi_info_mod;
1414
struct ndpi_flow_struct flow;
15-
u_int8_t protocol_was_guessed, unused;
15+
u_int8_t unused;
1616
u_int32_t i, ret;
1717
u_int16_t bool_value;
1818
struct ndpi_lru_cache_stats lru_stats;
@@ -831,15 +831,15 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
831831
ndpi_detection_get_l4(pkt.data(), pkt.size(), &l4_return, &l4_len_return, &l4_protocol_return, NDPI_DETECTION_ONLY_IPV4);
832832

833833
ndpi_detection_process_packet(ndpi_info_mod, &flow, pkt.data(), pkt.size(), 0, &input_info);
834-
p = ndpi_detection_giveup(ndpi_info_mod, &flow, &protocol_was_guessed);
834+
p = ndpi_detection_giveup(ndpi_info_mod, &flow);
835835

836836
assert(p.proto.master_protocol == ndpi_get_flow_masterprotocol(&flow));
837837
assert(p.proto.app_protocol == ndpi_get_flow_appprotocol(&flow));
838838
assert(p.category == ndpi_get_flow_category(&flow));
839839
ndpi_is_master_only_protocol(ndpi_info_mod, p.proto.app_protocol);
840840
ndpi_normalize_protocol(ndpi_info_mod, &p.proto);
841-
assert(ndpi_stack_get_upper_proto(&p.protocol_stack) == ndpi_get_upper_proto(p));
842-
assert(ndpi_stack_get_lower_proto(&p.protocol_stack) == ndpi_get_lower_proto(p));
841+
assert(ndpi_stack_get_upper_proto(&p.protocol_stack) == ndpi_get_upper_proto(p.proto));
842+
assert(ndpi_stack_get_lower_proto(&p.protocol_stack) == ndpi_get_lower_proto(p.proto));
843843
ndpi_get_flow_error_code(&flow);
844844
ndpi_get_flow_risk_info(&flow, out, sizeof(out), 1);
845845
ndpi_get_flow_ndpi_proto(&flow, &p2);

fuzz/fuzz_ndpi_reader.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ static void node_cleanup_walker(const void *node, ndpi_VISIT which, int depth, v
4848

4949
if((which == ndpi_preorder) || (which == ndpi_leaf)) { /* Avoid walking the same node multiple times */
5050
if((!flow->detection_completed) && flow->ndpi_flow) {
51-
u_int8_t proto_guessed;
52-
5351
flow->detected_protocol = ndpi_detection_giveup(workflow->ndpi_struct,
54-
flow->ndpi_flow, &proto_guessed);
52+
flow->ndpi_flow);
5553
}
5654

5755
process_ndpi_collected_info(workflow, flow);

fuzz/fuzz_process_packet.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ static ndpi_serializer json_serializer = {};
1010
static ndpi_serializer csv_serializer = {};
1111

1212
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
13-
uint8_t protocol_was_guessed;
14-
1513
if (ndpi_info_mod == NULL) {
1614
fuzz_init_detection_module(&ndpi_info_mod, NULL);
1715

@@ -22,19 +20,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
2220
memset(&ndpi_flow, 0, SIZEOF_FLOW_STRUCT);
2321
ndpi_protocol detected_protocol =
2422
ndpi_detection_process_packet(ndpi_info_mod, &ndpi_flow, Data, Size, 0, NULL);
25-
ndpi_protocol guessed_protocol =
26-
ndpi_detection_giveup(ndpi_info_mod, &ndpi_flow, &protocol_was_guessed);
23+
detected_protocol = ndpi_detection_giveup(ndpi_info_mod, &ndpi_flow);
2724

2825
ndpi_reset_serializer(&json_serializer);
2926
ndpi_reset_serializer(&csv_serializer);
30-
if (protocol_was_guessed == 0)
31-
{
32-
ndpi_dpi2json(ndpi_info_mod, &ndpi_flow, detected_protocol, &json_serializer);
33-
ndpi_dpi2json(ndpi_info_mod, &ndpi_flow, detected_protocol, &csv_serializer);
34-
} else {
35-
ndpi_dpi2json(ndpi_info_mod, &ndpi_flow, guessed_protocol, &json_serializer);
36-
ndpi_dpi2json(ndpi_info_mod, &ndpi_flow, guessed_protocol, &csv_serializer);
37-
}
27+
ndpi_dpi2json(ndpi_info_mod, &ndpi_flow, detected_protocol, &json_serializer);
28+
ndpi_dpi2json(ndpi_info_mod, &ndpi_flow, detected_protocol, &csv_serializer);
3829
ndpi_free_flow_data(&ndpi_flow);
3930

4031
return 0;

python/ndpi/ndpi.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ def process_packet(self, flow, packet, packet_time_ms, input_info):
5959

6060
def giveup(self, flow):
6161
p = lib.ndpi_detection_giveup(self._detection_module,
62-
flow.C,
63-
ffi.new("uint8_t*", 0))
62+
flow.C)
6463
return ndpi_protocol(C=p,
6564
master_protocol=p.proto.master_protocol,
6665
app_protocol=p.proto.app_protocol,

python/ndpi/ndpi_build.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656
const u_int64_t packet_time_ms,
5757
struct ndpi_flow_input_info *input_info);
5858
ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_struct,
59-
struct ndpi_flow_struct *flow,
60-
u_int8_t *protocol_was_guessed);
59+
struct ndpi_flow_struct *flow);
6160
void ndpi_py_setup_detection_module(struct ndpi_detection_module_struct *mod);
6261
struct ndpi_flow_struct * ndpi_py_initialize_flow(void);
6362
char* ndpi_protocol2name(struct ndpi_detection_module_struct *ndpi_mod, ndpi_protocol proto, char *buf, u_int buf_len);

src/include/ndpi_api.h

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,11 @@ extern "C" {
223223
*
224224
* @par ndpi_struct = the detection module
225225
* @par flow = the flow given for the detection module
226-
* @par protocol_was_guessed = 1 if the protocol was guesses (requires enable_guess = 1), 0 otherwise
227226
* @return the detected protocol even if the flow is not completed;
228227
*
229228
*/
230229
ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_struct,
231-
struct ndpi_flow_struct *flow,
232-
u_int8_t *protocol_was_guessed);
230+
struct ndpi_flow_struct *flow);
233231

234232
/**
235233
* Processes one packet and returns the ID of the detected protocol.
@@ -415,26 +413,26 @@ extern "C" {
415413
* Write the protocol name in the buffer -buf- as master_protocol.protocol
416414
*
417415
* @par ndpi_mod = the detection module
418-
* @par proto = the struct ndpi_protocol contain the protocols name
416+
* @par proto = the struct ndpi_master_app_protocol contain the protocols name
419417
* @par buf = the buffer to write the name of the protocols
420418
* @par buf_len = the length of the buffer
421419
* @return the buffer contains the master_protocol and protocol name
422420
*
423421
*/
424422
char* ndpi_protocol2name(struct ndpi_detection_module_struct *ndpi_mod,
425-
ndpi_protocol proto, char *buf, u_int buf_len);
423+
ndpi_master_app_protocol proto, char *buf, u_int buf_len);
426424

427425
/**
428426
* Same as ndpi_protocol2name() with the difference that the numeric protocol
429427
* name is returned
430428
*
431-
* @par proto = the struct ndpi_protocol contain the protocols name
429+
* @par proto = the struct ndpi_master_app_protocol contain the protocols name
432430
* @par buf = the buffer to write the name of the protocols
433431
* @par buf_len = the length of the buffer
434432
* @return the buffer contains the master_protocol and protocol name
435433
*
436434
*/
437-
char* ndpi_protocol2id(ndpi_protocol proto, char *buf, u_int buf_len);
435+
char* ndpi_protocol2id(ndpi_master_app_protocol proto, char *buf, u_int buf_len);
438436

439437
/**
440438
* Find out if a given category is custom/user-defined
@@ -975,8 +973,8 @@ extern "C" {
975973
ndpi_l4_proto_info ndpi_get_l4_proto_info(struct ndpi_detection_module_struct *ndpi_struct, u_int16_t ndpi_proto_id);
976974
const char* ndpi_get_l4_proto_name(ndpi_l4_proto_info proto);
977975

978-
u_int16_t ndpi_get_lower_proto(ndpi_protocol proto);
979-
u_int16_t ndpi_get_upper_proto(ndpi_protocol proto);
976+
u_int16_t ndpi_get_lower_proto(ndpi_master_app_protocol proto);
977+
u_int16_t ndpi_get_upper_proto(ndpi_master_app_protocol proto);
980978
bool ndpi_is_proto(ndpi_master_app_protocol proto, u_int16_t p);
981979
bool ndpi_is_proto_unknown(ndpi_master_app_protocol proto);
982980
bool ndpi_is_proto_equals(ndpi_master_app_protocol to_check, ndpi_master_app_protocol to_match, bool exact_match_only);
@@ -1042,8 +1040,6 @@ extern "C" {
10421040
int ndpi_flowv6_flow_hash(u_int8_t l4_proto, const struct ndpi_in6_addr *src_ip, const struct ndpi_in6_addr *dst_ip,
10431041
u_int16_t src_port, u_int16_t dst_port, u_int8_t icmp_type, u_int8_t icmp_code,
10441042
u_char *hash_buf, u_int8_t hash_buf_len);
1045-
u_int8_t ndpi_extra_dissection_possible(struct ndpi_detection_module_struct *ndpi_str,
1046-
struct ndpi_flow_struct *flow);
10471043
u_int8_t ndpi_is_safe_ssl_cipher(u_int32_t cipher);
10481044
const char* ndpi_cipher2str(u_int32_t cipher, char unknown_cipher[8]);
10491045
const char* ndpi_tunnel2str(ndpi_packet_tunnel tt);
@@ -1136,7 +1132,7 @@ extern "C" {
11361132
u_int8_t ndpi_is_public_ipv4(u_int32_t a /* host byte order */);
11371133
u_int64_t ndpi_htonll(u_int64_t v);
11381134
u_int64_t ndpi_ntohll(u_int64_t v);
1139-
u_int8_t ndpi_is_encrypted_proto(struct ndpi_detection_module_struct *ndpi_str, ndpi_protocol proto);
1135+
u_int8_t ndpi_is_encrypted_proto(struct ndpi_detection_module_struct *ndpi_str, ndpi_master_app_protocol proto);
11401136

11411137
/* DGA */
11421138
int ndpi_check_dga_name(struct ndpi_detection_module_struct *ndpi_str,

0 commit comments

Comments
 (0)