mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Added get_fd() to BaseSniffer.
Signed-off-by: Matias Fontanini <matias.fontanini@gmail.com>
This commit is contained in:
committed by
Matias Fontanini
parent
931a86eff9
commit
c6dc18d215
@@ -159,6 +159,11 @@ namespace Tins {
|
||||
* \brief Stops sniffing loops.
|
||||
*/
|
||||
void stop_sniff();
|
||||
|
||||
/**
|
||||
* \brief Gets the file descriptor associated with the sniffer.
|
||||
*/
|
||||
int get_fd();
|
||||
protected:
|
||||
/**
|
||||
* Default constructor.
|
||||
|
||||
@@ -105,6 +105,10 @@ void BaseSniffer::stop_sniff() {
|
||||
pcap_breakloop(handle);
|
||||
}
|
||||
|
||||
int BaseSniffer::get_fd() {
|
||||
return pcap_get_selectable_fd(handle);
|
||||
}
|
||||
|
||||
bool BaseSniffer::set_filter(const std::string &filter) {
|
||||
if(actual_filter.bf_insns)
|
||||
pcap_freecode(&actual_filter);
|
||||
|
||||
Reference in New Issue
Block a user