From: <kr...@us...> - 2006-08-14 01:54:57
|
Revision: 250 Author: krisk84 Date: 2006-08-13 18:54:52 -0700 (Sun, 13 Aug 2006) ViewCVS: http://svn.sourceforge.net/astlinux/?rev=250&view=rev Log Message: ----------- move astshape to iproute2 dir Modified Paths: -------------- trunk/package/iproute2/astshape.init trunk/package/iproute2/iproute2.mk Added Paths: ----------- trunk/package/iproute2/astshape Removed Paths: ------------- trunk/target/generic/target_skeleton/usr/sbin/astshape Copied: trunk/package/iproute2/astshape (from rev 247, trunk/target/generic/target_skeleton/usr/sbin/astshape) =================================================================== --- trunk/package/iproute2/astshape (rev 0) +++ trunk/package/iproute2/astshape 2006-08-14 01:54:52 UTC (rev 250) @@ -0,0 +1,134 @@ +#!/bin/bash +# AstShape +# Based off of WonderShaper (HTB) +# Enhanced by Kristian Kielhofner <kr...@kr...> +# Make sure that all of your VoIP devices set tos on RTP to 0x18 +# iax.conf: tos=0x18 sip.conf: tos=0x18 + +. /etc/rc.conf + +DOWNLINK=$EXTDOWN +UPLINK=$EXTUP +DEV=$EXTIF + +if [ "$1" = "status" ] +then + echo "Showing AstShape status for $DEV" + echo + tc -s qdisc ls dev $DEV + tc -s class ls dev $DEV + exit +fi + + +# clean existing down- and uplink qdiscs, hide errors +tc qdisc del dev $DEV root 2> /dev/null > /dev/null +tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null + +if [ "$1" = "stop" ] +then + exit +fi + +###### uplink + +#install root HTB, point default traffic to 1:30 +tc qdisc add dev $DEV root handle 1: htb default 30 + +#shape everything at $UPLINK speed to prevent queing +tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst 6k + +#voip class 1:10 - "the crown prince of bandwidth" +tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit burst 6k prio 1 + +#high prio class 1:20 +tc class add dev $DEV parent 1:1 classid 1:20 htb rate ${UPLINK}kbit burst 6k prio 2 + +#default class 1:30 +tc class add dev $DEV parent 1:1 classid 1:30 htb rate $[9*$UPLINK/10]kbit burst 6k prio 3 + +#bulk class 1:40 +tc class add dev $DEV parent 1:1 classid 1:40 htb rate $[8*$UPLINK/10]kbit burst 6k prio 4 + +#all get Stochastic Fairness +tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10 +tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10 +tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10 +tc qdisc add dev $DEV parent 1:40 handle 40: sfq perturb 10 + +#Voip TOS in 1:10 +tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip tos 0x18 0xff flowid 1:10 + +#Ports as defined above +for a in $VOIPPORTS +do + tc filter add dev $DEV parent 1:0 protocol ip prio 11 u32 match ip dport $a 0xffff flowid 1:10 + tc filter add dev $DEV parent 1:0 protocol ip prio 11 u32 match ip sport $a 0xffff flowid 1:10 +done + +#TOS Minimum Delay (ssh, NOT scp) in 1:20 +tc filter add dev $DEV parent 1:0 protocol ip prio 20 u32 match ip tos 0x10 0xff flowid 1:20 + +#DNS in interactive class 1:20 +tc filter add dev $DEV parent 1:0 protocol ip prio 21 u32 match ip sport 53 0xffff flowid 1:20 +tc filter add dev $DEV parent 1:0 protocol ip prio 22 u32 match ip dport 53 0xffff flowid 1:20 + +#only give TCP ACK's higher priority if this connection is asymmetrical +if [ ! $DOWNLINK = $UPLINK ] +then +#give TCP ACK's higher priority in 1:20 +tc filter add dev $DEV parent 1: protocol ip prio 23 u32 \ + match ip protocol 6 0xff \ + match u8 0x05 0x0f at 0 \ + match u16 0x0000 0xffc0 at 2 \ + match u8 0x10 0xff at 33 \ + flowid 1:20 +fi + +#Ports as defined above +for a in $INTPORTS +do + tc filter add dev $DEV parent 1:0 protocol ip prio 24 u32 match ip dport $a 0xffff flowid 1:20 + tc filter add dev $DEV parent 1:0 protocol ip prio 24 u32 match ip sport $a 0xffff flowid 1:20 +done + +#ICMP (ip protocol 1) in the interactive class 1:20 +tc filter add dev $DEV parent 1: protocol ip prio 25 u32 match ip protocol 1 0xff flowid 1:20 + +#the slowest of the slow +for a in $NOPRIOPORTDST +do + tc filter add dev $DEV parent 1: protocol ip prio 40 u32 match ip dport $a 0xffff flowid 1:40 +done + +for a in $NOPRIOPORTSRC +do + tc filter add dev $DEV parent 1: protocol ip prio 41 u32 match ip sport $a 0xffff flowid 1:40 +done + +for a in $NOPRIOHOSTSRC +do + tc filter add dev $DEV parent 1: protocol ip prio 42 u32 match ip src $a flowid 1:40 +done + +for a in $NOPRIOHOSTDST +do + tc filter add dev $DEV parent 1: protocol ip prio 43 u32 match ip dst $a flowid 1:40 +done + +#rest is 'non-interactive' ie 'bulk' and ends up in 1:30 +tc filter add dev $DEV parent 1: protocol ip prio 30 u32 match ip dst 0.0.0.0/0 flowid 1:30 + +########## downlink ############# +# slow downloads down to somewhat less than the real speed to prevent +# queuing at our ISP. Tune to see how high you can set it. +# ISPs tend to have *huge* queues to make sure big downloads are fast +# +# attach ingress policer: + +tc qdisc add dev $DEV handle ffff: ingress + +# filter *everything* to it (0.0.0.0/0), drop everything that's +# coming in too fast: +tc filter add dev $DEV parent ffff: protocol ip prio 100 u32 match ip src \ + 0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1 Modified: trunk/package/iproute2/astshape.init =================================================================== --- trunk/package/iproute2/astshape.init 2006-08-14 01:50:24 UTC (rev 249) +++ trunk/package/iproute2/astshape.init 2006-08-14 01:54:52 UTC (rev 250) @@ -7,10 +7,20 @@ then if [ "$EXTUP" -a "$EXTDOWN" ] then + +if [ -x /usr/sbin/shape ] +then echo "Starting AstShape..." /usr/sbin/astshape +else +echo "You don't have astshape installed" +exit 1 fi + fi + +fi +fi } stop () { @@ -18,10 +28,18 @@ then if [ "$EXTUP" -a "$EXTDOWN" ] then + +if [ -x /usr/sbin/astshape ] +then echo "Stopping AstShape..." /usr/sbin/astshape stop +else +echo "You don't have astshape installed" +exit 1 fi + fi +fi } case $1 in Modified: trunk/package/iproute2/iproute2.mk =================================================================== --- trunk/package/iproute2/iproute2.mk 2006-08-14 01:50:24 UTC (rev 249) +++ trunk/package/iproute2/iproute2.mk 2006-08-14 01:54:52 UTC (rev 250) @@ -39,6 +39,7 @@ $(INSTALL) -Dc $(IPROUTE2_DIR)/ip/ip $(TARGET_DIR)/sbin/ip $(INSTALL) -Dc $(IPROUTE2_DIR)/$(IPROUTE2_BINARY) $(TARGET_DIR)/$(IPROUTE2_TARGET_BINARY) $(INSTALL) -D -m 0755 package/iproute2/astshape.init $(TARGET_DIR)/etc/init.d/astshape + $(INSTALL) -D -m 0755 package/iproute2/astshape $(TARGET_DIR)/usr/sbin/astshape iproute2: uclibc linux $(TARGET_DIR)/$(IPROUTE2_TARGET_BINARY) Deleted: trunk/target/generic/target_skeleton/usr/sbin/astshape =================================================================== --- trunk/target/generic/target_skeleton/usr/sbin/astshape 2006-08-14 01:50:24 UTC (rev 249) +++ trunk/target/generic/target_skeleton/usr/sbin/astshape 2006-08-14 01:54:52 UTC (rev 250) @@ -1,134 +0,0 @@ -#!/bin/bash -# AstShape -# Based off of WonderShaper (HTB) -# Enhanced by Kristian Kielhofner <kr...@kr...> -# Make sure that all of your VoIP devices set tos on RTP to 0x18 -# iax.conf: tos=0x18 sip.conf: tos=0x18 - -. /etc/rc.conf - -DOWNLINK=$EXTDOWN -UPLINK=$EXTUP -DEV=$EXTIF - -if [ "$1" = "status" ] -then - echo "Showing AstShape status for $DEV" - echo - tc -s qdisc ls dev $DEV - tc -s class ls dev $DEV - exit -fi - - -# clean existing down- and uplink qdiscs, hide errors -tc qdisc del dev $DEV root 2> /dev/null > /dev/null -tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null - -if [ "$1" = "stop" ] -then - exit -fi - -###### uplink - -#install root HTB, point default traffic to 1:30 -tc qdisc add dev $DEV root handle 1: htb default 30 - -#shape everything at $UPLINK speed to prevent queing -tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst 6k - -#voip class 1:10 - "the crown prince of bandwidth" -tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit burst 6k prio 1 - -#high prio class 1:20 -tc class add dev $DEV parent 1:1 classid 1:20 htb rate ${UPLINK}kbit burst 6k prio 2 - -#default class 1:30 -tc class add dev $DEV parent 1:1 classid 1:30 htb rate $[9*$UPLINK/10]kbit burst 6k prio 3 - -#bulk class 1:40 -tc class add dev $DEV parent 1:1 classid 1:40 htb rate $[8*$UPLINK/10]kbit burst 6k prio 4 - -#all get Stochastic Fairness -tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10 -tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10 -tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10 -tc qdisc add dev $DEV parent 1:40 handle 40: sfq perturb 10 - -#Voip TOS in 1:10 -tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip tos 0x18 0xff flowid 1:10 - -#Ports as defined above -for a in $VOIPPORTS -do - tc filter add dev $DEV parent 1:0 protocol ip prio 11 u32 match ip dport $a 0xffff flowid 1:10 - tc filter add dev $DEV parent 1:0 protocol ip prio 11 u32 match ip sport $a 0xffff flowid 1:10 -done - -#TOS Minimum Delay (ssh, NOT scp) in 1:20 -tc filter add dev $DEV parent 1:0 protocol ip prio 20 u32 match ip tos 0x10 0xff flowid 1:20 - -#DNS in interactive class 1:20 -tc filter add dev $DEV parent 1:0 protocol ip prio 21 u32 match ip sport 53 0xffff flowid 1:20 -tc filter add dev $DEV parent 1:0 protocol ip prio 22 u32 match ip dport 53 0xffff flowid 1:20 - -#only give TCP ACK's higher priority if this connection is asymmetrical -if [ ! $DOWNLINK = $UPLINK ] -then -#give TCP ACK's higher priority in 1:20 -tc filter add dev $DEV parent 1: protocol ip prio 23 u32 \ - match ip protocol 6 0xff \ - match u8 0x05 0x0f at 0 \ - match u16 0x0000 0xffc0 at 2 \ - match u8 0x10 0xff at 33 \ - flowid 1:20 -fi - -#Ports as defined above -for a in $INTPORTS -do - tc filter add dev $DEV parent 1:0 protocol ip prio 24 u32 match ip dport $a 0xffff flowid 1:20 - tc filter add dev $DEV parent 1:0 protocol ip prio 24 u32 match ip sport $a 0xffff flowid 1:20 -done - -#ICMP (ip protocol 1) in the interactive class 1:20 -tc filter add dev $DEV parent 1: protocol ip prio 25 u32 match ip protocol 1 0xff flowid 1:20 - -#the slowest of the slow -for a in $NOPRIOPORTDST -do - tc filter add dev $DEV parent 1: protocol ip prio 40 u32 match ip dport $a 0xffff flowid 1:40 -done - -for a in $NOPRIOPORTSRC -do - tc filter add dev $DEV parent 1: protocol ip prio 41 u32 match ip sport $a 0xffff flowid 1:40 -done - -for a in $NOPRIOHOSTSRC -do - tc filter add dev $DEV parent 1: protocol ip prio 42 u32 match ip src $a flowid 1:40 -done - -for a in $NOPRIOHOSTDST -do - tc filter add dev $DEV parent 1: protocol ip prio 43 u32 match ip dst $a flowid 1:40 -done - -#rest is 'non-interactive' ie 'bulk' and ends up in 1:30 -tc filter add dev $DEV parent 1: protocol ip prio 30 u32 match ip dst 0.0.0.0/0 flowid 1:30 - -########## downlink ############# -# slow downloads down to somewhat less than the real speed to prevent -# queuing at our ISP. Tune to see how high you can set it. -# ISPs tend to have *huge* queues to make sure big downloads are fast -# -# attach ingress policer: - -tc qdisc add dev $DEV handle ffff: ingress - -# filter *everything* to it (0.0.0.0/0), drop everything that's -# coming in too fast: -tc filter add dev $DEV parent ffff: protocol ip prio 100 u32 match ip src \ - 0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2006-08-15 20:01:46
|
Revision: 261 Author: krisk84 Date: 2006-08-15 13:01:37 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/astlinux/?rev=261&view=rev Log Message: ----------- astshape init fix, remove support for opt Modified Paths: -------------- trunk/package/iproute2/astshape.init trunk/target/device/geni586/target_skeleton/boot/grub/grub.conf trunk/target/device/net4801/target_skeleton/boot/grub/grub.conf trunk/target/device/wrap/target_skeleton/boot/grub/grub.conf trunk/target/generic/target_skeleton/etc/rc Modified: trunk/package/iproute2/astshape.init =================================================================== --- trunk/package/iproute2/astshape.init 2006-08-15 19:52:10 UTC (rev 260) +++ trunk/package/iproute2/astshape.init 2006-08-15 20:01:37 UTC (rev 261) @@ -8,7 +8,7 @@ if [ "$EXTUP" -a "$EXTDOWN" ] then -if [ -x /usr/sbin/shape ] +if [ -x /usr/sbin/astshape ] then echo "Starting AstShape..." /usr/sbin/astshape Modified: trunk/target/device/geni586/target_skeleton/boot/grub/grub.conf =================================================================== --- trunk/target/device/geni586/target_skeleton/boot/grub/grub.conf 2006-08-15 19:52:10 UTC (rev 260) +++ trunk/target/device/geni586/target_skeleton/boot/grub/grub.conf 2006-08-15 20:01:37 UTC (rev 261) @@ -3,25 +3,25 @@ title AstLinux (Boot from IDE CF, USB KeyDisk) root (hd0,0) - kernel /boot/bzImage root=/dev/hda1 astlinux=i586 astkd=/dev/sda1 astopt=/dev/hda2 ide=nodma + kernel /boot/bzImage root=/dev/hda1 astlinux=i586 astkd=/dev/sda1 ide=nodma savedefault title AstLinux (Boot from USB, IDE CF/HD KeyDisk) root (hd0,0) - kernel /boot/bzImage root=/dev/sda1 astlinux=i586 astkd=/dev/hda1 astopt=/dev/sda2 ide=nodma rootdelay=10 + kernel /boot/bzImage root=/dev/sda1 astlinux=i586 astkd=/dev/hda1 ide=nodma rootdelay=10 savedefault title AstLinux (Boot from USB, Use third partition for KeyDisk) root (hd0,0) - kernel /boot/bzImage root=/dev/sda1 astlinux=i586 astkd=/dev/sda3 astopt=/dev/sda2 ide=nodma rootdelay=10 + kernel /boot/bzImage root=/dev/sda1 astlinux=i586 astkd=/dev/sda3 ide=nodma rootdelay=10 savedefault title AstLinux (Boot from IDE CF, IDE CF/HD KeyDisk - secondary master) root (hd0,0) - kernel /boot/bzImage root=/dev/hda1 astlinux=i586 astkd=/dev/hdc1 astopt=/dev/hda2 ide=nodma + kernel /boot/bzImage root=/dev/hda1 astlinux=i586 astkd=/dev/hdc1 ide=nodma savedefault title AstLinux (Boot from IDE CF, Use third partition for KeyDisk) root (hd0,0) - kernel /boot/bzImage root=/dev/hda1 astlinux=i586 astkd=/dev/hda3 astopt=/dev/hda2 ide=nodma + kernel /boot/bzImage root=/dev/hda1 astlinux=i586 astkd=/dev/hda3 ide=nodma savedefault Modified: trunk/target/device/net4801/target_skeleton/boot/grub/grub.conf =================================================================== --- trunk/target/device/net4801/target_skeleton/boot/grub/grub.conf 2006-08-15 19:52:10 UTC (rev 260) +++ trunk/target/device/net4801/target_skeleton/boot/grub/grub.conf 2006-08-15 20:01:37 UTC (rev 261) @@ -5,10 +5,10 @@ title AstLinux (Boot from CF - Use USB KeyDisk) root (hd0,0) - kernel /boot/bzImage root=/dev/hda1 console=ttyS0,19200n8 astlinux=net4801 astkd=/dev/sda1 astopt=/dev/hda2 ide=nodma + kernel /boot/bzImage root=/dev/hda1 console=ttyS0,19200n8 astlinux=net4801 astkd=/dev/sda1 ide=nodma savedefault title AstLinux (Boot from CF - Use third partition for KeyDisk) root (hd0,0) - kernel /boot/bzImage root=/dev/hda1 console=ttyS0,19200n8 astlinux=net4801 astkd=/dev/hda3 astopt=/dev/hda2 ide=nodma + kernel /boot/bzImage root=/dev/hda1 console=ttyS0,19200n8 astlinux=net4801 astkd=/dev/hda3 ide=nodma savedefault Modified: trunk/target/device/wrap/target_skeleton/boot/grub/grub.conf =================================================================== --- trunk/target/device/wrap/target_skeleton/boot/grub/grub.conf 2006-08-15 19:52:10 UTC (rev 260) +++ trunk/target/device/wrap/target_skeleton/boot/grub/grub.conf 2006-08-15 20:01:37 UTC (rev 261) @@ -5,10 +5,10 @@ title AstLinux (Boot from CF - Use USB KeyDisk) root (hd0,0) - kernel /boot/bzImage root=/dev/hda1 console=ttyS0,38400n8 astlinux=net4801 astkd=/dev/sda1 astopt=/dev/hda2 ide=nodma reboot=bios + kernel /boot/bzImage root=/dev/hda1 console=ttyS0,38400n8 astlinux=net4801 astkd=/dev/sda1 ide=nodma reboot=bios savedefault title AstLinux (Boot from CF - Use third partition for KeyDisk) root (hd0,0) - kernel /boot/bzImage root=/dev/hda1 console=ttyS0,38400n8 astlinux=net4801 astkd=/dev/hda3 astopt=/dev/hda2 ide=nodma reboot=bios + kernel /boot/bzImage root=/dev/hda1 console=ttyS0,38400n8 astlinux=net4801 astkd=/dev/hda3 ide=nodma reboot=bios savedefault Modified: trunk/target/generic/target_skeleton/etc/rc =================================================================== --- trunk/target/generic/target_skeleton/etc/rc 2006-08-15 19:52:10 UTC (rev 260) +++ trunk/target/generic/target_skeleton/etc/rc 2006-08-15 20:01:37 UTC (rev 261) @@ -200,13 +200,8 @@ if [ $OPTDEV ] then -echo "$OPTDEV /mnt/opt ext2 ro,noauto 0 0" >> /tmp/etc/fstab -export PATH=$PATH:/mnt/opt/sbin:/mnt/opt/bin -if `mount /mnt/opt > /dev/null 2> /dev/null` -then -echo "$OPTDEV mounted" +echo "ASTOPT IS NO LONGER SUPPORTED - $OPTDEV WILL NOT BE MOUNTED" fi -fi if [ "$KDDEV" ] then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |