xref: /netbsd-src/usr.sbin/altq/libaltq/qop_conf.c (revision 0d33c75c011a3e4f0696de85363f64f94253fbbc)
1*0d33c75cSchristos /*	$NetBSD: qop_conf.c,v 1.4 2011/08/16 12:49:13 christos Exp $	*/
2dd191f37Speter /*	$KAME: qop_conf.c,v 1.3 2002/10/26 06:59:53 kjc Exp $	*/
395a65560Sthorpej /*
495a65560Sthorpej  * Copyright (C) 1999-2000
595a65560Sthorpej  *	Sony Computer Science Laboratories, Inc.  All rights reserved.
695a65560Sthorpej  *
795a65560Sthorpej  * Redistribution and use in source and binary forms, with or without
895a65560Sthorpej  * modification, are permitted provided that the following conditions
995a65560Sthorpej  * are met:
1095a65560Sthorpej  * 1. Redistributions of source code must retain the above copyright
1195a65560Sthorpej  *    notice, this list of conditions and the following disclaimer.
1295a65560Sthorpej  * 2. Redistributions in binary form must reproduce the above copyright
1395a65560Sthorpej  *    notice, this list of conditions and the following disclaimer in the
1495a65560Sthorpej  *    documentation and/or other materials provided with the distribution.
1595a65560Sthorpej  *
1695a65560Sthorpej  * THIS SOFTWARE IS PROVIDED BY SONY CSL AND CONTRIBUTORS ``AS IS'' AND
1795a65560Sthorpej  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1895a65560Sthorpej  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1995a65560Sthorpej  * ARE DISCLAIMED.  IN NO EVENT SHALL SONY CSL OR CONTRIBUTORS BE LIABLE
2095a65560Sthorpej  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2195a65560Sthorpej  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2295a65560Sthorpej  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2395a65560Sthorpej  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2495a65560Sthorpej  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2595a65560Sthorpej  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2695a65560Sthorpej  * SUCH DAMAGE.
2795a65560Sthorpej  */
2895a65560Sthorpej 
2995a65560Sthorpej #include <sys/param.h>
3095a65560Sthorpej #include <sys/socket.h>
3195a65560Sthorpej #include <net/if.h>
3295a65560Sthorpej #include <stdio.h>
33*0d33c75cSchristos #include <string.h>
3495a65560Sthorpej 
3595a65560Sthorpej #include <altq/altq.h>
3695a65560Sthorpej #include "altq_qop.h"
3795a65560Sthorpej 
3895a65560Sthorpej typedef int (interface_parser_t)(const char *, int, char **);
3995a65560Sthorpej typedef int (class_parser_t)(const char *, const char *, const char *,
4095a65560Sthorpej 			     int, char **);
4195a65560Sthorpej 
4295a65560Sthorpej extern interface_parser_t	null_interface_parser;
4395a65560Sthorpej extern class_parser_t		null_class_parser;
4495a65560Sthorpej extern interface_parser_t	cbq_interface_parser;
4595a65560Sthorpej extern class_parser_t		cbq_class_parser;
4695a65560Sthorpej extern interface_parser_t	hfsc_interface_parser;
4795a65560Sthorpej extern class_parser_t		hfsc_class_parser;
4895a65560Sthorpej extern interface_parser_t	red_interface_parser;
4995a65560Sthorpej extern interface_parser_t	rio_interface_parser;
5095a65560Sthorpej extern interface_parser_t	blue_interface_parser;
5195a65560Sthorpej extern interface_parser_t	wfq_interface_parser;
5295a65560Sthorpej extern interface_parser_t	fifoq_interface_parser;
5395a65560Sthorpej extern interface_parser_t	priq_interface_parser;
5495a65560Sthorpej extern class_parser_t		priq_class_parser;
55dd191f37Speter extern interface_parser_t	jobs_interface_parser;
56dd191f37Speter extern class_parser_t		jobs_class_parser;
5795a65560Sthorpej 
5895a65560Sthorpej struct qdisc_parser qdisc_parser[] = {
5995a65560Sthorpej 	{"null",	null_interface_parser,	null_class_parser},
6095a65560Sthorpej 	{"cbq",		cbq_interface_parser,	cbq_class_parser},
6195a65560Sthorpej 	{"hfsc",	hfsc_interface_parser,	hfsc_class_parser},
6295a65560Sthorpej 	{"red",		red_interface_parser,	NULL},
6395a65560Sthorpej 	{"rio",		rio_interface_parser,	NULL},
6495a65560Sthorpej 	{"blue",	blue_interface_parser,	NULL},
6595a65560Sthorpej 	{"wfq",		wfq_interface_parser,	NULL},
6695a65560Sthorpej 	{"fifoq",	fifoq_interface_parser,	NULL},
6795a65560Sthorpej 	{"priq",	priq_interface_parser,	priq_class_parser},
68dd191f37Speter 	{"jobs",	jobs_interface_parser,	jobs_class_parser},
6995a65560Sthorpej 	{NULL, NULL, NULL}
7095a65560Sthorpej };
7195a65560Sthorpej 
72