Merge remote branch 'crater/master' into vkernel64
[dragonfly.git] / sys / net / altq / altq.h
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.2 2008/04/06 18:58:15 dillon 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_FAIRQ             6       /* fair queue (requires keep state) */
40 #define ALTQT_MAX               7       /* should be max discipline type + 1 */
41
42 /* simple token packet meter profile */
43 struct  tb_profile {
44         u_int   rate;   /* rate in bit-per-sec */
45         u_int   depth;  /* depth in bytes */
46 };
47
48 /*
49  * generic packet counter
50  */
51 struct pktcntr {
52         uint64_t        packets;
53         uint64_t        bytes;
54 };
55
56 #define PKTCNTR_ADD(cntr, len)          do {                            \
57         (cntr)->packets++; (cntr)->bytes += len;                        \
58 } while (0)
59
60 #ifdef _KERNEL
61 #include <net/altq/altq_var.h>
62 #endif
63
64 #endif /* _ALTQ_ALTQ_H_ */