aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--example/ndpiReader.c2
-rw-r--r--src/lib/ndpi_content_match.c.inc12
-rw-r--r--src/lib/third_party/include/libcache.h2
-rw-r--r--src/lib/third_party/src/libcache.c4
-rw-r--r--wireshark/ndpi.lua14
5 files changed, 20 insertions, 14 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index b76d66f34..fa3dd4b27 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -312,7 +312,7 @@ void extcap_config() {
/* -i <interface> */
printf("arg {number=%u}{call=-i}{display=Capture Interface or Pcap File Path}{type=string}"
"{tooltip=The interface name}\n", argidx++);
- printf("arg {number=%u}{call=-i}{display=Pcap File to Analize}{type=fileselect}"
+ printf("arg {number=%u}{call=-i}{display=Pcap File to Analyze}{type=fileselect}"
"{tooltip=The pcap file to analyze (if the interface is unspecified)}\n", argidx++);
setupDetection(0, NULL);
diff --git a/src/lib/ndpi_content_match.c.inc b/src/lib/ndpi_content_match.c.inc
index e5a5d68fb..4fd04dac9 100644
--- a/src/lib/ndpi_content_match.c.inc
+++ b/src/lib/ndpi_content_match.c.inc
@@ -8100,12 +8100,12 @@ ndpi_protocol_match host_match[] = {
{ ".snapads.", "Snapchat", NDPI_PROTOCOL_SNAPCHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
/* Detected "instagram.c10r.facebook.com". Omitted "*amazonaws.com" and "*facebook.com" CDNs e.g. "ig-telegraph-shv-04-frc3.facebook.com" */
- { ".cdninstagram.com", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_FUN },
- { "instagram.", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_FUN },
- { ".instagram.", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_FUN },
- { "igcdn-photos-", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_FUN },
- { "instagramimages-", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_FUN },
- { "instagramstatic-", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_FUN },
+ { ".cdninstagram.com", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
+ { "instagram.", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
+ { ".instagram.", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
+ { "igcdn-photos-", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
+ { "instagramimages-", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
+ { "instagramstatic-", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
{ ".waze.com", "Waze", NDPI_PROTOCOL_WAZE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
diff --git a/src/lib/third_party/include/libcache.h b/src/lib/third_party/include/libcache.h
index fa1675f14..53632616e 100644
--- a/src/lib/third_party/include/libcache.h
+++ b/src/lib/third_party/include/libcache.h
@@ -43,7 +43,7 @@ typedef enum cache_result {
} cache_result;
-typedef struct cache_t *cache_t;
+typedef struct cache *cache_t;
/**
diff --git a/src/lib/third_party/src/libcache.c b/src/lib/third_party/src/libcache.c
index 11af22284..0a2ce6f6a 100644
--- a/src/lib/third_party/src/libcache.c
+++ b/src/lib/third_party/src/libcache.c
@@ -53,7 +53,7 @@ typedef struct cache_entry *cache_entry;
typedef struct cache_entry_map *cache_entry_map;
-struct cache_t {
+struct cache {
uint32_t size;
uint32_t max_size;
cache_entry head;
@@ -103,7 +103,7 @@ cache_t cache_new(uint32_t cache_max_size) {
return NULL;
}
- cache_t cache = (cache_t) calloc(sizeof(struct cache_t), 1);
+ cache_t cache = (cache_t) calloc(sizeof(struct cache), 1);
if(!cache) {
return NULL;
}
diff --git a/wireshark/ndpi.lua b/wireshark/ndpi.lua
index d6ff9c39d..a667749e0 100644
--- a/wireshark/ndpi.lua
+++ b/wireshark/ndpi.lua
@@ -421,7 +421,7 @@ function ndpi_proto.dissector(tvb, pinfo, tree)
srckey = tostring(pinfo.src)
dstkey = tostring(pinfo.dst)
- flowkey = srckey.." / "..dstkey.." ["..ndpikey.."]"
+ flowkey = srckey.." / "..dstkey.."\t["..ndpikey.."]"
if(ndpi_flows[flowkey] == nil) then
ndpi_flows[flowkey] = 0
num_ndpi_flows = num_ndpi_flows + 1
@@ -524,13 +524,18 @@ local function ndpi_dialog_menu()
local i
if(ndpi_protos ~= {}) then
+ local tot = 0
label = "nDPI Protocol Breakdown\n"
label = label .. "-----------------------\n"
+ for _,v in pairs(ndpi_protos) do
+ tot = tot + v
+ end
+
i = 0
for k,v in pairsByValues(ndpi_protos, rev) do
- -- label = label .. k .. "\t".. bytesToSize(v) .. "\n"
- label = label .. string.format("%-32s\t%s\n", k, bytesToSize(v))
+ local pctg = formatPctg((v * 100) / tot)
+ label = label .. string.format("%-32s\t\t%s\t", k, bytesToSize(v)).. "\t["..pctg.."]\n"
if(i == max_num_entries) then break else i = i + 1 end
end
@@ -540,7 +545,8 @@ local function ndpi_dialog_menu()
label = label .. "-----------\n"
i = 0
for k,v in pairsByValues(ndpi_flows, rev) do
- label = label .. string.format("%-32s\t%s\n", k, bytesToSize(v))
+ local pctg = formatPctg((v * 100) / tot)
+ label = label .. string.format("%-48s\t%s", k, bytesToSize(v)).. "\t["..pctg.."]\n"
if(i == max_num_entries) then break else i = i + 1 end
end