aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2015-10-12 09:15:02 +0200
committerLuca Deri <deri@ntop.org>2015-10-12 09:15:02 +0200
commit247acce949e6647892f745248fa46d1264eb3d90 (patch)
treea14a2237b74cfed4fb0cce439a8d0ef1fb0b3e8b
parent91b2e0bff2e233c006c347ea3186725f2f597879 (diff)
Simplified IPv6 typedefs
-rw-r--r--example/ndpiReader.c4
-rw-r--r--src/include/linux_compat.h33
2 files changed, 7 insertions, 30 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index 71bb1f352..91e98b2f4 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -917,8 +917,8 @@ static struct ndpi_flow *get_ndpi_flow6(u_int16_t thread_id,
memset(&iph, 0, sizeof(iph));
iph.version = 4;
- iph.saddr = iph6->ip6_src.__u6_addr.__u6_addr32[2] + iph6->ip6_src.__u6_addr.__u6_addr32[3];
- iph.daddr = iph6->ip6_dst.__u6_addr.__u6_addr32[2] + iph6->ip6_dst.__u6_addr.__u6_addr32[3];
+ iph.saddr = iph6->ip6_src.u6_addr.u6_addr32[2] + iph6->ip6_src.u6_addr.u6_addr32[3];
+ iph.daddr = iph6->ip6_dst.u6_addr.u6_addr32[2] + iph6->ip6_dst.u6_addr.u6_addr32[3];
iph.protocol = iph6->ip6_ctlun.ip6_un1.ip6_un1_nxt;
if(iph.protocol == 0x3C /* IPv6 destination option */) {
diff --git a/src/include/linux_compat.h b/src/include/linux_compat.h
index 0497b31d0..4f7b3cd00 100644
--- a/src/include/linux_compat.h
+++ b/src/include/linux_compat.h
@@ -164,28 +164,11 @@ typedef uint u_int32_t;
/* Already defined in WS2tcpip.h */
struct ndpi_win_in6_addr
{
- union
- {
+ union {
u_int8_t u6_addr8[16];
u_int16_t u6_addr16[8];
u_int32_t u6_addr32[4];
} in6_u;
-#ifdef s6_addr
-#undef s6_addr
-#endif
-
-#ifdef s6_addr16
-#undef s6_addr16
-#endif
-
-#ifdef s6_addr32
-#undef s6_addr32
-#endif
-
-#define s6_addr in6_u.u6_addr8
- // #define s6_addr16 in6_u.u6_addr16
- // #define s6_addr32 in6_u.u6_addr32
-
};
#define in6_addr win_in6_addr
@@ -208,18 +191,12 @@ struct ndpi_ip6_ext
struct ndpi_in6_addr {
union {
- u_int8_t __u6_addr8[16];
- u_int16_t __u6_addr16[8];
- u_int32_t __u6_addr32[4];
- } __u6_addr; /* 128-bit IP6 address */
+ u_int8_t u6_addr8[16];
+ u_int16_t u6_addr16[8];
+ u_int32_t u6_addr32[4];
+ } u6_addr; /* 128-bit IP6 address */
};
-#undef s6_addr
-#undef s6_addr16
-#undef s6_addr32
-#define s6_addr __u6_addr.__u6_addr8
-#define s6_addr16 __u6_addr.__u6_addr16
-#define s6_addr32 __u6_addr.__u6_addr32
struct ndpi_ip6_hdr {
union {