aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_main.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2015-11-26 23:47:55 +0100
committerLuca Deri <deri@ntop.org>2015-11-26 23:47:55 +0100
commitcb68d4d00a22f6c367b4b18a35bd827ae2609d09 (patch)
treeee697e404eca3400960b3437bace33d3504c0b3b /src/lib/ndpi_main.c
parent98ef945d2ef6e2ab072076b5ab68c5b7d05a7098 (diff)
Win32 compilation fixes
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r--src/lib/ndpi_main.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index bdcac35e0..51a2c66b0 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -1833,6 +1833,22 @@ u_int ndpi_get_num_supported_protocols(struct ndpi_detection_module_struct *ndpi
/* ******************************************************************** */
+#ifdef WIN32
+char * strsep(char **sp, char *sep)
+{
+ char *p, *s;
+ if (sp == NULL || *sp == NULL || **sp == '\0') return(NULL);
+ s = *sp;
+ p = s + strcspn(s, sep);
+ if (*p != '\0') *p++ = '\0';
+ *sp = p;
+ return(s);
+}
+#endif
+
+/* ******************************************************************** */
+
+
int ndpi_handle_rule(struct ndpi_detection_module_struct *ndpi_mod, char* rule, u_int8_t do_add) {
char *at, *proto, *elem;
ndpi_proto_defaults_t *def;