1 /* $NetBSD: altq_fifoq.h,v 1.6.12.1 2006/03/18 12:08:18 peter Exp $ */
2 /* $KAME: altq_fifoq.h,v 1.8 2002/11/29 04:36:23 kjc Exp $ */
5 * Copyright (C) 1997-2002
6 * Sony Computer Science Laboratories Inc. All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
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.
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
30 #ifndef _ALTQ_ALTQ_FIFOQ_H_
31 #define _ALTQ_ALTQ_FIFOQ_H_
34 typedef struct fifoq_state
{
35 struct fifoq_state
*q_next
; /* next fifoq_state in the list */
36 struct ifaltq
*q_ifq
; /* backpointer to ifaltq */
38 struct mbuf
*q_head
; /* head of queue */
39 struct mbuf
*q_tail
; /* tail of queue */
40 int q_len
; /* queue length */
41 int q_limit
; /* max queue length */
45 struct pktcntr xmit_cnt
;
46 struct pktcntr drop_cnt
;
52 struct fifoq_interface
{
53 char fifoq_ifname
[IFNAMSIZ
];
56 struct fifoq_getstats
{
57 struct fifoq_interface iface
;
60 struct pktcntr xmit_cnt
;
61 struct pktcntr drop_cnt
;
66 struct fifoq_interface iface
;
70 #define FIFOQ_LIMIT 50 /* default max queue length */
75 #define FIFOQ_IF_ATTACH _IOW('Q', 1, struct fifoq_interface)
76 #define FIFOQ_IF_DETACH _IOW('Q', 2, struct fifoq_interface)
77 #define FIFOQ_ENABLE _IOW('Q', 3, struct fifoq_interface)
78 #define FIFOQ_DISABLE _IOW('Q', 4, struct fifoq_interface)
79 #define FIFOQ_CONFIG _IOWR('Q', 6, struct fifoq_conf)
80 #define FIFOQ_GETSTATS _IOWR('Q', 12, struct fifoq_getstats)
82 #endif /* _ALTQ_ALTQ_FIFOQ_H_ */