Added checks for missing protocol initialization

Fixed missing LOG_ERR initialization
Fixed logging warnings
This commit is contained in:
Luca Deri
2018-07-23 14:58:16 +02:00
parent 49ed41142c
commit 5100cc0eae
5 changed files with 75 additions and 44 deletions
+5 -5
View File
@@ -231,11 +231,11 @@
# define NDPI_LOG_DBG(...) {} # define NDPI_LOG_DBG(...) {}
# define NDPI_LOG_DBG2(...) {} # define NDPI_LOG_DBG2(...) {}
# else # else
# define NDPI_LOG(proto, mod, log_level, args...) {} # define NDPI_LOG(proto, mod, log_level, args...) { /* printf(args); */ }
# define NDPI_LOG_ERR(mod, args...) {} # define NDPI_LOG_ERR(mod, args...) { printf(args); }
# define NDPI_LOG_INFO(mod, args...) {} # define NDPI_LOG_INFO(mod, args...) { /* printf(args); */ }
# define NDPI_LOG_DBG(mod, args...) {} # define NDPI_LOG_DBG(mod, args...) { /* printf(args); */ }
# define NDPI_LOG_DBG2(mod, args...) {} # define NDPI_LOG_DBG2(mod, args...) { /* printf(args); */ }
# endif # endif
#endif /* NDPI_ENABLE_DEBUG_MESSAGES */ #endif /* NDPI_ENABLE_DEBUG_MESSAGES */
+63 -34
View File
@@ -523,7 +523,7 @@ void ndpi_exclude_protocol(struct ndpi_detection_module_struct *ndpi_struct,
if(protocol_id < NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS) { if(protocol_id < NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS) {
#ifdef NDPI_ENABLE_DEBUG_MESSAGES #ifdef NDPI_ENABLE_DEBUG_MESSAGES
if ( ndpi_struct && if( ndpi_struct &&
ndpi_struct->ndpi_log_level >= NDPI_LOG_DEBUG && ndpi_struct->ndpi_log_level >= NDPI_LOG_DEBUG &&
ndpi_struct->ndpi_debug_printf != NULL) { ndpi_struct->ndpi_debug_printf != NULL) {
@@ -571,8 +571,13 @@ void ndpi_set_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod,
memcpy(&ndpi_mod->proto_defaults[protoId].master_udp_protoId, udp_master_protoId, 2*sizeof(u_int16_t)); memcpy(&ndpi_mod->proto_defaults[protoId].master_udp_protoId, udp_master_protoId, 2*sizeof(u_int16_t));
for(j=0; j<MAX_DEFAULT_PORTS; j++) { for(j=0; j<MAX_DEFAULT_PORTS; j++) {
if(udpDefPorts[j].port_low != 0) addDefaultPort(ndpi_mod, &udpDefPorts[j], &ndpi_mod->proto_defaults[protoId], 0, &ndpi_mod->udpRoot, __FUNCTION__,__LINE__); if(udpDefPorts[j].port_low != 0)
if(tcpDefPorts[j].port_low != 0) addDefaultPort(ndpi_mod, &tcpDefPorts[j], &ndpi_mod->proto_defaults[protoId], 0, &ndpi_mod->tcpRoot, __FUNCTION__,__LINE__); addDefaultPort(ndpi_mod, &udpDefPorts[j],
&ndpi_mod->proto_defaults[protoId], 0, &ndpi_mod->udpRoot, __FUNCTION__,__LINE__);
if(tcpDefPorts[j].port_low != 0)
addDefaultPort(ndpi_mod, &tcpDefPorts[j],
&ndpi_mod->proto_defaults[protoId], 0, &ndpi_mod->tcpRoot, __FUNCTION__,__LINE__);
} }
} }
@@ -912,13 +917,30 @@ int ndpi_set_detection_preferences(struct ndpi_detection_module_struct *ndpi_mod
/* ******************************************************************** */ /* ******************************************************************** */
static void ndpi_validate_protocol_initialization(struct ndpi_detection_module_struct *ndpi_mod) {
int i;
for(i=0; i<(int)ndpi_mod->ndpi_num_supported_protocols; i++) {
if(ndpi_mod->proto_defaults[i].protoName == NULL) {
NDPI_LOG_ERR(ndpi_mod, "[NDPI] INTERNAL ERROR missing protoName initialization for [protoId=%d]: recovering\n", i);
} else {
if((i != NDPI_PROTOCOL_UNKNOWN)
&& (ndpi_mod->proto_defaults[i].protoCategory == NDPI_PROTOCOL_CATEGORY_UNSPECIFIED)) {
NDPI_LOG_ERR(ndpi_mod, "[NDPI] INTERNAL ERROR missing category [protoId=%d/%s] initialization: recovering\n",
i, ndpi_mod->proto_defaults[i].protoName ? ndpi_mod->proto_defaults[i].protoName : "???");
}
}
}
}
/* ******************************************************************** */
/* This function is used to map protocol name and default ports and it MUST /* This function is used to map protocol name and default ports and it MUST
be updated whenever a new protocol is added to NDPI. be updated whenever a new protocol is added to NDPI.
Do NOT add web services (NDPI_SERVICE_xxx) here. Do NOT add web services (NDPI_SERVICE_xxx) here.
*/ */
static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndpi_mod) { static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndpi_mod) {
int i; int i;
ndpi_port_range ports_a[MAX_DEFAULT_PORTS], ports_b[MAX_DEFAULT_PORTS]; ndpi_port_range ports_a[MAX_DEFAULT_PORTS], ports_b[MAX_DEFAULT_PORTS];
u_int16_t no_master[2] = { NDPI_PROTOCOL_NO_MASTER_PROTO, NDPI_PROTOCOL_NO_MASTER_PROTO }, u_int16_t no_master[2] = { NDPI_PROTOCOL_NO_MASTER_PROTO, NDPI_PROTOCOL_NO_MASTER_PROTO },
@@ -1144,40 +1166,54 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */); ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_40, ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_40,
no_master, no_master,
no_master, "Free", NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, no_master, "Free", NDPI_PROTOCOL_CATEGORY_CUSTOM_1 /* dummy */,
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */, ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */); ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_41, ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_41,
no_master, no_master,
no_master, "Free", NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, no_master, "Free", NDPI_PROTOCOL_CATEGORY_CUSTOM_1 /* dummy */,
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */, ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */); ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_42, ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_42,
no_master, no_master,
no_master, "Free", NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, no_master, "Free", NDPI_PROTOCOL_CATEGORY_CUSTOM_1 /* dummy */,
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */, ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */); ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_43, ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_43,
no_master, no_master,
no_master, "Free", NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, no_master, "Free", NDPI_PROTOCOL_CATEGORY_CUSTOM_1 /* dummy */,
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */, ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */); ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_44, ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_44,
no_master, no_master,
no_master, "Free", NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, no_master, "Free", NDPI_PROTOCOL_CATEGORY_CUSTOM_1 /* dummy */,
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */, ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */); ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_45, ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_45,
no_master, no_master,
no_master, "Free", NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, no_master, "Free", NDPI_PROTOCOL_CATEGORY_CUSTOM_1 /* dummy */,
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */, ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */); ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_46, ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_46,
no_master, no_master,
no_master, "Free", NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, no_master, "Free", NDPI_PROTOCOL_CATEGORY_CUSTOM_1 /* dummy */,
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_196,
no_master,
no_master, "Free", NDPI_PROTOCOL_CATEGORY_CUSTOM_1 /* dummy */,
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_205,
no_master,
no_master, "Free", NDPI_PROTOCOL_CATEGORY_CUSTOM_1 /* dummy */,
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_VIDTO,
no_master,
no_master, "PPStream", NDPI_PROTOCOL_CATEGORY_MEDIA,
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */, ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */); ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_XBOX, ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_XBOX,
no_master, no_master,
@@ -1863,22 +1899,15 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */, ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */); ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_AJP, ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_AJP,
no_master, no_master,
no_master, "AJP", NDPI_PROTOCOL_CATEGORY_WEB, no_master, "AJP", NDPI_PROTOCOL_CATEGORY_WEB,
ndpi_build_default_ports(ports_a, 8009, 0, 0, 0, 0) /* TCP */, ndpi_build_default_ports(ports_a, 8009, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */); ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
/* calling function for host and content matched protocols */ /* calling function for host and content matched protocols */
init_string_based_protocols(ndpi_mod); init_string_based_protocols(ndpi_mod);
for(i=0; i<(int)ndpi_mod->ndpi_num_supported_protocols; i++) { ndpi_validate_protocol_initialization(ndpi_mod);
if((ndpi_mod->proto_defaults[i].protoName == NULL)
|| ((i != NDPI_PROTOCOL_UNKNOWN)
&& (ndpi_mod->proto_defaults[i].protoCategory == NDPI_PROTOCOL_CATEGORY_UNSPECIFIED))) {
NDPI_LOG_ERR(ndpi_mod, "[NDPI] missing protoId=%d/%s: INTERNAL ERROR: not all protocols have been initialized\n",
i, ndpi_mod->proto_defaults[i].protoName ? ndpi_mod->proto_defaults[i].protoName : "???");
}
}
} }
/* ****************************************************** */ /* ****************************************************** */
@@ -2057,7 +2086,7 @@ void ndpi_debug_printf(unsigned int proto, struct ndpi_detection_module_struct *
vsnprintf(str,sizeof(str)-1, format, args); vsnprintf(str,sizeof(str)-1, format, args);
va_end(args); va_end(args);
if (ndpi_str != NULL) { if(ndpi_str != NULL) {
printf("%s:%s:%-3u - [%s]: %s", printf("%s:%s:%-3u - [%s]: %s",
file_name, func_name, line_number, ndpi_get_proto_name(ndpi_str, proto), str); file_name, func_name, line_number, ndpi_get_proto_name(ndpi_str, proto), str);
} else { } else {
@@ -2299,9 +2328,9 @@ void ndpi_exit_detection_module(struct ndpi_detection_module_struct *ndpi_struct
ndpi_Destroy_Patricia((patricia_tree_t*)ndpi_struct->protocols_ptree, ndpi_Destroy_Patricia((patricia_tree_t*)ndpi_struct->protocols_ptree,
free_ptree_data); free_ptree_data);
if (ndpi_struct->udpRoot != NULL) if(ndpi_struct->udpRoot != NULL)
ndpi_tdestroy(ndpi_struct->udpRoot, ndpi_free); ndpi_tdestroy(ndpi_struct->udpRoot, ndpi_free);
if (ndpi_struct->tcpRoot != NULL) if(ndpi_struct->tcpRoot != NULL)
ndpi_tdestroy(ndpi_struct->tcpRoot, ndpi_free); ndpi_tdestroy(ndpi_struct->tcpRoot, ndpi_free);
if(ndpi_struct->host_automa.ac_automa != NULL) if(ndpi_struct->host_automa.ac_automa != NULL)
@@ -2463,10 +2492,10 @@ u_int ndpi_get_num_supported_protocols(struct ndpi_detection_module_struct *ndpi
char * strsep(char **sp, char *sep) char * strsep(char **sp, char *sep)
{ {
char *p, *s; char *p, *s;
if (sp == NULL || *sp == NULL || **sp == '\0') return(NULL); if(sp == NULL || *sp == NULL || **sp == '\0') return(NULL);
s = *sp; s = *sp;
p = s + strcspn(s, sep); p = s + strcspn(s, sep);
if (*p != '\0') *p++ = '\0'; if(*p != '\0') *p++ = '\0';
*sp = p; *sp = p;
return(s); return(s);
} }
@@ -3365,7 +3394,7 @@ static int ndpi_init_packet_header(struct ndpi_detection_module_struct *ndpi_str
u_int8_t l4protocol; u_int8_t l4protocol;
u_int8_t l4_result; u_int8_t l4_result;
if (flow) { if(flow) {
/* reset payload_packet_len, will be set if ipv4 tcp or udp */ /* reset payload_packet_len, will be set if ipv4 tcp or udp */
flow->packet.payload_packet_len = 0; flow->packet.payload_packet_len = 0;
flow->packet.l4_packet_len = 0; flow->packet.l4_packet_len = 0;
@@ -3898,8 +3927,8 @@ void ndpi_process_extra_packet(struct ndpi_detection_module_struct *ndpi_struct,
ndpi_connection_tracking(ndpi_struct, flow); ndpi_connection_tracking(ndpi_struct, flow);
/* call the extra packet function (which may add more data/info to flow) */ /* call the extra packet function (which may add more data/info to flow) */
if (flow->extra_packets_func) { if(flow->extra_packets_func) {
if ((flow->extra_packets_func(ndpi_struct, flow)) == 0) if((flow->extra_packets_func(ndpi_struct, flow)) == 0)
flow->check_extra_packets = 0; flow->check_extra_packets = 0;
} }
@@ -3918,7 +3947,7 @@ void ndpi_load_ip_category(struct ndpi_detection_module_struct *ndpi_struct,
if(ptr) { if(ptr) {
ptr[0] = '\0'; ptr[0] = '\0';
ptr++; ptr++;
if (atoi(ptr)>=0 && atoi(ptr)<=32) if(atoi(ptr)>=0 && atoi(ptr)<=32)
bits = atoi(ptr); bits = atoi(ptr);
} }
@@ -5371,7 +5400,7 @@ const char* ndpi_category_get_name(struct ndpi_detection_module_struct *ndpi_mod
ndpi_protocol_category_t ndpi_get_proto_category(struct ndpi_detection_module_struct *ndpi_mod, ndpi_protocol_category_t ndpi_get_proto_category(struct ndpi_detection_module_struct *ndpi_mod,
ndpi_protocol proto) { ndpi_protocol proto) {
/* simple rule: sub protocol first, master after */ /* simple rule: sub protocol first, master after */
if ((proto.master_protocol == NDPI_PROTOCOL_UNKNOWN) || if((proto.master_protocol == NDPI_PROTOCOL_UNKNOWN) ||
(ndpi_mod->proto_defaults[proto.app_protocol].protoCategory != NDPI_PROTOCOL_CATEGORY_UNSPECIFIED)) (ndpi_mod->proto_defaults[proto.app_protocol].protoCategory != NDPI_PROTOCOL_CATEGORY_UNSPECIFIED))
return ndpi_mod->proto_defaults[proto.app_protocol].protoCategory; return ndpi_mod->proto_defaults[proto.app_protocol].protoCategory;
else else
+1 -1
View File
@@ -230,7 +230,7 @@ void ndpi_search_mqtt (struct ndpi_detection_module_struct *ndpi_struct,
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MQTT); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MQTT);
return; return;
} else { } else {
NDPI_LOG_INFO(ndpi_struct, "found Mqtt UNSUBSCRIBE\n",pt); NDPI_LOG_INFO(ndpi_struct, "found Mqtt UNSUBSCRIBE\n");
ndpi_int_mqtt_add_connection(ndpi_struct,flow); ndpi_int_mqtt_add_connection(ndpi_struct,flow);
return; return;
} }
+1 -1
View File
@@ -190,7 +190,7 @@ void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct,
} }
if (message_id == MSG_SD){ if (message_id == MSG_SD){
NDPI_LOG_DBG2(ndpi_struct, "SOME/IP-SD currently not supported\n", message_type); NDPI_LOG_DBG2(ndpi_struct, "SOME/IP-SD currently not supported [%d]\n", message_type);
} }
//Filtering by port. //Filtering by port.
+5 -3
View File
@@ -49,13 +49,15 @@ void ndpi_search_soulseek_tcp(struct ndpi_detection_module_struct *ndpi_struct,
if(src != NULL) if(src != NULL)
NDPI_LOG_DBG2(ndpi_struct, NDPI_LOG_DBG2(ndpi_struct,
" SRC bitmask: %u, packet tick %llu , last safe access timestamp: %llu\n", " SRC bitmask: %u, packet tick %llu , last safe access timestamp: %llu\n",
NDPI_COMPARE_PROTOCOL_TO_BITMASK(src->detected_protocol_bitmask, NDPI_PROTOCOL_SOULSEEK) NDPI_COMPARE_PROTOCOL_TO_BITMASK(src->detected_protocol_bitmask, NDPI_PROTOCOL_SOULSEEK)
!= 0 ? 1 : 0, (u_int64_t) packet->tick_timestamp, (u_int64_t) src->soulseek_last_safe_access_time); != 0 ? 1 : 0, (long long unsigned int) packet->tick_timestamp,
(long long unsigned int) src->soulseek_last_safe_access_time);
if(dst != NULL) if(dst != NULL)
NDPI_LOG_DBG2(ndpi_struct, NDPI_LOG_DBG2(ndpi_struct,
" DST bitmask: %u, packet tick %llu , last safe ts: %llu\n", " DST bitmask: %u, packet tick %llu , last safe ts: %llu\n",
NDPI_COMPARE_PROTOCOL_TO_BITMASK(dst->detected_protocol_bitmask, NDPI_PROTOCOL_SOULSEEK) NDPI_COMPARE_PROTOCOL_TO_BITMASK(dst->detected_protocol_bitmask, NDPI_PROTOCOL_SOULSEEK)
!= 0 ? 1 : 0, (u_int64_t) packet->tick_timestamp, (u_int64_t) dst->soulseek_last_safe_access_time); != 0 ? 1 : 0, (long long unsigned int) packet->tick_timestamp,
(long long unsigned int) dst->soulseek_last_safe_access_time);
if(packet->payload_packet_len == 431) { if(packet->payload_packet_len == 431) {
if(dst != NULL) { if(dst != NULL) {