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

Removed tins_direction_t typedef in favor of native pcap_direction_t

This commit is contained in:
Jesus Llorente
2015-11-24 20:09:41 +02:00
parent b07deba105
commit 4b9f998784
2 changed files with 5 additions and 7 deletions

View File

@@ -47,8 +47,6 @@ namespace Tins {
class SnifferIterator; class SnifferIterator;
class SnifferConfiguration; class SnifferConfiguration;
typedef pcap_direction_t tins_direction_t;
/** /**
* \class BaseSniffer * \class BaseSniffer
* \brief Base class for sniffers. * \brief Base class for sniffers.
@@ -220,7 +218,7 @@ namespace Tins {
* This calls pcap_setdirection using the provided parameter. * This calls pcap_setdirection using the provided parameter.
* \param d The direction for the sniffer. * \param d The direction for the sniffer.
*/ */
int set_direction(tins_direction_t d); int set_direction(pcap_direction_t d);
/** /**
* \brief Sets whether to extract RawPDUs or fully parsed packets. * \brief Sets whether to extract RawPDUs or fully parsed packets.
@@ -580,7 +578,7 @@ namespace Tins {
* Sets the direction option. * Sets the direction option.
* \param direction The direction to be set. * \param direction The direction to be set.
*/ */
void set_direction(tins_direction_t direction); void set_direction(pcap_direction_t direction);
/** /**
* Sets the immediate mode option. * Sets the immediate mode option.
@@ -612,7 +610,7 @@ namespace Tins {
bool _promisc; bool _promisc;
bool _rfmon; bool _rfmon;
bool _immediate_mode; bool _immediate_mode;
tins_direction_t _direction; pcap_direction_t _direction;
}; };
template<class Functor> template<class Functor>

View File

@@ -224,7 +224,7 @@ void BaseSniffer::set_timeout(int ms) {
pcap_set_timeout(handle, ms); pcap_set_timeout(handle, ms);
} }
int BaseSniffer::set_direction(tins_direction_t d) { int BaseSniffer::set_direction(pcap_direction_t d) {
return pcap_setdirection(handle, d); return pcap_setdirection(handle, d);
} }
@@ -492,7 +492,7 @@ void SnifferConfiguration::set_timeout(unsigned timeout)
_timeout = timeout; _timeout = timeout;
} }
void SnifferConfiguration::set_direction(tins_direction_t direction) void SnifferConfiguration::set_direction(pcap_direction_t direction)
{ {
_direction = direction; _direction = direction;
} }