diff options
author | Campus <campus@ntop.org> | 2016-10-07 11:37:42 +0200 |
---|---|---|
committer | Campus <campus@ntop.org> | 2016-10-07 11:37:42 +0200 |
commit | 2c47dca086940c643f98ad5e868899f84b61dd82 (patch) | |
tree | 598acb5b3a7623b495c491bd793cc4f97f6a28d6 /src/lib/protocols/vmware.c | |
parent | 7e8e243e68bc6bc4d979e03887d57d75fd36f00b (diff) |
fixed some dissector for logic or syntax
Diffstat (limited to 'src/lib/protocols/vmware.c')
-rw-r--r-- | src/lib/protocols/vmware.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/protocols/vmware.c b/src/lib/protocols/vmware.c index 9ef3ccd2f..e5421b946 100644 --- a/src/lib/protocols/vmware.c +++ b/src/lib/protocols/vmware.c @@ -27,30 +27,30 @@ void ndpi_search_vmware(struct ndpi_detection_module_struct *ndpi_struct, struct struct ndpi_packet_struct *packet = &flow->packet; /* Check whether this is an VMWARE flow */ - if(packet->udp != NULL) { - if((packet->payload_packet_len == 66) - && (ntohs(packet->udp->dest) == 902) - && ((packet->payload[0] & 0xFF) == 0xA4)) { + if(packet->udp != NULL){ + if((packet->payload_packet_len == 66) && + (ntohs(packet->udp->dest) == 902) && + ((packet->payload[0] & 0xFF) == 0xA4)){ + NDPI_LOG(NDPI_PROTOCOL_VMWARE, ndpi_struct, NDPI_LOG_DEBUG, "Found vmware.\n"); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_VMWARE, NDPI_PROTOCOL_UNKNOWN); - } - else { - NDPI_LOG(NDPI_PROTOCOL_VMWARE, ndpi_struct, NDPI_LOG_DEBUG, "exclude vmware.\n"); - NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_VMWARE); + return; } } + NDPI_LOG(NDPI_PROTOCOL_VMWARE, ndpi_struct, NDPI_LOG_DEBUG, "exclude vmware.\n"); + NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_VMWARE); } - void init_vmware_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) - { - ndpi_set_bitmask_protocol_detection("VMWARE", ndpi_struct, detection_bitmask, *id, - NDPI_PROTOCOL_VMWARE, - ndpi_search_vmware, - NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, - SAVE_DETECTION_BITMASK_AS_UNKNOWN, - ADD_TO_DETECTION_BITMASK); - - *id += 1; - } +void init_vmware_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("VMWARE", ndpi_struct, detection_bitmask, *id, + NDPI_PROTOCOL_VMWARE, + ndpi_search_vmware, + NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); + + *id += 1; +} #endif |