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