removed debug prints, changed line of documentation

This commit is contained in:
Yoni.Linder
2017-06-14 16:49:50 +03:00
committed by alexei-argus
parent ae959f2d78
commit 7d39ba2124
3 changed files with 1 additions and 25 deletions
-1
View File
@@ -1114,7 +1114,6 @@ static void setupDetection(u_int16_t thread_id, pcap_t * pcap_handle) {
// enable all protocols // enable all protocols
NDPI_BITMASK_SET_ALL(all); NDPI_BITMASK_SET_ALL(all);
printf("Setting up detection...");
ndpi_set_protocol_detection_bitmask2(ndpi_thread_info[thread_id].workflow->ndpi_struct, &all); ndpi_set_protocol_detection_bitmask2(ndpi_thread_info[thread_id].workflow->ndpi_struct, &all);
// clear memory for results // clear memory for results
+1 -1
View File
@@ -2696,7 +2696,7 @@ void ndpi_set_protocol_detection_bitmask2(struct ndpi_detection_module_struct *n
/* MQTT */ /* MQTT */
init_mqtt_dissector(ndpi_struct, &a, detection_bitmask); init_mqtt_dissector(ndpi_struct, &a, detection_bitmask);
/* MQTT */ /* SOME/IP */
init_someip_dissector(ndpi_struct, &a, detection_bitmask); init_someip_dissector(ndpi_struct, &a, detection_bitmask);
/* RX */ /* RX */
-23
View File
@@ -81,8 +81,6 @@ void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct,
//####Maybe check carrier protocols?#### //####Maybe check carrier protocols?####
printf("trying to SOMEIP 1...");
NDPI_LOG(NDPI_PROTOCOL_SOMEIP, ndpi_struct, NDPI_LOG_DEBUG, "SOME/IP search called...\n"); NDPI_LOG(NDPI_PROTOCOL_SOMEIP, ndpi_struct, NDPI_LOG_DEBUG, "SOME/IP search called...\n");
struct ndpi_packet_struct *packet = &flow->packet; struct ndpi_packet_struct *packet = &flow->packet;
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_UNKNOWN) { if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_UNKNOWN) {
@@ -101,9 +99,6 @@ void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct,
u_int32_t message_id = (u_int32_t) ((packet->payload[0]<<24)+(packet->payload[1]<<16)+(packet->payload[2]<<8)+packet->payload[3]); u_int32_t message_id = (u_int32_t) ((packet->payload[0]<<24)+(packet->payload[1]<<16)+(packet->payload[2]<<8)+packet->payload[3]);
u_int32_t request_id = (u_int32_t) ((packet->payload[8]<<24)+(packet->payload[9]<<16)+(packet->payload[10]<<8)+packet->payload[11]); u_int32_t request_id = (u_int32_t) ((packet->payload[8]<<24)+(packet->payload[9]<<16)+(packet->payload[10]<<8)+packet->payload[11]);
printf("trying to SOMEIP 2...");
NDPI_LOG(NDPI_PROTOCOL_SOMEIP, ndpi_struct, NDPI_LOG_DEBUG, "====>>>> SOME/IP Message ID: %08x [len: %u]\n", NDPI_LOG(NDPI_PROTOCOL_SOMEIP, ndpi_struct, NDPI_LOG_DEBUG, "====>>>> SOME/IP Message ID: %08x [len: %u]\n",
message_id, packet->payload_packet_len); message_id, packet->payload_packet_len);
if (packet->payload_packet_len < 16) { if (packet->payload_packet_len < 16) {
@@ -119,9 +114,6 @@ void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct,
####Maximum packet size in SOMEIP depends on the carrier protocol, and I'm not certain how well enforced it is, so let's leave that for round 2#### ####Maximum packet size in SOMEIP depends on the carrier protocol, and I'm not certain how well enforced it is, so let's leave that for round 2####
*/ */
printf("trying to SOMEIP 3...");
// we extract the remaining length // we extract the remaining length
u_int32_t someip_len = (u_int32_t) ((packet->payload[4]<<24) + (packet->payload[5]<<16) + (packet->payload[6]<<8) +packet->payload[7]); u_int32_t someip_len = (u_int32_t) ((packet->payload[4]<<24) + (packet->payload[5]<<16) + (packet->payload[6]<<8) +packet->payload[7]);
if (packet->payload_packet_len != (someip_len + 8)) { if (packet->payload_packet_len != (someip_len + 8)) {
@@ -130,8 +122,6 @@ void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct,
return; return;
} }
printf("trying to SOMEIP 4...");
u_int8_t protocol_version = (u_int8_t) (packet->payload[12]); u_int8_t protocol_version = (u_int8_t) (packet->payload[12]);
NDPI_LOG(NDPI_PROTOCOL_SOMEIP, ndpi_struct, NDPI_LOG_DEBUG,"====>>>> SOME/IP protocol version: [%d]\n",protocol_version); NDPI_LOG(NDPI_PROTOCOL_SOMEIP, ndpi_struct, NDPI_LOG_DEBUG,"====>>>> SOME/IP protocol version: [%d]\n",protocol_version);
if (protocol_version != 0x01){ if (protocol_version != 0x01){
@@ -142,8 +132,6 @@ void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct,
u_int8_t interface_version = (packet->payload[13]); u_int8_t interface_version = (packet->payload[13]);
printf("trying to SOMEIP 5...");
u_int8_t message_type = (u_int8_t) (packet->payload[14]); u_int8_t message_type = (u_int8_t) (packet->payload[14]);
NDPI_LOG(NDPI_PROTOCOL_SOMEIP, ndpi_struct, NDPI_LOG_DEBUG,"====>>>> SOME/IP message type: [%d]\n",message_type); NDPI_LOG(NDPI_PROTOCOL_SOMEIP, ndpi_struct, NDPI_LOG_DEBUG,"====>>>> SOME/IP message type: [%d]\n",message_type);
if ((message_type != 0x00) && (message_type != 0x01) && (message_type != 0x02) && (message_type != 0x40) && (message_type != 0x41) && if ((message_type != 0x00) && (message_type != 0x01) && (message_type != 0x02) && (message_type != 0x40) && (message_type != 0x41) &&
@@ -153,8 +141,6 @@ void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct,
return; return;
} }
printf("trying to SOMEIP 6...");
u_int8_t return_code = (u_int8_t) (packet->payload[15]); u_int8_t return_code = (u_int8_t) (packet->payload[15]);
NDPI_LOG(NDPI_PROTOCOL_SOMEIP, ndpi_struct, NDPI_LOG_DEBUG,"====>>>> SOME/IP return code: [%d]\n",return_code); NDPI_LOG(NDPI_PROTOCOL_SOMEIP, ndpi_struct, NDPI_LOG_DEBUG,"====>>>> SOME/IP return code: [%d]\n",return_code);
if ((return_code > 0x3f)) { if ((return_code > 0x3f)) {
@@ -163,8 +149,6 @@ void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct,
return; return;
} }
printf("trying to SOMEIP 7...");
if (message_id == MSG_MAGIC_COOKIE){ if (message_id == MSG_MAGIC_COOKIE){
if ((someip_len == 0x08) && (request_id == 0xDEADBEEF) && (interface_version == 0x01) && if ((someip_len == 0x08) && (request_id == 0xDEADBEEF) && (interface_version == 0x01) &&
(message_type == 0x01) && (return_code == 0x00)){ (message_type == 0x01) && (return_code == 0x00)){
@@ -179,8 +163,6 @@ void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct,
} }
} }
printf("trying to SOMEIP 8...");
if (message_id == MSG_MAGIC_COOKIE_ACK){ if (message_id == MSG_MAGIC_COOKIE_ACK){
if ((someip_len == 0x08) && (request_id == 0xDEADBEEF) && (interface_version == 0x01) && if ((someip_len == 0x08) && (request_id == 0xDEADBEEF) && (interface_version == 0x01) &&
(message_type == 0x02) && (return_code == 0x00)){ (message_type == 0x02) && (return_code == 0x00)){
@@ -195,8 +177,6 @@ void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct,
} }
} }
printf("trying to SOMEIP 9...");
if (message_id == MSG_SD){ if (message_id == MSG_SD){
//####Service Discovery message. Fill in later!#### //####Service Discovery message. Fill in later!####
} }
@@ -217,9 +197,6 @@ void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct,
} }
} }
printf("trying to SOMEIP 10...");
NDPI_LOG(NDPI_PROTOCOL_SOMEIP, ndpi_struct, NDPI_LOG_DEBUG, "Reached the end without confirming SOME/IP ...\n"); NDPI_LOG(NDPI_PROTOCOL_SOMEIP, ndpi_struct, NDPI_LOG_DEBUG, "Reached the end without confirming SOME/IP ...\n");
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SOMEIP); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SOMEIP);
return; return;