aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/ndpi_main.c23
-rw-r--r--src/lib/protocols/openvpn.c12
2 files changed, 31 insertions, 4 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 7959a3570..c6a39394d 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -4386,47 +4386,66 @@ char* ndpi_protocol2name(struct ndpi_detection_module_struct *ndpi_mod,
const char* ndpi_category_str(ndpi_protocol_category_t category) {
switch(category) {
- case NDPI_PROTOCOL_CATEGORY_UNSPECIFIED:
- return("Unspecified");
case NDPI_PROTOCOL_CATEGORY_MEDIA:
return("Media");
+ break;
case NDPI_PROTOCOL_CATEGORY_VPN:
return("VPN");
+ break;
case NDPI_PROTOCOL_CATEGORY_MAIL_SEND:
return("EmailSend");
+ break;
case NDPI_PROTOCOL_CATEGORY_MAIL_SYNC:
return("EmailSync");
+ break;
case NDPI_PROTOCOL_CATEGORY_FILE_TRANSFER:
return("FileTransfer");
+ break;
case NDPI_PROTOCOL_CATEGORY_WEB:
return("Web");
+ break;
case NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK:
return("SocialNetwork");
+ break;
case NDPI_PROTOCOL_CATEGORY_P2P:
return("P2P");
+ break;
case NDPI_PROTOCOL_CATEGORY_GAME:
return("Game");
+ break;
case NDPI_PROTOCOL_CATEGORY_CHAT:
return("Chat");
+ break;
case NDPI_PROTOCOL_CATEGORY_VOIP:
return("VoIP");
+ break;
case NDPI_PROTOCOL_CATEGORY_DATABASE:
return("Database");
+ break;
case NDPI_PROTOCOL_CATEGORY_REMOTE_ACCESS:
return("RemoteAccess");
+ break;
case NDPI_PROTOCOL_CATEGORY_CLOUD:
return("Cloud");
+ break;
case NDPI_PROTOCOL_CATEGORY_NETWORK:
return("Network");
+ break;
case NDPI_PROTOCOL_CATEGORY_COLLABORATIVE:
return("Collaborative");
+ break;
case NDPI_PROTOCOL_CATEGORY_RPC:
return("RPC");
+ break;
case NDPI_PROTOCOL_CATEGORY_NETWORK_TOOL:
return("NetworkTool");
+ break;
case NDPI_PROTOCOL_CATEGORY_SYSTEM:
return("System");
+ break;
}
+
+ return("Unspecified");
}
/* ****************************************************** */
diff --git a/src/lib/protocols/openvpn.c b/src/lib/protocols/openvpn.c
index 3e8412355..234f18df8 100644
--- a/src/lib/protocols/openvpn.c
+++ b/src/lib/protocols/openvpn.c
@@ -37,11 +37,19 @@
#define P_PACKET_ID_ARRAY_LEN_OFFSET(hmac_size) (P_HARD_RESET_PACKET_ID_OFFSET(hmac_size) + 8)
#define P_HARD_RESET_CLIENT_MAX_COUNT 5
-static inline u_int32_t get_packet_id(const u_int8_t * payload, u_int8_t hms) {
+static
+#ifndef WIN32
+inline
+#endif
+u_int32_t get_packet_id(const u_int8_t * payload, u_int8_t hms) {
return ntohl(*(u_int32_t*)(payload + P_HARD_RESET_PACKET_ID_OFFSET(hms)));
}
-static inline int8_t check_pkid_and_detect_hmac_size(const u_int8_t * payload) {
+static
+#ifndef WIN32
+inline
+#endif
+int8_t check_pkid_and_detect_hmac_size(const u_int8_t * payload) {
// try to guess
if (get_packet_id(payload, P_HMAC_160) == 1)
return P_HMAC_160;