1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 **************************************************************************** 11 ****************************************************************************/ 12 #ifndef __LINUX_PKT_SCHED_H 13 #define __LINUX_PKT_SCHED_H 14 15 #define TC_PRIO_BESTEFFORT 0 16 #define TC_PRIO_FILLER 1 17 #define TC_PRIO_BULK 2 18 #define TC_PRIO_INTERACTIVE_BULK 4 19 #define TC_PRIO_INTERACTIVE 6 20 #define TC_PRIO_CONTROL 7 21 22 #define TC_PRIO_MAX 15 23 24 struct tc_stats 25 { 26 __u64 bytes; 27 __u32 packets; 28 __u32 drops; 29 __u32 overlimits; 30 __u32 bps; 31 __u32 pps; 32 __u32 qlen; 33 __u32 backlog; 34 }; 35 36 struct tc_estimator 37 { 38 signed char interval; 39 unsigned char ewma_log; 40 }; 41 42 #define TC_H_MAJ_MASK (0xFFFF0000U) 43 #define TC_H_MIN_MASK (0x0000FFFFU) 44 #define TC_H_MAJ(h) ((h)&TC_H_MAJ_MASK) 45 #define TC_H_MIN(h) ((h)&TC_H_MIN_MASK) 46 #define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK)) 47 48 #define TC_H_UNSPEC (0U) 49 #define TC_H_ROOT (0xFFFFFFFFU) 50 #define TC_H_INGRESS (0xFFFFFFF1U) 51 52 struct tc_ratespec 53 { 54 unsigned char cell_log; 55 unsigned char __reserved; 56 unsigned short feature; 57 short addend; 58 unsigned short mpu; 59 __u32 rate; 60 }; 61 62 struct tc_fifo_qopt 63 { 64 __u32 limit; 65 }; 66 67 #define TCQ_PRIO_BANDS 16 68 #define TCQ_MIN_PRIO_BANDS 2 69 70 struct tc_prio_qopt 71 { 72 int bands; 73 __u8 priomap[TC_PRIO_MAX+1]; 74 }; 75 76 struct tc_tbf_qopt 77 { 78 struct tc_ratespec rate; 79 struct tc_ratespec peakrate; 80 __u32 limit; 81 __u32 buffer; 82 __u32 mtu; 83 }; 84 85 enum 86 { 87 TCA_TBF_UNSPEC, 88 TCA_TBF_PARMS, 89 TCA_TBF_RTAB, 90 TCA_TBF_PTAB, 91 __TCA_TBF_MAX, 92 }; 93 94 #define TCA_TBF_MAX (__TCA_TBF_MAX - 1) 95 96 struct tc_sfq_qopt 97 { 98 unsigned quantum; 99 int perturb_period; 100 __u32 limit; 101 unsigned divisor; 102 unsigned flows; 103 }; 104 105 enum 106 { 107 TCA_RED_UNSPEC, 108 TCA_RED_PARMS, 109 TCA_RED_STAB, 110 __TCA_RED_MAX, 111 }; 112 113 #define TCA_RED_MAX (__TCA_RED_MAX - 1) 114 115 struct tc_red_qopt 116 { 117 __u32 limit; 118 __u32 qth_min; 119 __u32 qth_max; 120 unsigned char Wlog; 121 unsigned char Plog; 122 unsigned char Scell_log; 123 unsigned char flags; 124 #define TC_RED_ECN 1 125 #define TC_RED_HARDDROP 2 126 }; 127 128 struct tc_red_xstats 129 { 130 __u32 early; 131 __u32 pdrop; 132 __u32 other; 133 __u32 marked; 134 }; 135 136 #define MAX_DPs 16 137 138 enum 139 { 140 TCA_GRED_UNSPEC, 141 TCA_GRED_PARMS, 142 TCA_GRED_STAB, 143 TCA_GRED_DPS, 144 __TCA_GRED_MAX, 145 }; 146 147 #define TCA_GRED_MAX (__TCA_GRED_MAX - 1) 148 149 struct tc_gred_qopt 150 { 151 __u32 limit; 152 __u32 qth_min; 153 __u32 qth_max; 154 __u32 DP; 155 __u32 backlog; 156 __u32 qave; 157 __u32 forced; 158 __u32 early; 159 __u32 other; 160 __u32 pdrop; 161 __u8 Wlog; 162 __u8 Plog; 163 __u8 Scell_log; 164 __u8 prio; 165 __u32 packets; 166 __u32 bytesin; 167 }; 168 169 struct tc_gred_sopt 170 { 171 __u32 DPs; 172 __u32 def_DP; 173 __u8 grio; 174 __u8 flags; 175 __u16 pad1; 176 }; 177 178 #define TC_HTB_NUMPRIO 8 179 #define TC_HTB_MAXDEPTH 8 180 #define TC_HTB_PROTOVER 3 181 182 struct tc_htb_opt 183 { 184 struct tc_ratespec rate; 185 struct tc_ratespec ceil; 186 __u32 buffer; 187 __u32 cbuffer; 188 __u32 quantum; 189 __u32 level; 190 __u32 prio; 191 }; 192 struct tc_htb_glob 193 { 194 __u32 version; 195 __u32 rate2quantum; 196 __u32 defcls; 197 __u32 debug; 198 199 __u32 direct_pkts; 200 }; 201 enum 202 { 203 TCA_HTB_UNSPEC, 204 TCA_HTB_PARMS, 205 TCA_HTB_INIT, 206 TCA_HTB_CTAB, 207 TCA_HTB_RTAB, 208 __TCA_HTB_MAX, 209 }; 210 211 #define TCA_HTB_MAX (__TCA_HTB_MAX - 1) 212 213 struct tc_htb_xstats 214 { 215 __u32 lends; 216 __u32 borrows; 217 __u32 giants; 218 __u32 tokens; 219 __u32 ctokens; 220 }; 221 222 struct tc_hfsc_qopt 223 { 224 __u16 defcls; 225 }; 226 227 struct tc_service_curve 228 { 229 __u32 m1; 230 __u32 d; 231 __u32 m2; 232 }; 233 234 struct tc_hfsc_stats 235 { 236 __u64 work; 237 __u64 rtwork; 238 __u32 period; 239 __u32 level; 240 }; 241 242 enum 243 { 244 TCA_HFSC_UNSPEC, 245 TCA_HFSC_RSC, 246 TCA_HFSC_FSC, 247 TCA_HFSC_USC, 248 __TCA_HFSC_MAX, 249 }; 250 251 #define TCA_HFSC_MAX (__TCA_HFSC_MAX - 1) 252 253 #define TC_CBQ_MAXPRIO 8 254 #define TC_CBQ_MAXLEVEL 8 255 #define TC_CBQ_DEF_EWMA 5 256 257 struct tc_cbq_lssopt 258 { 259 unsigned char change; 260 unsigned char flags; 261 #define TCF_CBQ_LSS_BOUNDED 1 262 #define TCF_CBQ_LSS_ISOLATED 2 263 unsigned char ewma_log; 264 unsigned char level; 265 #define TCF_CBQ_LSS_FLAGS 1 266 #define TCF_CBQ_LSS_EWMA 2 267 #define TCF_CBQ_LSS_MAXIDLE 4 268 #define TCF_CBQ_LSS_MINIDLE 8 269 #define TCF_CBQ_LSS_OFFTIME 0x10 270 #define TCF_CBQ_LSS_AVPKT 0x20 271 __u32 maxidle; 272 __u32 minidle; 273 __u32 offtime; 274 __u32 avpkt; 275 }; 276 277 struct tc_cbq_wrropt 278 { 279 unsigned char flags; 280 unsigned char priority; 281 unsigned char cpriority; 282 unsigned char __reserved; 283 __u32 allot; 284 __u32 weight; 285 }; 286 287 struct tc_cbq_ovl 288 { 289 unsigned char strategy; 290 #define TC_CBQ_OVL_CLASSIC 0 291 #define TC_CBQ_OVL_DELAY 1 292 #define TC_CBQ_OVL_LOWPRIO 2 293 #define TC_CBQ_OVL_DROP 3 294 #define TC_CBQ_OVL_RCLASSIC 4 295 unsigned char priority2; 296 __u16 pad; 297 __u32 penalty; 298 }; 299 300 struct tc_cbq_police 301 { 302 unsigned char police; 303 unsigned char __res1; 304 unsigned short __res2; 305 }; 306 307 struct tc_cbq_fopt 308 { 309 __u32 split; 310 __u32 defmap; 311 __u32 defchange; 312 }; 313 314 struct tc_cbq_xstats 315 { 316 __u32 borrows; 317 __u32 overactions; 318 __s32 avgidle; 319 __s32 undertime; 320 }; 321 322 enum 323 { 324 TCA_CBQ_UNSPEC, 325 TCA_CBQ_LSSOPT, 326 TCA_CBQ_WRROPT, 327 TCA_CBQ_FOPT, 328 TCA_CBQ_OVL_STRATEGY, 329 TCA_CBQ_RATE, 330 TCA_CBQ_RTAB, 331 TCA_CBQ_POLICE, 332 __TCA_CBQ_MAX, 333 }; 334 335 #define TCA_CBQ_MAX (__TCA_CBQ_MAX - 1) 336 337 enum { 338 TCA_DSMARK_UNSPEC, 339 TCA_DSMARK_INDICES, 340 TCA_DSMARK_DEFAULT_INDEX, 341 TCA_DSMARK_SET_TC_INDEX, 342 TCA_DSMARK_MASK, 343 TCA_DSMARK_VALUE, 344 __TCA_DSMARK_MAX, 345 }; 346 347 #define TCA_DSMARK_MAX (__TCA_DSMARK_MAX - 1) 348 349 enum { 350 TCA_ATM_UNSPEC, 351 TCA_ATM_FD, 352 TCA_ATM_PTR, 353 TCA_ATM_HDR, 354 TCA_ATM_EXCESS, 355 TCA_ATM_ADDR, 356 TCA_ATM_STATE, 357 __TCA_ATM_MAX, 358 }; 359 360 #define TCA_ATM_MAX (__TCA_ATM_MAX - 1) 361 362 enum 363 { 364 TCA_NETEM_UNSPEC, 365 TCA_NETEM_CORR, 366 TCA_NETEM_DELAY_DIST, 367 TCA_NETEM_REORDER, 368 TCA_NETEM_CORRUPT, 369 __TCA_NETEM_MAX, 370 }; 371 372 #define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1) 373 374 struct tc_netem_qopt 375 { 376 __u32 latency; 377 __u32 limit; 378 __u32 loss; 379 __u32 gap; 380 __u32 duplicate; 381 __u32 jitter; 382 }; 383 384 struct tc_netem_corr 385 { 386 __u32 delay_corr; 387 __u32 loss_corr; 388 __u32 dup_corr; 389 }; 390 391 struct tc_netem_reorder 392 { 393 __u32 probability; 394 __u32 correlation; 395 }; 396 397 struct tc_netem_corrupt 398 { 399 __u32 probability; 400 __u32 correlation; 401 }; 402 403 #define NETEM_DIST_SCALE 8192 404 405 #endif 406