aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesus Fernandez Manzano <jesus.manzano@galgus.net>2022-04-26 12:10:23 +0200
committerRosen Penev <rosenp@gmail.com>2022-05-16 19:32:09 -0700
commitfaf414d0ea69f063a8a9d3dbb91d3bcdd137725d (patch)
treecb8136ef8f6206f0109ef9a55185d2d6e2c11236
parentb05dac56718b64c29780a6464d39ef5e1f5c5278 (diff)
softflowd: add traffic capture filter
softflowd can filter the traffic with an optional bpf program, specified on the command-line as a BPF expression Signed-off-by: Jesus Fernandez Manzano <jesus.manzano@galgus.net>
-rw-r--r--net/softflowd/Makefile2
-rw-r--r--net/softflowd/files/softflowd.config1
-rwxr-xr-xnet/softflowd/files/softflowd.init3
3 files changed, 4 insertions, 2 deletions
diff --git a/net/softflowd/Makefile b/net/softflowd/Makefile
index 3e966e495..347e0b744 100644
--- a/net/softflowd/Makefile
+++ b/net/softflowd/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=softflowd
PKG_VERSION:=1.0.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/irino/softflowd/tar.gz/softflowd-$(PKG_VERSION)?
diff --git a/net/softflowd/files/softflowd.config b/net/softflowd/files/softflowd.config
index 61a2ee460..87dbf1369 100644
--- a/net/softflowd/files/softflowd.config
+++ b/net/softflowd/files/softflowd.config
@@ -12,3 +12,4 @@ config softflowd
option tracking_level 'full'
option track_ipv6 '0'
option sampling_rate '100'
+ option filter ''
diff --git a/net/softflowd/files/softflowd.init b/net/softflowd/files/softflowd.init
index 3f1c5f8aa..1fdd9ae30 100755
--- a/net/softflowd/files/softflowd.init
+++ b/net/softflowd/files/softflowd.init
@@ -29,6 +29,7 @@ start_instance() {
[ "$enabled" -gt 0 ] || return 1
config_get pid_file "$section" 'pid_file'
+ config_get filter "$section" 'filter'
args=""
append_string "$section" 'interface' '-i'
@@ -45,7 +46,7 @@ start_instance() {
append_bool "$section" track_ipv6 '-6'
procd_open_instance
- procd_set_param command /usr/sbin/softflowd -d $args${pid_file:+ -p $pid_file}
+ procd_set_param command /usr/sbin/softflowd -d $args${pid_file:+ -p $pid_file} "$filter"
procd_set_param respawn
procd_close_instance
}