7 . /etc/rc.d/init.d/functions
8 . /etc/sysconfig/network
9 . /lib/rc-scripts/functions.network
15 # set all major variables
19 get_ppp_device_and_pid
21 # Simple QoS support (bandwidth limit)
22 if [ -n "${BANDWIDTH_OUT}" ]; then
23 if [ "${QDISC_CLASS}" = "htb" -o "${QDISC_CLASS}" = "cbq" ]; then
24 case "${QDISC_CLASS}" in
26 tc qdisc add dev ${REALDEVICE} root handle 1: htb default 10
27 tc class add dev ${REALDEVICE} parent 1: classid 1:10 htb rate ${BANDWIDTH_OUT}kbit ceil ${BANDWIDTH_OUT}kbit
28 [ -n "${QDISC}" ] && tc qdisc add dev ${REALDEVICE} parent 1:10 ${QDISC}
31 # FIXME: hardcoded ethernet speed (bandwidth)
32 tc qdisc add dev ${REALDEVICE} root handle 1: cbq bandwidth 100000kbit cell 8 avpkt 1000 mpu 64
33 tc class add dev ${REALDEVICE} parent 1: classid 1:10 cbq bandwidth 100000kbit rate ${BANDWIDTH_OUT}kbit maxburst 5 avpkt 1000 allot 1514 bounded
34 [ -n "${QDISC}" ] && tc qdisc add dev ${REALDEVICE} parent 1:10 ${QDISC}
35 tc filter add dev ${REALDEVICE} protocol ip parent 1: u32 match ip src 0.0.0.0/0 flowid 1:10
38 elif [ -z "${QDISC}" -o "${QDISC}" = "tbf" ]; then
39 tc qdisc add dev ${REALDEVICE} root tbf rate ${BANDWIDTH_OUT}kbit latency 50ms burst 51200
40 elif [ -n "${QDISC}" ]; then
41 tc qdisc add dev ${REALDEVICE} root ${QDISC}
44 if [ -n "${QDISC}" ]; then
45 tc qdisc add dev ${REALDEVICE} root ${QDISC}
49 if [ -n "${BANDWIDTH_IN}" ]; then
50 tc qdisc add dev ${REALDEVICE} handle ffff: ingress
51 tc filter add dev ${REALDEVICE} parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate ${BANDWIDTH_IN}kbit burst 10k drop flowid :3
54 . /lib/rc-scripts/ifup-aliases
55 . /lib/rc-scripts/ifup-routes
56 . /lib/rc-scripts/ifup-neigh
58 # don't set hostname on ppp/slip connections
59 if [ -n "$NEEDHOSTNAME" -a "${DEVICETYPE}" != "ppp" -a "${DEVICETYPE}" != "slip" ]; then
60 IPADDR=$(ip -f inet addr show dev ${DEVICE} |
61 awk '/inet/ { print $2 }' |awk -F"/" '{ print $1 }')
62 eval $(/bin/ipcalc --silent --hostname ${IPADDR}) && set_hostname $HOSTNAME
66 if [ "$TLEDS_DEV" = "$DEVICE" -a -x /usr/bin/tleds ]; then
67 /usr/bin/tleds -qc "$DEVICE"
70 # execute run_up() function (if available in device configuration file)
73 # Notify programs that have requested notification