1 /* $KAME: altq.h,v 1.10 2003/07/10 12:07:47 kjc Exp $ */ 2 /* $DragonFly: src/sys/net/altq/altq.h,v 1.1 2005/02/11 22:25:57 joerg Exp $ */ 3 4 /* 5 * Copyright (C) 1998-2003 6 * Sony Computer Science Laboratories Inc. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 17 * THIS SOFTWARE IS PROVIDED BY SONY CSL AND CONTRIBUTORS ``AS IS'' AND 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 * ARE DISCLAIMED. IN NO EVENT SHALL SONY CSL OR CONTRIBUTORS BE LIABLE 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 #ifndef _ALTQ_ALTQ_H_ 30 #define _ALTQ_ALTQ_H_ 31 32 /* altq discipline type */ 33 #define ALTQT_NONE 0 /* reserved */ 34 #define ALTQT_CBQ 1 /* cbq */ 35 #define ALTQT_RED 2 /* red */ 36 #define ALTQT_RIO 3 /* rio */ 37 #define ALTQT_HFSC 4 /* hfsc */ 38 #define ALTQT_PRIQ 5 /* priority queue */ 39 #define ALTQT_MAX 6 /* should be max discipline type + 1 */ 40 41 /* simple token packet meter profile */ 42 struct tb_profile { 43 u_int rate; /* rate in bit-per-sec */ 44 u_int depth; /* depth in bytes */ 45 }; 46 47 /* 48 * generic packet counter 49 */ 50 struct pktcntr { 51 uint64_t packets; 52 uint64_t bytes; 53 }; 54 55 #define PKTCNTR_ADD(cntr, len) do { \ 56 (cntr)->packets++; (cntr)->bytes += len; \ 57 } while (0) 58 59 #ifdef _KERNEL 60 #include <net/altq/altq_var.h> 61 #endif 62 63 #endif /* _ALTQ_ALTQ_H_ */ 64