mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
@@ -34,6 +34,7 @@ IF(LIBTINS_BUILD_SHARED)
|
||||
ELSE(LIBTINS_BUILD_SHARED)
|
||||
MESSAGE(STATUS "Build will generate a static library.")
|
||||
SET(LIBTINS_TYPE STATIC)
|
||||
SET(TINS_STATIC_BUILD ON)
|
||||
ENDIF(LIBTINS_BUILD_SHARED)
|
||||
|
||||
# The version number.
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Tins {
|
||||
* \brief Represents an ARP PDU.
|
||||
*
|
||||
*/
|
||||
class ARP : public PDU {
|
||||
class TINS_API ARP : public PDU {
|
||||
public:
|
||||
/**
|
||||
* The type of the hardware address.
|
||||
|
||||
@@ -39,14 +39,13 @@
|
||||
#include "ip_address.h"
|
||||
#include "hw_address.h"
|
||||
|
||||
|
||||
namespace Tins {
|
||||
|
||||
/**
|
||||
* \class BootP
|
||||
* \brief Class representing a BootP packet.
|
||||
*/
|
||||
class BootP : public PDU {
|
||||
class TINS_API BootP : public PDU {
|
||||
public:
|
||||
/**
|
||||
* The type of the IP addresses.
|
||||
|
||||
@@ -13,4 +13,7 @@
|
||||
/* Use pcap_sendpacket to send l2 packets */
|
||||
#cmakedefine HAVE_PACKET_SENDER_PCAP_SENDPACKET
|
||||
|
||||
/* Indicate whether libtins was built statically */
|
||||
#cmakedefine TINS_STATIC_BUILD
|
||||
|
||||
#endif // TINS_CONFIG_H
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "utils.h"
|
||||
#include "snap.h"
|
||||
#include "rawpdu.h"
|
||||
#include "macros.h"
|
||||
#include "handshake_capturer.h"
|
||||
|
||||
namespace Tins {
|
||||
@@ -53,7 +54,7 @@ namespace Crypto {
|
||||
/**
|
||||
* \brief Class that represents the keys used to decrypt a session.
|
||||
*/
|
||||
class SessionKeys {
|
||||
class TINS_API SessionKeys {
|
||||
public:
|
||||
/**
|
||||
* The size of the Pairwise Master Key.
|
||||
@@ -136,7 +137,7 @@ namespace Crypto {
|
||||
* of some access point, and this will generate the Pairwise Master Key
|
||||
* from those parameters.
|
||||
*/
|
||||
class SupplicantData {
|
||||
class TINS_API SupplicantData {
|
||||
public:
|
||||
/**
|
||||
* The type used to store the PMK.
|
||||
@@ -185,7 +186,7 @@ namespace Crypto {
|
||||
/**
|
||||
* \brief Decrypts WEP-encrypted traffic.
|
||||
*/
|
||||
class WEPDecrypter {
|
||||
class TINS_API WEPDecrypter {
|
||||
public:
|
||||
typedef HWAddress<6> address_type;
|
||||
|
||||
@@ -241,7 +242,7 @@ namespace Crypto {
|
||||
* This class takes valid PSK and SSID tuples, captures client handshakes,
|
||||
* and decrypts their traffic afterwards.
|
||||
*/
|
||||
class WPA2Decrypter {
|
||||
class TINS_API WPA2Decrypter {
|
||||
public:
|
||||
/*
|
||||
* \brief The type used to store Dot11 addresses.
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
#ifndef TINS_DHCP_H
|
||||
#define TINS_DHCP_H
|
||||
|
||||
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "bootp.h"
|
||||
#include "macros.h"
|
||||
#include "pdu_option.h"
|
||||
#include "cxxstd.h"
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Tins {
|
||||
*
|
||||
* \endcode
|
||||
*/
|
||||
class DHCP : public BootP {
|
||||
class TINS_API DHCP : public BootP {
|
||||
public:
|
||||
/**
|
||||
* This PDU's flag.
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <cstring>
|
||||
#include <list>
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "endianness.h"
|
||||
#include "small_uint.h"
|
||||
#include "ipv6_address.h"
|
||||
@@ -47,7 +48,7 @@ class OutputMemoryStream;
|
||||
* \class DHCPv6
|
||||
* \brief Represents a DHCPv6 PDU.
|
||||
*/
|
||||
class DHCPv6 : public PDU {
|
||||
class TINS_API DHCPv6 : public PDU {
|
||||
public:
|
||||
/**
|
||||
* Represents a DHCPv6 option.
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Tins {
|
||||
* }
|
||||
* \endcode
|
||||
*/
|
||||
class DNS : public PDU {
|
||||
class TINS_API DNS : public PDU {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
|
||||
@@ -33,13 +33,14 @@
|
||||
#define TINS_DOT11_DOT11_ASSOC_H
|
||||
|
||||
#include "../dot11/dot11_mgmt.h"
|
||||
#include "../macros.h"
|
||||
|
||||
namespace Tins {
|
||||
/**
|
||||
* \brief Class representing a Disassociation frame in the IEEE 802.11 Protocol.
|
||||
*
|
||||
*/
|
||||
class Dot11Disassoc : public Dot11ManagementFrame {
|
||||
class TINS_API Dot11Disassoc : public Dot11ManagementFrame {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -133,7 +134,7 @@ private:
|
||||
* \brief Class representing an Association Request frame in the IEEE 802.11 Protocol.
|
||||
*
|
||||
*/
|
||||
class Dot11AssocRequest : public Dot11ManagementFrame {
|
||||
class TINS_API Dot11AssocRequest : public Dot11ManagementFrame {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -244,7 +245,7 @@ private:
|
||||
* \brief Class representing an Association Response frame in the IEEE 802.11 Protocol.
|
||||
*
|
||||
*/
|
||||
class Dot11AssocResponse : public Dot11ManagementFrame {
|
||||
class TINS_API Dot11AssocResponse : public Dot11ManagementFrame {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -370,7 +371,7 @@ private:
|
||||
* \brief Class representing an ReAssociation Request frame in the IEEE 802.11 Protocol.
|
||||
*
|
||||
*/
|
||||
class Dot11ReAssocRequest : public Dot11ManagementFrame {
|
||||
class TINS_API Dot11ReAssocRequest : public Dot11ManagementFrame {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -496,7 +497,7 @@ private:
|
||||
* \brief IEEE 802.11 ReAssociation Response frame.
|
||||
*
|
||||
*/
|
||||
class Dot11ReAssocResponse : public Dot11ManagementFrame {
|
||||
class TINS_API Dot11ReAssocResponse : public Dot11ManagementFrame {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
|
||||
@@ -33,12 +33,13 @@
|
||||
#define TINS_DOT11_DOT11_AUTH_H
|
||||
|
||||
#include "../dot11/dot11_mgmt.h"
|
||||
#include "../macros.h"
|
||||
|
||||
namespace Tins {
|
||||
/**
|
||||
* \brief IEEE 802.11 Authentication Request frame.
|
||||
*/
|
||||
class Dot11Authentication : public Dot11ManagementFrame {
|
||||
class TINS_API Dot11Authentication : public Dot11ManagementFrame {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -165,7 +166,7 @@ private:
|
||||
* \brief IEEE 802.11 Deauthentication frame.
|
||||
*
|
||||
*/
|
||||
class Dot11Deauthentication : public Dot11ManagementFrame {
|
||||
class TINS_API Dot11Deauthentication : public Dot11ManagementFrame {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
|
||||
@@ -52,7 +52,7 @@ class RSNInformation;
|
||||
/**
|
||||
* \brief Class representing an 802.11 frame.
|
||||
*/
|
||||
class Dot11 : public PDU {
|
||||
class TINS_API Dot11 : public PDU {
|
||||
public:
|
||||
/**
|
||||
* The type used to store hardware addresses.
|
||||
|
||||
@@ -33,13 +33,14 @@
|
||||
#define TINS_DOT11_DOT11_BEACON_H
|
||||
|
||||
#include "../dot11/dot11_mgmt.h"
|
||||
#include "../macros.h"
|
||||
|
||||
namespace Tins {
|
||||
/**
|
||||
* \brief Class representing an 802.11 Beacon.
|
||||
*
|
||||
*/
|
||||
class Dot11Beacon : public Dot11ManagementFrame {
|
||||
class TINS_API Dot11Beacon : public Dot11ManagementFrame {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
|
||||
@@ -34,12 +34,13 @@
|
||||
#define TINS_DOT11_DOT11_CONTROL_H
|
||||
|
||||
#include "../dot11/dot11_base.h"
|
||||
#include "../macros.h"
|
||||
|
||||
namespace Tins {
|
||||
/**
|
||||
* \brief Class that represents an 802.11 control frame.
|
||||
*/
|
||||
class Dot11Control : public Dot11 {
|
||||
class TINS_API Dot11Control : public Dot11 {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -92,7 +93,7 @@ public:
|
||||
* \brief Class that represents an abstraction of the 802.11 control frames
|
||||
* that contain a target address.
|
||||
*/
|
||||
class Dot11ControlTA : public Dot11Control {
|
||||
class TINS_API Dot11ControlTA : public Dot11Control {
|
||||
public:
|
||||
/**
|
||||
* \brief Getter for the target address field.
|
||||
@@ -157,7 +158,7 @@ private:
|
||||
/**
|
||||
* \brief IEEE 802.11 RTS frame.
|
||||
*/
|
||||
class Dot11RTS : public Dot11ControlTA {
|
||||
class TINS_API Dot11RTS : public Dot11ControlTA {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -216,7 +217,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class Dot11PSPoll : public Dot11ControlTA {
|
||||
class TINS_API Dot11PSPoll : public Dot11ControlTA {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -276,7 +277,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class Dot11CFEnd : public Dot11ControlTA {
|
||||
class TINS_API Dot11CFEnd : public Dot11ControlTA {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -336,7 +337,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class Dot11EndCFAck : public Dot11ControlTA {
|
||||
class TINS_API Dot11EndCFAck : public Dot11ControlTA {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -396,7 +397,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class Dot11Ack : public Dot11Control {
|
||||
class TINS_API Dot11Ack : public Dot11Control {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -457,7 +458,7 @@ public:
|
||||
/**
|
||||
* \brief Class that represents an 802.11 Block Ack Request PDU.
|
||||
*/
|
||||
class Dot11BlockAckRequest : public Dot11ControlTA {
|
||||
class TINS_API Dot11BlockAckRequest : public Dot11ControlTA {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -593,7 +594,7 @@ private:
|
||||
/**
|
||||
* \brief Class that represents an 802.11 block ack frame.
|
||||
*/
|
||||
class Dot11BlockAck : public Dot11ControlTA {
|
||||
class TINS_API Dot11BlockAck : public Dot11ControlTA {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
|
||||
@@ -33,9 +33,11 @@
|
||||
#define TINS_DOT11_DOT11_DATA_H
|
||||
|
||||
#include "../dot11/dot11_base.h"
|
||||
#include "../macros.h"
|
||||
|
||||
namespace Tins {
|
||||
class Dot11Data : public Dot11 {
|
||||
|
||||
class TINS_API Dot11Data : public Dot11 {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -256,7 +258,7 @@ private:
|
||||
address_type _addr4;
|
||||
};
|
||||
|
||||
class Dot11QoSData : public Dot11Data {
|
||||
class TINS_API Dot11QoSData : public Dot11Data {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
|
||||
@@ -36,12 +36,13 @@
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include "../dot11/dot11_base.h"
|
||||
#include "../macros.h"
|
||||
|
||||
namespace Tins {
|
||||
/**
|
||||
* \brief Abstract class that englobes all Management frames in the 802.11 protocol.
|
||||
*/
|
||||
class Dot11ManagementFrame : public Dot11 {
|
||||
class TINS_API Dot11ManagementFrame : public Dot11 {
|
||||
public:
|
||||
/**
|
||||
* The supported rates container type.
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
#define TINS_DOT11_DOT11_PROBE_H
|
||||
|
||||
#include "../dot11/dot11_mgmt.h"
|
||||
#include "../macros.h"
|
||||
|
||||
namespace Tins {
|
||||
/**
|
||||
* \brief Class representing an Probe Request frame in the IEEE 802.11 Protocol.
|
||||
*
|
||||
*/
|
||||
class Dot11ProbeRequest : public Dot11ManagementFrame {
|
||||
class TINS_API Dot11ProbeRequest : public Dot11ManagementFrame {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -105,7 +106,7 @@ public:
|
||||
* \brief Class representing an Probe Response frame in the IEEE 802.11 Protocol.
|
||||
*
|
||||
*/
|
||||
class Dot11ProbeResponse : public Dot11ManagementFrame {
|
||||
class TINS_API Dot11ProbeResponse : public Dot11ManagementFrame {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define TINS_DOT1Q_H
|
||||
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "endianness.h"
|
||||
#include "small_uint.h"
|
||||
|
||||
@@ -39,7 +40,7 @@ namespace Tins {
|
||||
* \class Dot1Q
|
||||
* Represents an IEEE 802.1q PDU.
|
||||
*/
|
||||
class Dot1Q : public PDU {
|
||||
class TINS_API Dot1Q : public PDU {
|
||||
public:
|
||||
/**
|
||||
* This PDU's flag.
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Tins {
|
||||
* \class Dot3
|
||||
* \brief Class representing an IEEE 802.3 PDU.
|
||||
*/
|
||||
class Dot3 : public PDU {
|
||||
class TINS_API Dot3 : public PDU {
|
||||
public:
|
||||
/**
|
||||
* \brief The address type.
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "small_uint.h"
|
||||
#include "endianness.h"
|
||||
|
||||
|
||||
namespace Tins {
|
||||
namespace Memory {
|
||||
class OutputMemoryStream;
|
||||
@@ -52,7 +51,7 @@ class OutputMemoryStream;
|
||||
* \class EAPOL
|
||||
* \brief Represents the EAP encapsulation over LAN.
|
||||
*/
|
||||
class EAPOL : public PDU {
|
||||
class TINS_API EAPOL : public PDU {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
@@ -184,7 +183,7 @@ class OutputMemoryStream;
|
||||
/**
|
||||
* \brief Class that represents the RC4 EAPOL PDU.
|
||||
*/
|
||||
class RC4EAPOL : public EAPOL {
|
||||
class TINS_API RC4EAPOL : public EAPOL {
|
||||
public:
|
||||
/**
|
||||
* The type used to store the key.
|
||||
@@ -367,7 +366,7 @@ class OutputMemoryStream;
|
||||
/**
|
||||
* \brief Class that represents the RSN EAPOL PDU.
|
||||
*/
|
||||
class RSNEAPOL : public EAPOL {
|
||||
class TINS_API RSNEAPOL : public EAPOL {
|
||||
public:
|
||||
/**
|
||||
* The type used to store the key.
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Tins {
|
||||
* \class EthernetII
|
||||
* \brief Represents an Ethernet II PDU.
|
||||
*/
|
||||
class EthernetII : public PDU {
|
||||
class TINS_API EthernetII : public PDU {
|
||||
public:
|
||||
/**
|
||||
* \brief The hardware address type.
|
||||
|
||||
@@ -29,13 +29,14 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if !defined(TINS_HANDSHAKE_CAPTURER_H) && defined(HAVE_DOT11)
|
||||
#if !defined(TINS_HANDSHAKE_CAPTURER_H) && defined(HAVE_DOT11)
|
||||
#define TINS_HANDSHAKE_CAPTURER_H
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <utility>
|
||||
#include "hw_address.h"
|
||||
#include "macros.h"
|
||||
#include "eapol.h"
|
||||
|
||||
// .h
|
||||
@@ -106,7 +107,7 @@ namespace Tins {
|
||||
/**
|
||||
* Captures 802.1X RSN handshakes.
|
||||
*/
|
||||
class RSNHandshakeCapturer {
|
||||
class TINS_API RSNHandshakeCapturer {
|
||||
public:
|
||||
/**
|
||||
* The type of handshakes that will be captured.
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
namespace Tins {
|
||||
namespace Memory {
|
||||
class InputMemoryStream;
|
||||
} // memory
|
||||
} // Memory
|
||||
|
||||
/**
|
||||
* \class ICMP
|
||||
@@ -60,7 +60,7 @@ class InputMemoryStream;
|
||||
* ICMP is the representation of the ICMP PDU. Instances of this class
|
||||
* must be sent over a level 3 PDU, this will otherwise fail.
|
||||
*/
|
||||
class ICMP : public PDU {
|
||||
class TINS_API ICMP : public PDU {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <stdint.h>
|
||||
#include "macros.h"
|
||||
#include "small_uint.h"
|
||||
#include "endianness.h"
|
||||
|
||||
@@ -12,7 +13,7 @@ namespace Tins {
|
||||
/**
|
||||
* \brief Class that represents an ICMP extension object
|
||||
*/
|
||||
class ICMPExtension {
|
||||
class TINS_API ICMPExtension {
|
||||
public:
|
||||
/**
|
||||
* The type used to store the payload
|
||||
@@ -121,7 +122,7 @@ private:
|
||||
/**
|
||||
* \brief Class that represents an ICMP extensions structure
|
||||
*/
|
||||
class ICMPExtensionsStructure {
|
||||
class TINS_API ICMPExtensionsStructure {
|
||||
public:
|
||||
/**
|
||||
* The minimum ICMP payload size that has to be present when the PDU
|
||||
|
||||
@@ -53,7 +53,7 @@ class OutputMemoryStream;
|
||||
* \class ICMPv6
|
||||
* \brief Represents an ICMPv6 PDU.
|
||||
*/
|
||||
class ICMPv6 : public PDU {
|
||||
class TINS_API ICMPv6 : public PDU {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
|
||||
@@ -59,7 +59,7 @@ class OutputMemoryStream;
|
||||
* and set as the source address. If you don't want this behaviour, simply
|
||||
* set the source address to 0.0.0.0.
|
||||
*/
|
||||
class IP : public PDU {
|
||||
class TINS_API IP : public PDU {
|
||||
public:
|
||||
/**
|
||||
* This PDU's flag.
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
#include <iostream>
|
||||
#include <stdint.h>
|
||||
#include "cxxstd.h"
|
||||
#include "macros.h"
|
||||
|
||||
namespace Tins {
|
||||
/**
|
||||
* \class IPv4Address
|
||||
* \brief Abstraction of an IPv4 address.
|
||||
*/
|
||||
class IPv4Address {
|
||||
class TINS_API IPv4Address {
|
||||
public:
|
||||
/**
|
||||
* The address size.
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "ip_address.h"
|
||||
|
||||
namespace Tins {
|
||||
@@ -66,7 +67,7 @@ private:
|
||||
uint16_t offset_;
|
||||
};
|
||||
|
||||
class IPv4Stream {
|
||||
class TINS_API IPv4Stream {
|
||||
public:
|
||||
IPv4Stream();
|
||||
|
||||
@@ -93,7 +94,7 @@ private:
|
||||
/**
|
||||
* \brief Reassembles fragmented IP packets.
|
||||
*/
|
||||
class IPv4Reassembler {
|
||||
class TINS_API IPv4Reassembler {
|
||||
public:
|
||||
/**
|
||||
* The status of each processed packet.
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define TINS_IPSEC_H
|
||||
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "endianness.h"
|
||||
#include "small_uint.h"
|
||||
|
||||
@@ -39,7 +40,7 @@ namespace Tins {
|
||||
* \class IPSecAH
|
||||
* \brief Represents an IPSec Authentication Header.
|
||||
*/
|
||||
class IPSecAH : public PDU {
|
||||
class TINS_API IPSecAH : public PDU {
|
||||
public:
|
||||
/**
|
||||
* This PDU's flag.
|
||||
@@ -175,7 +176,7 @@ private:
|
||||
/**
|
||||
* \brief Represents an IPSec Authentication Header.
|
||||
*/
|
||||
class IPSecESP : public PDU {
|
||||
class TINS_API IPSecESP : public PDU {
|
||||
public:
|
||||
/**
|
||||
* This PDU's flag.
|
||||
|
||||
@@ -50,7 +50,7 @@ class PacketSender;
|
||||
* \class IPv6
|
||||
* Represents an IPv6 PDU.
|
||||
*/
|
||||
class IPv6 : public PDU {
|
||||
class TINS_API IPv6 : public PDU {
|
||||
public:
|
||||
/**
|
||||
* This PDU's flag.
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
#include <stdexcept>
|
||||
#include <stdint.h>
|
||||
#include "cxxstd.h"
|
||||
#include "macros.h"
|
||||
|
||||
namespace Tins {
|
||||
|
||||
/**
|
||||
* Represents an IPv6 address.
|
||||
*/
|
||||
class IPv6Address {
|
||||
class TINS_API IPv6Address {
|
||||
public:
|
||||
/**
|
||||
* The exception thrown when a malformed address is parsed.
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <stdint.h>
|
||||
#include "macros.h"
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "endianness.h"
|
||||
|
||||
namespace Tins {
|
||||
@@ -45,7 +46,7 @@ namespace Tins {
|
||||
*
|
||||
* This PDU follows the standard LLC frame described in the IEEE 802.2 specs.
|
||||
*/
|
||||
class LLC : public PDU {
|
||||
class TINS_API LLC : public PDU {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "macros.h"
|
||||
|
||||
namespace Tins {
|
||||
class Loopback : public PDU {
|
||||
class TINS_API Loopback : public PDU {
|
||||
public:
|
||||
/**
|
||||
* This PDU's type.
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
|
||||
// Check if this is Visual Studio
|
||||
#ifdef _MSC_VER
|
||||
// This is Visual Studio
|
||||
@@ -44,6 +46,18 @@
|
||||
#define TINS_NOEXCEPT
|
||||
#define TINS_LIKELY(x) (x)
|
||||
#define TINS_UNLIKELY(x) (x)
|
||||
// If libtins was built into a shared library
|
||||
#if !defined(TINS_STATIC_BUILD)
|
||||
// Export/import symbols, depending on whether we're compiling or consuming the lib
|
||||
#ifdef tins_EXPORTS
|
||||
#define TINS_API __declspec(dllexport)
|
||||
#else
|
||||
#define TINS_API __declspec(dllimport)
|
||||
#endif // tins_EXPORTS
|
||||
#else // TINS_STATIC_BUILD
|
||||
// Otherwise, default this to an empty macro
|
||||
#define TINS_API
|
||||
#endif // TINS_STATIC_BUILD
|
||||
#else
|
||||
// Not Vistual Studio. Assume this is gcc compatible
|
||||
#define TINS_BEGIN_PACK
|
||||
@@ -53,6 +67,9 @@
|
||||
#define TINS_NOEXCEPT noexcept
|
||||
#define TINS_LIKELY(x) __builtin_expect((x),1)
|
||||
#define TINS_UNLIKELY(x) __builtin_expect((x),0)
|
||||
#endif //
|
||||
#define TINS_API
|
||||
#endif // _MSC_VER
|
||||
|
||||
|
||||
|
||||
#endif // TINS_MACROS_H
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <stdint.h>
|
||||
#include "macros.h"
|
||||
#include "hw_address.h"
|
||||
#include "ip_address.h"
|
||||
|
||||
@@ -41,7 +42,7 @@ namespace Tins {
|
||||
* \class NetworkInterface
|
||||
* \brief Abstraction of a network interface
|
||||
*/
|
||||
class NetworkInterface {
|
||||
class TINS_API NetworkInterface {
|
||||
public:
|
||||
/**
|
||||
* \brief The type used to store the interface's identifier.
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
#include "data_link_type.h"
|
||||
#include "macros.h"
|
||||
|
||||
namespace Tins {
|
||||
class PDU;
|
||||
@@ -74,7 +75,7 @@ class PDU;
|
||||
* }
|
||||
* \endcode
|
||||
*/
|
||||
class OfflinePacketFilter {
|
||||
class TINS_API OfflinePacketFilter {
|
||||
public:
|
||||
/**
|
||||
* Constructs an OfflinePacketFilter object.
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace Tins {
|
||||
* \sa PacketSender::send
|
||||
* \sa PacketSender::send_recv
|
||||
*/
|
||||
class PacketSender {
|
||||
class TINS_API PacketSender {
|
||||
public:
|
||||
/**
|
||||
* The default timeout for receive actions.
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <pcap.h>
|
||||
#include "data_link_type.h"
|
||||
#include "utils.h"
|
||||
#include "macros.h"
|
||||
#include "cxxstd.h"
|
||||
|
||||
struct timeval;
|
||||
@@ -75,7 +76,7 @@ class Packet;
|
||||
* writer.write(vt.begin(), vt.end());
|
||||
* \endcode
|
||||
*/
|
||||
class PacketWriter {
|
||||
class TINS_API PacketWriter {
|
||||
public:
|
||||
/**
|
||||
* \brief The type of PDUs that will be written to this file (deprecated).
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "macros.h"
|
||||
#include "cxxstd.h"
|
||||
#include "exceptions.h"
|
||||
#include "macros.h"
|
||||
|
||||
/** \brief The Tins namespace.
|
||||
*/
|
||||
@@ -104,7 +105,7 @@ namespace Tins {
|
||||
* PDU::serialization_type buffer = packet.serialize();
|
||||
* \endcode
|
||||
*/
|
||||
class PDU {
|
||||
class TINS_API PDU {
|
||||
public:
|
||||
/**
|
||||
* The type that will be returned when serializing PDUs.
|
||||
|
||||
@@ -31,10 +31,11 @@
|
||||
#define TINS_PKTAP_H
|
||||
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
|
||||
namespace Tins {
|
||||
|
||||
class PKTAP : public PDU {
|
||||
class TINS_API PKTAP : public PDU {
|
||||
public:
|
||||
/**
|
||||
* This PDU's flag.
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define TINS_PPI_H
|
||||
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "endianness.h"
|
||||
#include "small_uint.h"
|
||||
|
||||
@@ -43,7 +44,7 @@ namespace Tins {
|
||||
* cannot be serialized. Therefore, it is only useful while
|
||||
* sniffing packets.
|
||||
*/
|
||||
class PPI : public PDU {
|
||||
class TINS_API PPI : public PDU {
|
||||
public:
|
||||
/**
|
||||
* This PDU's flag.
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "endianness.h"
|
||||
#include "small_uint.h"
|
||||
#include "pdu_option.h"
|
||||
@@ -44,7 +45,7 @@ namespace Tins {
|
||||
* \class PPPoE
|
||||
* \brief Represents a Point-to-point protocol over Ethernet PDU.
|
||||
*/
|
||||
class PPPoE : public PDU {
|
||||
class TINS_API PPPoE : public PDU {
|
||||
public:
|
||||
/**
|
||||
* The tag types enum.
|
||||
|
||||
@@ -47,7 +47,7 @@ class PacketSender;
|
||||
* the FCS-at-end flag is on, the channel is set to 1, TSFT is set to 0,
|
||||
* dbm_signal is set to -50, and the rx_flag and antenna fields to 0.
|
||||
*/
|
||||
class RadioTap : public PDU {
|
||||
class TINS_API RadioTap : public PDU {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "cxxstd.h"
|
||||
|
||||
namespace Tins {
|
||||
@@ -60,7 +61,7 @@ namespace Tins {
|
||||
* DNS dns = raw.to<DNS>();
|
||||
* \endcode
|
||||
*/
|
||||
class RawPDU : public PDU {
|
||||
class TINS_API RawPDU : public PDU {
|
||||
public:
|
||||
/**
|
||||
* The type used to store the payload.
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
#include "macros.h"
|
||||
#include "endianness.h"
|
||||
|
||||
namespace Tins{
|
||||
@@ -43,7 +44,7 @@ class PDUOption;
|
||||
/**
|
||||
* \brief Class that models the RSN information structure.
|
||||
*/
|
||||
class RSNInformation {
|
||||
class TINS_API RSNInformation {
|
||||
public:
|
||||
/**
|
||||
* \brief Enum that represents the different cypher suites.
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "endianness.h"
|
||||
#include "hw_address.h"
|
||||
|
||||
@@ -40,7 +41,7 @@ namespace Tins {
|
||||
* \class SLL
|
||||
* \brief Represents a Linux cooked-mode capture (SLL) PDU.
|
||||
*/
|
||||
class SLL : public PDU {
|
||||
class TINS_API SLL : public PDU {
|
||||
public:
|
||||
/**
|
||||
* This PDU's flag.
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Tins {
|
||||
* Note that this PDU contains the 802.3 LLC structure + SNAP frame.
|
||||
* So far only unnumbered information structure is supported.
|
||||
*/
|
||||
class SNAP : public PDU {
|
||||
class TINS_API SNAP : public PDU {
|
||||
public:
|
||||
/**
|
||||
* \brief This PDU's flag.
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "pdu.h"
|
||||
#include "packet.h"
|
||||
#include "cxxstd.h"
|
||||
#include "macros.h"
|
||||
#include "exceptions.h"
|
||||
#include "internals.h"
|
||||
|
||||
@@ -57,7 +58,7 @@ namespace Tins {
|
||||
*
|
||||
* Initialization must be done using the BaseSniffer::init method.
|
||||
*/
|
||||
class BaseSniffer {
|
||||
class TINS_API BaseSniffer {
|
||||
public:
|
||||
/**
|
||||
* The iterator type.
|
||||
@@ -279,7 +280,7 @@ namespace Tins {
|
||||
* \class Sniffer
|
||||
* \brief Sniffs packets from a network interface.
|
||||
*/
|
||||
class Sniffer : public BaseSniffer {
|
||||
class TINS_API Sniffer : public BaseSniffer {
|
||||
public:
|
||||
/**
|
||||
* \deprecated This enum is no longer necessary. You should use the
|
||||
@@ -359,7 +360,7 @@ namespace Tins {
|
||||
* This class acts exactly in the same way that Sniffer, but reads
|
||||
* packets from a pcap file instead of an interface.
|
||||
*/
|
||||
class FileSniffer : public BaseSniffer {
|
||||
class TINS_API FileSniffer : public BaseSniffer {
|
||||
public:
|
||||
/**
|
||||
* \brief Constructs an instance of FileSniffer.
|
||||
@@ -509,7 +510,7 @@ namespace Tins {
|
||||
* Sniffer sniffer("eth0", config);
|
||||
* \endcode
|
||||
*/
|
||||
class SnifferConfiguration {
|
||||
class TINS_API SnifferConfiguration {
|
||||
public:
|
||||
/**
|
||||
* \brief The default snapshot length.
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define TINS_STP_H
|
||||
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "endianness.h"
|
||||
#include "hw_address.h"
|
||||
#include "small_uint.h"
|
||||
@@ -40,7 +41,7 @@ namespace Tins {
|
||||
* \class STP
|
||||
* \brief Represents a Spanning Tree Protocol PDU.
|
||||
*/
|
||||
class STP : public PDU {
|
||||
class TINS_API STP : public PDU {
|
||||
public:
|
||||
/**
|
||||
* This PDU's flag.
|
||||
|
||||
@@ -76,7 +76,7 @@ class OutputMemoryStream;
|
||||
* \sa RawPDU
|
||||
*/
|
||||
|
||||
class TCP : public PDU {
|
||||
class TINS_API TCP : public PDU {
|
||||
public:
|
||||
/**
|
||||
* This PDU's flag.
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <algorithm>
|
||||
#include <stdint.h>
|
||||
#include "sniffer.h"
|
||||
#include "macros.h"
|
||||
#include "tcp.h"
|
||||
#include "utils.h"
|
||||
#include "ip.h"
|
||||
@@ -50,7 +51,7 @@ class RawPDU;
|
||||
* \class TCPStream
|
||||
* \brief Represents a TCP stream.
|
||||
*/
|
||||
class TCPStream {
|
||||
class TINS_API TCPStream {
|
||||
public:
|
||||
/**
|
||||
* The stream information.
|
||||
@@ -203,7 +204,7 @@ private:
|
||||
* \class TCPStreamFollower
|
||||
* \brief Follows TCP streams and notifies the user when data is available.
|
||||
*/
|
||||
class TCPStreamFollower {
|
||||
class TINS_API TCPStreamFollower {
|
||||
public:
|
||||
/**
|
||||
* \brief Default constructor.
|
||||
|
||||
Reference in New Issue
Block a user