Skip to content

Commit

Permalink
qosify: add support for configuring overhead
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nbd168 committed Nov 21, 2021
1 parent 9962585 commit e961079
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions package/network/config/qosify/files/qosify.conf
Expand Up @@ -28,6 +28,7 @@ config interface wan
option disabled 1
option bandwidth_up 100mbit
option bandwidth_down 100mbit
option overhead_type none
# defaults:
option ingress 1
option egress 1
Expand Down
41 changes: 40 additions & 1 deletion package/network/config/qosify/files/qosify.init
Expand Up @@ -72,7 +72,46 @@ add_interface() {
add_option boolean autorate_ingress
add_option string ingress_options
add_option string egress_options
add_option string options

config_get user_options "$cfg" options

config_get otype "$cfg" overhead_type
options=
case "$otype" in
none);;
manual)
config_get overhead "$cfg" overhead
[ -n "$overhead" ] && append options "overhead $overhead"

config_get encap "$cfg" overhead_encap
[ -n "$encap" ] && append options "$encap"
;;
conservative|\
pppoa-vcmux|\
pppoa-llc|\
pppoe-vcmux|\
pppoe-llcsnap|\
bridged-vcmux|\
bridged-llcsnap|\
ipoa-vcmux|\
ipoa-llcsnap|\
pppoe-ptm|\
bridged-ptm|\
docsis|\
ethernet)
append options "$otype"
;;
esac

config_get mpu "$cfg" overhead_mpu
[ -n "$mpu" ] && append options "mpu $mpu"

config_get ovlan "$cfg" overhead_vlan
[ "${ovlan:-0}" -ge 2 ] && append options "ether-vlan"
[ "${ovlan:-0}" -ge 1 ] && append options "ether-vlan"

[ -n "$user_options" ] && append options "$user_options"
[ -n "$options" ] && json_add_string options "$options"

json_close_object
}
Expand Down

0 comments on commit e961079

Please sign in to comment.