Win32 fixes
This commit is contained in:
+2
-3
@@ -1,7 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
|
||||||
# 1.5.1 r8171 06/09/2014
|
/bin/rm -f configure config.h config.h.in src/lib/Makefile.in
|
||||||
#
|
|
||||||
autoreconf -ivf
|
autoreconf -ivf
|
||||||
./configure
|
./configure
|
||||||
|
|||||||
+2
-2
@@ -95,7 +95,7 @@ libndpi_la_SOURCES = ndpi_content_match.c.inc \
|
|||||||
protocols/quake.c \
|
protocols/quake.c \
|
||||||
protocols/radius.c \
|
protocols/radius.c \
|
||||||
protocols/rdp.c \
|
protocols/rdp.c \
|
||||||
protocols/redis.c \
|
protocols/redis_net.c \
|
||||||
protocols/rsync.c \
|
protocols/rsync.c \
|
||||||
protocols/rtcp.c \
|
protocols/rtcp.c \
|
||||||
protocols/rtmp.c \
|
protocols/rtmp.c \
|
||||||
@@ -148,7 +148,7 @@ libndpi_la_SOURCES = ndpi_content_match.c.inc \
|
|||||||
protocols/xdmcp.c \
|
protocols/xdmcp.c \
|
||||||
protocols/yahoo.c \
|
protocols/yahoo.c \
|
||||||
protocols/zattoo.c \
|
protocols/zattoo.c \
|
||||||
protocols/zmq.c \
|
protocols/zeromq.c \
|
||||||
third_party/include/actypes.h \
|
third_party/include/actypes.h \
|
||||||
third_party/include/ahocorasick.h \
|
third_party/include/ahocorasick.h \
|
||||||
third_party/include/node.h \
|
third_party/include/node.h \
|
||||||
|
|||||||
+6
-2
@@ -41,7 +41,11 @@
|
|||||||
#ifndef _PATRICIA_H
|
#ifndef _PATRICIA_H
|
||||||
#define _PATRICIA_H
|
#define _PATRICIA_H
|
||||||
|
|
||||||
#define HAVE_IPV6
|
#ifndef WIN32
|
||||||
|
#define PATRICIA_IPV6 HAVE_IPV6
|
||||||
|
#else
|
||||||
|
#define PATRICIA_IPV6 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/* typedef unsigned int u_int; */
|
/* typedef unsigned int u_int; */
|
||||||
/* { from defs.h */
|
/* { from defs.h */
|
||||||
@@ -94,7 +98,7 @@ typedef struct the_prefix_t {
|
|||||||
int ref_count; /* reference count */
|
int ref_count; /* reference count */
|
||||||
union {
|
union {
|
||||||
struct in_addr sin;
|
struct in_addr sin;
|
||||||
#ifdef HAVE_IPV6
|
#ifdef PATRICIA_IPV6
|
||||||
struct in6_addr sin6;
|
struct in6_addr sin6;
|
||||||
#endif /* IPV6 */
|
#endif /* IPV6 */
|
||||||
} add;
|
} add;
|
||||||
|
|||||||
Vendored
+17
-16
@@ -60,6 +60,7 @@
|
|||||||
|
|
||||||
#include "patricia.h"
|
#include "patricia.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
|
|
||||||
long atol(const char *nptr) {
|
long atol(const char *nptr) {
|
||||||
@@ -125,12 +126,12 @@ inet_pton (int af, const char *src, void *dst)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef NT
|
#ifdef NT
|
||||||
#if defined(HAVE_IPV6) && (!defined(__KERNEL__))
|
#if defined(PATRICIA_IPV6) && (!defined(__KERNEL__))
|
||||||
else if(af == AF_INET6) {
|
else if(af == AF_INET6) {
|
||||||
struct in6_addr Address;
|
struct in6_addr Address;
|
||||||
return (inet6_addr(src, &Address));
|
return (inet6_addr(src, &Address));
|
||||||
}
|
}
|
||||||
#endif /* HAVE_IPV6 */
|
#endif /* PATRICIA_IPV6 */
|
||||||
#endif /* NT */
|
#endif /* NT */
|
||||||
#ifndef NT
|
#ifndef NT
|
||||||
else {
|
else {
|
||||||
@@ -174,10 +175,10 @@ ndpi_my_inet_pton (int af, const char *src, void *dst)
|
|||||||
}
|
}
|
||||||
memcpy (dst, xp, sizeof(struct in_addr));
|
memcpy (dst, xp, sizeof(struct in_addr));
|
||||||
return (1);
|
return (1);
|
||||||
#if defined(HAVE_IPV6) && (!defined(__KERNEL__))
|
#if defined(PATRICIA_IPV6) && (!defined(__KERNEL__))
|
||||||
} else if(af == AF_INET6) {
|
} else if(af == AF_INET6) {
|
||||||
return (inet_pton (af, src, dst));
|
return (inet_pton (af, src, dst));
|
||||||
#endif /* HAVE_IPV6 */
|
#endif /* PATRICIA_IPV6 */
|
||||||
} else {
|
} else {
|
||||||
#ifndef NT
|
#ifndef NT
|
||||||
#ifndef __KERNEL__
|
#ifndef __KERNEL__
|
||||||
@@ -235,7 +236,7 @@ ndpi_ndpi_prefix_toa2x (prefix_t *prefix, char *buff, int with_len)
|
|||||||
}
|
}
|
||||||
return (buff);
|
return (buff);
|
||||||
}
|
}
|
||||||
#if defined(HAVE_IPV6) && (!defined(__KERNEL__))
|
#if defined(PATRICIA_IPV6) && (!defined(__KERNEL__))
|
||||||
else if(prefix->family == AF_INET6) {
|
else if(prefix->family == AF_INET6) {
|
||||||
char *r;
|
char *r;
|
||||||
r = (char *) inet_ntop (AF_INET6, &prefix->add.sin6, buff, 48 /* a guess value */ );
|
r = (char *) inet_ntop (AF_INET6, &prefix->add.sin6, buff, 48 /* a guess value */ );
|
||||||
@@ -245,7 +246,7 @@ ndpi_ndpi_prefix_toa2x (prefix_t *prefix, char *buff, int with_len)
|
|||||||
}
|
}
|
||||||
return (buff);
|
return (buff);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_IPV6 */
|
#endif /* PATRICIA_IPV6 */
|
||||||
else
|
else
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@@ -273,7 +274,7 @@ ndpi_New_Prefix2 (int family, void *dest, int bitlen, prefix_t *prefix)
|
|||||||
int dynamic_allocated = 0;
|
int dynamic_allocated = 0;
|
||||||
int default_bitlen = sizeof(struct in_addr) * 8;
|
int default_bitlen = sizeof(struct in_addr) * 8;
|
||||||
|
|
||||||
#if defined(HAVE_IPV6) && (!defined(__KERNEL__))
|
#if defined(PATRICIA_IPV6) && (!defined(__KERNEL__))
|
||||||
if(family == AF_INET6) {
|
if(family == AF_INET6) {
|
||||||
default_bitlen = sizeof(struct in6_addr) * 8;
|
default_bitlen = sizeof(struct in6_addr) * 8;
|
||||||
if(prefix == NULL) {
|
if(prefix == NULL) {
|
||||||
@@ -283,7 +284,7 @@ ndpi_New_Prefix2 (int family, void *dest, int bitlen, prefix_t *prefix)
|
|||||||
memcpy (&prefix->add.sin6, dest, sizeof(struct in6_addr));
|
memcpy (&prefix->add.sin6, dest, sizeof(struct in6_addr));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* HAVE_IPV6 */
|
#endif /* PATRICIA_IPV6 */
|
||||||
if(family == AF_INET) {
|
if(family == AF_INET) {
|
||||||
if(prefix == NULL) {
|
if(prefix == NULL) {
|
||||||
#ifndef NT
|
#ifndef NT
|
||||||
@@ -327,9 +328,9 @@ ndpi_ascii2prefix (int family, char *string)
|
|||||||
long maxbitlen = 0;
|
long maxbitlen = 0;
|
||||||
char *cp;
|
char *cp;
|
||||||
struct in_addr sin;
|
struct in_addr sin;
|
||||||
#if defined(HAVE_IPV6) && (!defined(__KERNEL__))
|
#if defined(PATRICIA_IPV6) && (!defined(__KERNEL__))
|
||||||
struct in6_addr sin6;
|
struct in6_addr sin6;
|
||||||
#endif /* HAVE_IPV6 */
|
#endif /* PATRICIA_IPV6 */
|
||||||
char save[MAXLINE];
|
char save[MAXLINE];
|
||||||
|
|
||||||
if(string == NULL)
|
if(string == NULL)
|
||||||
@@ -338,19 +339,19 @@ ndpi_ascii2prefix (int family, char *string)
|
|||||||
/* easy way to handle both families */
|
/* easy way to handle both families */
|
||||||
if(family == 0) {
|
if(family == 0) {
|
||||||
family = AF_INET;
|
family = AF_INET;
|
||||||
#if defined(HAVE_IPV6) && (!defined(__KERNEL__))
|
#if defined(PATRICIA_IPV6) && (!defined(__KERNEL__))
|
||||||
if(strchr (string, ':')) family = AF_INET6;
|
if(strchr (string, ':')) family = AF_INET6;
|
||||||
#endif /* HAVE_IPV6 */
|
#endif /* PATRICIA_IPV6 */
|
||||||
}
|
}
|
||||||
|
|
||||||
if(family == AF_INET) {
|
if(family == AF_INET) {
|
||||||
maxbitlen = sizeof(struct in_addr) * 8;
|
maxbitlen = sizeof(struct in_addr) * 8;
|
||||||
}
|
}
|
||||||
#if defined(HAVE_IPV6) && (!defined(__KERNEL__))
|
#if defined(PATRICIA_IPV6) && (!defined(__KERNEL__))
|
||||||
else if(family == AF_INET6) {
|
else if(family == AF_INET6) {
|
||||||
maxbitlen = sizeof(struct in6_addr) * 8;
|
maxbitlen = sizeof(struct in6_addr) * 8;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_IPV6 */
|
#endif /* PATRICIA_IPV6 */
|
||||||
|
|
||||||
if((cp = strchr (string, '/')) != NULL) {
|
if((cp = strchr (string, '/')) != NULL) {
|
||||||
bitlen = atol (cp + 1);
|
bitlen = atol (cp + 1);
|
||||||
@@ -372,7 +373,7 @@ ndpi_ascii2prefix (int family, char *string)
|
|||||||
return (ndpi_New_Prefix (AF_INET, &sin, bitlen));
|
return (ndpi_New_Prefix (AF_INET, &sin, bitlen));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_IPV6) && (!defined(__KERNEL__))
|
#if defined(PATRICIA_IPV6) && (!defined(__KERNEL__))
|
||||||
else if(family == AF_INET6) {
|
else if(family == AF_INET6) {
|
||||||
// Get rid of this with next IPv6 upgrade
|
// Get rid of this with next IPv6 upgrade
|
||||||
#if defined(NT) && !defined(HAVE_INET_NTOP)
|
#if defined(NT) && !defined(HAVE_INET_NTOP)
|
||||||
@@ -384,7 +385,7 @@ ndpi_ascii2prefix (int family, char *string)
|
|||||||
#endif /* NT */
|
#endif /* NT */
|
||||||
return (ndpi_New_Prefix (AF_INET6, &sin6, bitlen));
|
return (ndpi_New_Prefix (AF_INET6, &sin6, bitlen));
|
||||||
}
|
}
|
||||||
#endif /* HAVE_IPV6 */
|
#endif /* PATRICIA_IPV6 */
|
||||||
else
|
else
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user