diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2022-01-30 19:18:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-30 19:18:12 +0100 |
commit | 5bb5bec477e1a10a404fd9228ddc0f5041b51123 (patch) | |
tree | 923e8b698416595cf18e853215394fe6c66c8e02 /src/lib/protocols/world_of_warcraft.c | |
parent | 1fdcddb33d105a45061da1ceaefcb6a00542322f (diff) |
Remove `struct ndpi_id_struct` (#1427)
Remove the last uses of `struct ndpi_id_struct`.
That code is not really used and it has not been updated for a very long
time: see #1279 for details.
Correlation among flows is achieved via LRU caches.
This change allows to further reduce memory consumption (see also
91bb77a8).
At nDPI 4.0 (more precisly, at a6b10cf, because memory stats
were wrong until that commit):
```
nDPI Memory statistics:
nDPI Memory (once): 221.15 KB
Flow Memory (per flow): 2.94 KB
```
Now:
```
nDPI Memory statistics:
nDPI Memory (once): 235.27 KB
Flow Memory (per flow): 688 B <--------
```
i.e. memory usage per flow has been reduced by 77%.
Close #1279
Diffstat (limited to 'src/lib/protocols/world_of_warcraft.c')
-rw-r--r-- | src/lib/protocols/world_of_warcraft.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/lib/protocols/world_of_warcraft.c b/src/lib/protocols/world_of_warcraft.c index 2d35fe7ab..8b6da51f9 100644 --- a/src/lib/protocols/world_of_warcraft.c +++ b/src/lib/protocols/world_of_warcraft.c @@ -56,9 +56,6 @@ void ndpi_search_worldofwarcraft(struct ndpi_detection_module_struct { struct ndpi_packet_struct *packet = &ndpi_struct->packet; - struct ndpi_id_struct *src = flow->src; - struct ndpi_id_struct *dst = flow->dst; - NDPI_LOG_DBG(ndpi_struct, "search World of Warcraft\n"); if (packet->tcp != NULL) { @@ -108,14 +105,11 @@ void ndpi_search_worldofwarcraft(struct ndpi_detection_module_struct return; } - if (NDPI_SRC_OR_DST_HAS_PROTOCOL(src, dst, NDPI_PROTOCOL_WORLDOFWARCRAFT) != 0) { - if (packet->tcp->source == htons(3724) - && packet->payload_packet_len == 8 && get_u_int32_t(packet->payload, 0) == htonl(0x0006ec01)) { - ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow); - NDPI_LOG_INFO(ndpi_struct, "World of Warcraft: connection detected\n"); - return; - } - + if (packet->tcp->source == htons(3724) + && packet->payload_packet_len == 8 && get_u_int32_t(packet->payload, 0) == htonl(0x0006ec01)) { + ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow); + NDPI_LOG_INFO(ndpi_struct, "World of Warcraft: connection detected\n"); + return; } /* for some well known WoW ports |