From cb68d4d00a22f6c367b4b18a35bd827ae2609d09 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Thu, 26 Nov 2015 23:47:55 +0100 Subject: Win32 compilation fixes --- src/lib/ndpi_main.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/lib/ndpi_main.c') 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; -- cgit v1.2.3