Home | History | Annotate | Line # | Download | only in libaltq
      1  1.2  peter /*	$KAME: qop_jobs.h,v 1.1 2002/10/26 06:59:53 kjc Exp $	*/
      2  1.2  peter /*	$Id: qop_jobs.h,v 1.2 2006/10/12 19:59:13 peter Exp $	*/
      3  1.2  peter /*
      4  1.2  peter  * Copyright (c) 2001-2002, by the Rector and Board of Visitors of the
      5  1.2  peter  * University of Virginia.
      6  1.2  peter  * All rights reserved.
      7  1.2  peter  *
      8  1.2  peter  * Redistribution and use in source and binary forms,
      9  1.2  peter  * with or without modification, are permitted provided
     10  1.2  peter  * that the following conditions are met:
     11  1.2  peter  *
     12  1.2  peter  * Redistributions of source code must retain the above
     13  1.2  peter  * copyright notice, this list of conditions and the following
     14  1.2  peter  * disclaimer.
     15  1.2  peter  *
     16  1.2  peter  * Redistributions in binary form must reproduce the above
     17  1.2  peter  * copyright notice, this list of conditions and the following
     18  1.2  peter  * disclaimer in the documentation and/or other materials provided
     19  1.2  peter  * with the distribution.
     20  1.2  peter  *
     21  1.2  peter  * Neither the name of the University of Virginia nor the names
     22  1.2  peter  * of its contributors may be used to endorse or promote products
     23  1.2  peter  * derived from this software without specific prior written
     24  1.2  peter  * permission.
     25  1.2  peter  *
     26  1.2  peter  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
     27  1.2  peter  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
     28  1.2  peter  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     29  1.2  peter  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     30  1.2  peter  * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
     31  1.2  peter  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
     32  1.2  peter  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     33  1.2  peter  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     34  1.2  peter  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     35  1.2  peter  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     36  1.2  peter  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     37  1.2  peter  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     38  1.2  peter  * THE POSSIBILITY OF SUCH DAMAGE.
     39  1.2  peter  */
     40  1.2  peter /*
     41  1.2  peter  * Copyright (C) 1999-2000
     42  1.2  peter  *	Sony Computer Science Laboratories, Inc.  All rights reserved.
     43  1.2  peter  *
     44  1.2  peter  * Redistribution and use in source and binary forms, with or without
     45  1.2  peter  * modification, are permitted provided that the following conditions
     46  1.2  peter  * are met:
     47  1.2  peter  * 1. Redistributions of source code must retain the above copyright
     48  1.2  peter  *    notice, this list of conditions and the following disclaimer.
     49  1.2  peter  * 2. Redistributions in binary form must reproduce the above copyright
     50  1.2  peter  *    notice, this list of conditions and the following disclaimer in the
     51  1.2  peter  *    documentation and/or other materials provided with the distribution.
     52  1.2  peter  *
     53  1.2  peter  * THIS SOFTWARE IS PROVIDED BY SONY CSL AND CONTRIBUTORS ``AS IS'' AND
     54  1.2  peter  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     55  1.2  peter  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     56  1.2  peter  * ARE DISCLAIMED.  IN NO EVENT SHALL SONY CSL OR CONTRIBUTORS BE LIABLE
     57  1.2  peter  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     58  1.2  peter  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     59  1.2  peter  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     60  1.2  peter  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     61  1.2  peter  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     62  1.2  peter  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     63  1.2  peter  * SUCH DAMAGE.
     64  1.2  peter  */
     65  1.2  peter /*
     66  1.2  peter  * JoBS - altq prototype implementation
     67  1.2  peter  *
     68  1.2  peter  * Author: Nicolas Christin <nicolas (at) cs.virginia.edu>
     69  1.2  peter  *
     70  1.2  peter  * JoBS algorithms originally devised and proposed by
     71  1.2  peter  * Nicolas Christin and Jorg Liebeherr.
     72  1.2  peter  * Grateful Acknowledgments to Tarek Abdelzaher for his help and
     73  1.2  peter  * comments, and to Kenjiro Cho for some helpful advice.
     74  1.2  peter  * Contributed by the Multimedia Networks Group at the University
     75  1.2  peter  * of Virginia.
     76  1.2  peter  *
     77  1.2  peter  * http://qosbox.cs.virginia.edu
     78  1.2  peter  *
     79  1.2  peter  */
     80  1.2  peter 
     81  1.2  peter #include <altq/altq_jobs.h>
     82  1.2  peter 
     83  1.2  peter /*
     84  1.2  peter  * jobs private ifinfo structure
     85  1.2  peter  */
     86  1.2  peter struct jobs_ifinfo {
     87  1.2  peter 	int qlimit;		/* max queue length */
     88  1.2  peter 	int separate;
     89  1.2  peter 	struct classinfo *default_class;
     90  1.2  peter };
     91  1.2  peter 
     92  1.2  peter /*
     93  1.2  peter  * jobs private classinfo structure
     94  1.2  peter  */
     95  1.2  peter struct jobs_classinfo {
     96  1.2  peter 	int		pri;
     97  1.2  peter 	int64_t		adc;
     98  1.2  peter 	int64_t		rdc;
     99  1.2  peter 	int64_t		alc;
    100  1.2  peter 	int64_t		rlc;
    101  1.2  peter 	int64_t		arc;
    102  1.2  peter 	int		flags;
    103  1.2  peter };
    104  1.2  peter 
    105  1.2  peter 
    106  1.2  peter int jobs_interface_parser(const char *ifname, int argc, char **argv);
    107  1.2  peter int jobs_class_parser(const char *ifname, const char *class_name,
    108  1.2  peter     const char *parent_name, int argc, char **argv);
    109  1.2  peter int qcmd_jobs_add_if(const char *ifname, u_int bandwidth, int qlimit, int separate);
    110  1.2  peter int qcmd_jobs_add_class(const char *ifname, const char *class_name, int pri,
    111  1.2  peter     int64_t adc, int64_t rdc, int64_t alc, int64_t rlc, int64_t arc,
    112  1.2  peter     int flags);
    113  1.2  peter int qcmd_jobs_modify_class(const char *ifname, const char *class_name, int pri,
    114  1.2  peter     int64_t adc, int64_t rdc, int64_t alc, int64_t rlc, int64_t arc);
    115  1.2  peter int qop_jobs_add_if(struct ifinfo **rp, const char *ifname,
    116  1.2  peter     u_int bandwidth, int qlimit, int separate);
    117  1.2  peter int qop_jobs_add_class(struct classinfo **rp, const char *class_name,
    118  1.2  peter     struct ifinfo *ifinfo, int pri,
    119  1.2  peter     int64_t adc, int64_t rdc, int64_t alc, int64_t rlc, int64_t arc,
    120  1.2  peter     int flags);
    121  1.2  peter int qop_jobs_modify_class(struct classinfo *clinfo, int pri,
    122  1.2  peter     int64_t adc, int64_t rdc, int64_t alc, int64_t rlc, int64_t arc);
    123