Skip to content
Snippets Groups Projects
Select Git revision
  • a5c042c294954d6f95404161b56f044c9dbd3708
  • v2018.2.x default protected
  • 0x4A6F-rpi4
  • 0x4A6F-master
  • master
  • v2018.2.2-ffs
  • v2016.2.4-batmanbug
  • radv-filterd
  • v2016.2.x
  • hoodselector
  • v2016.1.x
  • babel
  • v2015.1.x
  • 2014.4.x
  • 2014.3.x
  • v2018.2.2-ffs0.1
  • v2018.2.1-ffs0.1
  • v2018.2.1
  • v2018.2-ffs0.1
  • v2018.2
  • v2018.1.4
  • v2018.1.3
  • v2018.1.2
  • v2018.1.1
  • v2018.1
  • v2017.1.8
  • v2017.1.7
  • v2017.1.6
  • v2017.1.5
  • v2017.1.4
  • v2017.1.3
  • v2017.1.2
  • v2016.2.7
  • v2017.1.1
  • v2017.1
35 results

50-gluon-simple-tc

Blame
  • Forked from firmware / FFS Gluon
    Source project has a limited visibility.
    50-gluon-simple-tc 737 B
    [ "$ACTION" = 'add' ] || exit 0
    
    config_load gluon-simple-tc
    
    
    tc_interface() {
    	local iface="$1"
    
    	config_get ifname "$iface" ifname
    
    	[ "$INTERFACE" = "$ifname" ] || return
    
    	config_get_bool enabled "$iface" enabled 0
    
    	[ "$enabled" -eq 1 ] || return
    
    	config_get limit_egress "$iface" limit_egress
    	config_get limit_ingress "$iface" limit_ingress
    
    	if [ "$limit_egress" ]; then
    		tc qdisc add dev "$INTERFACE" root tbf rate "${limit_egress}kbit" latency 50ms burst 2k
    	fi
    
    	if [ "$limit_ingress" ]; then
    		tc qdisc add dev "$INTERFACE" handle ffff: ingress
    		tc filter add dev "$INTERFACE" parent ffff: u32 match u8 00 00 at 0 police rate "${limit_ingress}kbit" burst 10k drop flowid :1
    	fi
    }
    
    config_foreach tc_interface 'interface'