1 /* $NetBSD: altq_afmap.h,v 1.2.64.1 2006/03/18 12:08:18 peter Exp $ */
2 /* $KAME: altq_afmap.h,v 1.6 2002/04/03 05:38:50 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_AFMAP_H_
31 #define _ALTQ_ALTQ_AFMAP_H_
33 #include <sys/queue.h>
34 #include <altq/altq.h>
37 char af_ifname
[IFNAMSIZ
]; /* if name, e.g. "en0" */
40 u_int32_t af_pcr
; /* peek cell rate */
42 struct flowinfo afu_fi
;
43 struct flowinfo_in afu_fi4
;
45 struct flowinfo_in6 afu_fi6
;
48 #define af_flowinfo af_fiu.afu_fi
49 #define af_flowinfo4 af_fiu.afu_fi4
50 #define af_flowinfo6 af_fiu.afu_fi6
53 u_int32_t afs_packets
; /* total packet count */
54 u_int32_t afs_bytes
; /* total byte count */
57 /* set or get flowmap */
58 #define AFM_ADDFMAP _IOWR('F', 30, struct atm_flowmap)
59 #define AFM_DELFMAP _IOWR('F', 31, struct atm_flowmap)
60 #define AFM_CLEANFMAP _IOWR('F', 32, struct atm_flowmap)
61 #define AFM_GETFMAP _IOWR('F', 33, struct atm_flowmap)
65 /* per flow information */
67 LIST_ENTRY(afm
) afm_list
;
71 struct flowinfo afmu_fi
;
72 struct flowinfo_in afmu_fi4
;
74 struct flowinfo_in6 afmu_fi6
;
77 #define afm_flowinfo afm_fiu.afmu_fi
78 #define afm_flowinfo4 afm_fiu.afmu_fi4
79 #define afm_flowinfo6 afm_fiu.afmu_fi6
82 u_int32_t afms_packets
; /* total packet count */
83 u_int32_t afms_bytes
; /* total byte count */
88 LIST_ENTRY(afm_head
) afh_chain
;
89 LIST_HEAD(, afm
) afh_head
;
90 struct ifnet
*afh_ifp
;
93 struct afm
*afm_top(struct ifnet
*);
94 int afm_alloc(struct ifnet
*);
95 int afm_dealloc(struct ifnet
*);
96 int afm_add(struct ifnet
*, struct atm_flowmap
*);
97 int afm_remove(struct afm
*);
98 int afm_removeall(struct ifnet
*);
99 struct afm
*afm_lookup(struct ifnet
*, int, int);
100 struct afm
*afm_match(struct ifnet
*, struct flowinfo
*);
104 #endif /* _ALTQ_ALTQ_AFMAP_H_ */