Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __LINUX_TC_EM_META_H |
| 2 | #define __LINUX_TC_EM_META_H |
| 3 | |
Jaswinder Singh Rajput | 9976007 | 2009-01-30 20:12:59 +0530 | [diff] [blame] | 4 | #include <linux/types.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | #include <linux/pkt_cls.h> |
| 6 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 7 | enum { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | TCA_EM_META_UNSPEC, |
| 9 | TCA_EM_META_HDR, |
| 10 | TCA_EM_META_LVALUE, |
| 11 | TCA_EM_META_RVALUE, |
| 12 | __TCA_EM_META_MAX |
| 13 | }; |
| 14 | #define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1) |
| 15 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 16 | struct tcf_meta_val { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | __u16 kind; |
| 18 | __u8 shift; |
| 19 | __u8 op; |
| 20 | }; |
| 21 | |
| 22 | #define TCF_META_TYPE_MASK (0xf << 12) |
| 23 | #define TCF_META_TYPE(kind) (((kind) & TCF_META_TYPE_MASK) >> 12) |
| 24 | #define TCF_META_ID_MASK 0x7ff |
| 25 | #define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK) |
| 26 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 27 | enum { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | TCF_META_TYPE_VAR, |
| 29 | TCF_META_TYPE_INT, |
| 30 | __TCF_META_TYPE_MAX |
| 31 | }; |
| 32 | #define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1) |
| 33 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 34 | enum { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | TCF_META_ID_VALUE, |
| 36 | TCF_META_ID_RANDOM, |
| 37 | TCF_META_ID_LOADAVG_0, |
| 38 | TCF_META_ID_LOADAVG_1, |
| 39 | TCF_META_ID_LOADAVG_2, |
| 40 | TCF_META_ID_DEV, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | TCF_META_ID_PRIORITY, |
| 42 | TCF_META_ID_PROTOCOL, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | TCF_META_ID_PKTTYPE, |
| 44 | TCF_META_ID_PKTLEN, |
| 45 | TCF_META_ID_DATALEN, |
| 46 | TCF_META_ID_MACLEN, |
| 47 | TCF_META_ID_NFMARK, |
| 48 | TCF_META_ID_TCINDEX, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | TCF_META_ID_RTCLASSID, |
| 50 | TCF_META_ID_RTIIF, |
Thomas Graf | 4890062 | 2005-06-08 15:10:48 -0700 | [diff] [blame] | 51 | TCF_META_ID_SK_FAMILY, |
| 52 | TCF_META_ID_SK_STATE, |
| 53 | TCF_META_ID_SK_REUSE, |
| 54 | TCF_META_ID_SK_BOUND_IF, |
| 55 | TCF_META_ID_SK_REFCNT, |
| 56 | TCF_META_ID_SK_SHUTDOWN, |
| 57 | TCF_META_ID_SK_PROTO, |
| 58 | TCF_META_ID_SK_TYPE, |
| 59 | TCF_META_ID_SK_RCVBUF, |
| 60 | TCF_META_ID_SK_RMEM_ALLOC, |
| 61 | TCF_META_ID_SK_WMEM_ALLOC, |
| 62 | TCF_META_ID_SK_OMEM_ALLOC, |
| 63 | TCF_META_ID_SK_WMEM_QUEUED, |
| 64 | TCF_META_ID_SK_RCV_QLEN, |
| 65 | TCF_META_ID_SK_SND_QLEN, |
| 66 | TCF_META_ID_SK_ERR_QLEN, |
| 67 | TCF_META_ID_SK_FORWARD_ALLOCS, |
| 68 | TCF_META_ID_SK_SNDBUF, |
| 69 | TCF_META_ID_SK_ALLOCS, |
Michał Mirosław | e20e694 | 2011-07-14 14:45:59 -0700 | [diff] [blame] | 70 | __TCF_META_ID_SK_ROUTE_CAPS, /* unimplemented but in ABI already */ |
Eric Dumazet | 81c3d54 | 2005-10-03 14:13:38 -0700 | [diff] [blame] | 71 | TCF_META_ID_SK_HASH, |
Thomas Graf | 4890062 | 2005-06-08 15:10:48 -0700 | [diff] [blame] | 72 | TCF_META_ID_SK_LINGERTIME, |
| 73 | TCF_META_ID_SK_ACK_BACKLOG, |
| 74 | TCF_META_ID_SK_MAX_ACK_BACKLOG, |
| 75 | TCF_META_ID_SK_PRIO, |
| 76 | TCF_META_ID_SK_RCVLOWAT, |
| 77 | TCF_META_ID_SK_RCVTIMEO, |
| 78 | TCF_META_ID_SK_SNDTIMEO, |
| 79 | TCF_META_ID_SK_SENDMSG_OFF, |
| 80 | TCF_META_ID_SK_WRITE_PENDING, |
Stephen Hemminger | 3113e88 | 2008-02-05 03:20:13 -0800 | [diff] [blame] | 81 | TCF_META_ID_VLAN_TAG, |
Stephen Hemminger | c2e3143 | 2010-08-24 14:48:10 -0700 | [diff] [blame] | 82 | TCF_META_ID_RXHASH, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | __TCF_META_ID_MAX |
| 84 | }; |
| 85 | #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) |
| 86 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 87 | struct tcf_meta_hdr { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | struct tcf_meta_val left; |
| 89 | struct tcf_meta_val right; |
| 90 | }; |
| 91 | |
| 92 | #endif |