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 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 95 | autoreply define classify_add_del_session |
Pavel Kotucek | d2c97d9 | 2017-01-24 10:58:12 +0100 | [diff] [blame] | 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 | |
Pavel Kotucek | d2c97d9 | 2017-01-24 10:58:12 +0100 | [diff] [blame] | 109 | /** \brief Set/unset policer classify interface |
| 110 | @param client_index - opaque cookie to identify the sender |
| 111 | @param context - sender context, to match reply w/ request |
| 112 | @param sw_if_index - interface to set/unset policer classify |
| 113 | @param ip4_table_index - ip4 classify table index (~0 for skip) |
| 114 | @param ip6_table_index - ip6 classify table index (~0 for skip) |
| 115 | @param l2_table_index - l2 classify table index (~0 for skip) |
| 116 | @param is_add - Set if non-zero, else unset |
| 117 | Note: User is recommeneded to use just one valid table_index per call. |
| 118 | (ip4_table_index, ip6_table_index, or l2_table_index) |
| 119 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 120 | autoreply define policer_classify_set_interface |
Pavel Kotucek | d2c97d9 | 2017-01-24 10:58:12 +0100 | [diff] [blame] | 121 | { |
| 122 | u32 client_index; |
| 123 | u32 context; |
| 124 | u32 sw_if_index; |
| 125 | u32 ip4_table_index; |
| 126 | u32 ip6_table_index; |
| 127 | u32 l2_table_index; |
| 128 | u8 is_add; |
| 129 | }; |
| 130 | |
Pavel Kotucek | d2c97d9 | 2017-01-24 10:58:12 +0100 | [diff] [blame] | 131 | /** \brief Get list of policer classify interfaces and tables |
| 132 | @param client_index - opaque cookie to identify the sender |
| 133 | @param context - sender context, to match reply w/ request |
| 134 | @param type - classify table type |
| 135 | */ |
| 136 | define policer_classify_dump |
| 137 | { |
| 138 | u32 client_index; |
| 139 | u32 context; |
| 140 | u8 type; |
| 141 | }; |
| 142 | |
| 143 | /** \brief Policer iclassify operational state response. |
| 144 | @param context - sender context, to match reply w/ request |
| 145 | @param sw_if_index - software interface index |
| 146 | @param table_index - classify table index |
| 147 | */ |
| 148 | define policer_classify_details |
| 149 | { |
| 150 | u32 context; |
| 151 | u32 sw_if_index; |
| 152 | u32 table_index; |
| 153 | }; |
| 154 | |
| 155 | /** \brief Classify get table IDs request |
| 156 | @param client_index - opaque cookie to identify the sender |
| 157 | @param context - sender context, to match reply w/ request |
| 158 | */ |
| 159 | define classify_table_ids |
| 160 | { |
| 161 | u32 client_index; |
| 162 | u32 context; |
| 163 | }; |
| 164 | |
| 165 | /** \brief Reply for classify get table IDs request |
| 166 | @param context - sender context which was passed in the request |
| 167 | @param count - number of ids returned in response |
| 168 | @param ids - array of classify table ids |
| 169 | */ |
| 170 | define classify_table_ids_reply |
| 171 | { |
| 172 | u32 context; |
| 173 | i32 retval; |
| 174 | u32 count; |
| 175 | u32 ids[count]; |
| 176 | }; |
| 177 | |
| 178 | /** \brief Classify table ids by interface index request |
| 179 | @param client_index - opaque cookie to identify the sender |
| 180 | @param context - sender context, to match reply w/ request |
| 181 | @param sw_if_index - index of the interface |
| 182 | */ |
| 183 | define classify_table_by_interface |
| 184 | { |
| 185 | u32 client_index; |
| 186 | u32 context; |
| 187 | u32 sw_if_index; |
| 188 | }; |
| 189 | |
| 190 | /** \brief Reply for classify table id by interface index request |
| 191 | @param context - sender context which was passed in the request |
| 192 | @param count - number of ids returned in response |
| 193 | @param sw_if_index - index of the interface |
| 194 | @param l2_table_id - l2 classify table index |
| 195 | @param ip4_table_id - ip4 classify table index |
| 196 | @param ip6_table_id - ip6 classify table index |
| 197 | */ |
| 198 | define classify_table_by_interface_reply |
| 199 | { |
| 200 | u32 context; |
| 201 | i32 retval; |
| 202 | u32 sw_if_index; |
| 203 | u32 l2_table_id; |
| 204 | u32 ip4_table_id; |
| 205 | u32 ip6_table_id; |
| 206 | }; |
| 207 | |
| 208 | /** \brief Classify table info |
| 209 | @param client_index - opaque cookie to identify the sender |
| 210 | @param context - sender context, to match reply w/ request |
| 211 | @param table_id - classify table index |
| 212 | */ |
| 213 | define classify_table_info |
| 214 | { |
| 215 | u32 client_index; |
| 216 | u32 context; |
| 217 | u32 table_id; |
| 218 | }; |
| 219 | |
| 220 | /** \brief Reply for classify table info request |
| 221 | @param context - sender context which was passed in the request |
| 222 | @param count - number of ids returned in response |
| 223 | @param table_id - classify table index |
| 224 | @param nbuckets - number of buckets when adding a table |
| 225 | @param match_n_vectors - number of match vectors |
| 226 | @param skip_n_vectors - number of skip_n_vectors |
| 227 | @param active_sessions - number of sessions (active entries) |
| 228 | @param next_table_index - index of next table |
| 229 | @param miss_next_index - index of miss table |
| 230 | @param mask[] - match mask |
| 231 | */ |
| 232 | define classify_table_info_reply |
| 233 | { |
| 234 | u32 context; |
| 235 | i32 retval; |
| 236 | u32 table_id; |
| 237 | u32 nbuckets; |
| 238 | u32 match_n_vectors; |
| 239 | u32 skip_n_vectors; |
| 240 | u32 active_sessions; |
| 241 | u32 next_table_index; |
| 242 | u32 miss_next_index; |
| 243 | u32 mask_length; |
| 244 | u8 mask[mask_length]; |
| 245 | }; |
| 246 | |
| 247 | /** \brief Classify sessions dump request |
| 248 | @param client_index - opaque cookie to identify the sender |
| 249 | @param context - sender context, to match reply w/ request |
| 250 | @param table_id - classify table index |
| 251 | */ |
| 252 | define classify_session_dump |
| 253 | { |
| 254 | u32 client_index; |
| 255 | u32 context; |
| 256 | u32 table_id; |
| 257 | }; |
| 258 | |
| 259 | /** \brief Reply for classify table session dump request |
| 260 | @param context - sender context which was passed in the request |
| 261 | @param count - number of ids returned in response |
| 262 | @param table_id - classify table index |
| 263 | @param hit_next_index - hit_next_index of session |
| 264 | @param opaque_index - for add, opaque_index of session |
| 265 | @param advance - advance value of session |
| 266 | @param match[] - match value for session |
| 267 | */ |
| 268 | define classify_session_details |
| 269 | { |
| 270 | u32 context; |
| 271 | i32 retval; |
| 272 | u32 table_id; |
| 273 | u32 hit_next_index; |
| 274 | i32 advance; |
| 275 | u32 opaque_index; |
| 276 | u32 match_length; |
| 277 | u8 match[match_length]; |
| 278 | }; |
| 279 | |
| 280 | /** \brief Set/unset flow classify interface |
| 281 | @param client_index - opaque cookie to identify the sender |
| 282 | @param context - sender context, to match reply w/ request |
| 283 | @param sw_if_index - interface to set/unset flow classify |
| 284 | @param ip4_table_index - ip4 classify table index (~0 for skip) |
| 285 | @param ip6_table_index - ip6 classify table index (~0 for skip) |
| 286 | @param l2_table_index - l2 classify table index (~0 for skip) |
| 287 | @param is_add - Set if non-zero, else unset |
| 288 | Note: User is recommeneded to use just one valid table_index per call. |
| 289 | (ip4_table_index, ip6_table_index, or l2_table_index) |
| 290 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 291 | autoreply define flow_classify_set_interface { |
Pavel Kotucek | d2c97d9 | 2017-01-24 10:58:12 +0100 | [diff] [blame] | 292 | u32 client_index; |
| 293 | u32 context; |
| 294 | u32 sw_if_index; |
| 295 | u32 ip4_table_index; |
| 296 | u32 ip6_table_index; |
| 297 | u8 is_add; |
| 298 | }; |
| 299 | |
Pavel Kotucek | d2c97d9 | 2017-01-24 10:58:12 +0100 | [diff] [blame] | 300 | /** \brief Get list of flow classify interfaces and tables |
| 301 | @param client_index - opaque cookie to identify the sender |
| 302 | @param context - sender context, to match reply w/ request |
| 303 | @param type - classify table type |
| 304 | */ |
| 305 | define flow_classify_dump { |
| 306 | u32 client_index; |
| 307 | u32 context; |
| 308 | u8 type; |
| 309 | }; |
| 310 | |
| 311 | /** \brief Flow classify operational state response. |
| 312 | @param context - sender context, to match reply w/ request |
| 313 | @param sw_if_index - software interface index |
| 314 | @param table_index - classify table index |
| 315 | */ |
| 316 | define flow_classify_details { |
| 317 | u32 context; |
| 318 | u32 sw_if_index; |
| 319 | u32 table_index; |
| 320 | }; |
| 321 | |
| 322 | /* |
| 323 | * Local Variables: |
| 324 | * eval: (c-set-style "gnu") |
| 325 | * End: |
| 326 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 327 | |