Unified WhatsApp Video and Audio under WhatsAppCall
This commit is contained in:
+6
-6
@@ -1006,9 +1006,9 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp
|
||||
no_master, "Modbus", NDPI_PROTOCOL_CATEGORY_NETWORK, /* Perhaps IoT in the future */
|
||||
ndpi_build_default_ports(ports_a, 502, 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_ACCEPTABLE, NDPI_PROTOCOL_WHATSAPP_VIDEO,
|
||||
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_WHATSAPP_CALL,
|
||||
0 /* can_have_a_subprotocol */, no_master,
|
||||
no_master, "WhatsAppVideo", NDPI_PROTOCOL_CATEGORY_VOIP,
|
||||
no_master, "WhatsAppCall", NDPI_PROTOCOL_CATEGORY_VOIP,
|
||||
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_DATASAVER,
|
||||
@@ -1122,7 +1122,7 @@ 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_b, 0, 0, 0, 0, 0) /* UDP */);
|
||||
|
||||
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_FREE_64,
|
||||
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_64,
|
||||
0 /* can_have_a_subprotocol */, no_master,
|
||||
no_master, "Free64", NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT,
|
||||
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
|
||||
@@ -1249,9 +1249,9 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp
|
||||
no_master, "PcAnywhere", NDPI_PROTOCOL_CATEGORY_REMOTE_ACCESS,
|
||||
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_ACCEPTABLE, NDPI_PROTOCOL_WHATSAPP_VOICE,
|
||||
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_FREE_189,
|
||||
0 /* can_have_a_subprotocol */, no_master,
|
||||
no_master, "WhatsAppVoice", NDPI_PROTOCOL_CATEGORY_VOIP,
|
||||
no_master, "Free189", NDPI_PROTOCOL_CATEGORY_VOIP,
|
||||
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_ACCEPTABLE, NDPI_PROTOCOL_WHATSAPP_FILES,
|
||||
@@ -4055,7 +4055,7 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st
|
||||
goto check_stun_export;
|
||||
else if((flow->guessed_protocol_id == NDPI_PROTOCOL_HANGOUT_DUO)
|
||||
|| (flow->guessed_protocol_id == NDPI_PROTOCOL_MESSENGER)
|
||||
|| (flow->guessed_protocol_id == NDPI_PROTOCOL_WHATSAPP_VOICE))
|
||||
|| (flow->guessed_protocol_id == NDPI_PROTOCOL_WHATSAPP_CALL))
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, flow->guessed_protocol_id, NDPI_PROTOCOL_UNKNOWN);
|
||||
else if((flow->l4.tcp.tls_seen_client_cert == 1)
|
||||
&& (flow->protos.stun_ssl.ssl.client_certificate[0] != '\0')) {
|
||||
|
||||
@@ -45,8 +45,7 @@ static u_int8_t is_stun_based_proto(u_int16_t proto) {
|
||||
|
||||
switch(proto) {
|
||||
case NDPI_PROTOCOL_WHATSAPP:
|
||||
case NDPI_PROTOCOL_WHATSAPP_VOICE:
|
||||
case NDPI_PROTOCOL_WHATSAPP_VIDEO:
|
||||
case NDPI_PROTOCOL_WHATSAPP_CALL:
|
||||
case NDPI_PROTOCOL_MESSENGER:
|
||||
case NDPI_PROTOCOL_HANGOUT_DUO:
|
||||
case NDPI_PROTOCOL_SKYPE_CALL:
|
||||
@@ -318,7 +317,7 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct *
|
||||
switch(flow->guessed_protocol_id) {
|
||||
case NDPI_PROTOCOL_HANGOUT_DUO:
|
||||
case NDPI_PROTOCOL_MESSENGER:
|
||||
case NDPI_PROTOCOL_WHATSAPP_VOICE:
|
||||
case NDPI_PROTOCOL_WHATSAPP_CALL:
|
||||
/* Don't overwrite the protocol with sub-STUN protocols */
|
||||
break;
|
||||
|
||||
@@ -502,15 +501,15 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct *
|
||||
|
||||
flow->protos.stun_ssl.stun.num_processed_pkts++;
|
||||
#ifdef DEBUG_STUN
|
||||
printf("==>> NDPI_PROTOCOL_WHATSAPP_VOICE\n");
|
||||
printf("==>> NDPI_PROTOCOL_WHATSAPP_CALL\n");
|
||||
#endif
|
||||
|
||||
if((ntohs(packet->udp->source) == 3478) || (ntohs(packet->udp->dest) == 3478)) {
|
||||
flow->guessed_host_protocol_id = (is_messenger_ip_address(ntohl(packet->iph->saddr)) || is_messenger_ip_address(ntohl(packet->iph->daddr))) ?
|
||||
NDPI_PROTOCOL_MESSENGER : NDPI_PROTOCOL_WHATSAPP_VOICE;
|
||||
NDPI_PROTOCOL_MESSENGER : NDPI_PROTOCOL_WHATSAPP_CALL;
|
||||
} else
|
||||
flow->guessed_host_protocol_id = (is_google_ip_address(ntohl(packet->iph->saddr)) || is_google_ip_address(ntohl(packet->iph->daddr)))
|
||||
? NDPI_PROTOCOL_HANGOUT_DUO : NDPI_PROTOCOL_WHATSAPP_VOICE;
|
||||
? NDPI_PROTOCOL_HANGOUT_DUO : NDPI_PROTOCOL_WHATSAPP_CALL;
|
||||
|
||||
rc = (flow->protos.stun_ssl.stun.num_udp_pkts < MAX_NUM_STUN_PKTS) ? NDPI_IS_NOT_STUN : NDPI_IS_STUN;
|
||||
|
||||
@@ -571,7 +570,7 @@ void ndpi_search_stun(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
||||
} else {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found UDP stun\n"); /* Ummmmm we're in the TCP branch. This code looks bad */
|
||||
ndpi_int_stun_add_connection(ndpi_struct, flow,
|
||||
is_whatsapp ? (is_whatsapp == 1 ? NDPI_PROTOCOL_WHATSAPP_VOICE : NDPI_PROTOCOL_WHATSAPP_VIDEO) : NDPI_PROTOCOL_STUN,
|
||||
is_whatsapp ? NDPI_PROTOCOL_WHATSAPP_CALL : NDPI_PROTOCOL_STUN,
|
||||
NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
|
||||
@@ -604,8 +603,8 @@ void ndpi_search_stun(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
||||
} else {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found UDP stun\n");
|
||||
ndpi_int_stun_add_connection(ndpi_struct, flow,
|
||||
is_whatsapp ? (is_whatsapp == 1 ? NDPI_PROTOCOL_WHATSAPP_VOICE : NDPI_PROTOCOL_WHATSAPP_VIDEO)
|
||||
: NDPI_PROTOCOL_STUN, NDPI_PROTOCOL_UNKNOWN);
|
||||
is_whatsapp ? NDPI_PROTOCOL_WHATSAPP_CALL : NDPI_PROTOCOL_STUN,
|
||||
NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user