1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Prefix HAVE_ config.h macros with TINS_

This commit is contained in:
Matias Fontanini
2016-02-20 09:10:33 -08:00
parent bac8388cec
commit 64b84fa91d
66 changed files with 180 additions and 180 deletions

View File

@@ -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

View File

@@ -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 <map>
@@ -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<uint8_t> 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<typename Functor>
DecrypterProxy<Functor, WEPDecrypter> 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<typename Functor>
DecrypterProxy<Functor, WPA2Decrypter> make_wpa2_decrypter_proxy(const Functor& functor) {
return DecrypterProxy<Functor, WPA2Decrypter>(functor);
}
#endif // HAVE_WPA2_DECRYPTION
#endif // TINS_HAVE_WPA2_DECRYPTION
// Implementation section

View File

@@ -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

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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 <list>

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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)

View File

@@ -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 <vector>

View File

@@ -37,9 +37,9 @@
#include <stdint.h>
#include <map>
#include "config.h"
#ifdef HAVE_PACKET_SENDER_PCAP_SENDPACKET
#ifdef TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET
#include <pcap.h>
#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<T&>(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<int>& 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<NetworkInterface, pcap_t*> PcapHandleMap;
PcapHandleMap pcap_handles_;
#endif // HAVE_PACKET_SENDER_PCAP_SENDPACKET
#endif // TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET
};
} // Tins

View File

@@ -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"

View File

@@ -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 <stdint.h>

View File

@@ -32,7 +32,7 @@
#include "../config.h"
#ifdef HAVE_ACK_TRACKER
#ifdef TINS_HAVE_ACK_TRACKER
#include <vector>
#include <boost/icl/interval_set.hpp>
@@ -149,7 +149,7 @@ private:
} // TCPIP
} // Tins
#endif // HAVE_ACK_TRACKER
#endif // TINS_HAVE_ACK_TRACKER
#endif // TINS_TCP_IP_ACK_TRACKER_H

View File

@@ -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