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 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef __LINUX_PKT_CLS_H 20 #define __LINUX_PKT_CLS_H 21 #include <linux/types.h> 22 #include <linux/pkt_sched.h> 23 enum { 24 TCA_ACT_UNSPEC, 25 TCA_ACT_KIND, 26 TCA_ACT_OPTIONS, 27 TCA_ACT_INDEX, 28 TCA_ACT_STATS, 29 TCA_ACT_PAD, 30 __TCA_ACT_MAX 31 }; 32 #define TCA_ACT_MAX __TCA_ACT_MAX 33 #define TCA_OLD_COMPAT (TCA_ACT_MAX + 1) 34 #define TCA_ACT_MAX_PRIO 32 35 #define TCA_ACT_BIND 1 36 #define TCA_ACT_NOBIND 0 37 #define TCA_ACT_UNBIND 1 38 #define TCA_ACT_NOUNBIND 0 39 #define TCA_ACT_REPLACE 1 40 #define TCA_ACT_NOREPLACE 0 41 #define TC_ACT_UNSPEC (- 1) 42 #define TC_ACT_OK 0 43 #define TC_ACT_RECLASSIFY 1 44 #define TC_ACT_SHOT 2 45 #define TC_ACT_PIPE 3 46 #define TC_ACT_STOLEN 4 47 #define TC_ACT_QUEUED 5 48 #define TC_ACT_REPEAT 6 49 #define TC_ACT_REDIRECT 7 50 #define TC_ACT_JUMP 0x10000000 51 enum { 52 TCA_ID_UNSPEC = 0, 53 TCA_ID_POLICE = 1, 54 __TCA_ID_MAX = 255 55 }; 56 #define TCA_ID_MAX __TCA_ID_MAX 57 struct tc_police { 58 __u32 index; 59 int action; 60 #define TC_POLICE_UNSPEC TC_ACT_UNSPEC 61 #define TC_POLICE_OK TC_ACT_OK 62 #define TC_POLICE_RECLASSIFY TC_ACT_RECLASSIFY 63 #define TC_POLICE_SHOT TC_ACT_SHOT 64 #define TC_POLICE_PIPE TC_ACT_PIPE 65 __u32 limit; 66 __u32 burst; 67 __u32 mtu; 68 struct tc_ratespec rate; 69 struct tc_ratespec peakrate; 70 int refcnt; 71 int bindcnt; 72 __u32 capab; 73 }; 74 struct tcf_t { 75 __u64 install; 76 __u64 lastuse; 77 __u64 expires; 78 __u64 firstuse; 79 }; 80 struct tc_cnt { 81 int refcnt; 82 int bindcnt; 83 }; 84 #define tc_gen __u32 index; __u32 capab; int action; int refcnt; int bindcnt 85 enum { 86 TCA_POLICE_UNSPEC, 87 TCA_POLICE_TBF, 88 TCA_POLICE_RATE, 89 TCA_POLICE_PEAKRATE, 90 TCA_POLICE_AVRATE, 91 TCA_POLICE_RESULT, 92 TCA_POLICE_TM, 93 TCA_POLICE_PAD, 94 __TCA_POLICE_MAX 95 #define TCA_POLICE_RESULT TCA_POLICE_RESULT 96 }; 97 #define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1) 98 #define TCA_CLS_FLAGS_SKIP_HW (1 << 0) 99 #define TCA_CLS_FLAGS_SKIP_SW (1 << 1) 100 #define TC_U32_HTID(h) ((h) & 0xFFF00000) 101 #define TC_U32_USERHTID(h) (TC_U32_HTID(h) >> 20) 102 #define TC_U32_HASH(h) (((h) >> 12) & 0xFF) 103 #define TC_U32_NODE(h) ((h) & 0xFFF) 104 #define TC_U32_KEY(h) ((h) & 0xFFFFF) 105 #define TC_U32_UNSPEC 0 106 #define TC_U32_ROOT (0xFFF00000) 107 enum { 108 TCA_U32_UNSPEC, 109 TCA_U32_CLASSID, 110 TCA_U32_HASH, 111 TCA_U32_LINK, 112 TCA_U32_DIVISOR, 113 TCA_U32_SEL, 114 TCA_U32_POLICE, 115 TCA_U32_ACT, 116 TCA_U32_INDEV, 117 TCA_U32_PCNT, 118 TCA_U32_MARK, 119 TCA_U32_FLAGS, 120 TCA_U32_PAD, 121 __TCA_U32_MAX 122 }; 123 #define TCA_U32_MAX (__TCA_U32_MAX - 1) 124 struct tc_u32_key { 125 __be32 mask; 126 __be32 val; 127 int off; 128 int offmask; 129 }; 130 struct tc_u32_sel { 131 unsigned char flags; 132 unsigned char offshift; 133 unsigned char nkeys; 134 __be16 offmask; 135 __u16 off; 136 short offoff; 137 short hoff; 138 __be32 hmask; 139 struct tc_u32_key keys[0]; 140 }; 141 struct tc_u32_mark { 142 __u32 val; 143 __u32 mask; 144 __u32 success; 145 }; 146 struct tc_u32_pcnt { 147 __u64 rcnt; 148 __u64 rhit; 149 __u64 kcnts[0]; 150 }; 151 #define TC_U32_TERMINAL 1 152 #define TC_U32_OFFSET 2 153 #define TC_U32_VAROFFSET 4 154 #define TC_U32_EAT 8 155 #define TC_U32_MAXDEPTH 8 156 enum { 157 TCA_RSVP_UNSPEC, 158 TCA_RSVP_CLASSID, 159 TCA_RSVP_DST, 160 TCA_RSVP_SRC, 161 TCA_RSVP_PINFO, 162 TCA_RSVP_POLICE, 163 TCA_RSVP_ACT, 164 __TCA_RSVP_MAX 165 }; 166 #define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1) 167 struct tc_rsvp_gpi { 168 __u32 key; 169 __u32 mask; 170 int offset; 171 }; 172 struct tc_rsvp_pinfo { 173 struct tc_rsvp_gpi dpi; 174 struct tc_rsvp_gpi spi; 175 __u8 protocol; 176 __u8 tunnelid; 177 __u8 tunnelhdr; 178 __u8 pad; 179 }; 180 enum { 181 TCA_ROUTE4_UNSPEC, 182 TCA_ROUTE4_CLASSID, 183 TCA_ROUTE4_TO, 184 TCA_ROUTE4_FROM, 185 TCA_ROUTE4_IIF, 186 TCA_ROUTE4_POLICE, 187 TCA_ROUTE4_ACT, 188 __TCA_ROUTE4_MAX 189 }; 190 #define TCA_ROUTE4_MAX (__TCA_ROUTE4_MAX - 1) 191 enum { 192 TCA_FW_UNSPEC, 193 TCA_FW_CLASSID, 194 TCA_FW_POLICE, 195 TCA_FW_INDEV, 196 TCA_FW_ACT, 197 TCA_FW_MASK, 198 __TCA_FW_MAX 199 }; 200 #define TCA_FW_MAX (__TCA_FW_MAX - 1) 201 enum { 202 TCA_TCINDEX_UNSPEC, 203 TCA_TCINDEX_HASH, 204 TCA_TCINDEX_MASK, 205 TCA_TCINDEX_SHIFT, 206 TCA_TCINDEX_FALL_THROUGH, 207 TCA_TCINDEX_CLASSID, 208 TCA_TCINDEX_POLICE, 209 TCA_TCINDEX_ACT, 210 __TCA_TCINDEX_MAX 211 }; 212 #define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1) 213 enum { 214 FLOW_KEY_SRC, 215 FLOW_KEY_DST, 216 FLOW_KEY_PROTO, 217 FLOW_KEY_PROTO_SRC, 218 FLOW_KEY_PROTO_DST, 219 FLOW_KEY_IIF, 220 FLOW_KEY_PRIORITY, 221 FLOW_KEY_MARK, 222 FLOW_KEY_NFCT, 223 FLOW_KEY_NFCT_SRC, 224 FLOW_KEY_NFCT_DST, 225 FLOW_KEY_NFCT_PROTO_SRC, 226 FLOW_KEY_NFCT_PROTO_DST, 227 FLOW_KEY_RTCLASSID, 228 FLOW_KEY_SKUID, 229 FLOW_KEY_SKGID, 230 FLOW_KEY_VLAN_TAG, 231 FLOW_KEY_RXHASH, 232 __FLOW_KEY_MAX, 233 }; 234 #define FLOW_KEY_MAX (__FLOW_KEY_MAX - 1) 235 enum { 236 FLOW_MODE_MAP, 237 FLOW_MODE_HASH, 238 }; 239 enum { 240 TCA_FLOW_UNSPEC, 241 TCA_FLOW_KEYS, 242 TCA_FLOW_MODE, 243 TCA_FLOW_BASECLASS, 244 TCA_FLOW_RSHIFT, 245 TCA_FLOW_ADDEND, 246 TCA_FLOW_MASK, 247 TCA_FLOW_XOR, 248 TCA_FLOW_DIVISOR, 249 TCA_FLOW_ACT, 250 TCA_FLOW_POLICE, 251 TCA_FLOW_EMATCHES, 252 TCA_FLOW_PERTURB, 253 __TCA_FLOW_MAX 254 }; 255 #define TCA_FLOW_MAX (__TCA_FLOW_MAX - 1) 256 enum { 257 TCA_BASIC_UNSPEC, 258 TCA_BASIC_CLASSID, 259 TCA_BASIC_EMATCHES, 260 TCA_BASIC_ACT, 261 TCA_BASIC_POLICE, 262 __TCA_BASIC_MAX 263 }; 264 #define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1) 265 enum { 266 TCA_CGROUP_UNSPEC, 267 TCA_CGROUP_ACT, 268 TCA_CGROUP_POLICE, 269 TCA_CGROUP_EMATCHES, 270 __TCA_CGROUP_MAX, 271 }; 272 #define TCA_CGROUP_MAX (__TCA_CGROUP_MAX - 1) 273 #define TCA_BPF_FLAG_ACT_DIRECT (1 << 0) 274 enum { 275 TCA_BPF_UNSPEC, 276 TCA_BPF_ACT, 277 TCA_BPF_POLICE, 278 TCA_BPF_CLASSID, 279 TCA_BPF_OPS_LEN, 280 TCA_BPF_OPS, 281 TCA_BPF_FD, 282 TCA_BPF_NAME, 283 TCA_BPF_FLAGS, 284 TCA_BPF_FLAGS_GEN, 285 TCA_BPF_TAG, 286 __TCA_BPF_MAX, 287 }; 288 #define TCA_BPF_MAX (__TCA_BPF_MAX - 1) 289 enum { 290 TCA_FLOWER_UNSPEC, 291 TCA_FLOWER_CLASSID, 292 TCA_FLOWER_INDEV, 293 TCA_FLOWER_ACT, 294 TCA_FLOWER_KEY_ETH_DST, 295 TCA_FLOWER_KEY_ETH_DST_MASK, 296 TCA_FLOWER_KEY_ETH_SRC, 297 TCA_FLOWER_KEY_ETH_SRC_MASK, 298 TCA_FLOWER_KEY_ETH_TYPE, 299 TCA_FLOWER_KEY_IP_PROTO, 300 TCA_FLOWER_KEY_IPV4_SRC, 301 TCA_FLOWER_KEY_IPV4_SRC_MASK, 302 TCA_FLOWER_KEY_IPV4_DST, 303 TCA_FLOWER_KEY_IPV4_DST_MASK, 304 TCA_FLOWER_KEY_IPV6_SRC, 305 TCA_FLOWER_KEY_IPV6_SRC_MASK, 306 TCA_FLOWER_KEY_IPV6_DST, 307 TCA_FLOWER_KEY_IPV6_DST_MASK, 308 TCA_FLOWER_KEY_TCP_SRC, 309 TCA_FLOWER_KEY_TCP_DST, 310 TCA_FLOWER_KEY_UDP_SRC, 311 TCA_FLOWER_KEY_UDP_DST, 312 TCA_FLOWER_FLAGS, 313 TCA_FLOWER_KEY_VLAN_ID, 314 TCA_FLOWER_KEY_VLAN_PRIO, 315 TCA_FLOWER_KEY_VLAN_ETH_TYPE, 316 TCA_FLOWER_KEY_ENC_KEY_ID, 317 TCA_FLOWER_KEY_ENC_IPV4_SRC, 318 TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK, 319 TCA_FLOWER_KEY_ENC_IPV4_DST, 320 TCA_FLOWER_KEY_ENC_IPV4_DST_MASK, 321 TCA_FLOWER_KEY_ENC_IPV6_SRC, 322 TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK, 323 TCA_FLOWER_KEY_ENC_IPV6_DST, 324 TCA_FLOWER_KEY_ENC_IPV6_DST_MASK, 325 TCA_FLOWER_KEY_TCP_SRC_MASK, 326 TCA_FLOWER_KEY_TCP_DST_MASK, 327 TCA_FLOWER_KEY_UDP_SRC_MASK, 328 TCA_FLOWER_KEY_UDP_DST_MASK, 329 TCA_FLOWER_KEY_SCTP_SRC_MASK, 330 TCA_FLOWER_KEY_SCTP_DST_MASK, 331 TCA_FLOWER_KEY_SCTP_SRC, 332 TCA_FLOWER_KEY_SCTP_DST, 333 TCA_FLOWER_KEY_ENC_UDP_SRC_PORT, 334 TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK, 335 TCA_FLOWER_KEY_ENC_UDP_DST_PORT, 336 TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK, 337 TCA_FLOWER_KEY_FLAGS, 338 TCA_FLOWER_KEY_FLAGS_MASK, 339 TCA_FLOWER_KEY_ICMPV4_CODE, 340 TCA_FLOWER_KEY_ICMPV4_CODE_MASK, 341 TCA_FLOWER_KEY_ICMPV4_TYPE, 342 TCA_FLOWER_KEY_ICMPV4_TYPE_MASK, 343 TCA_FLOWER_KEY_ICMPV6_CODE, 344 TCA_FLOWER_KEY_ICMPV6_CODE_MASK, 345 TCA_FLOWER_KEY_ICMPV6_TYPE, 346 TCA_FLOWER_KEY_ICMPV6_TYPE_MASK, 347 __TCA_FLOWER_MAX, 348 }; 349 #define TCA_FLOWER_MAX (__TCA_FLOWER_MAX - 1) 350 enum { 351 TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT = (1 << 0), 352 }; 353 enum { 354 TCA_MATCHALL_UNSPEC, 355 TCA_MATCHALL_CLASSID, 356 TCA_MATCHALL_ACT, 357 TCA_MATCHALL_FLAGS, 358 __TCA_MATCHALL_MAX, 359 }; 360 #define TCA_MATCHALL_MAX (__TCA_MATCHALL_MAX - 1) 361 struct tcf_ematch_tree_hdr { 362 __u16 nmatches; 363 __u16 progid; 364 }; 365 enum { 366 TCA_EMATCH_TREE_UNSPEC, 367 TCA_EMATCH_TREE_HDR, 368 TCA_EMATCH_TREE_LIST, 369 __TCA_EMATCH_TREE_MAX 370 }; 371 #define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1) 372 struct tcf_ematch_hdr { 373 __u16 matchid; 374 __u16 kind; 375 __u16 flags; 376 __u16 pad; 377 }; 378 #define TCF_EM_REL_END 0 379 #define TCF_EM_REL_AND (1 << 0) 380 #define TCF_EM_REL_OR (1 << 1) 381 #define TCF_EM_INVERT (1 << 2) 382 #define TCF_EM_SIMPLE (1 << 3) 383 #define TCF_EM_REL_MASK 3 384 #define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK) 385 enum { 386 TCF_LAYER_LINK, 387 TCF_LAYER_NETWORK, 388 TCF_LAYER_TRANSPORT, 389 __TCF_LAYER_MAX 390 }; 391 #define TCF_LAYER_MAX (__TCF_LAYER_MAX - 1) 392 #define TCF_EM_CONTAINER 0 393 #define TCF_EM_CMP 1 394 #define TCF_EM_NBYTE 2 395 #define TCF_EM_U32 3 396 #define TCF_EM_META 4 397 #define TCF_EM_TEXT 5 398 #define TCF_EM_VLAN 6 399 #define TCF_EM_CANID 7 400 #define TCF_EM_IPSET 8 401 #define TCF_EM_MAX 8 402 enum { 403 TCF_EM_PROG_TC 404 }; 405 enum { 406 TCF_EM_OPND_EQ, 407 TCF_EM_OPND_GT, 408 TCF_EM_OPND_LT 409 }; 410 #endif 411