1*62856425Sitojun /* $NetBSD: qop_red.h,v 1.2 2001/08/16 07:48:14 itojun Exp $ */ 295a65560Sthorpej /* $KAME: qop_red.h,v 1.2 2000/10/18 09:15:20 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 /* 3095a65560Sthorpej * red private ifinfo structure 3195a65560Sthorpej */ 3295a65560Sthorpej struct red_ifinfo { 3395a65560Sthorpej int weight; /* weight for EWMA */ 3495a65560Sthorpej int inv_pmax; /* inverse of max drop probability */ 3595a65560Sthorpej int th_min; /* red min threshold */ 3695a65560Sthorpej int th_max; /* red max threshold */ 3795a65560Sthorpej int qlimit; /* max queue length */ 3895a65560Sthorpej int pkttime; /* average packet time in usec */ 3995a65560Sthorpej int flags; /* see below */ 4095a65560Sthorpej }; 4195a65560Sthorpej 4295a65560Sthorpej int red_interface_parser(const char *ifname, int argc, char **argv); 4395a65560Sthorpej int qcmd_red_add_if(const char *ifname, u_int bandwidth, int weight, 4495a65560Sthorpej int inv_pmax, int th_min, int th_max, int qlimit, 4595a65560Sthorpej int pkttime, int flags); 4695a65560Sthorpej int qop_red_add_if(struct ifinfo **rp, const char *ifname, 4795a65560Sthorpej u_int bandwidth, int weight, int inv_pmax, int th_min, 4895a65560Sthorpej int th_max, int qlimit, int pkttime, int flags); 49