Home | History | Annotate | Line # | Download | only in libaltq
qop_cbq.h revision 1.1
      1 /*	$KAME: qop_cbq.h,v 1.2 2000/10/18 09:15:18 kjc Exp $	*/
      2 /*
      3  * Copyright (c) Sun Microsystems, Inc. 1993-1998 All rights reserved.
      4  *
      5  * Redistribution and use in source and binary forms, with or without
      6  * modification, are permitted provided that the following conditions
      7  * are met:
      8  *
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  *
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  *
     16  * 3. All advertising materials mentioning features or use of this software
     17  *    must display the following acknowledgement:
     18  *      This product includes software developed by the SMCC Technology
     19  *      Development Group at Sun Microsystems, Inc.
     20  *
     21  * 4. The name of the Sun Microsystems, Inc nor may not be used to endorse or
     22  *      promote products derived from this software without specific prior
     23  *      written permission.
     24  *
     25  * SUN MICROSYSTEMS DOES NOT CLAIM MERCHANTABILITY OF THIS SOFTWARE OR THE
     26  * SUITABILITY OF THIS SOFTWARE FOR ANY PARTICULAR PURPOSE.  The software is
     27  * provided "as is" without express or implied warranty of any kind.
     28  *
     29  * These notices must be retained in any copies of any part of this software.
     30  */
     31 
     32 #include <altq/altq_rmclass.h>
     33 #include <altq/altq_cbq.h>
     34 
     35 /* cbq admission types */
     36 typedef enum {
     37 	CBQ_QOS_NONE,
     38 	CBQ_QOS_GUARANTEED,
     39 	CBQ_QOS_PREDICTIVE,
     40 	CBQ_QOS_CNTR_DELAY,
     41 	CBQ_QOS_CNTR_LOAD
     42 }  cbq_tos_t;
     43 
     44 /*
     45  * cbq private ifinfo structure
     46  */
     47 struct cbq_ifinfo {
     48 	struct classinfo *root_class;		/* root class */
     49 	struct classinfo *default_class;	/* default class */
     50 	struct classinfo *ctl_class;		/* control class */
     51 
     52 	double	nsPerByte;		/* bandwidth in ns per sec */
     53 	int	is_wrr;			/* use weighted-round robin */
     54 	int	is_efficient;		/* use work-conserving */
     55 };
     56 
     57 /*
     58  * cbq private classinfo structure
     59  */
     60 struct cbq_classinfo {
     61 	u_int	bandwidth;		/* bandwidth in bps */
     62 	u_int	allocated;		/* bandwidth used by children */
     63 
     64 	u_int	maxdelay;
     65 	u_int	maxburst;
     66 	u_int	minburst;
     67 	u_int	av_pkt_size;
     68 	u_int	max_pkt_size;
     69 
     70 	cbq_class_spec_t	class_spec;	/* class parameters */
     71 };
     72 
     73 int cbq_interface_parser(const char *ifname, int argc, char **argv);
     74 int cbq_class_parser(const char *ifname, const char *class_name,
     75 		     const char *parent_name, int argc, char **argv);
     76 
     77 int qcmd_cbq_add_if(const char *ifname, u_int bandwidth,
     78 		    int is_wrr, int efficient);
     79 int qcmd_cbq_add_class(const char *ifname, const char *class_name,
     80 		       const char *parent_name, const char *borrow_name,
     81 		       u_int pri, u_int bandwidth,
     82 		       u_int maxdelay, u_int maxburst, u_int minburst,
     83 		       u_int av_pkt_size, u_int max_pkt_size,
     84 		       int admission_type, int flags);
     85 int qcmd_cbq_modify_class(const char *ifname, const char *class_name,
     86 			  u_int pri, u_int bandwidth,
     87 			  u_int maxdelay, u_int maxburst, u_int minburst,
     88 			  u_int av_pkt_size, u_int max_pkt_size, int flags);
     89 
     90 int qop_cbq_add_if(struct ifinfo **rp, const char *ifname,
     91 		   u_int bandwidth, int is_wrr, int efficient);
     92 int qop_cbq_add_class(struct classinfo **rp, const char *class_name,
     93 		      struct ifinfo *ifinfo, struct classinfo *parent,
     94 		      struct classinfo *borrow, u_int pri, u_int bandwidth,
     95 		      u_int maxdelay, u_int maxburst, u_int minburst,
     96 		      u_int av_pkt_size, u_int max_pkt_size,
     97 		      int admission_type, int flags);
     98 int qop_cbq_modify_class(struct classinfo *clinfo, u_int pri, u_int bandwidth,
     99 			 u_int maxdelay, u_int maxburst, u_int minburst,
    100 			 u_int av_pkt_size, u_int max_pkt_size, int flags);
    101 
    102