fixes #119 - add support for pcap capture filters

This commit is contained in:
Jason Antman
2017-08-27 08:00:38 -04:00
parent e5455240c9
commit 7f02b84ced
6 changed files with 94 additions and 20 deletions

View File

@@ -53,9 +53,13 @@ typedef void (*NethogsMonitorCallback)(int action,
* occurs.
* @param cb A pointer to a callback function following the
* NethogsMonitorCallback definition
* @param filter A string (char array) pcap filter to restrict what packets
* are captured, or NULL. The filter string format is the same as that of
* tcpdump(1); for full details, see the man page for pcap-filter(7).
*/
NETHOGS_DSO_VISIBLE int nethogsmonitor_loop(NethogsMonitorCallback cb);
NETHOGS_DSO_VISIBLE int nethogsmonitor_loop(NethogsMonitorCallback cb,
char *filter);
/**
* @brief Enter the process monitoring loop and reports updates using the
@@ -65,6 +69,9 @@ NETHOGS_DSO_VISIBLE int nethogsmonitor_loop(NethogsMonitorCallback cb);
* occurs.
* @param cb A pointer to a callback function following the
* NethogsMonitorCallback definition
* @param filter A string (char array) pcap filter to restrict what packets
* are captured, or NULL. The filter string format is the same as that of
* tcpdump(1); for full details, see the man page for pcap-filter(7).
* @param devc number of values in devicenames array
* @param devicenames pointer to array of devicenames (char arrays)
* @param all when false, loopback interface and down/not running interfaces
@@ -72,7 +79,8 @@ NETHOGS_DSO_VISIBLE int nethogsmonitor_loop(NethogsMonitorCallback cb);
*/
NETHOGS_DSO_VISIBLE int nethogsmonitor_loop_devices(NethogsMonitorCallback cb,
int devc, char **devicenames,
char *filter, int devc,
char **devicenames,
bool all);
/**