Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/altq/altqd Import the altq configuration daemon.



details:   https://anonhg.NetBSD.org/src/rev/7210f7a86554
branches:  trunk
changeset: 500684:7210f7a86554
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Dec 16 17:39:40 2000 +0000

description:
Import the altq configuration daemon.

diffstat:

 usr.sbin/altq/altqd/Makefile                            |    29 +
 usr.sbin/altq/altqd/altq.conf.5                         |  1172 +++++++++++++++
 usr.sbin/altq/altqd/altq.conf.samples/cbq.bandwidthtest |    17 +
 usr.sbin/altq/altqd/altq.conf.samples/cbq.diffedge      |    57 +
 usr.sbin/altq/altqd/altq.conf.samples/cbq.lo0           |    12 +
 usr.sbin/altq/altqd/altq.conf.samples/cbq.sample0       |    57 +
 usr.sbin/altq/altqd/altq.conf.samples/cbq.sample1       |    18 +
 usr.sbin/altq/altqd/altq.conf.samples/cbq.sample2       |    13 +
 usr.sbin/altq/altqd/altq.conf.samples/cbq.sharing       |    36 +
 usr.sbin/altq/altqd/altq.conf.samples/cbq.v6            |    68 +
 usr.sbin/altq/altqd/altq.conf.samples/cbq.widecamp      |    94 +
 usr.sbin/altq/altqd/altq.conf.samples/cdnr.sample       |    36 +
 usr.sbin/altq/altqd/altq.conf.samples/hfsc.diffedge     |    59 +
 usr.sbin/altq/altqd/altq.conf.samples/hfsc.grate        |    23 +
 usr.sbin/altq/altqd/altq.conf.samples/hfsc.lo0          |    23 +
 usr.sbin/altq/altqd/altq.conf.samples/hfsc.pvc0         |    14 +
 usr.sbin/altq/altqd/altq.conf.samples/hfsc.share        |    34 +
 usr.sbin/altq/altqd/altqd.8                             |   102 +
 usr.sbin/altq/altqd/altqd.c                             |   339 ++++
 usr.sbin/altq/altqd/if_nameindex.c                      |   130 +
 usr.sbin/altq/altqd/if_nameindex.h                      |    17 +
 usr.sbin/altq/altqd/libaltq2.c                          |    69 +
 22 files changed, 2419 insertions(+), 0 deletions(-)

diffs (truncated from 2508 to 300 lines):

