|
24 | 24 | /* static so default is zero-initialization, let's just define it */ |
25 | 25 |
|
26 | 26 | const ndpi_protocol Flow::ndpiUnknownProtocol = { NDPI_PROTOCOL_UNKNOWN, |
27 | | - NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, NULL }; |
| 27 | + NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN, |
| 28 | + NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, NULL }; |
28 | 29 | // #define DEBUG_DISCOVERY |
29 | 30 | // #define DEBUG_UA |
30 | 31 | // #define DEBUG_SCORE |
@@ -670,9 +671,12 @@ void Flow::processExtraDissectedInformation() { |
670 | 671 | && (ndpiFlow->protos.tls_quic.server_names != NULL)) |
671 | 672 | protos.tls.server_names = strdup(ndpiFlow->protos.tls_quic.server_names); |
672 | 673 |
|
673 | | - if((protos.tls.client_alpn == NULL) |
674 | | - && (ndpiFlow->protos.tls_quic.alpn != NULL)) |
675 | | - protos.tls.client_alpn = strdup(ndpiFlow->protos.tls_quic.alpn); |
| 674 | + if(protos.tls.client_alpn == NULL) { |
| 675 | + if(ndpiFlow->protos.tls_quic.negotiated_alpn != NULL) |
| 676 | + protos.tls.client_alpn = strdup(ndpiFlow->protos.tls_quic.negotiated_alpn); |
| 677 | + else if(ndpiFlow->protos.tls_quic.advertised_alpns != NULL) |
| 678 | + protos.tls.client_alpn = strdup(ndpiFlow->protos.tls_quic.advertised_alpns); |
| 679 | + } |
676 | 680 |
|
677 | 681 | if((protos.tls.client_tls_supported_versions == NULL) |
678 | 682 | && (ndpiFlow->protos.tls_quic.tls_supported_versions != NULL)) |
@@ -774,7 +778,7 @@ void Flow::processPacket(const struct pcap_pkthdr *h, |
774 | 778 | * be able to guess the protocol. */ |
775 | 779 |
|
776 | 780 | proto_id = ndpi_detection_process_packet(iface->get_ndpi_struct(), ndpiFlow, |
777 | | - ip_packet, ip_len, packet_time); |
| 781 | + ip_packet, ip_len, packet_time, NULL); |
778 | 782 |
|
779 | 783 | detected = ndpi_is_protocol_detected(iface->get_ndpi_struct(), proto_id); |
780 | 784 |
|
@@ -857,10 +861,10 @@ void Flow::processDNSPacket(const u_char *ip_packet, u_int16_t ip_len, u_int64_t |
857 | 861 | /* Instruct nDPI to continue the dissection |
858 | 862 | See https://github.com/ntop/ntopng/commit/30f52179d9f7a1eb774534def93d55c77d6070bc#diff-20b1df29540b6de59ceb6c6d2f3afdb5R387 |
859 | 863 | */ |
860 | | - ndpiFlow->check_extra_packets = 1, ndpiFlow->max_extra_packets_to_check = 10; |
| 864 | + ndpiFlow->max_extra_packets_to_check = 10; |
861 | 865 |
|
862 | 866 | proto_id = ndpi_detection_process_packet(iface->get_ndpi_struct(), ndpiFlow, |
863 | | - ip_packet, ip_len, packet_time); |
| 867 | + ip_packet, ip_len, packet_time, NULL); |
864 | 868 |
|
865 | 869 | /* |
866 | 870 | A DNS flow won't change to a non-DNS flow. However, this check is |
@@ -2381,17 +2385,15 @@ void Flow::lua(lua_State* vm, AddressTree * ptree, |
2381 | 2385 |
|
2382 | 2386 | void Flow::lua_confidence(lua_State* vm) { |
2383 | 2387 | switch(getConfidence()) { |
2384 | | - case NDPI_CONFIDENCE_MATCH_BY_PORT: |
2385 | | - case NDPI_CONFIDENCE_MATCH_BY_IP: |
2386 | | - lua_push_uint32_table_entry(vm, "confidence", (ndpiConfidence) confidence_guessed); |
2387 | | - break; |
2388 | | - |
2389 | 2388 | case NDPI_CONFIDENCE_DPI_CACHE: |
| 2389 | + case NDPI_CONFIDENCE_DPI_PARTIAL_CACHE: |
2390 | 2390 | case NDPI_CONFIDENCE_DPI: |
2391 | | - lua_push_uint32_table_entry(vm, "confidence", (ndpiConfidence) confidence_dpi); |
| 2391 | + case NDPI_CONFIDENCE_NBPF: |
| 2392 | + lua_push_uint32_table_entry(vm, "confidence", (ndpiConfidence) confidence_guessed); |
2392 | 2393 | break; |
2393 | 2394 |
|
2394 | 2395 | default: |
| 2396 | + lua_push_uint32_table_entry(vm, "confidence", (ndpiConfidence) confidence_guessed); |
2395 | 2397 | break; |
2396 | 2398 | } |
2397 | 2399 | } |
@@ -6205,17 +6207,14 @@ void Flow::getProtocolJSONInfo(ndpi_serializer *serializer) { |
6205 | 6207 |
|
6206 | 6208 | if(getConfidence() != NDPI_CONFIDENCE_UNKNOWN) { |
6207 | 6209 | switch(getConfidence()) { |
6208 | | - case NDPI_CONFIDENCE_MATCH_BY_PORT: |
6209 | | - case NDPI_CONFIDENCE_MATCH_BY_IP: |
6210 | | - ndpi_serialize_string_uint32(serializer, "confidence", (ndpiConfidence) confidence_guessed); |
6211 | | - break; |
6212 | | - |
6213 | | - case NDPI_CONFIDENCE_DPI_CACHE: |
6214 | | - case NDPI_CONFIDENCE_DPI: |
6215 | | - ndpi_serialize_string_uint32(serializer, "confidence", (ndpiConfidence) confidence_dpi); |
| 6210 | + case NDPI_CONFIDENCE_DPI_CACHE: |
| 6211 | + case NDPI_CONFIDENCE_DPI: |
| 6212 | + case NDPI_CONFIDENCE_NBPF: |
| 6213 | + ndpi_serialize_string_uint32(serializer, "confidence", (ndpiConfidence) confidence_dpi); |
6216 | 6214 | break; |
6217 | 6215 |
|
6218 | | - default: |
| 6216 | + default: |
| 6217 | + ndpi_serialize_string_uint32(serializer, "confidence", (ndpiConfidence) confidence_guessed); |
6219 | 6218 | break; |
6220 | 6219 | } |
6221 | 6220 | } |
|
0 commit comments