aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Piserchia <vito.piserchia@dreamlab.net>2016-11-03 15:08:56 +0100
committerVito Piserchia <vito.piserchia@dreamlab.net>2016-11-03 15:08:56 +0100
commit087ca9d0d5c03fe0a6943d1763348ef317a824d2 (patch)
tree2dd8ff68321acb8232373da247dfdbefd661b4f7
parent8169b35fa68c5dde575b961820271f4b05dd6e4d (diff)
parent002b8b04e9ff06aa75a93af4466361636ef38820 (diff)
Merge remote-tracking branch 'upstream/dev' into dev
-rw-r--r--example/Makefile.am2
-rw-r--r--src/lib/ndpi_main.c23
-rw-r--r--src/lib/protocols/openvpn.c12
3 files changed, 32 insertions, 5 deletions
diff --git a/example/Makefile.am b/example/Makefile.am
index a55212c92..c1eee8496 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -4,7 +4,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/include @PCAP_INC@
AM_CFLAGS = @PTHREAD_CFLAGS@
LDADD = $(top_builddir)/src/lib/libndpi.la @JSON_C_LIB@ @PTHREAD_LIBS@ @PCAP_LIB@
-AM_LDFLAGS = -static
+AM_LDFLAGS = -static -ldl
ndpiReader_SOURCES = ndpiReader.c ndpi_util.c ndpi_util.h
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;