diff -r 4bed169312cf -r 7210f7a86554 usr.sbin/altq/altqd/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/altq/altqd/Makefile      Sat Dec 16 17:39:40 2000 +0000
@@ -0,0 +1,29 @@
+PREFIX?=       /usr/local
+SYS_INCLUDES?= -I/usr/src/sys-altq
+
+PROGS=         altqd
+ALTQD_OBJS=    altqd.o if_nameindex.o libaltq2.o ../libaltq/libaltq.a
+MAN5=          altq.conf.5
+MAN8=          altqd.8
+
+CFLAGS=                -g -Wall
+CFLAGS+=       -W -Wpointer-arith -Wcast-qual -Wmissing-prototypes -ansi
+DEFINES=       -DALTQ $(SYS_DEFINES)
+INCLUDES=      -I. -I../libaltq $(SYS_INCLUDES)
+
+all: $(PROGS)
+
+install: $(PROGS)
+       $(INSTALL) $(COPY) -m 0755 $(PROGS) $(PREFIX)/bin
+       $(INSTALL) $(COPY) -m 0644 $(MAN5) $(PREFIX)/man/man5
+       $(INSTALL) $(COPY) -m 0644 $(MAN8) $(PREFIX)/man/man8
+
+altqd: $(ALTQD_OBJS)
+       $(CC) $(CFLAGS) $(INCLUDES) $(DEFINES) -o $@ $(ALTQD_OBJS) $(SYS_LIBS) -lm
+
+.c.o: 
+       $(CC) $(CFLAGS) $(INCLUDES) $(DEFINES) -c $*.c
+
+clean:;                -rm -f $(PROGS) *.a *.o core *.core *.bak ,* *~ "#"*
+
+
diff -r 4bed169312cf -r 7210f7a86554 usr.sbin/altq/altqd/altq.conf.5
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/altq/altqd/altq.conf.5   Sat Dec 16 17:39:40 2000 +0000
@@ -0,0 +1,1172 @@
+.\"    $KAME: altq.conf.5,v 1.7 2000/11/09 02:50:45 itojun Exp $
+.\"
+.\" Copyright (C) 2000
+.\" Sony Computer Science Laboratories Inc.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 
+.\" THIS SOFTWARE IS PROVIDED BY SONY CSL AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL SONY CSL OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd September 28, 1999
+.Dt ALTQ.CONF 5
+.Os KAME
+.\"
+.Sh NAME
+.Nm altq.conf
+.Nd ALTQ configuration file
+.\"
+.Sh DESCRIPTION
+The
+.Nm altq.conf
+file contains a number of lines specifying the behavior of queueing
+disciplines.  Comments start with a # and extend to the end of the line.
+.Pp
+The
+.Xr altqd 8
+program reads 
+.Pa /etc/altq.conf
+at startup and sets up queueing disciplines.
+BLUE, CBQ (Class-Based Queueing), FIFOQ (First-In First-Out Queue),
+HFSC (Hierarchical Fair Service Curve), PRIQ (Priority Queueing),
+RED (Random Early Detection), RIO (RED with IN/OUT),
+WFQ (Weighted Fair Queueing), 
+and CDNR (Diffserv Traffic Conditioner) can be configured in this file.
+.Pp
+.Sh Interface Commands
+.Bl -tag -width interface -offset indent
+.It Nm interface
+.Ar if_name
+.Op Cm bandwidth Ar bps
+.Op Cm tbrsize Ar bytes
+.Op Ar sched_type
+.Op Ar discipline-specific-options
+.El
+.Pp
+The 
+.Sy interface
+command specifies a network interface to be under control of ALTQ.
+One interface specification is provided for each network interface
+under control of ALTQ.  A system configured as a router may have
+multiple interface specifications.
+.\"
+.Bl -tag -width 8n -offset indent
+.It Em if_name
+specifies the name of a network interface (e.g., fxp0).
+.It Sy bandwidth
+specifies the interface bandwidth in bits per second.  
+This is the maximum rate that the queueing discipline will allow on this
+interface.
+.It Sy tbrsize
+specifies the bucket size of a token bucket regulator in bytes.  
+When
+.Sy tbrsize
+is omitted, the system automatically sets the bucket size
+using heuristics.
+The token rate is set to the interface bandwidth specified by the
+.Sy interface
+command.
+.It Em sched_type
+Type of a queueing discipline.  It must be either
+.Sy blue ,
+.Sy cbq ,
+.Sy fifoq ,
+.Sy hfsc ,
+.Sy priq ,
+.Sy red ,
+.Sy rio ,
+or
+.Sy wfq.
+If the interface has only traffic conditioners and no queueing
+discipline, sched_type can be omitted.
+.El
+.Pp
+.Sh Class Command
+.Bl -tag -width class -offset indent
+.It Nm class
+.Ar sched_type
+.Ar if_name
+.Ar class_name
+.Ar parent_name
+.Op Cm red|rio
+.Op Cm ecn
+.Op Cm cleardscp
+.Op Ar discipline-specific-options
+.El
+.Pp
+The 
+.Sy class
+command specifies a packet scheduling class for CBQ, HFSC, or PRIQ.
+A class specifier must be provided for each packet scheduling class.
+.Bl -tag -width 8n -offset indent
+.It Em sched_type
+Type of queueing discipline.  Must correspond to the discipline name
+in interface specification.
+.It Em if_name
+Interface name. Must correspond to name in interface specification.
+.It Em class_name
+Arbitrary name for this class.  Must be unique for this interface.  
+.It Em parent_name
+The name of the parent class for this class (for CBQ or HFSC).
+Parent class must have been previously defined.
+PRIQ does not have class hierarchy and parent_name must be ``NULL''
+for PRIQ classes.
+.It Sy red
+Use RED (Random Early Detection) on this class queue.
+RED drops packets with the probability propotional to the average
+queue length.
+.It Sy rio
+Use RIO (RED with In/Out bit) on this class queue.
+RIO runs triple RED algorithms at the same time.
+.It Sy ecn
+Use RED/ECN (Explicit Congestion Notification) on this
+class queue (experimental implementation).  ECN implies RED.
+.It Sy cleardscp
+Clear diffserv codepoint in the IP header.
+.El
+.Pp
+.Sh Filter Commands
+.Bl -tag -width filter -offset indent
+.It Nm filter
+.Ar if_name
+.Ar class_name
+.Op Cm name Ar fltr_name
+.Op Cm ruleno Ar num
+.Ar filter_values
+.El
+.Pp
+The 
+.Sy filter
+command specifies a filter to classify packets into
+a scheduling class.
+A filter specifier determines any statically-defined packet
+classification rules.  
+.Bl -tag -width 10n -offset indent
+.It Em if_name
+Name of a network interface (e.g., fxp0).
+.It Em class_name
+Name of a class or a conditioner to which matching packets are directed.
+.It Sy name
+Add an arbitrary name to the filter for a future refenece.
+.It Sy ruleno
+Specifies explicit order of filter matching.  Filter matching is performed
+from a filter with a larger ruleno.  Default is 0.
+.El
+.Pp
+.Em filter_value
+should be in the following format:
+.Bl -tag -width filter -offset indent
+.It filter_values:
+.Ad dst_addr Op Cm netmask Ar mask
+.Ar dport
+.Ad src_addr Op Cm netmask Ar mask
+.Ar sport
+.Ar proto
+.Oo
+.Sy tos 
+.Ar value 
+.Op Cm tosmask Ar value
+.Oc
+.Op Cm gpi Ar value
+.El
+.Pp
+Here 
+.Ad dst_addr
+and
+.Ad src_addr
+are dotted-decimal addresses of
+the destination and the source respectively.  An address may be
+followed by 
+.Sy netmask
+keyword.
+.Em dport
+and
+.Em sport
+are port numbers of the destination and the source respectively.
+.Em proto
+is a protocol number defined for IP packets (e.g. 6 for TCP).
+.Sy tos
+keyword can be used to specify the type of service field value.
+.Sy gpi
+keyword can be used to specify the Security Parameter Index value for 
+IPSec.
+.Pp
+When filter value 0 is used, it is taken as a wildcard.
+.Bl -tag -width filter6 -offset indent
+.It Nm filter6
+.Ar if_name
+.Ar class_name
+.Op Cm name Ar fltr_name
+.Op Cm ruleno Ar num
+.Ar filter6_values
+.El
+.Pp
+The 
+.Sy filter6
+command is for IPv6. 
+.Em filter6_value
+should be in the following format:
+.Bl -tag -width filter6 -offset indent
+.It filter6_values:
+.Ad dst_addr[/prefix_len]
+.Ar dport
+.Ad src_addr[/prefix_len]
+.Ar sport
+.Ar proto
+.Op Cm flowlabel Ar value
+.Oo
+.Sy tclass
+.Ar value 
+.Op Cm tclassmask Ar value
+.Oc
+.Op Cm gpi Ar value
+.El
+.Pp
+Here 
+.Ad dst_addr
+and
+.Ad src_addr
+are IPv6 addresses of the destination and the source respectively.
+An address may be followed by an optional 
+.Sy address prefix length.
+.Em dport
+and
+.Em sport
+are port numbers of the destination and the source respectively.
+.Em proto
+is a protocol number defined for IPv6 packets (e.g. 6 for TCP).
+.Sy flowlabel
+keyword can be used to specify the flowlabel field value.
+.Sy tclass
+keyword can be used to specify the traffic class field value.
+.Sy gpi
+keyword can be used to specify the Security Parameter Index value for
+IPSec.
+.Pp
+When filter value 0 is used, it is taken as a wildcard.
+.Pp



Home | Main Index | Thread Index | Old Index