Pavel Kotucek | d2c97d9 | 2017-01-24 10:58:12 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015-2016 Cisco and/or its affiliates. |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at: |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | */ |
| 15 | |
| 16 | /** \brief Add/Delete classification table request |
| 17 | @param client_index - opaque cookie to identify the sender |
| 18 | @param context - sender context, to match reply w/ request |
| 19 | @param is_add- if non-zero add the table, else delete it |
| 20 | @param del_chain - if non-zero delete the whole chain of tables |
| 21 | @param table_index - if add, reuturns index of the created table, else specifies the table to delete |
| 22 | @param nbuckets - number of buckets when adding a table |
| 23 | @param memory_size - memory size when adding a table |
| 24 | @param match_n_vectors - number of match vectors |
| 25 | @param next_table_index - index of next table |
| 26 | @param miss_next_index - index of miss table |
| 27 | @param current_data_flag - option to use current node's packet payload |
| 28 | as the starting point from where packets are classified, |
| 29 | This option is only valid for L2/L3 input ACL for now. |
| 30 | 0: by default, classify data from the buffer's start location |
| 31 | 1: classify packets from VPP node’s current data pointer |
| 32 | @param current_data_offset - a signed value to shift the start location of |
| 33 | the packet to be classified |
| 34 | For example, if input IP ACL node is used, L2 header’s first byte |
| 35 | can be accessible by configuring current_data_offset to -14 |
| 36 | if there is no vlan tag. |
| 37 | This is valid only if current_data_flag is set to 1. |
| 38 | @param mask[] - match mask |
| 39 | */ |
| 40 | define classify_add_del_table |
| 41 | { |
| 42 | u32 client_index; |
| 43 | u32 context; |
| 44 | u8 is_add; |
| 45 | u8 del_chain; |
| 46 | u32 table_index; |
| 47 | u32 nbuckets; |
| 48 | u32 memory_size; |
| 49 | u32 skip_n_vectors; |
| 50 | u32 match_n_vectors; |
| 51 | u32 next_table_index; |
| 52 | u32 miss_next_index; |
| 53 | u32 current_data_flag; |
| 54 | i32 current_data_offset; |
| 55 | u8 mask[0]; |
| 56 | }; |
| 57 | |
| 58 | /** \brief Add/Delete classification table response |
| 59 | @param context - sender context, to match reply w/ request |
| 60 | @param retval - return code for the table add/del requst |
| 61 | @param new_table_index - for add, returned index of the new table |
| 62 | @param skip_n_vectors - for add, returned value of skip_n_vectors in table |
| 63 | @param match_n_vectors -for add, returned value of match_n_vectors in table |
| 64 | */ |
| 65 | define classify_add_del_table_reply |
| 66 | { |
| 67 | u32 context; |
| 68 | i32 retval; |
| 69 | u32 new_table_index; |
| 70 | u32 skip_n_vectors; |
| 71 | u32 match_n_vectors; |
| 72 | }; |
| 73 | |
| 74 | /** \brief Classify add / del session request |
| 75 | @param client_index - opaque cookie to identify the sender |
| 76 | @param context - sender context, to match reply w/ request |
| 77 | @param is_add - add session if non-zero, else delete |
| 78 | @param table_index - index of the table to add/del the session, required |
| 79 | @param hit_next_index - for add, hit_next_index of new session, required |
| 80 | @param opaque_index - for add, opaque_index of new session |
| 81 | @param advance -for add, advance value for session |
| 82 | @param action - |
| 83 | 0: no action (by default) |
| 84 | metadata is not used. |
| 85 | 1: Classified IP packets will be looked up from the |
| 86 | specified ipv4 fib table (configured by metadata as VRF id). |
| 87 | Only valid for L3 input ACL node |
| 88 | 2: Classified IP packets will be looked up from the |
| 89 | specified ipv6 fib table (configured by metadata as VRF id). |
| 90 | Only valid for L3 input ACL node |
| 91 | @param metadata - valid only if action != 0 |
| 92 | VRF id if action is 1 or 2. |
| 93 | @param match[] - for add, match value for session, required |
| 94 | */ |
| 95 | define classify_add_del_session |
| 96 | { |
| 97 | u32 client_index; |
| 98 | u32 context; |
| 99 | u8 is_add; |
| 100 | u32 table_index; |
| 101 | u32 hit_next_index; |
| 102 | u32 opaque_index; |
| 103 | i32 advance; |
| 104 | u8 action; |
| 105 | u32 metadata; |
| 106 | u8 match[0]; |
| 107 | }; |
| 108 | |
| 109 | /** \brief Classify add / del session response |
| 110 | @param context - sender context, to match reply w/ request |
| 111 | @param retval - return code for the add/del session request |
| 112 | */ |
| 113 | define classify_add_del_session_reply |
| 114 | { |
| 115 | u32 context; |
| 116 | i32 retval; |
| 117 | }; |
| 118 | |
| 119 | /** \brief Set/unset policer classify interface |
| 120 | @param client_index - opaque cookie to identify the sender |
| 121 | @param context - sender context, to match reply w/ request |
| 122 | @param sw_if_index - interface to set/unset policer classify |
| 123 | @param ip4_table_index - ip4 classify table index (~0 for skip) |
| 124 | @param ip6_table_index - ip6 classify table index (~0 for skip) |
| 125 | @param l2_table_index - l2 classify table index (~0 for skip) |
| 126 | @param is_add - Set if non-zero, else unset |
| 127 | Note: User is recommeneded to use just one valid table_index per call. |
| 128 | (ip4_table_index, ip6_table_index, or l2_table_index) |
| 129 | */ |
| 130 | define policer_classify_set_interface |
| 131 | { |
| 132 | u32 client_index; |
| 133 | u32 context; |
| 134 | u32 sw_if_index; |
| 135 | u32 ip4_table_index; |
| 136 | u32 ip6_table_index; |
| 137 | u32 l2_table_index; |
| 138 | u8 is_add; |
| 139 | }; |
| 140 | |
| 141 | /** \brief Set/unset policer classify interface response |
| 142 | @param context - sender context, to match reply w/ request |
| 143 | @param retval - return value for request |
| 144 | */ |
| 145 | define policer_classify_set_interface_reply |
| 146 | { |
| 147 | u32 context; |
| 148 | i32 retval; |
| 149 | }; |
| 150 | |
| 151 | /** \brief Get list of policer classify interfaces and tables |
| 152 | @param client_index - opaque cookie to identify the sender |
| 153 | @param context - sender context, to match reply w/ request |
| 154 | @param type - classify table type |
| 155 | */ |
| 156 | define policer_classify_dump |
| 157 | { |
| 158 | u32 client_index; |
| 159 | u32 context; |
| 160 | u8 type; |
| 161 | }; |
| 162 | |
| 163 | /** \brief Policer iclassify operational state response. |
| 164 | @param context - sender context, to match reply w/ request |
| 165 | @param sw_if_index - software interface index |
| 166 | @param table_index - classify table index |
| 167 | */ |
| 168 | define policer_classify_details |
| 169 | { |
| 170 | u32 context; |
| 171 | u32 sw_if_index; |
| 172 | u32 table_index; |
| 173 | }; |
| 174 | |
| 175 | /** \brief Classify get table IDs request |
| 176 | @param client_index - opaque cookie to identify the sender |
| 177 | @param context - sender context, to match reply w/ request |
| 178 | */ |
| 179 | define classify_table_ids |
| 180 | { |
| 181 | u32 client_index; |
| 182 | u32 context; |
| 183 | }; |
| 184 | |
| 185 | /** \brief Reply for classify get table IDs request |
| 186 | @param context - sender context which was passed in the request |
| 187 | @param count - number of ids returned in response |
| 188 | @param ids - array of classify table ids |
| 189 | */ |
| 190 | define classify_table_ids_reply |
| 191 | { |
| 192 | u32 context; |
| 193 | i32 retval; |
| 194 | u32 count; |
| 195 | u32 ids[count]; |
| 196 | }; |
| 197 | |
| 198 | /** \brief Classify table ids by interface index request |
| 199 | @param client_index - opaque cookie to identify the sender |
| 200 | @param context - sender context, to match reply w/ request |
| 201 | @param sw_if_index - index of the interface |
| 202 | */ |
| 203 | define classify_table_by_interface |
| 204 | { |
| 205 | u32 client_index; |
| 206 | u32 context; |
| 207 | u32 sw_if_index; |
| 208 | }; |
| 209 | |
| 210 | /** \brief Reply for classify table id by interface index request |
| 211 | @param context - sender context which was passed in the request |
| 212 | @param count - number of ids returned in response |
| 213 | @param sw_if_index - index of the interface |
| 214 | @param l2_table_id - l2 classify table index |
| 215 | @param ip4_table_id - ip4 classify table index |
| 216 | @param ip6_table_id - ip6 classify table index |
| 217 | */ |
| 218 | define classify_table_by_interface_reply |
| 219 | { |
| 220 | u32 context; |
| 221 | i32 retval; |
| 222 | u32 sw_if_index; |
| 223 | u32 l2_table_id; |
| 224 | u32 ip4_table_id; |
| 225 | u32 ip6_table_id; |
| 226 | }; |
| 227 | |
| 228 | /** \brief Classify table info |
| 229 | @param client_index - opaque cookie to identify the sender |
| 230 | @param context - sender context, to match reply w/ request |
| 231 | @param table_id - classify table index |
| 232 | */ |
| 233 | define classify_table_info |
| 234 | { |
| 235 | u32 client_index; |
| 236 | u32 context; |
| 237 | u32 table_id; |
| 238 | }; |
| 239 | |
| 240 | /** \brief Reply for classify table info request |
| 241 | @param context - sender context which was passed in the request |
| 242 | @param count - number of ids returned in response |
| 243 | @param table_id - classify table index |
| 244 | @param nbuckets - number of buckets when adding a table |
| 245 | @param match_n_vectors - number of match vectors |
| 246 | @param skip_n_vectors - number of skip_n_vectors |
| 247 | @param active_sessions - number of sessions (active entries) |
| 248 | @param next_table_index - index of next table |
| 249 | @param miss_next_index - index of miss table |
| 250 | @param mask[] - match mask |
| 251 | */ |
| 252 | define classify_table_info_reply |
| 253 | { |
| 254 | u32 context; |
| 255 | i32 retval; |
| 256 | u32 table_id; |
| 257 | u32 nbuckets; |
| 258 | u32 match_n_vectors; |
| 259 | u32 skip_n_vectors; |
| 260 | u32 active_sessions; |
| 261 | u32 next_table_index; |
| 262 | u32 miss_next_index; |
| 263 | u32 mask_length; |
| 264 | u8 mask[mask_length]; |
| 265 | }; |
| 266 | |
| 267 | /** \brief Classify sessions dump request |
| 268 | @param client_index - opaque cookie to identify the sender |
| 269 | @param context - sender context, to match reply w/ request |
| 270 | @param table_id - classify table index |
| 271 | */ |
| 272 | define classify_session_dump |
| 273 | { |
| 274 | u32 client_index; |
| 275 | u32 context; |
| 276 | u32 table_id; |
| 277 | }; |
| 278 | |
| 279 | /** \brief Reply for classify table session dump request |
| 280 | @param context - sender context which was passed in the request |
| 281 | @param count - number of ids returned in response |
| 282 | @param table_id - classify table index |
| 283 | @param hit_next_index - hit_next_index of session |
| 284 | @param opaque_index - for add, opaque_index of session |
| 285 | @param advance - advance value of session |
| 286 | @param match[] - match value for session |
| 287 | */ |
| 288 | define classify_session_details |
| 289 | { |
| 290 | u32 context; |
| 291 | i32 retval; |
| 292 | u32 table_id; |
| 293 | u32 hit_next_index; |
| 294 | i32 advance; |
| 295 | u32 opaque_index; |
| 296 | u32 match_length; |
| 297 | u8 match[match_length]; |
| 298 | }; |
| 299 | |
| 300 | /** \brief Set/unset flow classify interface |
| 301 | @param client_index - opaque cookie to identify the sender |
| 302 | @param context - sender context, to match reply w/ request |
| 303 | @param sw_if_index - interface to set/unset flow classify |
| 304 | @param ip4_table_index - ip4 classify table index (~0 for skip) |
| 305 | @param ip6_table_index - ip6 classify table index (~0 for skip) |
| 306 | @param l2_table_index - l2 classify table index (~0 for skip) |
| 307 | @param is_add - Set if non-zero, else unset |
| 308 | Note: User is recommeneded to use just one valid table_index per call. |
| 309 | (ip4_table_index, ip6_table_index, or l2_table_index) |
| 310 | */ |
| 311 | define flow_classify_set_interface { |
| 312 | u32 client_index; |
| 313 | u32 context; |
| 314 | u32 sw_if_index; |
| 315 | u32 ip4_table_index; |
| 316 | u32 ip6_table_index; |
| 317 | u8 is_add; |
| 318 | }; |
| 319 | |
| 320 | /** \brief Set/unset flow classify interface response |
| 321 | @param context - sender context, to match reply w/ request |
| 322 | @param retval - return value for request |
| 323 | */ |
| 324 | define flow_classify_set_interface_reply { |
| 325 | u32 context; |
| 326 | i32 retval; |
| 327 | }; |
| 328 | |
| 329 | /** \brief Get list of flow classify interfaces and tables |
| 330 | @param client_index - opaque cookie to identify the sender |
| 331 | @param context - sender context, to match reply w/ request |
| 332 | @param type - classify table type |
| 333 | */ |
| 334 | define flow_classify_dump { |
| 335 | u32 client_index; |
| 336 | u32 context; |
| 337 | u8 type; |
| 338 | }; |
| 339 | |
| 340 | /** \brief Flow classify operational state response. |
| 341 | @param context - sender context, to match reply w/ request |
| 342 | @param sw_if_index - software interface index |
| 343 | @param table_index - classify table index |
| 344 | */ |
| 345 | define flow_classify_details { |
| 346 | u32 context; |
| 347 | u32 sw_if_index; |
| 348 | u32 table_index; |
| 349 | }; |
| 350 | |
| 351 | /* |
| 352 | * Local Variables: |
| 353 | * eval: (c-set-style "gnu") |
| 354 | * End: |
| 355 | */ |
| 356 | |