diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b0c71d..68b8fbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,7 +66,7 @@ INCLUDE(ExternalProject) INCLUDE(CheckCXXFeatures) IF(HAS_GCC_BUILTIN_SWAP) - SET(HAVE_GCC_BUILTIN_SWAP ON) + SET(TINS_HAVE_GCC_BUILTIN_SWAP ON) ENDIF() # C++11 support @@ -76,7 +76,7 @@ IF(LIBTINS_ENABLE_CXX11) # at least on VC2013 IF(HAS_CXX11_RVALUE_REFERENCES AND HAS_CXX11_FUNCTIONAL AND HAS_CXX11_CHRONO AND ((HAS_CXX11_DECLVAL AND HAS_CXX11_DECLTYPE) OR MSVC)) - SET(HAVE_CXX11 ON) + SET(TINS_HAVE_CXX11 ON) MESSAGE(STATUS "Enabling C++11 features") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_COMPILER_FLAGS}") ELSE() @@ -95,11 +95,11 @@ ENDIF(LIBTINS_ENABLE_CXX11) OPTION(LIBTINS_ENABLE_DOT11 "Compile libtins with IEEE 802.11 support" ON) OPTION(LIBTINS_ENABLE_WPA2 "Compile libtins with WPA2 decryption features (requires OpenSSL)" ON) IF(LIBTINS_ENABLE_DOT11) - SET(HAVE_DOT11 ON) + SET(TINS_HAVE_DOT11 ON) MESSAGE(STATUS "Enabling IEEE 802.11 support.") IF(LIBTINS_ENABLE_WPA2) FIND_PACKAGE(OpenSSL REQUIRED) - SET(HAVE_WPA2_DECRYPTION ON) + SET(TINS_HAVE_WPA2_DECRYPTION ON) MESSAGE(STATUS "Enabling WPA2 decryption support.") ELSE(LIBTINS_ENABLE_WPA2) MESSAGE(STATUS "Disabling WPA2 decryption support.") @@ -107,18 +107,18 @@ IF(LIBTINS_ENABLE_DOT11) ENDIF(LIBTINS_ENABLE_DOT11) OPTION(LIBTINS_ENABLE_ACK_TRACKER "Enable TCP ACK tracking support" ON) -IF(LIBTINS_ENABLE_ACK_TRACKER AND HAVE_CXX11) +IF(LIBTINS_ENABLE_ACK_TRACKER AND TINS_HAVE_CXX11) FIND_PACKAGE(Boost) IF (Boost_FOUND) MESSAGE(STATUS "Enabling TCP ACK tracking support.") INCLUDE_DIRECTORIES(Boost_INCLUDE_DIRS) - SET(HAVE_ACK_TRACKER ON) + SET(TINS_HAVE_ACK_TRACKER ON) ELSE() MESSAGE(WARNING "Disabling ACK tracking support as boost.icl was not found") - SET(HAVE_ACK_TRACKER OFF) + SET(TINS_HAVE_ACK_TRACKER OFF) ENDIF() ELSE() - SET(HAVE_ACK_TRACKER OFF) + SET(TINS_HAVE_ACK_TRACKER OFF) MESSAGE(STATUS "Disabling ACK tracking support") ENDIF() @@ -132,7 +132,7 @@ ENDIF(WIN32) OPTION(LIBTINS_USE_PCAP_SENDPACKET "Use pcap_sendpacket to send l2 packets" ${USE_PCAP_SENDPACKET_DEFAULT}) IF(LIBTINS_USE_PCAP_SENDPACKET) - SET(HAVE_PACKET_SENDER_PCAP_SENDPACKET ON) + SET(TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET ON) MESSAGE(STATUS "Using pcap_sendpacket to send l2 packets.") ENDIF(LIBTINS_USE_PCAP_SENDPACKET) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 2f9014d..cd98203 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -10,7 +10,7 @@ IF(libtins_FOUND) ) LINK_LIBRARIES(${LIBTINS_LIBRARIES}) - IF(HAVE_CXX11) + IF(TINS_HAVE_CXX11) SET(LIBTINS_CXX11_EXAMPLES arpmonitor dns_queries @@ -28,9 +28,9 @@ IF(libtins_FOUND) ELSE() MESSAGE(WARNING "Disabling HTTP requests example since boost.regex was not found") ENDIF() - ELSE(HAVE_CXX11) + ELSE(TINS_HAVE_CXX11) MESSAGE(WARNING "Disabling some examples since C++11 support is disabled.") - ENDIF(HAVE_CXX11) + ENDIF(TINS_HAVE_CXX11) ADD_CUSTOM_TARGET( examples DEPENDS @@ -43,7 +43,7 @@ IF(libtins_FOUND) ADD_EXECUTABLE(arpspoofing EXCLUDE_FROM_ALL arpspoofing.cpp) ADD_EXECUTABLE(route_table EXCLUDE_FROM_ALL route_table.cpp) - IF(HAVE_CXX11) + IF(TINS_HAVE_CXX11) ADD_EXECUTABLE(arpmonitor EXCLUDE_FROM_ALL arpmonitor.cpp) ADD_EXECUTABLE(dns_queries EXCLUDE_FROM_ALL dns_queries.cpp) ADD_EXECUTABLE(dns_spoof EXCLUDE_FROM_ALL dns_spoof.cpp) @@ -56,17 +56,17 @@ IF(libtins_FOUND) ADD_EXECUTABLE(http_requests EXCLUDE_FROM_ALL http_requests.cpp) TARGET_LINK_LIBRARIES(http_requests ${Boost_LIBRARIES}) ENDIF() - ENDIF(HAVE_CXX11) + ENDIF(TINS_HAVE_CXX11) ADD_EXECUTABLE(beacon_display EXCLUDE_FROM_ALL beacon_display.cpp) if(THREADS_FOUND) - IF(HAVE_CXX11) + IF(TINS_HAVE_CXX11) ADD_EXECUTABLE(traceroute EXCLUDE_FROM_ALL traceroute.cpp) ADD_EXECUTABLE(dns_stats EXCLUDE_FROM_ALL dns_stats.cpp) TARGET_LINK_LIBRARIES(traceroute ${CMAKE_THREAD_LIBS_INIT}) TARGET_LINK_LIBRARIES(dns_stats ${CMAKE_THREAD_LIBS_INIT}) - ENDIF(HAVE_CXX11) + ENDIF(TINS_HAVE_CXX11) IF(WIN32) MESSAGE(WARNING "Disabling portscan example since it doesn't compile on Windows.") ELSE() diff --git a/include/tins/config.h.in b/include/tins/config.h.in index 8fb34e8..2448adc 100644 --- a/include/tins/config.h.in +++ b/include/tins/config.h.in @@ -2,21 +2,21 @@ #define TINS_CONFIG_H /* Define if the compiler supports basic C++11 syntax */ -#cmakedefine HAVE_CXX11 +#cmakedefine TINS_HAVE_CXX11 /* Have IEEE 802.11 support */ -#cmakedefine HAVE_DOT11 +#cmakedefine TINS_HAVE_DOT11 /* Have WPA2 decryption library */ -#cmakedefine HAVE_WPA2_DECRYPTION +#cmakedefine TINS_HAVE_WPA2_DECRYPTION /* Use pcap_sendpacket to send l2 packets */ -#cmakedefine HAVE_PACKET_SENDER_PCAP_SENDPACKET +#cmakedefine TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET /* Have TCP ACK tracking */ -#cmakedefine HAVE_ACK_TRACKER +#cmakedefine TINS_HAVE_ACK_TRACKER /* Have GCC builtin swap */ -#cmakedefine HAVE_GCC_BUILTIN_SWAP +#cmakedefine TINS_HAVE_GCC_BUILTIN_SWAP #endif // TINS_CONFIG_H diff --git a/include/tins/crypto.h b/include/tins/crypto.h index 093cf6a..66d0037 100644 --- a/include/tins/crypto.h +++ b/include/tins/crypto.h @@ -29,7 +29,7 @@ #include "config.h" -#if !defined(TINS_CRYPTO_H) && defined(HAVE_DOT11) +#if !defined(TINS_CRYPTO_H) && defined(TINS_HAVE_DOT11) #define TINS_CRYPTO_H #include @@ -52,7 +52,7 @@ namespace Crypto { struct RC4Key; -#ifdef HAVE_WPA2_DECRYPTION +#ifdef TINS_HAVE_WPA2_DECRYPTION namespace WPA2 { /** @@ -165,7 +165,7 @@ private: }; } // WPA2 -#endif // HAVE_WPA2_DECRYPTION +#endif // TINS_HAVE_WPA2_DECRYPTION /** * \brief RC4 Key abstraction. @@ -240,7 +240,7 @@ private: std::vector key_buffer_; }; -#ifdef HAVE_WPA2_DECRYPTION +#ifdef TINS_HAVE_WPA2_DECRYPTION /** * \brief Decrypts WPA2-encrypted traffic. * @@ -382,7 +382,7 @@ private: bssids_map aps_; keys_map keys_; }; -#endif // HAVE_WPA2_DECRYPTION +#endif // TINS_HAVE_WPA2_DECRYPTION /** * \brief Pluggable decrypter object which can be used to decrypt @@ -459,7 +459,7 @@ void rc4(ForwardIterator start, ForwardIterator end, RC4Key& key, OutputIterator template DecrypterProxy make_wep_decrypter_proxy(const Functor& functor); -#ifdef HAVE_WPA2_DECRYPTION +#ifdef TINS_HAVE_WPA2_DECRYPTION /** * \brief Wrapper function to create a DecrypterProxy using a * WPA2Decrypter as the Decrypter template parameter. @@ -471,7 +471,7 @@ template DecrypterProxy make_wpa2_decrypter_proxy(const Functor& functor) { return DecrypterProxy(functor); } -#endif // HAVE_WPA2_DECRYPTION +#endif // TINS_HAVE_WPA2_DECRYPTION // Implementation section diff --git a/include/tins/cxxstd.h b/include/tins/cxxstd.h index 429d1b8..1a0b309 100644 --- a/include/tins/cxxstd.h +++ b/include/tins/cxxstd.h @@ -40,7 +40,7 @@ #define TINS_CXXSTD_GCC_FIX 0 #endif // __GXX_EXPERIMENTAL_CXX0X__ -#if !defined(TINS_IS_CXX11) && defined(HAVE_CXX11) +#if !defined(TINS_IS_CXX11) && defined(TINS_HAVE_CXX11) #define TINS_IS_CXX11 (__cplusplus > 199711L || TINS_CXXSTD_GCC_FIX == 1 || _MSC_VER >= 1800) #elif !defined(TINS_IS_CXX11) #define TINS_IS_CXX11 0 diff --git a/include/tins/dot11.h b/include/tins/dot11.h index 579e790..4e79832 100644 --- a/include/tins/dot11.h +++ b/include/tins/dot11.h @@ -29,7 +29,7 @@ #include "config.h" -#if !defined(TINS_DOT_11) && defined(HAVE_DOT11) +#if !defined(TINS_DOT_11) && defined(TINS_HAVE_DOT11) #define TINS_DOT_11 #include "dot11/dot11_base.h" diff --git a/include/tins/dot11/dot11_assoc.h b/include/tins/dot11/dot11_assoc.h index f6ae465..76fade8 100644 --- a/include/tins/dot11/dot11_assoc.h +++ b/include/tins/dot11/dot11_assoc.h @@ -29,7 +29,7 @@ #include "../config.h" -#if !defined(TINS_DOT11_DOT11_ASSOC_H) && defined(HAVE_DOT11) +#if !defined(TINS_DOT11_DOT11_ASSOC_H) && defined(TINS_HAVE_DOT11) #define TINS_DOT11_DOT11_ASSOC_H #include "../dot11/dot11_mgmt.h" diff --git a/include/tins/dot11/dot11_auth.h b/include/tins/dot11/dot11_auth.h index b71346a..f58f6a9 100644 --- a/include/tins/dot11/dot11_auth.h +++ b/include/tins/dot11/dot11_auth.h @@ -29,7 +29,7 @@ #include "../config.h" -#if !defined(TINS_DOT11_DOT11_AUTH_H) && defined(HAVE_DOT11) +#if !defined(TINS_DOT11_DOT11_AUTH_H) && defined(TINS_HAVE_DOT11) #define TINS_DOT11_DOT11_AUTH_H #include "../dot11/dot11_mgmt.h" diff --git a/include/tins/dot11/dot11_base.h b/include/tins/dot11/dot11_base.h index dd33a4e..c8091e4 100644 --- a/include/tins/dot11/dot11_base.h +++ b/include/tins/dot11/dot11_base.h @@ -29,7 +29,7 @@ #include "../config.h" -#if !defined(TINS_DOT11_DOT11_H) && defined(HAVE_DOT11) +#if !defined(TINS_DOT11_DOT11_H) && defined(TINS_HAVE_DOT11) #define TINS_DOT11_DOT11_H #include diff --git a/include/tins/dot11/dot11_beacon.h b/include/tins/dot11/dot11_beacon.h index c4ca35f..2edf7ee 100644 --- a/include/tins/dot11/dot11_beacon.h +++ b/include/tins/dot11/dot11_beacon.h @@ -29,7 +29,7 @@ #include "../config.h" -#if !defined(TINS_DOT11_DOT11_BEACON_H) && defined(HAVE_DOT11) +#if !defined(TINS_DOT11_DOT11_BEACON_H) && defined(TINS_HAVE_DOT11) #define TINS_DOT11_DOT11_BEACON_H #include "../dot11/dot11_mgmt.h" diff --git a/include/tins/dot11/dot11_control.h b/include/tins/dot11/dot11_control.h index 4305d71..2a421eb 100644 --- a/include/tins/dot11/dot11_control.h +++ b/include/tins/dot11/dot11_control.h @@ -29,7 +29,7 @@ #include "../config.h" -#if !defined(TINS_DOT11_DOT11_CONTROL_H) && defined(HAVE_DOT11) +#if !defined(TINS_DOT11_DOT11_CONTROL_H) && defined(TINS_HAVE_DOT11) #define TINS_DOT11_DOT11_CONTROL_H diff --git a/include/tins/dot11/dot11_data.h b/include/tins/dot11/dot11_data.h index 1a4cd55..5ecd9a9 100644 --- a/include/tins/dot11/dot11_data.h +++ b/include/tins/dot11/dot11_data.h @@ -29,7 +29,7 @@ #include "../config.h" -#if !defined(TINS_DOT11_DOT11_DATA_H) && defined(HAVE_DOT11) +#if !defined(TINS_DOT11_DOT11_DATA_H) && defined(TINS_HAVE_DOT11) #define TINS_DOT11_DOT11_DATA_H #include "../dot11/dot11_base.h" diff --git a/include/tins/dot11/dot11_mgmt.h b/include/tins/dot11/dot11_mgmt.h index 09ceeae..e1ae39a 100644 --- a/include/tins/dot11/dot11_mgmt.h +++ b/include/tins/dot11/dot11_mgmt.h @@ -29,7 +29,7 @@ #include "../config.h" -#if !defined(TINS_DOT11_DOT11_MGMT_H) && defined(HAVE_DOT11) +#if !defined(TINS_DOT11_DOT11_MGMT_H) && defined(TINS_HAVE_DOT11) #define TINS_DOT11_DOT11_MGMT_H diff --git a/include/tins/dot11/dot11_probe.h b/include/tins/dot11/dot11_probe.h index 3fe2133..fa7db64 100644 --- a/include/tins/dot11/dot11_probe.h +++ b/include/tins/dot11/dot11_probe.h @@ -29,7 +29,7 @@ #include "../config.h" -#if !defined(TINS_DOT11_DOT11_PROBE_H) && defined(HAVE_DOT11) +#if !defined(TINS_DOT11_DOT11_PROBE_H) && defined(TINS_HAVE_DOT11) #define TINS_DOT11_DOT11_PROBE_H diff --git a/include/tins/dot3.h b/include/tins/dot3.h index 2c46a22..a3225ab 100644 --- a/include/tins/dot3.h +++ b/include/tins/dot3.h @@ -145,12 +145,12 @@ public: */ uint32_t header_size() const; - #if !defined(_WIN32) || defined(HAVE_PACKET_SENDER_PCAP_SENDPACKET) + #if !defined(_WIN32) || defined(TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET) /** * \sa PDU::send() */ void send(PacketSender& sender, const NetworkInterface& iface); - #endif // !_WIN32 || HAVE_PACKET_SENDER_PCAP_SENDPACKET + #endif // !_WIN32 || TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET /** * \brief Check whether ptr points to a valid response for this PDU. diff --git a/include/tins/endianness.h b/include/tins/endianness.h index d2cc447..dad1c33 100644 --- a/include/tins/endianness.h +++ b/include/tins/endianness.h @@ -57,7 +57,7 @@ #define TINS_BYTE_SWAP_16(data) _byteswap_ushort(data) #define TINS_BYTE_SWAP_32(data) _byteswap_ulong(data) #define TINS_BYTE_SWAP_64(data) _byteswap_uint64(data) -#elif defined(HAVE_GCC_BUILTIN_SWAP) +#elif defined(TINS_HAVE_GCC_BUILTIN_SWAP) #define TINS_BYTE_SWAP_16(data) __builtin_bswap16(data) #define TINS_BYTE_SWAP_32(data) __builtin_bswap32(data) #define TINS_BYTE_SWAP_64(data) __builtin_bswap64(data) diff --git a/include/tins/handshake_capturer.h b/include/tins/handshake_capturer.h index 318a7e1..978a08d 100644 --- a/include/tins/handshake_capturer.h +++ b/include/tins/handshake_capturer.h @@ -29,7 +29,7 @@ #include "config.h" -#if !defined(TINS_HANDSHAKE_CAPTURER_H) && defined(HAVE_DOT11) +#if !defined(TINS_HANDSHAKE_CAPTURER_H) && defined(TINS_HAVE_DOT11) #define TINS_HANDSHAKE_CAPTURER_H #include diff --git a/include/tins/packet_sender.h b/include/tins/packet_sender.h index f3dea0e..9315b88 100644 --- a/include/tins/packet_sender.h +++ b/include/tins/packet_sender.h @@ -37,9 +37,9 @@ #include #include #include "config.h" -#ifdef HAVE_PACKET_SENDER_PCAP_SENDPACKET +#ifdef TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET #include -#endif // HAVE_PACKET_SENDER_PCAP_SENDPACKET +#endif // TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET #include "network_interface.h" #include "macros.h" #include "cxxstd.h" @@ -184,14 +184,14 @@ public: */ ~PacketSender(); - #if !defined(_WIN32) || defined(HAVE_PACKET_SENDER_PCAP_SENDPACKET) + #if !defined(_WIN32) || defined(TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET) /** * \brief Opens a layer 2 socket. * * If this operation fails, then a socket_open_error will be thrown. */ void open_l2_socket(const NetworkInterface& iface = NetworkInterface()); - #endif // !_WIN32 || defined(HAVE_PACKET_SENDER_PCAP_SENDPACKET) + #endif // !_WIN32 || defined(TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET) /** * \brief Opens a layer 3 socket, using the corresponding protocol @@ -324,7 +324,7 @@ public: #endif // _WIN32 - #if !defined(_WIN32) || defined(HAVE_PACKET_SENDER_PCAP_SENDPACKET) + #if !defined(_WIN32) || defined(TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET) /** * \brief Sends a level 2 PDU. * @@ -342,7 +342,7 @@ public: */ void send_l2(PDU& pdu, struct sockaddr* link_addr, uint32_t len_addr, const NetworkInterface& iface = NetworkInterface()); - #endif // !_WIN32 || HAVE_PACKET_SENDER_PCAP_SENDPACKET + #endif // !_WIN32 || TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET /** * \brief Receives a layer 3 PDU response to a previously sent PDU. @@ -393,9 +393,9 @@ private: void send(PDU& pdu, const NetworkInterface& iface) { static_cast(pdu).send(*this, iface); } - #ifdef HAVE_PACKET_SENDER_PCAP_SENDPACKET + #ifdef TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET pcap_t* make_pcap_handle(const NetworkInterface& iface) const; - #endif // HAVE_PACKET_SENDER_PCAP_SENDPACKET + #endif // TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET PDU* recv_match_loop(const std::vector& sockets, PDU& pdu, @@ -418,10 +418,10 @@ private: #if defined(BSD) || defined(__FreeBSD_kernel__) int buffer_size_; #endif // BSD - #ifdef HAVE_PACKET_SENDER_PCAP_SENDPACKET + #ifdef TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET typedef std::map PcapHandleMap; PcapHandleMap pcap_handles_; - #endif // HAVE_PACKET_SENDER_PCAP_SENDPACKET + #endif // TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET }; } // Tins diff --git a/include/tins/radiotap.h b/include/tins/radiotap.h index 9715d2b..a613512 100644 --- a/include/tins/radiotap.h +++ b/include/tins/radiotap.h @@ -29,7 +29,7 @@ #include "config.h" -#if !defined(TINS_RADIOTAP_H) && defined(HAVE_DOT11) +#if !defined(TINS_RADIOTAP_H) && defined(TINS_HAVE_DOT11) #define TINS_RADIOTAP_H #include "macros.h" diff --git a/include/tins/rsn_information.h b/include/tins/rsn_information.h index d814e92..359aad5 100644 --- a/include/tins/rsn_information.h +++ b/include/tins/rsn_information.h @@ -29,7 +29,7 @@ #include "config.h" -#if !defined(TINS_RSN_INFORMATION) && defined(HAVE_DOT11) +#if !defined(TINS_RSN_INFORMATION) && defined(TINS_HAVE_DOT11) #define TINS_RSN_INFORMATION #include diff --git a/include/tins/tcp_ip/ack_tracker.h b/include/tins/tcp_ip/ack_tracker.h index 4ff8c25..9453108 100644 --- a/include/tins/tcp_ip/ack_tracker.h +++ b/include/tins/tcp_ip/ack_tracker.h @@ -32,7 +32,7 @@ #include "../config.h" -#ifdef HAVE_ACK_TRACKER +#ifdef TINS_HAVE_ACK_TRACKER #include #include @@ -149,7 +149,7 @@ private: } // TCPIP } // Tins -#endif // HAVE_ACK_TRACKER +#endif // TINS_HAVE_ACK_TRACKER #endif // TINS_TCP_IP_ACK_TRACKER_H diff --git a/include/tins/tcp_ip/flow.h b/include/tins/tcp_ip/flow.h index 8b2845e..977247e 100644 --- a/include/tins/tcp_ip/flow.h +++ b/include/tins/tcp_ip/flow.h @@ -283,7 +283,7 @@ public: */ bool ack_tracking_enabled() const; - #ifdef HAVE_ACK_TRACKER + #ifdef TINS_HAVE_ACK_TRACKER /** * Retrieves the ACK tracker for this Flow (const) */ @@ -293,7 +293,7 @@ public: * Retrieves the ACK tracker for this Flow */ AckTracker& ack_tracker(); - #endif // HAVE_ACK_TRACKER + #endif // TINS_HAVE_ACK_TRACKER private: // Compress all flags into just one struct using bitfields struct flags { @@ -323,9 +323,9 @@ private: State state_; int mss_; flags flags_; - #ifdef HAVE_ACK_TRACKER + #ifdef TINS_HAVE_ACK_TRACKER AckTracker ack_tracker_; - #endif // HAVE_ACK_TRACKER + #endif // TINS_HAVE_ACK_TRACKER }; } // TCPIP diff --git a/src/crypto.cpp b/src/crypto.cpp index 69d2f1d..4dd9cfa 100644 --- a/src/crypto.cpp +++ b/src/crypto.cpp @@ -29,13 +29,13 @@ #include "crypto.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 -#ifdef HAVE_WPA2_DECRYPTION +#ifdef TINS_HAVE_WPA2_DECRYPTION #include #include #include -#endif // HAVE_WPA2_DECRYPTION +#endif // TINS_HAVE_WPA2_DECRYPTION #include "dot11/dot11_data.h" #include "dot11/dot11_beacon.h" #include "exceptions.h" @@ -130,7 +130,7 @@ PDU* WEPDecrypter::decrypt(RawPDU& raw, const string& password) { } } -#ifdef HAVE_WPA2_DECRYPTION +#ifdef TINS_HAVE_WPA2_DECRYPTION // WPA2Decrypter using WPA2::SessionKeys; @@ -629,9 +629,9 @@ bool WPA2Decrypter::decrypt(PDU& pdu) { return false; } -#endif // HAVE_WPA2_DECRYPTION +#endif // TINS_HAVE_WPA2_DECRYPTION } // namespace Crypto } // namespace Tins -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/src/dot11/dot11_assoc.cpp b/src/dot11/dot11_assoc.cpp index a6a0719..1bc1045 100644 --- a/src/dot11/dot11_assoc.cpp +++ b/src/dot11/dot11_assoc.cpp @@ -28,7 +28,7 @@ */ #include "dot11/dot11_assoc.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "memory_helpers.h" @@ -192,4 +192,4 @@ void Dot11ReAssocResponse::write_fixed_parameters(OutputMemoryStream& stream) { } // Tins -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/src/dot11/dot11_auth.cpp b/src/dot11/dot11_auth.cpp index d1bd4d3..7da33b0 100644 --- a/src/dot11/dot11_auth.cpp +++ b/src/dot11/dot11_auth.cpp @@ -28,7 +28,7 @@ */ #include "dot11/dot11_auth.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "memory_helpers.h" @@ -104,4 +104,4 @@ void Dot11Deauthentication::write_fixed_parameters(OutputMemoryStream& stream) { } // Tins -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/src/dot11/dot11_base.cpp b/src/dot11/dot11_base.cpp index 1ca9c58..f507bb1 100644 --- a/src/dot11/dot11_base.cpp +++ b/src/dot11/dot11_base.cpp @@ -29,7 +29,7 @@ #include "dot11/dot11_base.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include @@ -288,4 +288,4 @@ Dot11* Dot11::from_bytes(const uint8_t* buffer, uint32_t total_sz) { } // Tins -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/src/dot11/dot11_beacon.cpp b/src/dot11/dot11_beacon.cpp index 34fedd1..5c7753e 100644 --- a/src/dot11/dot11_beacon.cpp +++ b/src/dot11/dot11_beacon.cpp @@ -28,7 +28,7 @@ */ #include "dot11/dot11_beacon.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "memory_helpers.h" @@ -72,4 +72,4 @@ void Dot11Beacon::write_fixed_parameters(OutputMemoryStream& stream) { } // Tins -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/src/dot11/dot11_control.cpp b/src/dot11/dot11_control.cpp index 68ec1ca..39e51e4 100644 --- a/src/dot11/dot11_control.cpp +++ b/src/dot11/dot11_control.cpp @@ -28,7 +28,7 @@ */ #include "dot11/dot11_control.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "memory_helpers.h" @@ -251,4 +251,4 @@ uint32_t Dot11BlockAck::header_size() const { } // Tins -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/src/dot11/dot11_data.cpp b/src/dot11/dot11_data.cpp index 6b7f13b..c3fe1d5 100644 --- a/src/dot11/dot11_data.cpp +++ b/src/dot11/dot11_data.cpp @@ -28,7 +28,7 @@ */ #include "dot11/dot11_data.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "rawpdu.h" @@ -161,4 +161,4 @@ void Dot11QoSData::write_fixed_parameters(OutputMemoryStream& stream) { } // Tins -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/src/dot11/dot11_mgmt.cpp b/src/dot11/dot11_mgmt.cpp index fc558ab..54a3507 100644 --- a/src/dot11/dot11_mgmt.cpp +++ b/src/dot11/dot11_mgmt.cpp @@ -28,7 +28,7 @@ */ #include "dot11/dot11_mgmt.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "rsn_information.h" @@ -641,4 +641,4 @@ Dot11ManagementFrame::tim_type Dot11ManagementFrame::tim_type::from_option(const } // Tins -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/src/dot11/dot11_probe.cpp b/src/dot11/dot11_probe.cpp index 799c1ca..a29cc21 100644 --- a/src/dot11/dot11_probe.cpp +++ b/src/dot11/dot11_probe.cpp @@ -29,7 +29,7 @@ #include "dot11/dot11_probe.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "memory_helpers.h" @@ -88,4 +88,4 @@ void Dot11ProbeResponse::write_fixed_parameters(OutputMemoryStream& stream) { } // namespace Tins -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/src/dot3.cpp b/src/dot3.cpp index 8a0460e..618dc9d 100644 --- a/src/dot3.cpp +++ b/src/dot3.cpp @@ -86,13 +86,13 @@ uint32_t Dot3::header_size() const { return sizeof(header_); } -#if !defined(_WIN32) || defined(HAVE_PACKET_SENDER_PCAP_SENDPACKET) +#if !defined(_WIN32) || defined(TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET) void Dot3::send(PacketSender& sender, const NetworkInterface& iface) { if (!iface) { throw invalid_interface(); } - #if defined(BSD) || defined(__FreeBSD_kernel__) || defined(HAVE_PACKET_SENDER_PCAP_SENDPACKET) + #if defined(BSD) || defined(__FreeBSD_kernel__) || defined(TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET) sender.send_l2(*this, 0, 0, iface); #else struct sockaddr_ll addr; @@ -108,7 +108,7 @@ void Dot3::send(PacketSender& sender, const NetworkInterface& iface) { sender.send_l2(*this, (struct sockaddr*)&addr, (uint32_t)sizeof(addr)); #endif } -#endif // !_WIN32 || HAVE_PACKET_SENDER_PCAP_SENDPACKET +#endif // !_WIN32 || TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET bool Dot3::matches_response(const uint8_t* ptr, uint32_t total_sz) const { if (total_sz < sizeof(header_)) { diff --git a/src/ethernetII.cpp b/src/ethernetII.cpp index 62b45d3..a4e04ea 100644 --- a/src/ethernetII.cpp +++ b/src/ethernetII.cpp @@ -112,7 +112,7 @@ void EthernetII::send(PacketSender& sender, const NetworkInterface& iface) { if (!iface) { throw invalid_interface(); } - #if defined(HAVE_PACKET_SENDER_PCAP_SENDPACKET) || defined(BSD) || defined(__FreeBSD_kernel__) + #if defined(TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET) || defined(BSD) || defined(__FreeBSD_kernel__) // Sending using pcap_sendpacket/BSD bpf packet mode is the same here sender.send_l2(*this, 0, 0, iface); #elif defined(_WIN32) diff --git a/src/handshake_capturer.cpp b/src/handshake_capturer.cpp index 6f0f2da..7fe6878 100644 --- a/src/handshake_capturer.cpp +++ b/src/handshake_capturer.cpp @@ -29,7 +29,7 @@ #include "handshake_capturer.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include "dot11/dot11_data.h" @@ -106,4 +106,4 @@ bool RSNHandshakeCapturer::do_insert(const handshake_map::key_type& key, } // namespace Tins; -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/src/internals.cpp b/src/internals.cpp index 203d0e7..7f1758f 100644 --- a/src/internals.cpp +++ b/src/internals.cpp @@ -164,16 +164,16 @@ PDU* pdu_from_dlt_flag(int flag, case DLT_EN10MB: return new EthernetII(buffer, size); - #ifdef HAVE_DOT11 + #ifdef TINS_HAVE_DOT11 case DLT_IEEE802_11_RADIO: return new RadioTap(buffer, size); case DLT_IEEE802_11: return Dot11::from_bytes(buffer, size); - #else // HAVE_DOT11 + #else // TINS_HAVE_DOT11 case DLT_IEEE802_11_RADIO: case DLT_IEEE802_11: throw protocol_disabled(); - #endif // HAVE_DOT11 + #endif // TINS_HAVE_DOT11 case DLT_NULL: return new Loopback(buffer, size); @@ -200,7 +200,7 @@ Tins::PDU* pdu_from_flag(PDU::PDUType type, const uint8_t* buffer, uint32_t size return new Tins::IEEE802_3(buffer, size); case Tins::PDU::PPPOE: return new Tins::PPPoE(buffer, size); - #ifdef HAVE_DOT11 + #ifdef TINS_HAVE_DOT11 case Tins::PDU::RADIOTAP: return new Tins::RadioTap(buffer, size); case Tins::PDU::DOT11: @@ -226,7 +226,7 @@ Tins::PDU* pdu_from_flag(PDU::PDUType type, const uint8_t* buffer, uint32_t size case Tins::PDU::DOT11_RTS: case Tins::PDU::DOT11_QOS_DATA: return Tins::Dot11::from_bytes(buffer, size); - #endif // HAVE_DOT11 + #endif // TINS_HAVE_DOT11 default: return 0; }; diff --git a/src/packet_sender.cpp b/src/packet_sender.cpp index faa0f20..e390c34 100644 --- a/src/packet_sender.cpp +++ b/src/packet_sender.cpp @@ -129,12 +129,12 @@ PacketSender::~PacketSender() { } #endif - #ifdef HAVE_PACKET_SENDER_PCAP_SENDPACKET + #ifdef TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET for (PcapHandleMap::iterator it = pcap_handles_.begin(); it != pcap_handles_.end(); ++it) { pcap_close(it->second); } pcap_handles_.clear(); - #endif // HAVE_PACKET_SENDER_PCAP_SENDPACKET + #endif // TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET } void PacketSender::default_interface(const NetworkInterface& iface) { @@ -145,7 +145,7 @@ const NetworkInterface& PacketSender::default_interface() const { return default_iface_; } -#if !defined(_WIN32) || defined(HAVE_PACKET_SENDER_PCAP_SENDPACKET) +#if !defined(_WIN32) || defined(TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET) #ifndef _WIN32 bool PacketSender::ether_socket_initialized(const NetworkInterface& iface) const { @@ -168,7 +168,7 @@ int PacketSender::get_ether_socket(const NetworkInterface& iface) { } #endif // _WIN32 -#ifdef HAVE_PACKET_SENDER_PCAP_SENDPACKET +#ifdef TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET pcap_t* PacketSender::make_pcap_handle(const NetworkInterface& iface) const { // This is an ugly fix to make interface names look like what @@ -193,10 +193,10 @@ pcap_t* PacketSender::make_pcap_handle(const NetworkInterface& iface) const { return handle; } -#endif // HAVE_PACKET_SENDER_PCAP_SENDPACKET +#endif // TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET void PacketSender::open_l2_socket(const NetworkInterface& iface) { - #ifdef HAVE_PACKET_SENDER_PCAP_SENDPACKET + #ifdef TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET if (pcap_handles_.count(iface) == 0) { pcap_handles_.insert(make_pair(iface, make_pcap_handle(iface))); } @@ -239,7 +239,7 @@ void PacketSender::open_l2_socket(const NetworkInterface& iface) { } #endif } -#endif // !_WIN32 || HAVE_PACKET_SENDER_PCAP_SENDPACKET +#endif // !_WIN32 || TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET void PacketSender::open_l3_socket(SocketType type) { int socktype = find_type(type); @@ -309,14 +309,14 @@ void PacketSender::send(PDU& pdu, const NetworkInterface& iface) { if (pdu.matches_flag(PDU::ETHERNET_II)) { send(pdu, iface); } - #ifdef HAVE_DOT11 + #ifdef TINS_HAVE_DOT11 else if (pdu.matches_flag(PDU::DOT11)) { send(pdu, iface); } else if (pdu.matches_flag(PDU::RADIOTAP)) { send(pdu, iface); } - #endif // HAVE_DOT11 + #endif // TINS_HAVE_DOT11 else if (pdu.matches_flag(PDU::IEEE802_3)) { send(pdu, iface); } @@ -339,14 +339,14 @@ PDU* PacketSender::send_recv(PDU& pdu, const NetworkInterface& iface) { return pdu.recv_response(*this, iface); } -#if !defined(_WIN32) || defined(HAVE_PACKET_SENDER_PCAP_SENDPACKET) +#if !defined(_WIN32) || defined(TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET) void PacketSender::send_l2(PDU& pdu, struct sockaddr* link_addr, uint32_t len_addr, const NetworkInterface& iface) { PDU::serialization_type buffer = pdu.serialize(); - #ifdef HAVE_PACKET_SENDER_PCAP_SENDPACKET + #ifdef TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET open_l2_socket(iface); pcap_t* handle = pcap_handles_[iface]; const int buf_size = static_cast(buffer.size()); @@ -354,7 +354,7 @@ void PacketSender::send_l2(PDU& pdu, throw runtime_error("Failed to send packet: " + string(pcap_geterr(handle))); } - #else // HAVE_PACKET_SENDER_PCAP_SENDPACKET + #else // TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET int sock = get_ether_socket(iface); if (!buffer.empty()) { #if defined(BSD) || defined(__FreeBSD_kernel__) @@ -365,10 +365,10 @@ void PacketSender::send_l2(PDU& pdu, throw socket_write_error(make_error_string()); } } - #endif // HAVE_PACKET_SENDER_PCAP_SENDPACKET + #endif // TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET } -#endif // !_WIN32 || HAVE_PACKET_SENDER_PCAP_SENDPACKET +#endif // !_WIN32 || TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET #ifndef _WIN32 PDU* PacketSender::recv_l2(PDU& pdu, diff --git a/src/ppi.cpp b/src/ppi.cpp index 0963eb0..a256d99 100644 --- a/src/ppi.cpp +++ b/src/ppi.cpp @@ -59,7 +59,7 @@ PPI::PPI(const uint8_t* buffer, uint32_t total_sz) { if (stream) { switch (dlt()) { case DLT_IEEE802_11: - #ifdef HAVE_DOT11 + #ifdef TINS_HAVE_DOT11 parse_80211(stream.pointer(), stream.size()); #else throw protocol_disabled(); @@ -74,7 +74,7 @@ PPI::PPI(const uint8_t* buffer, uint32_t total_sz) { } break; case DLT_IEEE802_11_RADIO: - #ifdef HAVE_DOT11 + #ifdef TINS_HAVE_DOT11 inner_pdu(new RadioTap(stream.pointer(), stream.size())); #else throw protocol_disabled(); @@ -99,7 +99,7 @@ void PPI::write_serialization(uint8_t* buffer, uint32_t total_sz, const PDU *) { } void PPI::parse_80211(const uint8_t* buffer, uint32_t total_sz) { - #ifdef HAVE_DOT11 + #ifdef TINS_HAVE_DOT11 if (data_.size() >= 13) { // Is FCS-at-end on? if ((data_[12] & 1) == 1) { @@ -111,7 +111,7 @@ void PPI::parse_80211(const uint8_t* buffer, uint32_t total_sz) { } } inner_pdu(Dot11::from_bytes(buffer, total_sz)); - #endif // HAVE_DOT11 + #endif // TINS_HAVE_DOT11 } } // Tins diff --git a/src/radiotap.cpp b/src/radiotap.cpp index d0c3c5c..3865516 100644 --- a/src/radiotap.cpp +++ b/src/radiotap.cpp @@ -29,7 +29,7 @@ #include "radiotap.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include @@ -576,4 +576,4 @@ void RadioTap::write_serialization(uint8_t* buffer, uint32_t total_sz, const PDU } // Tins -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/src/rsn_information.cpp b/src/rsn_information.cpp index 0e09281..df641dc 100644 --- a/src/rsn_information.cpp +++ b/src/rsn_information.cpp @@ -28,7 +28,7 @@ */ #include "rsn_information.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include @@ -137,4 +137,4 @@ RSNInformation RSNInformation::from_option(const PDUOption& opt) } // Tins -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/src/sniffer.cpp b/src/sniffer.cpp index c2fcd65..e22bb6a 100644 --- a/src/sniffer.cpp +++ b/src/sniffer.cpp @@ -120,7 +120,7 @@ void sniff_loop_eth_handler(u_char* user, const struct pcap_pkthdr* h, const u_c } } -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 void sniff_loop_dot11_handler(u_char* user, const struct pcap_pkthdr* h, const u_char* bytes) { sniff_data* data = (sniff_data*)user; data->packet_processed = true; @@ -145,14 +145,14 @@ PtrPacket BaseSniffer::next_packet() { handler = sniff_loop_eth_handler; } else if (iface_type == DLT_IEEE802_11_RADIO) { - #ifdef HAVE_DOT11 + #ifdef TINS_HAVE_DOT11 handler = &sniff_loop_handler; #else throw protocol_disabled(); #endif } else if (iface_type == DLT_IEEE802_11) { - #ifdef HAVE_DOT11 + #ifdef TINS_HAVE_DOT11 handler = sniff_loop_dot11_handler; #else throw protocol_disabled(); diff --git a/src/tcp_ip/ack_tracker.cpp b/src/tcp_ip/ack_tracker.cpp index ba2c0bd..9991e7c 100644 --- a/src/tcp_ip/ack_tracker.cpp +++ b/src/tcp_ip/ack_tracker.cpp @@ -29,7 +29,7 @@ #include "tcp_ip/ack_tracker.h" -#ifdef HAVE_ACK_TRACKER +#ifdef TINS_HAVE_ACK_TRACKER #include #include "tcp.h" @@ -171,4 +171,4 @@ bool AckTracker::is_segment_acked(uint32_t sequence_number, uint32_t length) con } // TCPIP } // Tins -#endif // HAVE_ACK_TRACKER +#endif // TINS_HAVE_ACK_TRACKER diff --git a/src/tcp_ip/flow.cpp b/src/tcp_ip/flow.cpp index 21a0c4a..1bc7d0a 100644 --- a/src/tcp_ip/flow.cpp +++ b/src/tcp_ip/flow.cpp @@ -97,11 +97,11 @@ void Flow::process_packet(PDU& pdu) { // Update the internal state first if (tcp) { update_state(*tcp); - #ifdef HAVE_ACK_TRACKER + #ifdef TINS_HAVE_ACK_TRACKER if (flags_.ack_tracking) { ack_tracker_.process_packet(*tcp); } - #endif // HAVE_ACK_TRACKER + #endif // TINS_HAVE_ACK_TRACKER } if (flags_.ignore_data_packets) { return; @@ -213,17 +213,17 @@ void Flow::update_state(const TCP& tcp) { state_ = RST_SENT; } else if (state_ == SYN_SENT && (tcp.flags() & TCP::ACK) != 0) { - #ifdef HAVE_ACK_TRACKER + #ifdef TINS_HAVE_ACK_TRACKER ack_tracker_ = AckTracker(tcp.ack_seq()); - #endif // HAVE_ACK_TRACKER + #endif // TINS_HAVE_ACK_TRACKER state_ = ESTABLISHED; seq_number_++; } else if (state_ == UNKNOWN && (tcp.flags() & TCP::SYN) != 0) { // This is the server's state, sending it's first SYN|ACK - #ifdef HAVE_ACK_TRACKER + #ifdef TINS_HAVE_ACK_TRACKER ack_tracker_ = AckTracker(tcp.ack_seq()); - #endif // HAVE_ACK_TRACKER + #endif // TINS_HAVE_ACK_TRACKER state_ = SYN_SENT; seq_number_ = tcp.seq(); const TCP::option* mss_option = tcp.search_option(TCP::MSS); @@ -318,7 +318,7 @@ bool Flow::sack_permitted() const { } void Flow::enable_ack_tracking() { - #ifdef HAVE_ACK_TRACKER + #ifdef TINS_HAVE_ACK_TRACKER flags_.ack_tracking = 1; #else throw feature_disabled(); @@ -329,7 +329,7 @@ bool Flow::ack_tracking_enabled() const { return flags_.ack_tracking; } -#ifdef HAVE_ACK_TRACKER +#ifdef TINS_HAVE_ACK_TRACKER const AckTracker& Flow::ack_tracker() const { return ack_tracker_; } @@ -338,7 +338,7 @@ AckTracker& Flow::ack_tracker() { return ack_tracker_; } -#endif // HAVE_ACK_TRACKER +#endif // TINS_HAVE_ACK_TRACKER } // TCPIP } // Tins diff --git a/src/tcp_ip/stream_follower.cpp b/src/tcp_ip/stream_follower.cpp index d0a2d38..f16cad4 100644 --- a/src/tcp_ip/stream_follower.cpp +++ b/src/tcp_ip/stream_follower.cpp @@ -129,7 +129,7 @@ void StreamFollower::process_packet(PDU& packet, const timestamp_type& ts) { bool terminate_stream = total_chunks > max_buffered_chunks_ || total_buffered_bytes > max_buffered_bytes_; TerminationReason reason = BUFFERED_DATA; - #ifdef HAVE_ACK_TRACKER + #ifdef TINS_HAVE_ACK_TRACKER if (!terminate_stream) { uint32_t count = 0; count += stream.client_flow().ack_tracker().acked_intervals().iterative_size(); @@ -137,7 +137,7 @@ void StreamFollower::process_packet(PDU& packet, const timestamp_type& ts) { terminate_stream = count > DEFAULT_MAX_SACKED_INTERVALS; reason = SACKED_SEGMENTS; } - #endif // HAVE_ACK_TRACKER + #endif // TINS_HAVE_ACK_TRACKER if (stream.is_finished() || terminate_stream) { // If we're terminating the stream, execute the termination callback if (terminate_stream && on_stream_termination_) { diff --git a/tests/src/dot11/ack.cpp b/tests/src/dot11/ack.cpp index 8a579dd..e78f532 100644 --- a/tests/src/dot11/ack.cpp +++ b/tests/src/dot11/ack.cpp @@ -1,5 +1,5 @@ #include "dot11/dot11_control.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11.h" @@ -101,4 +101,4 @@ TEST_F(Dot11AckTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/assoc_request.cpp b/tests/src/dot11/assoc_request.cpp index 5adc7a6..a2e3f3d 100644 --- a/tests/src/dot11/assoc_request.cpp +++ b/tests/src/dot11/assoc_request.cpp @@ -1,6 +1,6 @@ #include "dot11/dot11_assoc.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_mgmt.h" @@ -90,4 +90,4 @@ TEST_F(Dot11AssocRequestTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/assoc_response.cpp b/tests/src/dot11/assoc_response.cpp index ebbb45d..765194e 100644 --- a/tests/src/dot11/assoc_response.cpp +++ b/tests/src/dot11/assoc_response.cpp @@ -1,6 +1,6 @@ #include "dot11/dot11_assoc.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_mgmt.h" @@ -98,4 +98,4 @@ TEST_F(Dot11AssocResponseTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/authentication.cpp b/tests/src/dot11/authentication.cpp index fa821cc..7fe5fdf 100644 --- a/tests/src/dot11/authentication.cpp +++ b/tests/src/dot11/authentication.cpp @@ -1,6 +1,6 @@ #include "dot11/dot11_auth.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_mgmt.h" @@ -106,4 +106,4 @@ TEST_F(Dot11AuthenticationTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/beacon.cpp b/tests/src/dot11/beacon.cpp index 229b3eb..fc9ee2b 100644 --- a/tests/src/dot11/beacon.cpp +++ b/tests/src/dot11/beacon.cpp @@ -1,6 +1,6 @@ #include "dot11/dot11_beacon.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "rsn_information.h" @@ -479,4 +479,4 @@ TEST_F(Dot11BeaconTest, RemoveOption) { EXPECT_EQ(old_buffer, new_buffer); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/block_ack_request.cpp b/tests/src/dot11/block_ack_request.cpp index e5e92a2..6686d66 100644 --- a/tests/src/dot11/block_ack_request.cpp +++ b/tests/src/dot11/block_ack_request.cpp @@ -1,6 +1,6 @@ #include "dot11/dot11_control.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11.h" @@ -94,4 +94,4 @@ TEST_F(Dot11BlockAckRequestTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/cfend.cpp b/tests/src/dot11/cfend.cpp index 77d81b1..15f102e 100644 --- a/tests/src/dot11/cfend.cpp +++ b/tests/src/dot11/cfend.cpp @@ -1,6 +1,6 @@ #include "config.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_control.h" @@ -78,4 +78,4 @@ TEST_F(Dot11CFEndTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/cfendack.cpp b/tests/src/dot11/cfendack.cpp index c2d0dd5..4d4d721 100644 --- a/tests/src/dot11/cfendack.cpp +++ b/tests/src/dot11/cfendack.cpp @@ -1,6 +1,6 @@ #include "config.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_control.h" @@ -78,4 +78,4 @@ TEST_F(Dot11EndCFAckTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/data.cpp b/tests/src/dot11/data.cpp index 7904779..140062f 100644 --- a/tests/src/dot11/data.cpp +++ b/tests/src/dot11/data.cpp @@ -1,6 +1,6 @@ #include "config.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_data.h" @@ -168,4 +168,4 @@ TEST_F(Dot11DataTest, Source_Dest_BSSID_Address3) { EXPECT_EQ(data.bssid_addr(), "00:18:f8:f5:c2:c6"); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/deauthentication.cpp b/tests/src/dot11/deauthentication.cpp index ceb3430..9bfb377 100644 --- a/tests/src/dot11/deauthentication.cpp +++ b/tests/src/dot11/deauthentication.cpp @@ -1,6 +1,6 @@ #include "dot11/dot11_auth.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_mgmt.h" @@ -88,4 +88,4 @@ TEST_F(Dot11DeauthenticationTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/disassoc.cpp b/tests/src/dot11/disassoc.cpp index 534ebb7..619ccef 100644 --- a/tests/src/dot11/disassoc.cpp +++ b/tests/src/dot11/disassoc.cpp @@ -1,6 +1,6 @@ #include "dot11/dot11_assoc.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_mgmt.h" @@ -89,4 +89,4 @@ TEST_F(Dot11DisassocTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/dot11.cpp b/tests/src/dot11/dot11.cpp index d28cff2..d1308c4 100644 --- a/tests/src/dot11/dot11.cpp +++ b/tests/src/dot11/dot11.cpp @@ -1,6 +1,6 @@ #include "config.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11.h" @@ -165,4 +165,4 @@ TEST_F(Dot11Test, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/probe_request.cpp b/tests/src/dot11/probe_request.cpp index b2c7dff..403bede 100644 --- a/tests/src/dot11/probe_request.cpp +++ b/tests/src/dot11/probe_request.cpp @@ -1,6 +1,6 @@ #include "dot11/dot11_probe.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_mgmt.h" @@ -72,4 +72,4 @@ TEST_F(Dot11ProbeRequestTest, FromBytes) { test_equals_expected(*inner); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/probe_response.cpp b/tests/src/dot11/probe_response.cpp index 0309bdc..c530992 100644 --- a/tests/src/dot11/probe_response.cpp +++ b/tests/src/dot11/probe_response.cpp @@ -1,6 +1,6 @@ #include "dot11/dot11_probe.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_mgmt.h" @@ -97,4 +97,4 @@ TEST_F(Dot11ProbeResponseTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/pspoll.cpp b/tests/src/dot11/pspoll.cpp index 25cf849..a7bb92c 100644 --- a/tests/src/dot11/pspoll.cpp +++ b/tests/src/dot11/pspoll.cpp @@ -1,6 +1,6 @@ #include "config.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_control.h" @@ -78,4 +78,4 @@ TEST_F(Dot11PSPollTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/reassoc_request.cpp b/tests/src/dot11/reassoc_request.cpp index 136548b..1f10ee8 100644 --- a/tests/src/dot11/reassoc_request.cpp +++ b/tests/src/dot11/reassoc_request.cpp @@ -1,6 +1,6 @@ #include "dot11/dot11_assoc.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_mgmt.h" @@ -97,4 +97,4 @@ TEST_F(Dot11ReAssocRequestTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/reassoc_response.cpp b/tests/src/dot11/reassoc_response.cpp index ecac10e..c9a05c4 100644 --- a/tests/src/dot11/reassoc_response.cpp +++ b/tests/src/dot11/reassoc_response.cpp @@ -1,6 +1,6 @@ #include "dot11/dot11_assoc.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_mgmt.h" @@ -86,4 +86,4 @@ TEST_F(Dot11ReAssocResponseTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/dot11/rts.cpp b/tests/src/dot11/rts.cpp index 9a6d47f..b01e0bb 100644 --- a/tests/src/dot11/rts.cpp +++ b/tests/src/dot11/rts.cpp @@ -1,6 +1,6 @@ #include "config.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include "tests/dot11_control.h" @@ -78,4 +78,4 @@ TEST_F(Dot11RTSTest, Serialize) { EXPECT_TRUE(std::equal(buffer.begin(), buffer.end(), expected_packet)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/ppi.cpp b/tests/src/ppi.cpp index a5bb550..1eceed5 100644 --- a/tests/src/ppi.cpp +++ b/tests/src/ppi.cpp @@ -1,7 +1,7 @@ #include "dot11/dot11_data.h" #include "dot11/dot11_beacon.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include @@ -53,4 +53,4 @@ TEST_F(PPITest, ConstructorFromBufferUsingEncapsulatedDot11WithOptions) { EXPECT_TRUE(dot11->search_option(static_cast(61)) != NULL); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/radiotap.cpp b/tests/src/radiotap.cpp index c6ff43b..6618d36 100644 --- a/tests/src/radiotap.cpp +++ b/tests/src/radiotap.cpp @@ -1,6 +1,6 @@ #include "radiotap.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include @@ -400,4 +400,4 @@ TEST_F(RadioTapTest, SerializationWorksFine) { ); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/tcp_ip.cpp b/tests/src/tcp_ip.cpp index 2f36527..5d76ae3 100644 --- a/tests/src/tcp_ip.cpp +++ b/tests/src/tcp_ip.cpp @@ -19,9 +19,9 @@ #include "packet.h" #include "utils.h" #include "config.h" -#ifdef HAVE_ACK_TRACKER +#ifdef TINS_HAVE_ACK_TRACKER #include "tcp_ip/ack_tracker.h" -#endif // HAVE_ACK_TRACKER +#endif // TINS_HAVE_ACK_TRACKER using namespace std; using namespace std::chrono; @@ -513,7 +513,7 @@ TEST_F(FlowTest, StreamFollower_FollowStream) { } -#ifdef HAVE_ACK_TRACKER +#ifdef TINS_HAVE_ACK_TRACKER using namespace boost; using namespace boost::icl; @@ -707,7 +707,7 @@ TEST_F(FlowTest, AckNumbersAreCorrect) { EXPECT_EQ(9898U, stream.server_flow().ack_tracker().ack_number()); } -#endif // HAVE_ACK_TRACKER +#endif // TINS_HAVE_ACK_TRACKER #else diff --git a/tests/src/wep_decrypt.cpp b/tests/src/wep_decrypt.cpp index 7f96652..7918dcc 100644 --- a/tests/src/wep_decrypt.cpp +++ b/tests/src/wep_decrypt.cpp @@ -1,6 +1,6 @@ #include "config.h" -#ifdef HAVE_DOT11 +#ifdef TINS_HAVE_DOT11 #include #include @@ -46,4 +46,4 @@ TEST_F(WEPDecryptTest, Decrypt1) { EXPECT_FALSE(decrypter.decrypt(dot11)); } -#endif // HAVE_DOT11 +#endif // TINS_HAVE_DOT11 diff --git a/tests/src/wpa2_decrypt.cpp b/tests/src/wpa2_decrypt.cpp index 3bfb742..935b7d1 100644 --- a/tests/src/wpa2_decrypt.cpp +++ b/tests/src/wpa2_decrypt.cpp @@ -1,6 +1,6 @@ #include "config.h" -#if defined(HAVE_DOT11) && defined(HAVE_WPA2_DECRYPTION) +#if defined(TINS_HAVE_DOT11) && defined(TINS_HAVE_WPA2_DECRYPTION) #include #include @@ -283,4 +283,4 @@ TEST_F(WPA2DecryptTest, DecryptCCMPAndTKIPWithoutUsingBeacon) { } } -#endif // defined(HAVE_DOT11) && defined(HAVE_WPA2_DECRYPTION) +#endif // defined(TINS_HAVE_DOT11) && defined(TINS_HAVE_WPA2_DECRYPTION)