#!/bin/sh # Cero3 Simple Shaper # A 1 tin cake shaper for # ethernet gateways. This is nearly the simplest possible # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # Copyright (C) 2012-5 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller . ${SQM_LIB_DIR}/defaults.sh QDISC=cake # to keep this as simple as possible we ignore the *_CAKE_OPTS from defaults.sh INGRESS_CAKE_OPTS="besteffort" EGRESS_CAKE_OPTS="besteffort" egress() { sqm_debug "egress" SILENT=1 $TC qdisc del dev $IFACE root $TC qdisc add dev $IFACE root $( get_stab_string ) cake \ bandwidth ${UPLINK}kbit $( get_cake_lla_string ) ${EGRESS_CAKE_OPTS} ${EQDISC_OPTS} } ingress() { sqm_debug "ingress" SILENT=1 $TC qdisc del dev $IFACE handle ffff: ingress $TC qdisc add dev $IFACE handle ffff: ingress SILENT=1 $TC qdisc del dev $DEV root [ "$ZERO_DSCP_INGRESS" -eq "1" ] && INGRESS_CAKE_OPTS="$INGRESS_CAKE_OPTS wash" $TC qdisc add dev $DEV root $( get_stab_string ) cake \ bandwidth ${DOWNLINK}kbit $( get_cake_lla_string ) ${INGRESS_CAKE_OPTS} ${IQDISC_OPTS} $IP link set dev $DEV up # redirect all IP packets arriving in $IFACE to ifb0 $TC filter add dev $IFACE parent ffff: protocol all prio 10 u32 \ match u32 0 0 flowid 1:1 action mirred egress redirect dev $DEV } sqm_prepare_script() { do_modules verify_qdisc $QDISC "cake" || return 1 }