1*772e66a6SGleb Smirnoff /*- 2*772e66a6SGleb Smirnoff * Copyright (C) 1999-2002 3*772e66a6SGleb Smirnoff * Sony Computer Science Laboratories Inc. All rights reserved. 4*772e66a6SGleb Smirnoff * 5*772e66a6SGleb Smirnoff * Redistribution and use in source and binary forms, with or without 6*772e66a6SGleb Smirnoff * modification, are permitted provided that the following conditions 7*772e66a6SGleb Smirnoff * are met: 8*772e66a6SGleb Smirnoff * 1. Redistributions of source code must retain the above copyright 9*772e66a6SGleb Smirnoff * notice, this list of conditions and the following disclaimer. 10*772e66a6SGleb Smirnoff * 2. Redistributions in binary form must reproduce the above copyright 11*772e66a6SGleb Smirnoff * notice, this list of conditions and the following disclaimer in the 12*772e66a6SGleb Smirnoff * documentation and/or other materials provided with the distribution. 13*772e66a6SGleb Smirnoff * 14*772e66a6SGleb Smirnoff * THIS SOFTWARE IS PROVIDED BY SONY CSL AND CONTRIBUTORS ``AS IS'' AND 15*772e66a6SGleb Smirnoff * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16*772e66a6SGleb Smirnoff * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17*772e66a6SGleb Smirnoff * ARE DISCLAIMED. IN NO EVENT SHALL SONY CSL OR CONTRIBUTORS BE LIABLE 18*772e66a6SGleb Smirnoff * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19*772e66a6SGleb Smirnoff * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20*772e66a6SGleb Smirnoff * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21*772e66a6SGleb Smirnoff * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22*772e66a6SGleb Smirnoff * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23*772e66a6SGleb Smirnoff * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24*772e66a6SGleb Smirnoff * SUCH DAMAGE. 25*772e66a6SGleb Smirnoff * 26*772e66a6SGleb Smirnoff * $KAME: altq_cdnr.h,v 1.9 2003/07/10 12:07:48 kjc Exp $ 27*772e66a6SGleb Smirnoff */ 28*772e66a6SGleb Smirnoff 29*772e66a6SGleb Smirnoff #ifndef _ALTQ_ALTQ_CDNR_H_ 30*772e66a6SGleb Smirnoff #define _ALTQ_ALTQ_CDNR_H_ 31*772e66a6SGleb Smirnoff 32*772e66a6SGleb Smirnoff #include <net/altq/altq.h> 33*772e66a6SGleb Smirnoff 34*772e66a6SGleb Smirnoff /* 35*772e66a6SGleb Smirnoff * traffic conditioner element types 36*772e66a6SGleb Smirnoff */ 37*772e66a6SGleb Smirnoff #define TCETYPE_NONE 0 38*772e66a6SGleb Smirnoff #define TCETYPE_TOP 1 /* top level conditioner */ 39*772e66a6SGleb Smirnoff #define TCETYPE_ELEMENT 2 /* a simple tc element */ 40*772e66a6SGleb Smirnoff #define TCETYPE_TBMETER 3 /* token bucket meter */ 41*772e66a6SGleb Smirnoff #define TCETYPE_TRTCM 4 /* (two-rate) three color marker */ 42*772e66a6SGleb Smirnoff #define TCETYPE_TSWTCM 5 /* time sliding window 3-color maker */ 43*772e66a6SGleb Smirnoff 44*772e66a6SGleb Smirnoff /* 45*772e66a6SGleb Smirnoff * traffic conditioner action 46*772e66a6SGleb Smirnoff */ 47*772e66a6SGleb Smirnoff struct cdnr_block; 48*772e66a6SGleb Smirnoff 49*772e66a6SGleb Smirnoff struct tc_action { 50*772e66a6SGleb Smirnoff int tca_code; /* e.g., TCACODE_PASS */ 51*772e66a6SGleb Smirnoff /* tca_code dependent variable */ 52*772e66a6SGleb Smirnoff union { 53*772e66a6SGleb Smirnoff u_long un_value; /* template */ 54*772e66a6SGleb Smirnoff u_int8_t un_dscp; /* diffserv code point */ 55*772e66a6SGleb Smirnoff u_long un_handle; /* tc action handle */ 56*772e66a6SGleb Smirnoff struct cdnr_block *un_next; /* next tc element block */ 57*772e66a6SGleb Smirnoff } tca_un; 58*772e66a6SGleb Smirnoff }; 59*772e66a6SGleb Smirnoff #define tca_value tca_un.un_value 60*772e66a6SGleb Smirnoff #define tca_dscp tca_un.un_dscp 61*772e66a6SGleb Smirnoff #define tca_handle tca_un.un_handle 62*772e66a6SGleb Smirnoff #define tca_next tca_un.un_next 63*772e66a6SGleb Smirnoff 64*772e66a6SGleb Smirnoff #define TCACODE_NONE 0 /* action is not set */ 65*772e66a6SGleb Smirnoff #define TCACODE_PASS 1 /* pass this packet */ 66*772e66a6SGleb Smirnoff #define TCACODE_DROP 2 /* discard this packet */ 67*772e66a6SGleb Smirnoff #define TCACODE_RETURN 3 /* do not process this packet */ 68*772e66a6SGleb Smirnoff #define TCACODE_MARK 4 /* mark dscp */ 69*772e66a6SGleb Smirnoff #define TCACODE_HANDLE 5 /* take action specified by handle */ 70*772e66a6SGleb Smirnoff #define TCACODE_NEXT 6 /* take action in the next tc element */ 71*772e66a6SGleb Smirnoff #define TCACODE_MAX 6 72*772e66a6SGleb Smirnoff 73*772e66a6SGleb Smirnoff #define CDNR_NULL_HANDLE 0 74*772e66a6SGleb Smirnoff 75*772e66a6SGleb Smirnoff struct cdnr_interface { 76*772e66a6SGleb Smirnoff char cdnr_ifname[IFNAMSIZ]; /* interface name (e.g., fxp0) */ 77*772e66a6SGleb Smirnoff }; 78*772e66a6SGleb Smirnoff 79*772e66a6SGleb Smirnoff /* simple element operations */ 80*772e66a6SGleb Smirnoff struct cdnr_add_element { 81*772e66a6SGleb Smirnoff struct cdnr_interface iface; 82*772e66a6SGleb Smirnoff struct tc_action action; 83*772e66a6SGleb Smirnoff 84*772e66a6SGleb Smirnoff u_long cdnr_handle; /* return value */ 85*772e66a6SGleb Smirnoff }; 86*772e66a6SGleb Smirnoff 87*772e66a6SGleb Smirnoff struct cdnr_delete_element { 88*772e66a6SGleb Smirnoff struct cdnr_interface iface; 89*772e66a6SGleb Smirnoff u_long cdnr_handle; 90*772e66a6SGleb Smirnoff }; 91*772e66a6SGleb Smirnoff 92*772e66a6SGleb Smirnoff /* token-bucket meter operations */ 93*772e66a6SGleb Smirnoff struct cdnr_add_tbmeter { 94*772e66a6SGleb Smirnoff struct cdnr_interface iface; 95*772e66a6SGleb Smirnoff struct tb_profile profile; 96*772e66a6SGleb Smirnoff struct tc_action in_action; 97*772e66a6SGleb Smirnoff struct tc_action out_action; 98*772e66a6SGleb Smirnoff 99*772e66a6SGleb Smirnoff u_long cdnr_handle; /* return value */ 100*772e66a6SGleb Smirnoff }; 101*772e66a6SGleb Smirnoff 102*772e66a6SGleb Smirnoff struct cdnr_modify_tbmeter { 103*772e66a6SGleb Smirnoff struct cdnr_interface iface; 104*772e66a6SGleb Smirnoff u_long cdnr_handle; 105*772e66a6SGleb Smirnoff struct tb_profile profile; 106*772e66a6SGleb Smirnoff }; 107*772e66a6SGleb Smirnoff 108*772e66a6SGleb Smirnoff struct cdnr_tbmeter_stats { 109*772e66a6SGleb Smirnoff struct cdnr_interface iface; 110*772e66a6SGleb Smirnoff u_long cdnr_handle; 111*772e66a6SGleb Smirnoff struct pktcntr in_cnt; 112*772e66a6SGleb Smirnoff struct pktcntr out_cnt; 113*772e66a6SGleb Smirnoff }; 114*772e66a6SGleb Smirnoff 115*772e66a6SGleb Smirnoff /* two-rate three-color marker operations */ 116*772e66a6SGleb Smirnoff struct cdnr_add_trtcm { 117*772e66a6SGleb Smirnoff struct cdnr_interface iface; 118*772e66a6SGleb Smirnoff struct tb_profile cmtd_profile; /* profile for committed tb */ 119*772e66a6SGleb Smirnoff struct tb_profile peak_profile; /* profile for peak tb */ 120*772e66a6SGleb Smirnoff struct tc_action green_action; /* action for green packets */ 121*772e66a6SGleb Smirnoff struct tc_action yellow_action; /* action for yellow packets */ 122*772e66a6SGleb Smirnoff struct tc_action red_action; /* action for red packets */ 123*772e66a6SGleb Smirnoff int coloraware; /* color-aware/color-blind */ 124*772e66a6SGleb Smirnoff 125*772e66a6SGleb Smirnoff u_long cdnr_handle; /* return value */ 126*772e66a6SGleb Smirnoff }; 127*772e66a6SGleb Smirnoff 128*772e66a6SGleb Smirnoff struct cdnr_modify_trtcm { 129*772e66a6SGleb Smirnoff struct cdnr_interface iface; 130*772e66a6SGleb Smirnoff u_long cdnr_handle; 131*772e66a6SGleb Smirnoff struct tb_profile cmtd_profile; /* profile for committed tb */ 132*772e66a6SGleb Smirnoff struct tb_profile peak_profile; /* profile for peak tb */ 133*772e66a6SGleb Smirnoff int coloraware; /* color-aware/color-blind */ 134*772e66a6SGleb Smirnoff }; 135*772e66a6SGleb Smirnoff 136*772e66a6SGleb Smirnoff struct cdnr_tcm_stats { 137*772e66a6SGleb Smirnoff struct cdnr_interface iface; 138*772e66a6SGleb Smirnoff u_long cdnr_handle; 139*772e66a6SGleb Smirnoff struct pktcntr green_cnt; 140*772e66a6SGleb Smirnoff struct pktcntr yellow_cnt; 141*772e66a6SGleb Smirnoff struct pktcntr red_cnt; 142*772e66a6SGleb Smirnoff }; 143*772e66a6SGleb Smirnoff 144*772e66a6SGleb Smirnoff /* time sliding window three-color marker operations */ 145*772e66a6SGleb Smirnoff struct cdnr_add_tswtcm { 146*772e66a6SGleb Smirnoff struct cdnr_interface iface; 147*772e66a6SGleb Smirnoff u_int32_t cmtd_rate; /* committed rate (bits/sec) */ 148*772e66a6SGleb Smirnoff u_int32_t peak_rate; /* peak rate (bits/sec) */ 149*772e66a6SGleb Smirnoff u_int32_t avg_interval; /* averaging interval (msec) */ 150*772e66a6SGleb Smirnoff struct tc_action green_action; /* action for green packets */ 151*772e66a6SGleb Smirnoff struct tc_action yellow_action; /* action for yellow packets */ 152*772e66a6SGleb Smirnoff struct tc_action red_action; /* action for red packets */ 153*772e66a6SGleb Smirnoff 154*772e66a6SGleb Smirnoff u_long cdnr_handle; /* return value */ 155*772e66a6SGleb Smirnoff }; 156*772e66a6SGleb Smirnoff 157*772e66a6SGleb Smirnoff struct cdnr_modify_tswtcm { 158*772e66a6SGleb Smirnoff struct cdnr_interface iface; 159*772e66a6SGleb Smirnoff u_long cdnr_handle; 160*772e66a6SGleb Smirnoff u_int32_t cmtd_rate; /* committed rate (bits/sec) */ 161*772e66a6SGleb Smirnoff u_int32_t peak_rate; /* peak rate (bits/sec) */ 162*772e66a6SGleb Smirnoff u_int32_t avg_interval; /* averaging interval (msec) */ 163*772e66a6SGleb Smirnoff }; 164*772e66a6SGleb Smirnoff 165*772e66a6SGleb Smirnoff struct cdnr_add_filter { 166*772e66a6SGleb Smirnoff struct cdnr_interface iface; 167*772e66a6SGleb Smirnoff u_long cdnr_handle; 168*772e66a6SGleb Smirnoff #ifdef ALTQ3_CLFIER_COMPAT 169*772e66a6SGleb Smirnoff struct flow_filter filter; 170*772e66a6SGleb Smirnoff #endif 171*772e66a6SGleb Smirnoff u_long filter_handle; /* return value */ 172*772e66a6SGleb Smirnoff }; 173*772e66a6SGleb Smirnoff 174*772e66a6SGleb Smirnoff struct cdnr_delete_filter { 175*772e66a6SGleb Smirnoff struct cdnr_interface iface; 176*772e66a6SGleb Smirnoff u_long filter_handle; 177*772e66a6SGleb Smirnoff }; 178*772e66a6SGleb Smirnoff 179*772e66a6SGleb Smirnoff struct tce_stats { 180*772e66a6SGleb Smirnoff u_long tce_handle; /* tc element handle */ 181*772e66a6SGleb Smirnoff int tce_type; /* e.g., TCETYPE_ELEMENT */ 182*772e66a6SGleb Smirnoff struct pktcntr tce_cnts[3]; /* tcm returns 3 counters */ 183*772e66a6SGleb Smirnoff }; 184*772e66a6SGleb Smirnoff 185*772e66a6SGleb Smirnoff struct cdnr_get_stats { 186*772e66a6SGleb Smirnoff struct cdnr_interface iface; 187*772e66a6SGleb Smirnoff struct pktcntr cnts[TCACODE_MAX+1]; 188*772e66a6SGleb Smirnoff 189*772e66a6SGleb Smirnoff /* element stats */ 190*772e66a6SGleb Smirnoff int nskip; /* skip # of elements */ 191*772e66a6SGleb Smirnoff int nelements; /* # of element stats (WR) */ 192*772e66a6SGleb Smirnoff struct tce_stats *tce_stats; /* pointer to stats array */ 193*772e66a6SGleb Smirnoff }; 194*772e66a6SGleb Smirnoff 195*772e66a6SGleb Smirnoff #define CDNR_IF_ATTACH _IOW('Q', 1, struct cdnr_interface) 196*772e66a6SGleb Smirnoff #define CDNR_IF_DETACH _IOW('Q', 2, struct cdnr_interface) 197*772e66a6SGleb Smirnoff #define CDNR_ENABLE _IOW('Q', 3, struct cdnr_interface) 198*772e66a6SGleb Smirnoff #define CDNR_DISABLE _IOW('Q', 4, struct cdnr_interface) 199*772e66a6SGleb Smirnoff #define CDNR_ADD_FILTER _IOWR('Q', 10, struct cdnr_add_filter) 200*772e66a6SGleb Smirnoff #define CDNR_DEL_FILTER _IOW('Q', 11, struct cdnr_delete_filter) 201*772e66a6SGleb Smirnoff #define CDNR_GETSTATS _IOWR('Q', 12, struct cdnr_get_stats) 202*772e66a6SGleb Smirnoff #define CDNR_ADD_ELEM _IOWR('Q', 30, struct cdnr_add_element) 203*772e66a6SGleb Smirnoff #define CDNR_DEL_ELEM _IOW('Q', 31, struct cdnr_delete_element) 204*772e66a6SGleb Smirnoff #define CDNR_ADD_TBM _IOWR('Q', 32, struct cdnr_add_tbmeter) 205*772e66a6SGleb Smirnoff #define CDNR_MOD_TBM _IOW('Q', 33, struct cdnr_modify_tbmeter) 206*772e66a6SGleb Smirnoff #define CDNR_TBM_STATS _IOWR('Q', 34, struct cdnr_tbmeter_stats) 207*772e66a6SGleb Smirnoff #define CDNR_ADD_TCM _IOWR('Q', 35, struct cdnr_add_trtcm) 208*772e66a6SGleb Smirnoff #define CDNR_MOD_TCM _IOWR('Q', 36, struct cdnr_modify_trtcm) 209*772e66a6SGleb Smirnoff #define CDNR_TCM_STATS _IOWR('Q', 37, struct cdnr_tcm_stats) 210*772e66a6SGleb Smirnoff #define CDNR_ADD_TSW _IOWR('Q', 38, struct cdnr_add_tswtcm) 211*772e66a6SGleb Smirnoff #define CDNR_MOD_TSW _IOWR('Q', 39, struct cdnr_modify_tswtcm) 212*772e66a6SGleb Smirnoff 213*772e66a6SGleb Smirnoff #ifndef DSCP_EF 214*772e66a6SGleb Smirnoff /* diffserve code points */ 215*772e66a6SGleb Smirnoff #define DSCP_MASK 0xfc 216*772e66a6SGleb Smirnoff #define DSCP_CUMASK 0x03 217*772e66a6SGleb Smirnoff #define DSCP_EF 0xb8 218*772e66a6SGleb Smirnoff #define DSCP_AF11 0x28 219*772e66a6SGleb Smirnoff #define DSCP_AF12 0x30 220*772e66a6SGleb Smirnoff #define DSCP_AF13 0x38 221*772e66a6SGleb Smirnoff #define DSCP_AF21 0x48 222*772e66a6SGleb Smirnoff #define DSCP_AF22 0x50 223*772e66a6SGleb Smirnoff #define DSCP_AF23 0x58 224*772e66a6SGleb Smirnoff #define DSCP_AF31 0x68 225*772e66a6SGleb Smirnoff #define DSCP_AF32 0x70 226*772e66a6SGleb Smirnoff #define DSCP_AF33 0x78 227*772e66a6SGleb Smirnoff #define DSCP_AF41 0x88 228*772e66a6SGleb Smirnoff #define DSCP_AF42 0x90 229*772e66a6SGleb Smirnoff #define DSCP_AF43 0x98 230*772e66a6SGleb Smirnoff #define AF_CLASSMASK 0xe0 231*772e66a6SGleb Smirnoff #define AF_DROPPRECMASK 0x18 232*772e66a6SGleb Smirnoff #endif 233*772e66a6SGleb Smirnoff 234*772e66a6SGleb Smirnoff #ifdef _KERNEL 235*772e66a6SGleb Smirnoff 236*772e66a6SGleb Smirnoff /* 237*772e66a6SGleb Smirnoff * packet information passed to the input function of tc elements 238*772e66a6SGleb Smirnoff */ 239*772e66a6SGleb Smirnoff struct cdnr_pktinfo { 240*772e66a6SGleb Smirnoff int pkt_len; /* packet length */ 241*772e66a6SGleb Smirnoff u_int8_t pkt_dscp; /* diffserv code point */ 242*772e66a6SGleb Smirnoff }; 243*772e66a6SGleb Smirnoff 244*772e66a6SGleb Smirnoff /* 245*772e66a6SGleb Smirnoff * traffic conditioner control block common to all types of tc elements 246*772e66a6SGleb Smirnoff */ 247*772e66a6SGleb Smirnoff struct cdnr_block { 248*772e66a6SGleb Smirnoff LIST_ENTRY(cdnr_block) cb_next; 249*772e66a6SGleb Smirnoff int cb_len; /* size of this tc element */ 250*772e66a6SGleb Smirnoff int cb_type; /* cdnr block type */ 251*772e66a6SGleb Smirnoff int cb_ref; /* reference count of this element */ 252*772e66a6SGleb Smirnoff u_long cb_handle; /* handle of this tc element */ 253*772e66a6SGleb Smirnoff struct top_cdnr *cb_top; /* back pointer to top */ 254*772e66a6SGleb Smirnoff struct tc_action cb_action; /* top level action for this tcb */ 255*772e66a6SGleb Smirnoff struct tc_action *(*cb_input)(struct cdnr_block *, 256*772e66a6SGleb Smirnoff struct cdnr_pktinfo *); 257*772e66a6SGleb Smirnoff }; 258*772e66a6SGleb Smirnoff 259*772e66a6SGleb Smirnoff /* 260*772e66a6SGleb Smirnoff * top level traffic conditioner structure for an interface 261*772e66a6SGleb Smirnoff */ 262*772e66a6SGleb Smirnoff struct top_cdnr { 263*772e66a6SGleb Smirnoff struct cdnr_block tc_block; 264*772e66a6SGleb Smirnoff 265*772e66a6SGleb Smirnoff LIST_ENTRY(top_cdnr) tc_next; 266*772e66a6SGleb Smirnoff struct ifaltq *tc_ifq; 267*772e66a6SGleb Smirnoff 268*772e66a6SGleb Smirnoff LIST_HEAD(, cdnr_block) tc_elements; 269*772e66a6SGleb Smirnoff #ifdef ALTQ3_CLFIER_COMPAT 270*772e66a6SGleb Smirnoff struct acc_classifier tc_classifier; 271*772e66a6SGleb Smirnoff #endif 272*772e66a6SGleb Smirnoff struct pktcntr tc_cnts[TCACODE_MAX+1]; 273*772e66a6SGleb Smirnoff }; 274*772e66a6SGleb Smirnoff 275*772e66a6SGleb Smirnoff /* token bucket element */ 276*772e66a6SGleb Smirnoff struct tbe { 277*772e66a6SGleb Smirnoff u_int64_t rate; 278*772e66a6SGleb Smirnoff u_int64_t depth; 279*772e66a6SGleb Smirnoff 280*772e66a6SGleb Smirnoff u_int64_t token; 281*772e66a6SGleb Smirnoff u_int64_t filluptime; 282*772e66a6SGleb Smirnoff u_int64_t last; 283*772e66a6SGleb Smirnoff }; 284*772e66a6SGleb Smirnoff 285*772e66a6SGleb Smirnoff /* token bucket meter structure */ 286*772e66a6SGleb Smirnoff struct tbmeter { 287*772e66a6SGleb Smirnoff struct cdnr_block cdnrblk; /* conditioner block */ 288*772e66a6SGleb Smirnoff struct tbe tb; /* token bucket */ 289*772e66a6SGleb Smirnoff struct tc_action in_action; /* actions for IN/OUT */ 290*772e66a6SGleb Smirnoff struct tc_action out_action; /* actions for IN/OUT */ 291*772e66a6SGleb Smirnoff struct pktcntr in_cnt; /* statistics for IN/OUT */ 292*772e66a6SGleb Smirnoff struct pktcntr out_cnt; /* statistics for IN/OUT */ 293*772e66a6SGleb Smirnoff }; 294*772e66a6SGleb Smirnoff 295*772e66a6SGleb Smirnoff /* two-rate three-color marker structure */ 296*772e66a6SGleb Smirnoff struct trtcm { 297*772e66a6SGleb Smirnoff struct cdnr_block cdnrblk; /* conditioner block */ 298*772e66a6SGleb Smirnoff struct tbe cmtd_tb; /* committed tb profile */ 299*772e66a6SGleb Smirnoff struct tbe peak_tb; /* peak tb profile */ 300*772e66a6SGleb Smirnoff struct tc_action green_action; 301*772e66a6SGleb Smirnoff struct tc_action yellow_action; 302*772e66a6SGleb Smirnoff struct tc_action red_action; 303*772e66a6SGleb Smirnoff int coloraware; 304*772e66a6SGleb Smirnoff u_int8_t green_dscp; 305*772e66a6SGleb Smirnoff u_int8_t yellow_dscp; 306*772e66a6SGleb Smirnoff u_int8_t red_dscp; 307*772e66a6SGleb Smirnoff struct pktcntr green_cnt; 308*772e66a6SGleb Smirnoff struct pktcntr yellow_cnt; 309*772e66a6SGleb Smirnoff struct pktcntr red_cnt; 310*772e66a6SGleb Smirnoff }; 311*772e66a6SGleb Smirnoff 312*772e66a6SGleb Smirnoff /* time sliding window three-color marker structure */ 313*772e66a6SGleb Smirnoff struct tswtcm { 314*772e66a6SGleb Smirnoff struct cdnr_block cdnrblk; /* conditioner block */ 315*772e66a6SGleb Smirnoff 316*772e66a6SGleb Smirnoff u_int32_t avg_rate; /* average rate (bytes/sec) */ 317*772e66a6SGleb Smirnoff u_int64_t t_front; /* timestamp of last update */ 318*772e66a6SGleb Smirnoff 319*772e66a6SGleb Smirnoff u_int64_t timewin; /* average interval */ 320*772e66a6SGleb Smirnoff u_int32_t cmtd_rate; /* committed target rate */ 321*772e66a6SGleb Smirnoff u_int32_t peak_rate; /* peak target rate */ 322*772e66a6SGleb Smirnoff struct tc_action green_action; 323*772e66a6SGleb Smirnoff struct tc_action yellow_action; 324*772e66a6SGleb Smirnoff struct tc_action red_action; 325*772e66a6SGleb Smirnoff u_int8_t green_dscp; 326*772e66a6SGleb Smirnoff u_int8_t yellow_dscp; 327*772e66a6SGleb Smirnoff u_int8_t red_dscp; 328*772e66a6SGleb Smirnoff struct pktcntr green_cnt; 329*772e66a6SGleb Smirnoff struct pktcntr yellow_cnt; 330*772e66a6SGleb Smirnoff struct pktcntr red_cnt; 331*772e66a6SGleb Smirnoff }; 332*772e66a6SGleb Smirnoff 333*772e66a6SGleb Smirnoff #endif /* _KERNEL */ 334*772e66a6SGleb Smirnoff 335*772e66a6SGleb Smirnoff #endif /* _ALTQ_ALTQ_CDNR_H_ */ 336