diff --git a/CMakeLists.txt b/CMakeLists.txt index 2acdef6..d0ad24f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,17 @@ IF(LIBTINS_ENABLE_DOT11) ENDIF(LIBTINS_ENABLE_WPA2) ENDIF(LIBTINS_ENABLE_DOT11) +# Optionally enable TCPIP classes (on by default) +OPTION(LIBTINS_ENABLE_TCPIP "Enable TCPIP classes" ON) +IF(LIBTINS_ENABLE_TCPIP AND TINS_HAVE_CXX11) + SET(TINS_HAVE_TCPIP ON) + MESSAGE(STATUS "Enabling TCPIP classes") +ELSE() + SET(TINS_HAVE_TCPIP OFF) + MESSAGE(STATUS "Disabling TCPIP classes") +ENDIF() + +# Optionally enable the ACK tracker (on by default) OPTION(LIBTINS_ENABLE_ACK_TRACKER "Enable TCP ACK tracking support" ON) IF(LIBTINS_ENABLE_ACK_TRACKER AND TINS_HAVE_CXX11) FIND_PACKAGE(Boost) diff --git a/include/tins/config.h.in b/include/tins/config.h.in index b930a41..29b2624 100644 --- a/include/tins/config.h.in +++ b/include/tins/config.h.in @@ -13,6 +13,9 @@ /* Use pcap_sendpacket to send l2 packets */ #cmakedefine TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET +/* Have TCPIP classes */ +#cmakedefine TINS_HAVE_TCPIP + /* Have TCP ACK tracking */ #cmakedefine TINS_HAVE_ACK_TRACKER diff --git a/include/tins/tcp_ip/flow.h b/include/tins/tcp_ip/flow.h index 9c48cd1..5ea03dd 100644 --- a/include/tins/tcp_ip/flow.h +++ b/include/tins/tcp_ip/flow.h @@ -30,10 +30,9 @@ #ifndef TINS_TCP_IP_FLOW_H #define TINS_TCP_IP_FLOW_H -#include "../cxxstd.h" +#include "../config.h" -// This classes use C++11 features -#if TINS_IS_CXX11 +#ifdef TINS_HAVE_TCPIP #include #include @@ -331,6 +330,6 @@ private: } // TCPIP } // TINS -#endif // TINS_IS_CXX11 +#endif // TINS_HAVE_TCPIP #endif // TINS_TCP_IP_FLOW_H diff --git a/include/tins/tcp_ip/stream.h b/include/tins/tcp_ip/stream.h index e55928c..895ba68 100644 --- a/include/tins/tcp_ip/stream.h +++ b/include/tins/tcp_ip/stream.h @@ -30,10 +30,9 @@ #ifndef TINS_TCP_IP_STREAM_H #define TINS_TCP_IP_STREAM_H -#include "../cxxstd.h" +#include "../config.h" -// This classes use C++11 features -#if TINS_IS_CXX11 +#ifdef TINS_HAVE_TCPIP #include #include @@ -393,6 +392,6 @@ private: } // TCPIP } // Tins -#endif // TINS_IS_CXX11 +#endif // TINS_HAVE_TCPIP #endif // TINS_TCP_IP_STREAM_H diff --git a/include/tins/tcp_ip/stream_follower.h b/include/tins/tcp_ip/stream_follower.h index b7e0768..4c2de9c 100644 --- a/include/tins/tcp_ip/stream_follower.h +++ b/include/tins/tcp_ip/stream_follower.h @@ -30,10 +30,9 @@ #ifndef TINS_TCP_IP_STREAM_FOLLOWER_H #define TINS_TCP_IP_STREAM_FOLLOWER_H -#include "../cxxstd.h" +#include "../config.h" -// This classes use C++11 features -#if TINS_IS_CXX11 +#ifdef TINS_HAVE_TCPIP #include #include "stream.h" @@ -210,6 +209,6 @@ private: } // TCPIP } // Tins -#endif // TINS_IS_CXX11 +#endif // TINS_HAVE_TCPIP #endif // TINS_TCP_IP_STREAM_FOLLOWER_H diff --git a/include/tins/tcp_ip/stream_identifier.h b/include/tins/tcp_ip/stream_identifier.h index a2558cc..96603c7 100644 --- a/include/tins/tcp_ip/stream_identifier.h +++ b/include/tins/tcp_ip/stream_identifier.h @@ -30,10 +30,9 @@ #ifndef TINS_TCP_IP_STREAM_ID_H #define TINS_TCP_IP_STREAM_ID_H -#include "../cxxstd.h" +#include "../config.h" -// This classes use C++11 features -#if TINS_IS_CXX11 +#ifdef TINS_HAVE_TCPIP #include #include @@ -100,6 +99,6 @@ struct StreamIdentifier { } // TCPIP } // Tins -#endif // TINS_IS_CXX11 +#endif // TINS_HAVE_TCPIP #endif // TINS_TCP_IP_STREAM_ID_H diff --git a/src/tcp_ip/flow.cpp b/src/tcp_ip/flow.cpp index 1bc7d0a..9c415c2 100644 --- a/src/tcp_ip/flow.cpp +++ b/src/tcp_ip/flow.cpp @@ -29,7 +29,7 @@ #include "tcp_ip/flow.h" -#if TINS_IS_CXX11 +#ifdef TINS_HAVE_TCPIP #include #include diff --git a/src/tcp_ip/stream.cpp b/src/tcp_ip/stream.cpp index d0910e5..f1966da 100644 --- a/src/tcp_ip/stream.cpp +++ b/src/tcp_ip/stream.cpp @@ -29,7 +29,7 @@ #include "tcp_ip/stream.h" -#if TINS_IS_CXX11 +#ifdef TINS_HAVE_TCPIP #include #include @@ -307,4 +307,4 @@ void Stream::on_server_out_of_order(const Flow& flow, } // TCPIP } // Tins -#endif // TINS_IS_CXX11 +#endif // TINS_HAVE_TCPIP diff --git a/src/tcp_ip/stream_follower.cpp b/src/tcp_ip/stream_follower.cpp index 904b378..89383ec 100644 --- a/src/tcp_ip/stream_follower.cpp +++ b/src/tcp_ip/stream_follower.cpp @@ -29,7 +29,7 @@ #include "tcp_ip/stream_follower.h" -#if TINS_IS_CXX11 +#ifdef TINS_HAVE_TCPIP #include #include @@ -203,4 +203,4 @@ void StreamFollower::cleanup_streams(const timestamp_type& now) { } // TCPIP } // Tins -#endif // TINS_IS_CXX11 +#endif // TINS_HAVE_TCPIP diff --git a/src/tcp_ip/stream_identifier.cpp b/src/tcp_ip/stream_identifier.cpp index d2dd524..6f0cf8d 100644 --- a/src/tcp_ip/stream_identifier.cpp +++ b/src/tcp_ip/stream_identifier.cpp @@ -29,7 +29,7 @@ #include "tcp_ip/stream_identifier.h" -#if TINS_IS_CXX11 +#ifdef TINS_HAVE_TCPIP #include #include @@ -128,4 +128,4 @@ StreamIdentifier::address_type StreamIdentifier::serialize(const IPv6Address& ad } // TCPIP } // Tins -#endif // TINS_IS_CXX11 +#endif // TINS_HAVE_TCPIP diff --git a/tests/src/tcp_ip.cpp b/tests/src/tcp_ip.cpp index 97a73e5..be53c20 100644 --- a/tests/src/tcp_ip.cpp +++ b/tests/src/tcp_ip.cpp @@ -1,7 +1,7 @@ -#include "cxxstd.h" +#include "config.h" #include -#if TINS_IS_CXX11 +#ifdef TINS_HAVE_TCPIP #include #include @@ -714,4 +714,4 @@ TEST(Foo, Dummy) { } -#endif // TINS_IS_CXX11 +#endif // TINS_HAVE_TCPIP