diff options
author | Daniele De Lorenzi <daniele.delorenzi@fastnetserv.net> | 2019-04-02 15:49:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-02 15:49:54 +0200 |
commit | e27022b69886a327205dcdd166d7ccef1d02bcd9 (patch) | |
tree | 8e7e1aa15bdff1f152befbe4c6c205e47dcd26e6 /src/lib/protocols/ookla.c | |
parent | c51405e99bae3217545fa34386987b839a8c68a6 (diff) | |
parent | 153c77c2cd28d52d6b459263dea3ce988ceccd3c (diff) |
Merge pull request #11 from ntop/dev
Add all dev branch modifications
Diffstat (limited to 'src/lib/protocols/ookla.c')
-rw-r--r-- | src/lib/protocols/ookla.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/lib/protocols/ookla.c b/src/lib/protocols/ookla.c index b1eb295a7..06d97e216 100644 --- a/src/lib/protocols/ookla.c +++ b/src/lib/protocols/ookla.c @@ -22,34 +22,32 @@ #define NDPI_CURRENT_PROTO NDPI_PROTOCOL_OOKLA #include "ndpi_api.h" -#include "lruc.h" void ndpi_search_ookla(struct ndpi_detection_module_struct* ndpi_struct, struct ndpi_flow_struct* flow) { struct ndpi_packet_struct* packet = &flow->packet; u_int32_t addr = 0; void *value; - + NDPI_LOG_DBG(ndpi_struct, "Ookla detection\n"); - + if(packet->tcp->source == htons(8080)) addr = packet->iph->saddr; else if(packet->tcp->dest == htons(8080)) addr = packet->iph->daddr; else goto ookla_exclude; - + if(ndpi_struct->ookla_cache != NULL) { - if(lruc_get(ndpi_struct->ookla_cache, &addr, sizeof(addr), &value) == LRUC_NO_ERROR) { - /* Don't remove it as it can be used for other connections */ + if(ndpi_lru_find_cache(ndpi_struct->ookla_cache, addr, 0 /* Don't remove it as it can be used for other connections */)) { NDPI_LOG_INFO(ndpi_struct, "found ookla tcp connection\n"); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OOKLA, NDPI_PROTOCOL_UNKNOWN); return; - } + } } ookla_exclude: - NDPI_EXCLUDE_PROTO(ndpi_struct, flow); + NDPI_EXCLUDE_PROTO(ndpi_struct, flow); } void init_ookla_dissector(struct ndpi_detection_module_struct *ndpi_struct, @@ -63,4 +61,3 @@ void init_ookla_dissector(struct ndpi_detection_module_struct *ndpi_struct, *id += 1; } - |