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