1 #ifndef __LINUX_PKT_CLS_H 2 #define __LINUX_PKT_CLS_H 3 4 struct tc_police 5 { 6 __u32 index; 7 int action; 8 #define TC_POLICE_UNSPEC (-1) 9 #define TC_POLICE_OK 0 10 #define TC_POLICE_RECLASSIFY 1 11 #define TC_POLICE_SHOT 2 12 13 __u32 limit; 14 __u32 burst; 15 __u32 mtu; 16 struct tc_ratespec rate; 17 struct tc_ratespec peakrate; 18 }; 19 20 enum 21 { 22 TCA_POLICE_UNSPEC, 23 TCA_POLICE_TBF, 24 TCA_POLICE_RATE, 25 TCA_POLICE_PEAKRATE, 26 TCA_POLICE_AVRATE, 27 TCA_POLICE_RESULT, 28 #define TCA_POLICE_RESULT TCA_POLICE_RESULT 29 __TCA_POLICE_MAX 30 }; 31 32 #define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1) 33 34 /* U32 filters */ 35 36 #define TC_U32_HTID(h) ((h)&0xFFF00000) 37 #define TC_U32_USERHTID(h) (TC_U32_HTID(h)>>20) 38 #define TC_U32_HASH(h) (((h)>>12)&0xFF) 39 #define TC_U32_NODE(h) ((h)&0xFFF) 40 #define TC_U32_KEY(h) ((h)&0xFFFFF) 41 #define TC_U32_UNSPEC 0 42 #define TC_U32_ROOT (0xFFF00000) 43 44 enum 45 { 46 TCA_U32_UNSPEC, 47 TCA_U32_CLASSID, 48 TCA_U32_HASH, 49 TCA_U32_LINK, 50 TCA_U32_DIVISOR, 51 TCA_U32_SEL, 52 TCA_U32_POLICE, 53 __TCA_U32_MAX 54 }; 55 56 #define TCA_U32_MAX (__TCA_U32_MAX - 1) 57 58 struct tc_u32_key 59 { 60 __u32 mask; 61 __u32 val; 62 int off; 63 int offmask; 64 }; 65 66 struct tc_u32_sel 67 { 68 unsigned char flags; 69 unsigned char offshift; 70 unsigned char nkeys; 71 72 __u16 offmask; 73 __u16 off; 74 short offoff; 75 76 short hoff; 77 __u32 hmask; 78 79 struct tc_u32_key keys[0]; 80 }; 81 82 /* Flags */ 83 84 #define TC_U32_TERMINAL 1 85 #define TC_U32_OFFSET 2 86 #define TC_U32_VAROFFSET 4 87 #define TC_U32_EAT 8 88 89 #define TC_U32_MAXDEPTH 8 90 91 92 /* RSVP filter */ 93 94 enum 95 { 96 TCA_RSVP_UNSPEC, 97 TCA_RSVP_CLASSID, 98 TCA_RSVP_DST, 99 TCA_RSVP_SRC, 100 TCA_RSVP_PINFO, 101 TCA_RSVP_POLICE, 102 __TCA_RSVP_MAX 103 }; 104 105 #define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1) 106 107 struct tc_rsvp_gpi 108 { 109 __u32 key; 110 __u32 mask; 111 int offset; 112 }; 113 114 struct tc_rsvp_pinfo 115 { 116 struct tc_rsvp_gpi dpi; 117 struct tc_rsvp_gpi spi; 118 __u8 protocol; 119 __u8 tunnelid; 120 __u8 tunnelhdr; 121 __u8 pad; 122 }; 123 124 /* ROUTE filter */ 125 126 enum 127 { 128 TCA_ROUTE4_UNSPEC, 129 TCA_ROUTE4_CLASSID, 130 TCA_ROUTE4_TO, 131 TCA_ROUTE4_FROM, 132 TCA_ROUTE4_IIF, 133 TCA_ROUTE4_POLICE, 134 __TCA_ROUTE4_MAX 135 }; 136 137 #define TCA_ROUTE4_MAX (__TCA_ROUTE4_MAX - 1) 138 139 140 /* FW filter */ 141 142 enum 143 { 144 TCA_FW_UNSPEC, 145 TCA_FW_CLASSID, 146 TCA_FW_POLICE, 147 __TCA_FW_MAX 148 }; 149 150 #define TCA_FW_MAX (__TCA_FW_MAX - 1) 151 152 /* TC index filter */ 153 154 enum 155 { 156 TCA_TCINDEX_UNSPEC, 157 TCA_TCINDEX_HASH, 158 TCA_TCINDEX_MASK, 159 TCA_TCINDEX_SHIFT, 160 TCA_TCINDEX_FALL_THROUGH, 161 TCA_TCINDEX_CLASSID, 162 TCA_TCINDEX_POLICE, 163 __TCA_TCINDEX_MAX 164 }; 165 166 #define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1) 167 168 #endif 169