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

Merge branch 'master' of github.com:mfontanini/libtins into develop

Conflicts:
	examples/dns_stats.cpp
	include/tins/sniffer.h
	src/sniffer.cpp
This commit is contained in:
Matias Fontanini
2016-01-31 21:03:57 -08:00
4 changed files with 46 additions and 7 deletions

View File

@@ -204,6 +204,14 @@ public:
*/
int get_fd();
/**
* \brief Sets direction for the sniffer.
*
* This calls pcap_setdirection using the provided parameter.
* \param d The direction for the sniffer.
*/
bool set_direction(pcap_direction_t d);
/**
* \brief Sets the read timeout for this sniffer.
*
@@ -567,6 +575,12 @@ public:
*/
void set_timeout(unsigned timeout);
/**
* Sets the direction option.
* \param direction The direction to be set.
*/
void set_direction(pcap_direction_t direction);
/**
* Sets the immediate mode option.
* \param enabled The immediate mode option value.
@@ -581,7 +595,8 @@ protected:
PROMISCUOUS = 2,
RFMON = 4,
PACKET_FILTER = 8,
IMMEDIATE_MODE = 16
IMMEDIATE_MODE = 16,
DIRECTION = 16
};
void configure_sniffer_pre_activation(Sniffer& sniffer) const;
@@ -597,6 +612,7 @@ protected:
bool promisc_;
bool rfmon_;
bool immediate_mode_;
pcap_direction_t direction_;
};
template <typename Functor>