From 67c512c3ef1b1889e0aeff5d7616bacdd1cdbcbb Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Sat, 8 Oct 2022 21:23:38 -0300 Subject: [PATCH] internet, sixlowpan: use win32-internet.h as an alternative to netinet/in.h and sys/socket.h --- src/internet/model/ipv4-raw-socket-impl.cc | 5 ++++ src/internet/model/ipv6-raw-socket-impl.cc | 5 ++++ src/internet/test/ipv4-fragmentation-test.cc | 7 ++++- src/internet/test/ipv4-header-test.cc | 9 ++++-- src/internet/test/ipv4-raw-test.cc | 9 ++++-- src/internet/test/ipv6-fragmentation-test.cc | 30 +++++++++++-------- src/internet/test/ipv6-raw-test.cc | 9 ++++-- .../test/sixlowpan-fragmentation-test.cc | 7 ++++- 8 files changed, 60 insertions(+), 21 deletions(-) diff --git a/src/internet/model/ipv4-raw-socket-impl.cc b/src/internet/model/ipv4-raw-socket-impl.cc index 150814223..e49a64fa1 100644 --- a/src/internet/model/ipv4-raw-socket-impl.cc +++ b/src/internet/model/ipv4-raw-socket-impl.cc @@ -12,8 +12,13 @@ #include "ns3/packet.h" #include "ns3/uinteger.h" +#ifdef __WIN32__ +#include "ns3/win32-internet.h" +#else #include #include +#endif + #include namespace ns3 diff --git a/src/internet/model/ipv6-raw-socket-impl.cc b/src/internet/model/ipv6-raw-socket-impl.cc index 72a866623..b0720553c 100644 --- a/src/internet/model/ipv6-raw-socket-impl.cc +++ b/src/internet/model/ipv6-raw-socket-impl.cc @@ -33,8 +33,13 @@ #include "ns3/packet.h" #include "ns3/uinteger.h" +#ifdef __WIN32__ +#include "ns3/win32-internet.h" +#else #include #include +#endif + #include namespace ns3 diff --git a/src/internet/test/ipv4-fragmentation-test.cc b/src/internet/test/ipv4-fragmentation-test.cc index a4b080429..3a165a8f5 100644 --- a/src/internet/test/ipv4-fragmentation-test.cc +++ b/src/internet/test/ipv4-fragmentation-test.cc @@ -45,8 +45,13 @@ #include "ns3/udp-socket.h" #include "ns3/uinteger.h" -#include +#ifdef __WIN32__ +#include "ns3/win32-internet.h" +#else #include +#endif + +#include #include using namespace ns3; diff --git a/src/internet/test/ipv4-header-test.cc b/src/internet/test/ipv4-header-test.cc index afbc3ccf1..f6f6c335b 100644 --- a/src/internet/test/ipv4-header-test.cc +++ b/src/internet/test/ipv4-header-test.cc @@ -38,11 +38,16 @@ #include "ns3/test.h" #include "ns3/traffic-control-layer.h" -#include +#ifdef __WIN32__ +#include "ns3/win32-internet.h" +#else #include +#include +#endif + +#include #include #include -#include #include using namespace ns3; diff --git a/src/internet/test/ipv4-raw-test.cc b/src/internet/test/ipv4-raw-test.cc index 333595a49..242d66d36 100644 --- a/src/internet/test/ipv4-raw-test.cc +++ b/src/internet/test/ipv4-raw-test.cc @@ -40,10 +40,15 @@ #include "ns3/socket.h" #include "ns3/test.h" -#include +#ifdef __WIN32__ +#include "ns3/win32-internet.h" +#else #include -#include #include +#endif + +#include +#include #include using namespace ns3; diff --git a/src/internet/test/ipv6-fragmentation-test.cc b/src/internet/test/ipv6-fragmentation-test.cc index ff74f0700..52dafa401 100644 --- a/src/internet/test/ipv6-fragmentation-test.cc +++ b/src/internet/test/ipv6-fragmentation-test.cc @@ -23,11 +23,20 @@ * This is the test code for ipv6-l3protocol.cc (only the fragmentation and reassembly part). */ +#include "ns3/arp-l3-protocol.h" #include "ns3/boolean.h" #include "ns3/config.h" +#include "ns3/error-channel.h" +#include "ns3/icmpv4-l4-protocol.h" +#include "ns3/icmpv6-l4-protocol.h" #include "ns3/inet-socket-address.h" #include "ns3/inet6-socket-address.h" +#include "ns3/internet-stack-helper.h" +#include "ns3/ipv4-l3-protocol.h" +#include "ns3/ipv4-list-routing.h" #include "ns3/ipv4-raw-socket-factory.h" +#include "ns3/ipv4-static-routing.h" +#include "ns3/ipv6-l3-protocol.h" #include "ns3/ipv6-list-routing.h" #include "ns3/ipv6-raw-socket-factory.h" #include "ns3/ipv6-static-routing.h" @@ -38,24 +47,19 @@ #include "ns3/socket-factory.h" #include "ns3/socket.h" #include "ns3/test.h" +#include "ns3/traffic-control-layer.h" +#include "ns3/udp-l4-protocol.h" #include "ns3/udp-socket-factory.h" #include "ns3/udp-socket.h" #include "ns3/uinteger.h" -# -#include "ns3/arp-l3-protocol.h" -#include "ns3/error-channel.h" -#include "ns3/icmpv4-l4-protocol.h" -#include "ns3/icmpv6-l4-protocol.h" -#include "ns3/internet-stack-helper.h" -#include "ns3/ipv4-l3-protocol.h" -#include "ns3/ipv4-list-routing.h" -#include "ns3/ipv4-static-routing.h" -#include "ns3/ipv6-l3-protocol.h" -#include "ns3/traffic-control-layer.h" -#include "ns3/udp-l4-protocol.h" + +#ifdef __WIN32__ +#include "ns3/win32-internet.h" +#else +#include +#endif #include -#include #include using namespace ns3; diff --git a/src/internet/test/ipv6-raw-test.cc b/src/internet/test/ipv6-raw-test.cc index 755d6119d..9ba59ae1b 100644 --- a/src/internet/test/ipv6-raw-test.cc +++ b/src/internet/test/ipv6-raw-test.cc @@ -42,10 +42,15 @@ #include "ns3/test.h" #include "ns3/uinteger.h" -#include +#ifdef __WIN32__ +#include "ns3/win32-internet.h" +#else #include -#include #include +#endif + +#include +#include #include using namespace ns3; diff --git a/src/sixlowpan/test/sixlowpan-fragmentation-test.cc b/src/sixlowpan/test/sixlowpan-fragmentation-test.cc index 8702a89a2..0b0efb484 100644 --- a/src/sixlowpan/test/sixlowpan-fragmentation-test.cc +++ b/src/sixlowpan/test/sixlowpan-fragmentation-test.cc @@ -36,8 +36,13 @@ #include "ns3/udp-socket.h" #include "ns3/uinteger.h" -#include +#ifdef __WIN32__ +#include "ns3/win32-internet.h" +#else #include +#endif + +#include #include using namespace ns3;