diff options
author | Luca Deri <deri@ntop.org> | 2020-05-16 00:10:35 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2020-05-16 00:10:35 +0200 |
commit | 3d9285f1be84db7ecec821b75f67964dc4773a65 (patch) | |
tree | e88b21c20d28baaea0b371849242d5c4648eb3a9 /src/include | |
parent | c375782b96faf30558b3f91a7fe05eae62fc79c2 (diff) |
Added check for invalid HTTP URLs
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/ndpi_api.h.in | 4 | ||||
-rw-r--r-- | src/include/ndpi_define.h.in | 1 | ||||
-rw-r--r-- | src/include/ndpi_typedefs.h | 5 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/include/ndpi_api.h.in b/src/include/ndpi_api.h.in index bed449f60..6495c6825 100644 --- a/src/include/ndpi_api.h.in +++ b/src/include/ndpi_api.h.in @@ -1029,12 +1029,12 @@ extern "C" { void ndpi_data_print_window_values(struct ndpi_analyze_struct *s); /* debug */ - ndpi_risk ndpi_validate_url(char *url); + ndpi_risk_enum ndpi_validate_url(char *url); u_int8_t ndpi_is_protocol_detected(struct ndpi_detection_module_struct *ndpi_str, ndpi_protocol proto); - const char* ndpi_risk2str(ndpi_risk risk); + const char* ndpi_risk2str(ndpi_risk_enum risk); #ifdef __cplusplus } #endif diff --git a/src/include/ndpi_define.h.in b/src/include/ndpi_define.h.in index 77e961550..fd0575b03 100644 --- a/src/include/ndpi_define.h.in +++ b/src/include/ndpi_define.h.in @@ -278,6 +278,7 @@ #define NDPI_CLR_BIT(num, n) num &= ~(1UL << n) #define NDPI_CLR_BIT(num, n) num &= ~(1UL << n) #define NDPI_ISSET_BIT(num, n) (num & (1 << n)) +#define NDPI_ZERO_BIT(num) num = 0 /* this is a very very tricky macro *g*, * the compiler will remove all shifts here if the protocol is static... diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index 4d8796261..bdcfebbe2 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -64,10 +64,13 @@ typedef enum { NDPI_TLS_CERTIFICATE_MISMATCH, NDPI_HTTP_SUSPICIOUS_USER_AGENT, NDPI_HTTP_NUMERIC_IP_HOST, + NDPI_HTTP_SUSPICIOUS_URL, /* Leave this as last member */ NDPI_MAX_RISK -} ndpi_risk; +} ndpi_risk_enum; + +typedef u_int32_t ndpi_risk; /* NDPI_VISIT */ typedef enum { |