summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Alberto Suarez Lopez <bass@gentoo.org>2003-08-17 18:34:53 +0000
committerJose Alberto Suarez Lopez <bass@gentoo.org>2003-08-17 18:34:53 +0000
commit49fb8024469c33b1a021dbcd471e009b71c1099b (patch)
tree9816e8c545769228795a9c9377f60d68a2d02b0b /net-misc
parentFix mirror list for rc1 (diff)
downloadgentoo-2-49fb8024469c33b1a021dbcd471e009b71c1099b.tar.gz
gentoo-2-49fb8024469c33b1a021dbcd471e009b71c1099b.tar.bz2
gentoo-2-49fb8024469c33b1a021dbcd471e009b71c1099b.zip
First release
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/htbinit/ChangeLog9
-rw-r--r--net-misc/htbinit/Manifest4
-rw-r--r--net-misc/htbinit/files/digest-htbinit-0.8.41
-rw-r--r--net-misc/htbinit/files/htb.sysconfig265
-rw-r--r--net-misc/htbinit/files/rc_htbinit53
-rw-r--r--net-misc/htbinit/htbinit-0.8.4.ebuild47
6 files changed, 379 insertions, 0 deletions
diff --git a/net-misc/htbinit/ChangeLog b/net-misc/htbinit/ChangeLog
new file mode 100644
index 000000000000..682fe84b22b4
--- /dev/null
+++ b/net-misc/htbinit/ChangeLog
@@ -0,0 +1,9 @@
+# ChangeLog for net-misc/htbinit
+# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/htbinit/ChangeLog,v 1.1 2003/08/17 18:34:53 bass Exp $
+
+*htbinit-0.8.4 (17 Aug 2003)
+
+ 19 Jun 2003; J.Alberto Suárez L. <bass@gentoo.org> htbinit-0.8.4.ebuild:
+ First release. Thanks to Juan J. Prieto <jjptapia@eresmas.com>.
+
diff --git a/net-misc/htbinit/Manifest b/net-misc/htbinit/Manifest
new file mode 100644
index 000000000000..bc59d463d86b
--- /dev/null
+++ b/net-misc/htbinit/Manifest
@@ -0,0 +1,4 @@
+MD5 fc6f955ded8f29568602c8a9ff0e5bb3 htbinit-0.8.4.ebuild 1236
+MD5 04685986bc5af0b6724b8927f07a7657 files/digest-htbinit-0.8.4 59
+MD5 68de55d5fb71c7c25799d661a947c836 files/rc_htb.init 1046
+MD5 e9d322349aedc729948e23b4dfac59ac files/htb.sysconfig 7137
diff --git a/net-misc/htbinit/files/digest-htbinit-0.8.4 b/net-misc/htbinit/files/digest-htbinit-0.8.4
new file mode 100644
index 000000000000..7562b70efeb5
--- /dev/null
+++ b/net-misc/htbinit/files/digest-htbinit-0.8.4
@@ -0,0 +1 @@
+MD5 2baa55f336f87739c5184c87b9973345 htb.init-v0.8.4 31345
diff --git a/net-misc/htbinit/files/htb.sysconfig b/net-misc/htbinit/files/htb.sysconfig
new file mode 100644
index 000000000000..6c03c4233d1a
--- /dev/null
+++ b/net-misc/htbinit/files/htb.sysconfig
@@ -0,0 +1,265 @@
+#!/bin/bash
+
+# This is the main script to build the configuration
+# files in the format proposed by htb.init
+
+# By default, if nothing is modified, the generated files
+# are adequate to create classes that control minimum latency
+# and maximum throughput traffic.
+
+# But two (2) more classes are created, one specific for web traffic (port 80)
+# and a 'default' class for the rest. Normally, web traffic is considered of minimum
+# latency and that's the way we have configured it (it has a higher priority
+# than the maximum throughput and default), but it has it's own class because
+# of it's importance, so you could assign it a different class from ssh, dns, etc.
+
+# If you want to adjust the values for your own connection,
+# it will be enough to know the download and dowload bandwidth
+# to automatically adjust the RATE and CEIL values of each class.
+# When you are done, don't forget to execute:
+#
+# /etc/init.d/htb.init recreate
+# /etc/init.d/htb.init reload
+#
+# to rebuild the configuration files and restart the service.
+
+# By default the values are calculated for a 256Kbits download
+# and 128 Kbits upload bandwidth, very commom in Spain.
+#
+# NOTE: all values should be around 95-98% aprox. of the real ones
+# to be shure the queue is managed in your Linux router.
+########################################################
+
+##############################################################
+## WARNING: DON'T DELETE THE LINES WITH '/bin/cat' OR 'EOF' ##
+##############################################################
+# The htb.sysconfig script use the command 'cat' to generate #
+# the config files necesary for htb.init #
+##############################################################
+
+# I have considere NET like Internet zone, LOC the local network
+# and DMZ the dmz zone. Modify to your needs.
+NET=eth0
+LOC=eth1
+DMZ=eth2
+
+########################################################
+# --- Configuration files for NET zone.
+########################################################
+# Allowed keywords are DEFAULT, R2Q, DCACHE.
+/bin/cat > /etc/htbinit/$NET << EOF
+DEFAULT=40
+EOF
+
+# Maximum for root class
+# Allowed keywords are RATE, BURST, CBURST, INJECT, MTU
+/bin/cat > /etc/htbinit/$NET-2.root << EOF
+RATE=122Kbit
+BURST=2k
+EOF
+
+# Values for minimum latency class
+# Typical services: ssh, telnet, ftp, irc, dns, smtp, pop3, imap2
+# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO,
+# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME
+/bin/cat > /etc/htbinit/$NET-2:10.minlatency << EOF
+CEIL=122Kbit
+RATE=6Kbit
+BURST=2K
+LEAF=sfq
+PRIO=3
+RULE=:22
+RULE=:21
+RULE=:23
+RULE=:6667
+RULE=:53
+RULE=:25
+RULE=:110
+RULE=:143
+EOF
+
+# Values for maximum throughput class
+# Typical services: ftp-data.
+# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO,
+# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME
+/bin/cat > /etc/htbinit/$NET-2:20.maxthroughput << EOF
+CEIL=115Kbit
+RATE=55Kbit
+BURST=2K
+LEAF=sfq
+PRIO=5
+RULE=:20
+EOF
+
+# Values for web traffic
+# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO,
+# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME
+/bin/cat > /etc/htbinit/$NET-2:30.www << EOF
+CEIL=122Kbit
+RATE=31Kbit
+BURST=2K
+LEAF=sfq
+PRIO=4
+RULE=:80
+RULE=:443
+EOF
+
+# Values for default class
+# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO,
+# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME
+/bin/cat > /etc/htbinit/$NET-2:40.default << EOF
+CEIL=122Kbit
+RATE=30Kbit
+BURST=2k
+LEAF=sfq
+PRIO=6
+EOF
+
+########################################################
+# --- Configuration files for local zone (eth1).
+########################################################
+# Allowed keywords are DEFAULT, R2Q, DCACHE.
+/bin/cat > /etc/htbinit/$LOC << EOF
+DEFAULT=40
+EOF
+
+# Maximum for root class
+# Allowed keywords are RATE, BURST, CBURST, INJECT, MTU
+/bin/cat > /etc/htbinit/$LOC-2.root << EOF
+RATE=244Kbit
+BURST=2k
+EOF
+
+# Values for minimum latency class
+# Typical services: ssh, telnet, ftp, irc, dns, smtp, pop3, imap2
+# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO,
+# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME
+/bin/cat > /etc/htbinit/$LOC-2:10.minlatency << EOF
+CEIL=244Kbit
+RATE=12Kbit
+BURST=2K
+LEAF=sfq
+PRIO=3
+RULE=:22,
+RULE=:21,
+RULE=:23,
+RULE=:6667,
+RULE=:53,
+RULE=:25,
+RULE=:110,
+RULE=:143,
+EOF
+
+# Values for maximum throughput class
+# Typical services: ftp-data.
+# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO,
+# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME
+/bin/cat > /etc/htbinit/$LOC-2:20.maxthroughput << EOF
+CEIL=230Kbit
+RATE=110Kbit
+BURST=2K
+LEAF=sfq
+PRIO=5
+RULE=:20,
+EOF
+
+# Values for web traffic
+# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO,
+# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME
+/bin/cat > /etc/htbinit/$LOC-2:30.www << EOF
+CEIL=244Kbit
+RATE=61Kbit
+BURST=2K
+LEAF=sfq
+PRIO=4
+RULE=:80,
+RULE=:443,
+EOF
+
+# Values for default class
+# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO,
+# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME
+/bin/cat > /etc/htbinit/$LOC-2:40.default << EOF
+CEIL=244Kbit
+RATE=61Kbit
+BURST=2k
+LEAF=sfq
+PRIO=6
+EOF
+
+########################################################
+# --- Configuration files for DMZ (eth2).
+########################################################
+# WARNING: the values in the DMZ zone are merely orientative, this is,
+# take them just as an academic example. If you have such a zone,
+# uncomment the needed parts and adjust all values. Remember,
+# download and upload traffic are shared by the local and dmz zone.
+# Of course, we suppose you are offering such services in the DMZ.
+# Allowed keywords are DEFAULT, R2Q, DCACHE.
+#/bin/cat > /etc/htbinit/eth2 << EOF
+#DEFAULT=40
+#EOF
+
+# Maximum for root class
+# Allowed keywords are RATE, BURST, CBURST, INJECT, MTU
+#/bin/cat > /etc/htbinit/$DMZ-2.root << EOF
+#RATE=244Kbit
+#BURST=2k
+#EOF
+
+# Values for minimum latency class
+# Typical services: ssh, telnet, ftp, irc, dns, smtp, pop3, imap2
+# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO,
+# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME
+#/bin/cat > /etc/htbinit/$DMZ-2:10.minlatency << EOF
+#CEIL=244Kbit
+#RATE=12Kbit
+#BURST=2K
+#LEAF=sfq
+#PRIO=3
+#RULE=:22
+#RULE=:21
+#RULE=:23
+#RULE=:6667
+#RULE=:53
+#RULE=:25
+#RULE=:110
+#RULE=:143
+#EOF
+
+# Values for maximum throughput class
+# Typical services: ftp-data.
+# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO,
+# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME
+#/bin/cat > /etc/htbinit/$DMZ-2:20.maxthroughput << EOF
+#CEIL=230Kbit
+#RATE=110Kbit
+#BURST=2K
+#LEAF=sfq
+#PRIO=5
+#RULE=:20
+#EOF
+
+# Values for web traffic
+# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO,
+# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME
+#/bin/cat > /etc/htbinit/$DMZ-2:30.www << EOF
+#CEIL=244Kbit
+#RATE=61Kbit
+#BURST=2K
+#LEAF=sfq
+#PRIO=4
+#RULE=:80
+#RULE=:443
+#EOF
+
+# Values for default class
+# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO,
+# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME
+#/bin/cat > /etc/htbinit/$DMZ-2:40.default << EOF
+#CEIL=244Kbit
+#RATE=61Kbit
+#BURST=2k
+#LEAF=sfq
+#PRIO=6
+#EOF
diff --git a/net-misc/htbinit/files/rc_htbinit b/net-misc/htbinit/files/rc_htbinit
new file mode 100644
index 000000000000..2679e4853b51
--- /dev/null
+++ b/net-misc/htbinit/files/rc_htbinit
@@ -0,0 +1,53 @@
+#!/sbin/runscript
+#
+# (c) 2003 Juan J. Prieto <jjptapia@eresmas.com>
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# ===
+#
+# htbinit
+#
+# A shell-script wrapper for HTB.INIT designed for
+# use in the SysV-init system (/etc/init.d).
+#
+# usage: htbinit { start | stop | restart | reload | recreate | stats }
+#
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting htbinit"
+ /usr/sbin/htbinit start
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping htbinit"
+ /usr/sbin/htbinit stop
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading htbinit"
+ /usr/sbin/htbinit start invalidate
+ eend $?
+}
+
+recreate() {
+ ebegin "Recreating htbinit config files"
+ /bin/rm -rf /etc/htbinit/*
+ /usr/sbin/htb.sysconfig
+ einfo "htbinit (QoS) ... recreated. Use \"reload\" to load the new configuration."
+ eend $?
+}
+
+stats() {
+ ebegin "Showing htbinit stats"
+ /usr/sbin/htbinit stats
+ eend $?
+}
diff --git a/net-misc/htbinit/htbinit-0.8.4.ebuild b/net-misc/htbinit/htbinit-0.8.4.ebuild
new file mode 100644
index 000000000000..dad3871f2dd0
--- /dev/null
+++ b/net-misc/htbinit/htbinit-0.8.4.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/htbinit/htbinit-0.8.4.ebuild,v 1.1 2003/08/17 18:34:53 bass Exp $
+
+DESCRIPTION="Sets up Hierachical Token Bucket based traffic control (QoS) with iproute2"
+HOMEPAGE="http://www.sourceforge.net/projects/htbinit"
+SRC_URI="http://unc.dl.sourceforge.net/sourceforge/htbinit/htb.init-v${PV}"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~sparc ~alpha"
+
+DEPEND="sys-apps/iproute"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ cp ${DISTDIR}/htb.init-v${PV} ${S}
+}
+
+src_compile() {
+ mv htb.init-v${PV} htb.init-v${PV}.orig
+ sed <htb.init-v${PV}.orig >htb.init-v${PV} \
+ -e 's|HTB_PATH=${HTB_PATH:-/etc/sysconfig/htb}|HTB_PATH=/etc/htbinit|' \
+ -e 's|HTB_CACHE=${HTB_CACHE:-/var/cache/htb.init}|HTB_CACHE=/var/cache/htbinit|'
+}
+
+src_install() {
+ mv htb.init-v${PV} htbinit
+
+ exeinto /usr/sbin
+ doexe htbinit
+
+ exeinto /usr/sbin
+ doexe ${FILESDIR}/htb.sysconfig
+
+ exeinto /etc/init.d
+ newexe ${FILESDIR}/rc_htbinit htbinit
+
+ dodoc htbinit ${FILESDIR}/htb.sysconfig
+}
+
+pkg_postinst() {
+ einfo 'Run "rc-update add htbinit default" to run htbinit at startup.'
+ einfo 'Edit "/usr/sbin/htb.sysconfig" to make a custom configuration.'
+ einfo 'Please, read carefully the htbinit and htb.sysconfig documentation.'
+}