diff options
author | Luca Deri <deri@ntop.org> | 2021-02-24 11:04:04 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2021-02-24 11:04:04 +0100 |
commit | 545f2701327597bed074dad55d9b3baa4a3e2e14 (patch) | |
tree | 7aa6caa9c5cd1cd3305331f7bbc416b248df45a5 /src/lib/third_party | |
parent | 4bd175b07eb67ff2ce435c76302dcf51d969872b (diff) |
Windows code cleanup
Diffstat (limited to 'src/lib/third_party')
-rw-r--r-- | src/lib/third_party/src/ndpi_patricia.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/lib/third_party/src/ndpi_patricia.c b/src/lib/third_party/src/ndpi_patricia.c index 7035bf797..01138d681 100644 --- a/src/lib/third_party/src/ndpi_patricia.c +++ b/src/lib/third_party/src/ndpi_patricia.c @@ -122,10 +122,8 @@ static int ndpi_my_inet_pton (int af, const char *src, void *dst) } memcpy (dst, xp, sizeof(struct in_addr)); return (1); -#if defined(NDPI_PATRICIA_IPV6) } else if(af == AF_INET6) { return (inet_pton (af, src, dst)); -#endif /* NDPI_PATRICIA_IPV6 */ } else { #ifndef NT errno = EAFNOSUPPORT; @@ -182,7 +180,6 @@ static char * ndpi_prefix_toa2x (ndpi_prefix_t *prefix, char *buff, int with_len } return (buff); } -#if defined(NDPI_PATRICIA_IPV6) else if(prefix->family == AF_INET6) { char *r; r = (char *) inet_ntop (AF_INET6, &prefix->add.sin6, buff, 48 /* a guess value */ ); @@ -192,7 +189,6 @@ static char * ndpi_prefix_toa2x (ndpi_prefix_t *prefix, char *buff, int with_len } return (buff); } -#endif /* NDPI_PATRICIA_IPV6 */ else return (NULL); } @@ -218,7 +214,6 @@ static ndpi_prefix_t * ndpi_New_Prefix2 (int family, void *dest, int bitlen, ndp int dynamic_allocated = 0; int default_bitlen = sizeof(struct in_addr) * 8; -#if defined(NDPI_PATRICIA_IPV6) if(family == AF_INET6) { default_bitlen = sizeof(struct in6_addr) * 8; if(prefix == NULL) { @@ -228,7 +223,6 @@ static ndpi_prefix_t * ndpi_New_Prefix2 (int family, void *dest, int bitlen, ndp memcpy (&prefix->add.sin6, dest, sizeof(struct in6_addr)); } else -#endif /* NDPI_PATRICIA_IPV6 */ if(family == AF_INET) { if(prefix == NULL) { #ifndef NT @@ -972,9 +966,7 @@ static ndpi_prefix_t * ndpi_ascii2prefix (int family, char *string) long maxbitlen = 0; char *cp; struct in_addr sin; -#if defined(NDPI_PATRICIA_IPV6) struct in6_addr sin6; -#endif /* NDPI_PATRICIA_IPV6 */ char save[MAXLINE]; if(string == NULL) @@ -983,19 +975,15 @@ static ndpi_prefix_t * ndpi_ascii2prefix (int family, char *string) /* easy way to handle both families */ if(family == 0) { family = AF_INET; -#if defined(NDPI_PATRICIA_IPV6) if(strchr (string, ':')) family = AF_INET6; -#endif /* NDPI_PATRICIA_IPV6 */ } if(family == AF_INET) { maxbitlen = sizeof(struct in_addr) * 8; } -#if defined(NDPI_PATRICIA_IPV6) else if(family == AF_INET6) { maxbitlen = sizeof(struct in6_addr) * 8; } -#endif /* NDPI_PATRICIA_IPV6 */ if((cp = strchr (string, '/')) != NULL) { bitlen = atol (cp + 1); @@ -1016,8 +1004,6 @@ static ndpi_prefix_t * ndpi_ascii2prefix (int family, char *string) return (NULL); return (ndpi_New_Prefix (AF_INET, &sin, bitlen)); } - -#if defined(NDPI_PATRICIA_IPV6) else if(family == AF_INET6) { // Get rid of this with next IPv6 upgrade #if defined(NT) && !defined(HAVE_INET_NTOP) @@ -1029,7 +1015,6 @@ static ndpi_prefix_t * ndpi_ascii2prefix (int family, char *string) #endif /* NT */ return (ndpi_New_Prefix (AF_INET6, &sin6, bitlen)); } -#endif /* NDPI_PATRICIA_IPV6 */ else return (NULL); } |