Mapped the mining category in ndpi_category_get_name()
This commit is contained in:
@@ -800,7 +800,17 @@ typedef enum {
|
|||||||
CUSTOM_CATEGORY_ADVERTISEMENT = 101,
|
CUSTOM_CATEGORY_ADVERTISEMENT = 101,
|
||||||
CUSTOM_CATEGORY_BANNED_SITE = 102,
|
CUSTOM_CATEGORY_BANNED_SITE = 102,
|
||||||
CUSTOM_CATEGORY_SITE_UNAVAILABLE = 103,
|
CUSTOM_CATEGORY_SITE_UNAVAILABLE = 103,
|
||||||
|
|
||||||
|
/*
|
||||||
|
IMPORTANT
|
||||||
|
|
||||||
|
Please keep in sync with
|
||||||
|
|
||||||
|
static const char* categories[] = { ..}
|
||||||
|
|
||||||
|
in ndpi_main.c
|
||||||
|
*/
|
||||||
|
|
||||||
NDPI_PROTOCOL_NUM_CATEGORIES /*
|
NDPI_PROTOCOL_NUM_CATEGORIES /*
|
||||||
NOTE: Keep this as last member
|
NOTE: Keep this as last member
|
||||||
Unused as value but useful to getting the number of elements
|
Unused as value but useful to getting the number of elements
|
||||||
|
|||||||
+84
-5
@@ -1222,9 +1222,9 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp
|
|||||||
no_master, "SMBv23", NDPI_PROTOCOL_CATEGORY_SYSTEM_OS,
|
no_master, "SMBv23", NDPI_PROTOCOL_CATEGORY_SYSTEM_OS,
|
||||||
ndpi_build_default_ports(ports_a, 445, 0, 0, 0, 0) /* TCP */,
|
ndpi_build_default_ports(ports_a, 445, 0, 0, 0, 0) /* TCP */,
|
||||||
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
|
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
|
||||||
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_MINING,
|
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_UNSAFE, NDPI_PROTOCOL_MINING,
|
||||||
no_master,
|
no_master,
|
||||||
no_master, "Mining", CUSTOM_CATEGORY_MINING /* dummy */,
|
no_master, "Mining", CUSTOM_CATEGORY_MINING,
|
||||||
ndpi_build_default_ports(ports_a, 8333, 0, 0, 0, 0) /* TCP */,
|
ndpi_build_default_ports(ports_a, 8333, 0, 0, 0, 0) /* TCP */,
|
||||||
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
|
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
|
||||||
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_43,
|
ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_FREE_43,
|
||||||
@@ -5486,14 +5486,93 @@ static const char* categories[] = {
|
|||||||
"QuickTime",
|
"QuickTime",
|
||||||
"RealMedia",
|
"RealMedia",
|
||||||
"WindowsMedia",
|
"WindowsMedia",
|
||||||
"Webm",
|
"Webm", /* 32 */
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
|
||||||
|
"Mining", /* 99 */
|
||||||
|
"Malware",
|
||||||
|
"Advertisement",
|
||||||
|
"Banned_Site",
|
||||||
|
"Site_Unavailable"
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* ndpi_category_get_name(struct ndpi_detection_module_struct *ndpi_mod,
|
const char* ndpi_category_get_name(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
ndpi_protocol_category_t category) {
|
ndpi_protocol_category_t category) {
|
||||||
if(!ndpi_mod) return(NULL);
|
if((!ndpi_mod) || (category >= NDPI_PROTOCOL_NUM_CATEGORIES))
|
||||||
|
return(NULL);
|
||||||
|
|
||||||
if(category < NDPI_PROTOCOL_CATEGORY_CUSTOM_1)
|
if((category < NDPI_PROTOCOL_CATEGORY_CUSTOM_1) || (category >= CUSTOM_CATEGORY_MINING))
|
||||||
return(categories[category]);
|
return(categories[category]);
|
||||||
else {
|
else {
|
||||||
switch(category) {
|
switch(category) {
|
||||||
|
|||||||
Reference in New Issue
Block a user