diff --git a/luci-app-bandix/Makefile b/luci-app-bandix/Makefile index c7b706bc..8f404653 100644 --- a/luci-app-bandix/Makefile +++ b/luci-app-bandix/Makefile @@ -10,8 +10,8 @@ LUCI_DEPENDS:=+luci-base +luci-lib-jsonc +curl +bandix PKG_MAINTAINER:=timsaya -PKG_VERSION:=0.12.7 -PKG_RELEASE:=5 +PKG_VERSION:=0.12.8 +PKG_RELEASE:=6 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-bandix/htdocs/luci-static/resources/view/bandix/settings.js b/luci-app-bandix/htdocs/luci-static/resources/view/bandix/settings.js index 7777b4c2..70659560 100644 --- a/luci-app-bandix/htdocs/luci-static/resources/view/bandix/settings.js +++ b/luci-app-bandix/htdocs/luci-static/resources/view/bandix/settings.js @@ -266,13 +266,45 @@ return view.extend({ o.placeholder = '/usr/share/bandix'; o.rmempty = false; - // 添加 tc_priority 设置 - o = s.option(form.Value, 'tc_priority', _('TC Priority'), - _('Set TC filter priority to better coexist with other eBPF TC programs. Lower numbers indicate higher priority. 0 means system-assigned.')); + o = s.option(form.ListValue, 'tc_backend', _('TC backend'), + _('Select TC attach backend. Recommendation: use auto by default; tcx is preferred on kernel >= 6.6; netlink is safer on older kernels.')); + o.value('auto', 'auto'); + o.value('tcx', 'tcx'); + o.value('netlink', 'netlink'); + o.default = 'auto'; + o.rmempty = false; + + o = s.option(form.ListValue, 'tc_order', _('TC order')); + o.value('first', 'first'); + o.value('default', 'default'); + o.value('last', 'last'); + o.value('before', 'before'); + o.value('after', 'after'); + o.default = 'default'; + o.rmempty = false; + o.depends('tc_backend', 'tcx'); + + o = s.option(form.Value, 'netlink_priority', _('Netlink priority'), + _('Only used when backend is netlink. Range: 0..65535 (0 means default).')); + o.datatype = 'range(0,65535)'; o.default = '0'; - o.datatype = 'integer'; o.placeholder = '0'; o.rmempty = false; + o.depends('tc_backend', 'netlink'); + + o = s.option(form.Value, 'tcx_anchor_ingress_id', _('TCX ingress anchor program id'), + _('Used when tc_order is before/after. Must be a valid ingress program id on the same interface.')); + o.datatype = 'uinteger'; + o.rmempty = true; + o.depends({ tc_backend: 'tcx', tc_order: 'before' }); + o.depends({ tc_backend: 'tcx', tc_order: 'after' }); + + o = s.option(form.Value, 'tcx_anchor_egress_id', _('TCX egress anchor program id'), + _('Used when tc_order is before/after. Must be a valid egress program id on the same interface.')); + o.datatype = 'uinteger'; + o.rmempty = true; + o.depends({ tc_backend: 'tcx', tc_order: 'before' }); + o.depends({ tc_backend: 'tcx', tc_order: 'after' }); // 添加版本信息显示(合并显示) o = s.option(form.DummyValue, 'version', _('Version')); @@ -796,4 +828,4 @@ return view.extend({ return m.render(); } -}); \ No newline at end of file +}); diff --git a/luci-app-bandix/po/es/bandix.po b/luci-app-bandix/po/es/bandix.po index 65fd54e8..7160b6ee 100644 --- a/luci-app-bandix/po/es/bandix.po +++ b/luci-app-bandix/po/es/bandix.po @@ -1228,3 +1228,30 @@ msgstr "Origen resp." msgid "Repl Dst" msgstr "Destino resp." + +msgid "TC backend" +msgstr "Backend de TC" + +msgid "Select TC attach backend. Recommendation: use auto by default; tcx is preferred on kernel >= 6.6; netlink is safer on older kernels." +msgstr "Seleccione el backend de adjuncion TC. Recomendacion: use auto por defecto; tcx es preferible en kernel >= 6.6; netlink es mas seguro en kernels antiguos." + +msgid "TC order" +msgstr "Orden de TC" + +msgid "Netlink priority" +msgstr "Prioridad de Netlink" + +msgid "Only used when backend is netlink. Range: 0..65535 (0 means default)." +msgstr "Solo se usa cuando el backend es netlink. Rango: 0..65535 (0 significa predeterminado)." + +msgid "TCX ingress anchor program id" +msgstr "ID de programa ancla de ingreso TCX" + +msgid "Used when tc_order is before/after. Must be a valid ingress program id on the same interface." +msgstr "Se usa cuando tc_order es before/after. Debe ser un ID de programa de ingreso valido en la misma interfaz." + +msgid "TCX egress anchor program id" +msgstr "ID de programa ancla de egreso TCX" + +msgid "Used when tc_order is before/after. Must be a valid egress program id on the same interface." +msgstr "Se usa cuando tc_order es before/after. Debe ser un ID de programa de egreso valido en la misma interfaz." diff --git a/luci-app-bandix/po/fr/bandix.po b/luci-app-bandix/po/fr/bandix.po index 2191e16e..42e378f3 100644 --- a/luci-app-bandix/po/fr/bandix.po +++ b/luci-app-bandix/po/fr/bandix.po @@ -1227,4 +1227,31 @@ msgid "Repl Src" msgstr "Src. répl." msgid "Repl Dst" -msgstr "Dest. répl." \ No newline at end of file +msgstr "Dest. répl." + +msgid "TC backend" +msgstr "Backend TC" + +msgid "Select TC attach backend. Recommendation: use auto by default; tcx is preferred on kernel >= 6.6; netlink is safer on older kernels." +msgstr "Selectionnez le backend d attache TC. Recommandation : utilisez auto par defaut ; tcx est prefere sur noyau >= 6.6 ; netlink est plus sur sur les anciens noyaux." + +msgid "TC order" +msgstr "Ordre TC" + +msgid "Netlink priority" +msgstr "Priorite Netlink" + +msgid "Only used when backend is netlink. Range: 0..65535 (0 means default)." +msgstr "Utilise uniquement lorsque le backend est netlink. Plage : 0..65535 (0 signifie par defaut)." + +msgid "TCX ingress anchor program id" +msgstr "ID du programme d ancrage ingress TCX" + +msgid "Used when tc_order is before/after. Must be a valid ingress program id on the same interface." +msgstr "Utilise lorsque tc_order est before/after. Doit etre un ID de programme ingress valide sur la meme interface." + +msgid "TCX egress anchor program id" +msgstr "ID du programme d ancrage egress TCX" + +msgid "Used when tc_order is before/after. Must be a valid egress program id on the same interface." +msgstr "Utilise lorsque tc_order est before/after. Doit etre un ID de programme egress valide sur la meme interface." diff --git a/luci-app-bandix/po/ja/bandix.po b/luci-app-bandix/po/ja/bandix.po index 2875a19d..bc18fdf3 100644 --- a/luci-app-bandix/po/ja/bandix.po +++ b/luci-app-bandix/po/ja/bandix.po @@ -1228,3 +1228,30 @@ msgstr "応答元" msgid "Repl Dst" msgstr "応答先" + +msgid "TC backend" +msgstr "TCバックエンド" + +msgid "Select TC attach backend. Recommendation: use auto by default; tcx is preferred on kernel >= 6.6; netlink is safer on older kernels." +msgstr "TCアタッチのバックエンドを選択します。推奨: 既定ではautoを使用し、カーネル>= 6.6ではtcxを優先、古いカーネルではnetlinkの方が安全です。" + +msgid "TC order" +msgstr "TC順序" + +msgid "Netlink priority" +msgstr "Netlink優先度" + +msgid "Only used when backend is netlink. Range: 0..65535 (0 means default)." +msgstr "backendがnetlinkの場合のみ使用します。範囲: 0..65535(0は既定)。" + +msgid "TCX ingress anchor program id" +msgstr "TCX ingressアンカープログラムID" + +msgid "Used when tc_order is before/after. Must be a valid ingress program id on the same interface." +msgstr "tc_orderがbefore/afterのときに使用します。同じインターフェース上の有効なingressプログラムIDである必要があります。" + +msgid "TCX egress anchor program id" +msgstr "TCX egressアンカープログラムID" + +msgid "Used when tc_order is before/after. Must be a valid egress program id on the same interface." +msgstr "tc_orderがbefore/afterのときに使用します。同じインターフェース上の有効なegressプログラムIDである必要があります。" diff --git a/luci-app-bandix/po/pl/bandix.po b/luci-app-bandix/po/pl/bandix.po index 3c2cec83..56e9d2db 100644 --- a/luci-app-bandix/po/pl/bandix.po +++ b/luci-app-bandix/po/pl/bandix.po @@ -1228,3 +1228,30 @@ msgstr "Źródło odp." msgid "Repl Dst" msgstr "Cel odp." + +msgid "TC backend" +msgstr "Backend TC" + +msgid "Select TC attach backend. Recommendation: use auto by default; tcx is preferred on kernel >= 6.6; netlink is safer on older kernels." +msgstr "Wybierz backend podpiecia TC. Zalecenie: domyslnie uzyj auto; tcx jest preferowany na kernelu >= 6.6; netlink jest bezpieczniejszy na starszych kernelach." + +msgid "TC order" +msgstr "Kolejnosc TC" + +msgid "Netlink priority" +msgstr "Priorytet Netlink" + +msgid "Only used when backend is netlink. Range: 0..65535 (0 means default)." +msgstr "Uzywane tylko, gdy backend to netlink. Zakres: 0..65535 (0 oznacza domyslny)." + +msgid "TCX ingress anchor program id" +msgstr "ID programu kotwicy TCX ingress" + +msgid "Used when tc_order is before/after. Must be a valid ingress program id on the same interface." +msgstr "Uzywane, gdy tc_order to before/after. Musi to byc prawidlowe ID programu ingress na tym samym interfejsie." + +msgid "TCX egress anchor program id" +msgstr "ID programu kotwicy TCX egress" + +msgid "Used when tc_order is before/after. Must be a valid egress program id on the same interface." +msgstr "Uzywane, gdy tc_order to before/after. Musi to byc prawidlowe ID programu egress na tym samym interfejsie." diff --git a/luci-app-bandix/po/ru/bandix.po b/luci-app-bandix/po/ru/bandix.po index ebdd27f5..32e835a9 100644 --- a/luci-app-bandix/po/ru/bandix.po +++ b/luci-app-bandix/po/ru/bandix.po @@ -1227,4 +1227,31 @@ msgid "Repl Src" msgstr "Ист. ответа" msgid "Repl Dst" -msgstr "Назнач. ответа" \ No newline at end of file +msgstr "Назнач. ответа" + +msgid "TC backend" +msgstr "Бэкенд TC" + +msgid "Select TC attach backend. Recommendation: use auto by default; tcx is preferred on kernel >= 6.6; netlink is safer on older kernels." +msgstr "Выберите бэкенд подключения TC. Рекомендация: по умолчанию используйте auto; tcx предпочтителен на ядре >= 6.6; netlink безопаснее на старых ядрах." + +msgid "TC order" +msgstr "Порядок TC" + +msgid "Netlink priority" +msgstr "Приоритет Netlink" + +msgid "Only used when backend is netlink. Range: 0..65535 (0 means default)." +msgstr "Используется только при backend=netlink. Диапазон: 0..65535 (0 означает по умолчанию)." + +msgid "TCX ingress anchor program id" +msgstr "ID якорной программы TCX ingress" + +msgid "Used when tc_order is before/after. Must be a valid ingress program id on the same interface." +msgstr "Используется, когда tc_order имеет значение before/after. Должен быть корректный ID ingress-программы на том же интерфейсе." + +msgid "TCX egress anchor program id" +msgstr "ID якорной программы TCX egress" + +msgid "Used when tc_order is before/after. Must be a valid egress program id on the same interface." +msgstr "Используется, когда tc_order имеет значение before/after. Должен быть корректный ID egress-программы на том же интерфейсе." diff --git a/luci-app-bandix/po/zh_Hans/bandix.po b/luci-app-bandix/po/zh_Hans/bandix.po index a72d41fa..2e74db81 100644 --- a/luci-app-bandix/po/zh_Hans/bandix.po +++ b/luci-app-bandix/po/zh_Hans/bandix.po @@ -1254,4 +1254,31 @@ msgid "Repl Src" msgstr "回复源" msgid "Repl Dst" -msgstr "回复目标" \ No newline at end of file +msgstr "回复目标" + +msgid "TC backend" +msgstr "TC 后端" + +msgid "Select TC attach backend. Recommendation: use auto by default; tcx is preferred on kernel >= 6.6; netlink is safer on older kernels." +msgstr "选择 TC 挂载后端。建议默认使用 auto;在内核 >= 6.6 时优先使用 tcx;旧内核使用 netlink 更稳妥。" + +msgid "TC order" +msgstr "TC 顺序" + +msgid "Netlink priority" +msgstr "Netlink 优先级" + +msgid "Only used when backend is netlink. Range: 0..65535 (0 means default)." +msgstr "仅在后端为 netlink 时使用。范围:0..65535(0 表示默认)。" + +msgid "TCX ingress anchor program id" +msgstr "TCX 入站锚点程序 ID" + +msgid "Used when tc_order is before/after. Must be a valid ingress program id on the same interface." +msgstr "当 tc_order 为 before/after 时使用。必须是同一接口上的有效入站程序 ID。" + +msgid "TCX egress anchor program id" +msgstr "TCX 出站锚点程序 ID" + +msgid "Used when tc_order is before/after. Must be a valid egress program id on the same interface." +msgstr "当 tc_order 为 before/after 时使用。必须是同一接口上的有效出站程序 ID。" diff --git a/luci-app-bandix/po/zh_Hant/bandix.po b/luci-app-bandix/po/zh_Hant/bandix.po index 5c114f97..b77babc6 100644 --- a/luci-app-bandix/po/zh_Hant/bandix.po +++ b/luci-app-bandix/po/zh_Hant/bandix.po @@ -1227,4 +1227,31 @@ msgid "Repl Src" msgstr "回覆源" msgid "Repl Dst" -msgstr "回覆目標" \ No newline at end of file +msgstr "回覆目標" + +msgid "TC backend" +msgstr "TC 後端" + +msgid "Select TC attach backend. Recommendation: use auto by default; tcx is preferred on kernel >= 6.6; netlink is safer on older kernels." +msgstr "選擇 TC 掛載後端。建議預設使用 auto;在內核 >= 6.6 時優先使用 tcx;較舊內核使用 netlink 更穩妥。" + +msgid "TC order" +msgstr "TC 順序" + +msgid "Netlink priority" +msgstr "Netlink 優先級" + +msgid "Only used when backend is netlink. Range: 0..65535 (0 means default)." +msgstr "僅在後端為 netlink 時使用。範圍:0..65535(0 表示預設)。" + +msgid "TCX ingress anchor program id" +msgstr "TCX 入站錨點程式 ID" + +msgid "Used when tc_order is before/after. Must be a valid ingress program id on the same interface." +msgstr "當 tc_order 為 before/after 時使用。必須是同一介面上的有效入站程式 ID。" + +msgid "TCX egress anchor program id" +msgstr "TCX 出站錨點程式 ID" + +msgid "Used when tc_order is before/after. Must be a valid egress program id on the same interface." +msgstr "當 tc_order 為 before/after 時使用。必須是同一介面上的有效出站程式 ID。" diff --git a/openwrt-bandix/Makefile b/openwrt-bandix/Makefile index 7bbd5001..9a4e6d2e 100644 --- a/openwrt-bandix/Makefile +++ b/openwrt-bandix/Makefile @@ -1,8 +1,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bandix -PKG_VERSION:=0.12.8 -PKG_RELEASE:=3 +PKG_VERSION:=0.12.9 +PKG_RELEASE:=4 PKG_LICENSE:=Apache-2.0 PKG_MAINTAINER:=timsaya @@ -13,7 +13,7 @@ include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/rust/rust-values.mk # 二进制文件的文件名和URL -RUST_BANDIX_VERSION:=0.12.8 +RUST_BANDIX_VERSION:=0.12.9 RUST_BINARY_FILENAME:=bandix-$(RUST_BANDIX_VERSION)-$(RUSTC_TARGET_ARCH).tar.gz diff --git a/openwrt-bandix/files/bandix.config b/openwrt-bandix/files/bandix.config index 569bbab1..0341c1e7 100644 --- a/openwrt-bandix/files/bandix.config +++ b/openwrt-bandix/files/bandix.config @@ -8,7 +8,11 @@ config bandix 'general' option theme 'auto' option log_level 'info' - option tc_priority '0' + option tc_order 'default' + option tc_backend 'auto' + option netlink_priority '' + option tcx_anchor_ingress_id '' + option tcx_anchor_egress_id '' config bandix 'traffic' @@ -35,4 +39,3 @@ config bandix 'dns' option dns_max_records '10000' option dns_enable_storage '0' option dns_flush_interval '900' - diff --git a/openwrt-bandix/files/bandix.init b/openwrt-bandix/files/bandix.init index 72ae4771..7cafa2df 100644 --- a/openwrt-bandix/files/bandix.init +++ b/openwrt-bandix/files/bandix.init @@ -17,7 +17,12 @@ start_service() { local port local data_dir local log_level + local tc_order + local tc_backend local tc_priority + local netlink_priority + local tcx_anchor_ingress_id + local tcx_anchor_egress_id local traffic_enabled local traffic_realtime_window local traffic_flush_interval @@ -39,7 +44,12 @@ start_service() { config_get port 'general' 'port' config_get data_dir 'general' 'data_dir' config_get log_level 'general' 'log_level' + config_get tc_order 'general' 'tc_order' + config_get tc_backend 'general' 'tc_backend' config_get tc_priority 'general' 'tc_priority' + config_get netlink_priority 'general' 'netlink_priority' + config_get tcx_anchor_ingress_id 'general' 'tcx_anchor_ingress_id' + config_get tcx_anchor_egress_id 'general' 'tcx_anchor_egress_id' config_get_bool traffic_enabled 'traffic' 'enabled' config_get traffic_realtime_window 'traffic' 'traffic_realtime_window' config_get traffic_flush_interval 'traffic' 'traffic_flush_interval' @@ -64,8 +74,29 @@ start_service() { if [ -n "$log_level" ]; then args="$args --log-level $log_level" fi - if [ -n "$tc_priority" ]; then - args="$args --tc-priority $tc_priority" + if [ -z "$tc_order" ]; then + case "$tc_priority" in + 1) tc_order="first" ;; + 65535) tc_order="last" ;; + *) tc_order="default" ;; + esac + fi + [ -z "$tc_order" ] && tc_order="default" + if [ -n "$tc_order" ]; then + args="$args --tc-order $tc_order" + fi + [ -z "$tc_backend" ] && tc_backend="auto" + if [ -n "$tc_backend" ]; then + args="$args --tc-backend $tc_backend" + fi + if [ -n "$netlink_priority" ]; then + args="$args --netlink-priority $netlink_priority" + fi + if [ -n "$tcx_anchor_ingress_id" ]; then + args="$args --tcx-anchor-ingress-id $tcx_anchor_ingress_id" + fi + if [ -n "$tcx_anchor_egress_id" ]; then + args="$args --tcx-anchor-egress-id $tcx_anchor_egress_id" fi # 添加流量监控相关参数