aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/protocols')
-rw-r--r--src/lib/protocols/dns.c26
-rw-r--r--src/lib/protocols/quic.c4
-rw-r--r--src/lib/protocols/stun.c2
-rw-r--r--src/lib/protocols/tls.c6
4 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/protocols/dns.c b/src/lib/protocols/dns.c
index 7fc2e2085..94367d318 100644
--- a/src/lib/protocols/dns.c
+++ b/src/lib/protocols/dns.c
@@ -699,8 +699,8 @@ static void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, st
u_int num_queries, idx;
char _hostname[256];
- ret.master_protocol = NDPI_PROTOCOL_UNKNOWN;
- ret.app_protocol = (d_port == LLMNR_PORT) ? NDPI_PROTOCOL_LLMNR : (((d_port == MDNS_PORT) && isLLMNRMulticastAddress(packet) ) ? NDPI_PROTOCOL_MDNS : NDPI_PROTOCOL_DNS);
+ ret.proto.master_protocol = NDPI_PROTOCOL_UNKNOWN;
+ ret.proto.app_protocol = (d_port == LLMNR_PORT) ? NDPI_PROTOCOL_LLMNR : (((d_port == MDNS_PORT) && isLLMNRMulticastAddress(packet) ) ? NDPI_PROTOCOL_MDNS : NDPI_PROTOCOL_DNS);
if(invalid) {
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
@@ -800,29 +800,29 @@ static void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, st
if(ndpi_struct->cfg.dns_subclassification_enabled) {
ndpi_protocol_match_result ret_match;
- ret.app_protocol = ndpi_match_host_subprotocol(ndpi_struct, flow,
+ ret.proto.app_protocol = ndpi_match_host_subprotocol(ndpi_struct, flow,
flow->host_server_name,
strlen(flow->host_server_name),
&ret_match,
NDPI_PROTOCOL_DNS);
/* Add to FPC DNS cache */
- if(ret.app_protocol != NDPI_PROTOCOL_UNKNOWN &&
+ if(ret.proto.app_protocol != NDPI_PROTOCOL_UNKNOWN &&
(flow->protos.dns.rsp_type == 0x1 || flow->protos.dns.rsp_type == 0x1c) && /* A, AAAA */
ndpi_struct->fpc_dns_cache) {
ndpi_lru_add_to_cache(ndpi_struct->fpc_dns_cache,
- fpc_dns_cache_key_from_dns_info(flow), ret.app_protocol,
+ fpc_dns_cache_key_from_dns_info(flow), ret.proto.app_protocol,
ndpi_get_current_time(flow));
}
- if(ret.app_protocol == NDPI_PROTOCOL_UNKNOWN)
- ret.master_protocol = checkDNSSubprotocol(s_port, d_port);
+ if(ret.proto.app_protocol == NDPI_PROTOCOL_UNKNOWN)
+ ret.proto.master_protocol = checkDNSSubprotocol(s_port, d_port);
else
- ret.master_protocol = NDPI_PROTOCOL_DNS;
+ ret.proto.master_protocol = NDPI_PROTOCOL_DNS;
ndpi_check_dga_name(ndpi_struct, flow, flow->host_server_name, 1, 0);
} else {
- ret.master_protocol = checkDNSSubprotocol(s_port, d_port);
- ret.app_protocol = NDPI_PROTOCOL_UNKNOWN;
+ ret.proto.master_protocol = checkDNSSubprotocol(s_port, d_port);
+ ret.proto.app_protocol = NDPI_PROTOCOL_UNKNOWN;
}
/* Category is always NDPI_PROTOCOL_CATEGORY_NETWORK, regardless of the subprotocol */
@@ -835,11 +835,11 @@ static void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, st
if(is_query) {
/* In this case we say that the protocol has been detected just to let apps carry on with their activities */
- ndpi_set_detected_protocol(ndpi_struct, flow, ret.app_protocol, ret.master_protocol, NDPI_CONFIDENCE_DPI);
+ ndpi_set_detected_protocol(ndpi_struct, flow, ret.proto.app_protocol, ret.proto.master_protocol, NDPI_CONFIDENCE_DPI);
if(ndpi_struct->cfg.dns_parse_response_enabled) {
/* We have never triggered extra-dissection for LLMNR. Keep the old behaviour */
- if(ret.master_protocol != NDPI_PROTOCOL_LLMNR) {
+ if(ret.proto.master_protocol != NDPI_PROTOCOL_LLMNR) {
/* Don't use just 1 as in TCP DNS more packets could be returned (e.g. ACK). */
flow->max_extra_packets_to_check = 5;
flow->extra_packets_func = search_dns_again;
@@ -864,7 +864,7 @@ static void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, st
matched a subprotocol
**/
NDPI_LOG_INFO(ndpi_struct, "found DNS\n");
- ndpi_set_detected_protocol(ndpi_struct, flow, ret.app_protocol, ret.master_protocol, NDPI_CONFIDENCE_DPI);
+ ndpi_set_detected_protocol(ndpi_struct, flow, ret.proto.app_protocol, ret.proto.master_protocol, NDPI_CONFIDENCE_DPI);
} else {
if((flow->detected_protocol_stack[0] == NDPI_PROTOCOL_DNS)
|| (flow->detected_protocol_stack[1] == NDPI_PROTOCOL_DNS))
diff --git a/src/lib/protocols/quic.c b/src/lib/protocols/quic.c
index 345f77c47..5ff7e0e88 100644
--- a/src/lib/protocols/quic.c
+++ b/src/lib/protocols/quic.c
@@ -1772,8 +1772,8 @@ static int ndpi_search_quic_extra(struct ndpi_detection_module_struct *ndpi_stru
NDPI_LOG_DBG(ndpi_struct, "Found RTP/RTCP over QUIC\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SNAPCHAT_CALL, NDPI_PROTOCOL_QUIC, NDPI_CONFIDENCE_DPI);
/* In "extra_eval" data path, if we change the classification, we need to update the category, too */
- proto.master_protocol = NDPI_PROTOCOL_QUIC;
- proto.app_protocol = NDPI_PROTOCOL_SNAPCHAT_CALL;
+ proto.proto.master_protocol = NDPI_PROTOCOL_QUIC;
+ proto.proto.app_protocol = NDPI_PROTOCOL_SNAPCHAT_CALL;
proto.category = NDPI_PROTOCOL_CATEGORY_UNSPECIFIED;
ndpi_fill_protocol_category(ndpi_struct, flow, &proto);
} else {
diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c
index eba865ecb..a238e0a45 100644
--- a/src/lib/protocols/stun.c
+++ b/src/lib/protocols/stun.c
@@ -964,7 +964,7 @@ static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *nd
/* In "normal" data-path the generic code in `ndpi_internal_detection_process_packet()`
takes care of setting the category */
if(flow->extra_packets_func) {
- ndpi_protocol ret = { master_proto, app_proto, NDPI_PROTOCOL_UNKNOWN /* unused */, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, NULL};
+ ndpi_protocol ret = { { master_proto, app_proto }, NDPI_PROTOCOL_UNKNOWN /* unused */, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, NULL};
flow->category = ndpi_get_proto_category(ndpi_struct, ret);
}
}
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c
index 2d8247d51..9fe2a460a 100644
--- a/src/lib/protocols/tls.c
+++ b/src/lib/protocols/tls.c
@@ -349,7 +349,7 @@ static void checkTLSSubprotocol(struct ndpi_detection_module_struct *ndpi_struct
if(ndpi_lru_find_cache(ndpi_struct->tls_cert_cache, key,
&cached_proto, 0 /* Don't remove it as it can be used for other connections */,
ndpi_get_current_time(flow))) {
- ndpi_protocol ret = { __get_master(ndpi_struct, flow), cached_proto, NDPI_PROTOCOL_UNKNOWN /* unused */, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, NULL};
+ ndpi_protocol ret = { { __get_master(ndpi_struct, flow), cached_proto }, NDPI_PROTOCOL_UNKNOWN /* unused */, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, NULL};
ndpi_set_detected_protocol(ndpi_struct, flow, cached_proto, __get_master(ndpi_struct, flow), NDPI_CONFIDENCE_DPI_CACHE);
flow->category = ndpi_get_proto_category(ndpi_struct, ret);
@@ -735,7 +735,7 @@ void processCertificateElements(struct ndpi_detection_module_struct *ndpi_struct
if(rc == 0) {
/* Match found */
u_int16_t proto_id = (u_int16_t)val;
- ndpi_protocol ret = { __get_master(ndpi_struct, flow), proto_id, NDPI_PROTOCOL_UNKNOWN /* unused */, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, NULL};
+ ndpi_protocol ret = { { __get_master(ndpi_struct, flow), proto_id }, NDPI_PROTOCOL_UNKNOWN /* unused */, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, NULL};
ndpi_set_detected_protocol(ndpi_struct, flow, proto_id, __get_master(ndpi_struct, flow), NDPI_CONFIDENCE_DPI);
flow->category = ndpi_get_proto_category(ndpi_struct, ret);
@@ -1357,7 +1357,7 @@ static int ndpi_search_tls_udp(struct ndpi_detection_module_struct *ndpi_struct,
/* DTLS mid session: no need to further inspect the flow */
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DTLS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
- ndpi_protocol ret = { __get_master(ndpi_struct, flow), NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN /* unused */, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, NULL};
+ ndpi_protocol ret = { { __get_master(ndpi_struct, flow), NDPI_PROTOCOL_UNKNOWN }, NDPI_PROTOCOL_UNKNOWN /* unused */, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, NULL};
flow->category = ndpi_get_proto_category(ndpi_struct, ret);
flow->tls_quic.certificate_processed = 1; /* Fake, to avoid extra dissection */