aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2019-03-10 21:44:11 +0100
committerLuca Deri <deri@ntop.org>2019-03-10 21:44:11 +0100
commit6c1d236a03f6c41f14d0d3c8a7627548fcd55779 (patch)
treef014a84cbc2236491c215c6d4f5ea84dfb26933d /src
parent89d548f9d30a006caaf304a962f4cc4cf8cdf6c1 (diff)
Category cleanup
Diffstat (limited to 'src')
-rw-r--r--src/lib/ndpi_main.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index b0f1383d3..2471a0eb1 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -5698,14 +5698,6 @@ static const char* categories[] = {
"",
"",
"",
- "AVI",
- "Flash",
- "OGG",
- "MPEG",
- "QuickTime",
- "RealMedia",
- "WindowsMedia",
- "Webm", /* 32 */
"Music",
"Video",
"Shopping",
@@ -5791,9 +5783,7 @@ const char* ndpi_category_get_name(struct ndpi_detection_module_struct *ndpi_mod
if((!ndpi_mod) || (category >= NDPI_PROTOCOL_NUM_CATEGORIES))
return(NULL);
- if((category < NDPI_PROTOCOL_CATEGORY_CUSTOM_1) || (category >= CUSTOM_CATEGORY_MINING))
- return(categories[category]);
- else {
+ if((category >= NDPI_PROTOCOL_CATEGORY_CUSTOM_1) && (category <= NDPI_PROTOCOL_CATEGORY_CUSTOM_5)) {
switch(category) {
case NDPI_PROTOCOL_CATEGORY_CUSTOM_1:
return(ndpi_mod->custom_category_labels[0]);
@@ -5810,7 +5800,8 @@ const char* ndpi_category_get_name(struct ndpi_detection_module_struct *ndpi_mod
default:
return("Unspecified");
}
- }
+ } else
+ return(categories[category]);
}
/* ****************************************************** */