Ole Troan | 53fffa1 | 2018-11-13 12:36:56 +0100 | [diff] [blame] | 1 | /* Hey Emacs use -*- mode: C -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2018 Cisco and/or its affiliates. |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at: |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Paul Vinciguerra | 6407ba5 | 2019-04-04 13:22:20 -0700 | [diff] [blame^] | 17 | option version = "2.2.1"; |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 18 | |
Ole Troan | 53fffa1 | 2018-11-13 12:36:56 +0100 | [diff] [blame] | 19 | import "vnet/interface_types.api"; |
| 20 | |
Marek Gradzki | 51e5968 | 2018-03-06 10:05:44 +0100 | [diff] [blame] | 21 | service { |
| 22 | rpc want_interface_events returns want_interface_events_reply |
| 23 | events sw_interface_event; |
| 24 | }; |
| 25 | |
Dave Barach | aff7077 | 2016-10-31 11:59:07 -0400 | [diff] [blame] | 26 | /** \brief Set flags on the interface |
| 27 | @param client_index - opaque cookie to identify the sender |
| 28 | @param context - sender context, to match reply w/ request |
| 29 | @param sw_if_index - index of the interface to set flags on |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 30 | @param admin_up_down - set the admin state, 1 = up, 0 = down |
| 31 | @param link_up_down - Oper state sent on change event, not used in config. |
Dave Barach | aff7077 | 2016-10-31 11:59:07 -0400 | [diff] [blame] | 32 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 33 | autoreply define sw_interface_set_flags |
Dave Barach | aff7077 | 2016-10-31 11:59:07 -0400 | [diff] [blame] | 34 | { |
| 35 | u32 client_index; |
| 36 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 37 | u32 sw_if_index; |
| 38 | /* 1 = up, 0 = down */ |
| 39 | u8 admin_up_down; |
Dave Barach | aff7077 | 2016-10-31 11:59:07 -0400 | [diff] [blame] | 40 | }; |
| 41 | |
Ole Troan | d723161 | 2018-06-07 10:17:57 +0200 | [diff] [blame] | 42 | /** \brief Set interface physical MTU |
Matus Fabian | d162f3d | 2016-12-05 01:05:35 -0800 | [diff] [blame] | 43 | @param client_index - opaque cookie to identify the sender |
| 44 | @param context - sender context, to match reply w/ request |
| 45 | @param sw_if_index - index of the interface to set MTU on |
| 46 | @param mtu - MTU |
| 47 | */ |
Ole Troan | d723161 | 2018-06-07 10:17:57 +0200 | [diff] [blame] | 48 | autoreply define hw_interface_set_mtu |
Matus Fabian | d162f3d | 2016-12-05 01:05:35 -0800 | [diff] [blame] | 49 | { |
| 50 | u32 client_index; |
| 51 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 52 | u32 sw_if_index; |
Matus Fabian | d162f3d | 2016-12-05 01:05:35 -0800 | [diff] [blame] | 53 | u16 mtu; |
| 54 | }; |
| 55 | |
Ole Troan | d723161 | 2018-06-07 10:17:57 +0200 | [diff] [blame] | 56 | /** \brief Set interface L3 MTU */ |
| 57 | autoreply define sw_interface_set_mtu |
| 58 | { |
| 59 | u32 client_index; |
| 60 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 61 | u32 sw_if_index; |
| 62 | /* $$$$ Replace with enum */ |
| 63 | u32 mtu[4]; /* 0 - L3, 1 - IP4, 2 - IP6, 3 - MPLS */ |
Ole Troan | d723161 | 2018-06-07 10:17:57 +0200 | [diff] [blame] | 64 | }; |
| 65 | |
Neale Ranns | 1855b8e | 2018-07-11 10:31:26 -0700 | [diff] [blame] | 66 | /** \brief Set IP4 directed broadcast |
| 67 | The directed broadcast enabled a packet sent to the interface's |
| 68 | subnet address will be broadcast on the interface |
| 69 | @param sw_if_index |
| 70 | @param enable |
| 71 | */ |
| 72 | autoreply define sw_interface_set_ip_directed_broadcast |
| 73 | { |
| 74 | u32 client_index; |
| 75 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 76 | u32 sw_if_index; |
| 77 | u8 enable; |
Neale Ranns | 1855b8e | 2018-07-11 10:31:26 -0700 | [diff] [blame] | 78 | }; |
| 79 | |
Ole Troan | d723161 | 2018-06-07 10:17:57 +0200 | [diff] [blame] | 80 | |
Neale Ranns | a07bd70 | 2017-08-07 07:53:49 -0700 | [diff] [blame] | 81 | /** \brief Interface Event generated by want_interface_events |
Neale Ranns | d292ab1 | 2017-08-15 12:29:48 -0700 | [diff] [blame] | 82 | @param client_index - opaque cookie to identify the sender |
| 83 | @param pid - client pid registered to receive notification |
Neale Ranns | a07bd70 | 2017-08-07 07:53:49 -0700 | [diff] [blame] | 84 | @param sw_if_index - index of the interface of the event |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 85 | @param admin_up_down - The administrative state; 1 = up, 0 = down |
| 86 | @param link_up_down - The operational state; 1 = up, 0 = down |
Neale Ranns | a07bd70 | 2017-08-07 07:53:49 -0700 | [diff] [blame] | 87 | @param deleted - interface was deleted |
| 88 | */ |
| 89 | define sw_interface_event |
| 90 | { |
Neale Ranns | d292ab1 | 2017-08-15 12:29:48 -0700 | [diff] [blame] | 91 | u32 client_index; |
| 92 | u32 pid; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 93 | u32 sw_if_index; |
| 94 | u8 admin_up_down; |
| 95 | u8 link_up_down; |
| 96 | u8 deleted; |
Neale Ranns | a07bd70 | 2017-08-07 07:53:49 -0700 | [diff] [blame] | 97 | }; |
| 98 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 99 | /** \brief Register for interface events |
| 100 | @param client_index - opaque cookie to identify the sender |
| 101 | @param context - sender context, to match reply w/ request |
| 102 | @param enable_disable - 1 => register for events, 0 => cancel registration |
| 103 | @param pid - sender's pid |
| 104 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 105 | autoreply define want_interface_events |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 106 | { |
| 107 | u32 client_index; |
| 108 | u32 context; |
| 109 | u32 enable_disable; |
| 110 | u32 pid; |
| 111 | }; |
| 112 | |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 113 | /** \brief Interface details structure (fix this) |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 114 | @param sw_if_index - index of the interface |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 115 | @param sup_sw_if_index - index of parent interface if any, else same as sw_if_index |
| 116 | @param l2_address_length - length of the interface's l2 address |
| 117 | @param pid - the interface's l2 address |
| 118 | @param interface_name - name of the interface |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 119 | @param link_duplex - 1 if half duplex, 2 if full duplex |
Damjan Marion | 5100aa9 | 2018-11-08 15:30:16 +0100 | [diff] [blame] | 120 | @param link_speed - value in kbps |
Paul Vinciguerra | bdc0e6b | 2018-09-22 05:32:50 -0700 | [diff] [blame] | 121 | @param link_MTU - max. transmission unit |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 122 | @param sub_if_id - A number 0-N to uniquely identify this subif on super if |
| 123 | @param sub_dot1ad - 0 = dot1q, 1 = dot1ad |
| 124 | @param sub_dot1ah - 1 = dot1ah, 0 = otherwise |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 125 | @param sub_number_of_tags - Number of tags (0 - 2) |
| 126 | @param sub_outer_vlan_id |
| 127 | @param sub_inner_vlan_id |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 128 | @param sub_exact_match |
| 129 | @param sub_default |
| 130 | @param sub_outer_vlan_id_any |
| 131 | @param sub_inner_vlan_id_any |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 132 | @param vtr_op - vlan tag rewrite operation |
| 133 | @param vtr_push_dot1q |
| 134 | @param vtr_tag1 |
| 135 | @param vtr_tag2 |
Pavel Kotucek | 65e8457 | 2017-01-16 17:01:56 +0100 | [diff] [blame] | 136 | @param pbb_outer_tag - translate pbb s-tag |
| 137 | @param pbb_b_dmac[6] - B-tag remote mac address |
| 138 | @param pbb_b_smac[6] - B-tag local mac address |
| 139 | @param pbb_b_vlanid - B-tag vlanid |
| 140 | @param pbb_i_sid - I-tag service id |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 141 | */ |
| 142 | define sw_interface_details |
| 143 | { |
| 144 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 145 | u32 sw_if_index; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 146 | |
| 147 | /* index of sup interface (e.g. hw interface). |
| 148 | equal to sw_if_index for super hw interface. */ |
| 149 | u32 sup_sw_if_index; |
| 150 | |
| 151 | /* Layer 2 address, if applicable */ |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 152 | u32 l2_address_length; |
| 153 | u8 l2_address[8]; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 154 | |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 155 | /* Interface name */ |
| 156 | u8 interface_name[64]; |
| 157 | |
| 158 | /* 1 = up, 0 = down */ |
| 159 | u8 admin_up_down; |
| 160 | u8 link_up_down; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 161 | |
| 162 | /* 1 = half duplex, 2 = full duplex */ |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 163 | u8 link_duplex; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 164 | |
Damjan Marion | 5100aa9 | 2018-11-08 15:30:16 +0100 | [diff] [blame] | 165 | /* link speed in kbps */ |
| 166 | u32 link_speed; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 167 | |
| 168 | /* MTU */ |
Damjan Marion | fe7d4a2 | 2018-04-13 19:43:39 +0200 | [diff] [blame] | 169 | u16 link_mtu; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 170 | |
Ole Troan | d723161 | 2018-06-07 10:17:57 +0200 | [diff] [blame] | 171 | /* Per protocol MTUs */ |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 172 | u32 mtu[4]; /* 0 - L3, 1 - IP4, 2 - IP6, 3 - MPLS */ |
Ole Troan | d723161 | 2018-06-07 10:17:57 +0200 | [diff] [blame] | 173 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 174 | /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */ |
| 175 | u32 sub_id; |
| 176 | |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 177 | /* 0 = dot1q, 1=dot1ad */ |
| 178 | u8 sub_dot1ad; |
| 179 | /* 1 = dot1h, 1=otherwise */ |
| 180 | u8 sub_dot1ah; |
| 181 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 182 | /* Number of tags 0-2 */ |
| 183 | u8 sub_number_of_tags; |
| 184 | u16 sub_outer_vlan_id; |
| 185 | u16 sub_inner_vlan_id; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 186 | u8 sub_exact_match; |
| 187 | u8 sub_default; |
| 188 | u8 sub_outer_vlan_id_any; |
| 189 | u8 sub_inner_vlan_id_any; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 190 | |
| 191 | /* vlan tag rewrite state */ |
| 192 | u32 vtr_op; |
| 193 | u32 vtr_push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad |
| 194 | u32 vtr_tag1; // first pushed tag |
| 195 | u32 vtr_tag2; // second pushed tag |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 196 | u8 tag[64]; |
| 197 | |
Pavel Kotucek | 65e8457 | 2017-01-16 17:01:56 +0100 | [diff] [blame] | 198 | /* pbb tag rewrite info */ |
| 199 | u16 outer_tag; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 200 | u8 b_dmac[6]; |
| 201 | u8 b_smac[6]; |
Pavel Kotucek | 65e8457 | 2017-01-16 17:01:56 +0100 | [diff] [blame] | 202 | u16 b_vlanid; |
| 203 | u32 i_sid; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 204 | }; |
| 205 | |
Paul Vinciguerra | bb2c7b5 | 2019-03-14 09:47:29 -0700 | [diff] [blame] | 206 | /** \brief Request all or filtered subset of sw_interface_details |
| 207 | @param client_index - opaque cookie to identify the sender |
| 208 | @param context - sender context, to match reply w/ request |
Paul Vinciguerra | 6407ba5 | 2019-04-04 13:22:20 -0700 | [diff] [blame^] | 209 | @param sw_if_index - ~0 if ignore, index of the interface to filter on |
Paul Vinciguerra | bb2c7b5 | 2019-03-14 09:47:29 -0700 | [diff] [blame] | 210 | @param name_filter_valid - 1 if requesting a filtered subset of records else 0 |
| 211 | @param name_filter - interface name substring filter. Eg. loop1 returns [loop1, loop10] |
| 212 | */ |
| 213 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 214 | define sw_interface_dump |
| 215 | { |
| 216 | u32 client_index; |
| 217 | u32 context; |
Paul Vinciguerra | 6407ba5 | 2019-04-04 13:22:20 -0700 | [diff] [blame^] | 218 | vl_api_interface_index_t sw_if_index; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 219 | u8 name_filter_valid; |
| 220 | u8 name_filter[49]; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 221 | }; |
| 222 | |
| 223 | /** \brief Set or delete one or all ip addresses on a specified interface |
| 224 | @param client_index - opaque cookie to identify the sender |
| 225 | @param context - sender context, to match reply w/ request |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 226 | @param sw_if_index - index of the interface to add/del addresses |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 227 | @param is_add - add address if non-zero, else delete |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 228 | @param is_ipv6 - if non-zero the address is ipv6, else ipv4 |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 229 | @param del_all - if non-zero delete all addresses on the interface |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 230 | @param address_length - address length in bytes, 4 for ip4, 16 for ip6 |
| 231 | @param address - array of address bytes |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 232 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 233 | autoreply define sw_interface_add_del_address |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 234 | { |
| 235 | u32 client_index; |
| 236 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 237 | u32 sw_if_index; |
| 238 | u8 is_add; |
| 239 | u8 is_ipv6; |
| 240 | u8 del_all; |
| 241 | u8 address_length; |
| 242 | u8 address[16]; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 243 | }; |
| 244 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 245 | /** \brief Associate the specified interface with a fib table |
| 246 | @param client_index - opaque cookie to identify the sender |
| 247 | @param context - sender context, to match reply w/ request |
| 248 | @param sw_if_index - index of the interface |
| 249 | @param is_ipv6 - if non-zero ipv6, else ipv4 |
| 250 | @param vrf_id - fib table/vrd id to associate the interface with |
| 251 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 252 | autoreply define sw_interface_set_table |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 253 | { |
| 254 | u32 client_index; |
| 255 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 256 | u32 sw_if_index; |
| 257 | u8 is_ipv6; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 258 | u32 vrf_id; |
| 259 | }; |
| 260 | |
Juraj Sloboda | dfc1923 | 2016-12-05 13:20:37 +0100 | [diff] [blame] | 261 | /** \brief Get VRF id assigned to interface |
| 262 | @param client_index - opaque cookie to identify the sender |
| 263 | @param context - sender context, to match reply w/ request |
| 264 | @param sw_if_index - index of the interface |
| 265 | */ |
| 266 | define sw_interface_get_table |
| 267 | { |
| 268 | u32 client_index; |
| 269 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 270 | u32 sw_if_index; |
| 271 | u8 is_ipv6; |
Juraj Sloboda | dfc1923 | 2016-12-05 13:20:37 +0100 | [diff] [blame] | 272 | }; |
| 273 | |
| 274 | /** \brief Reply to get_sw_interface_vrf |
| 275 | @param context - sender context which was passed in the request |
| 276 | @param vrf_id - VRF id assigned to the interface |
| 277 | */ |
| 278 | define sw_interface_get_table_reply |
| 279 | { |
| 280 | u32 context; |
| 281 | i32 retval; |
| 282 | u32 vrf_id; |
| 283 | }; |
| 284 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 285 | /** \brief Set unnumbered interface add / del request |
| 286 | @param client_index - opaque cookie to identify the sender |
| 287 | @param context - sender context, to match reply w/ request |
| 288 | @param sw_if_index - interface with an IP address |
| 289 | @param unnumbered_sw_if_index - interface which will use the address |
| 290 | @param is_add - if non-zero set the association, else unset it |
| 291 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 292 | autoreply define sw_interface_set_unnumbered |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 293 | { |
| 294 | u32 client_index; |
| 295 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 296 | u32 sw_if_index; /* use this intfc address */ |
| 297 | u32 unnumbered_sw_if_index; /* on this interface */ |
| 298 | u8 is_add; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 299 | }; |
| 300 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 301 | /** \brief Clear interface statistics |
| 302 | @param client_index - opaque cookie to identify the sender |
| 303 | @param context - sender context, to match reply w/ request |
| 304 | @param sw_if_index - index of the interface to clear statistics |
| 305 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 306 | autoreply define sw_interface_clear_stats |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 307 | { |
| 308 | u32 client_index; |
| 309 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 310 | u32 sw_if_index; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 311 | }; |
| 312 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 313 | /** \brief Set / clear software interface tag |
| 314 | @param client_index - opaque cookie to identify the sender |
| 315 | @param context - sender context, to match reply w/ request |
| 316 | @param sw_if_index - the interface |
| 317 | @param add_del - 1 = add, 0 = delete |
| 318 | @param tag - an ascii tag |
| 319 | */ |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 320 | autoreply define sw_interface_tag_add_del |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 321 | { |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 322 | u32 client_index; |
| 323 | u32 context; |
| 324 | u8 is_add; |
| 325 | u32 sw_if_index; |
| 326 | u8 tag[64]; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 327 | }; |
| 328 | |
Jon Loeliger | 10c273b | 2017-03-30 08:39:33 -0500 | [diff] [blame] | 329 | /** \brief Set an interface's MAC address |
| 330 | @param client_index - opaque cookie to identify the sender |
| 331 | @param context - sender context, to match reply w/ request |
| 332 | @param sw_if_index - the interface whose MAC will be set |
| 333 | @param mac_addr - the new MAC address |
| 334 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 335 | autoreply define sw_interface_set_mac_address |
Jon Loeliger | 10c273b | 2017-03-30 08:39:33 -0500 | [diff] [blame] | 336 | { |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 337 | u32 client_index; |
| 338 | u32 context; |
| 339 | u32 sw_if_index; |
| 340 | u8 mac_address[6]; |
Jon Loeliger | 10c273b | 2017-03-30 08:39:33 -0500 | [diff] [blame] | 341 | }; |
| 342 | |
Juraj Sloboda | c037423 | 2018-02-01 15:18:49 +0100 | [diff] [blame] | 343 | /** \brief Get interface's MAC address |
| 344 | @param client_index - opaque cookie to identify the sender |
| 345 | @param context - sender context, to match reply w/ request |
| 346 | @param sw_if_index - the interface whose MAC will be returned |
| 347 | */ |
| 348 | define sw_interface_get_mac_address |
| 349 | { |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 350 | u32 client_index; |
| 351 | u32 context; |
| 352 | u32 sw_if_index; |
Juraj Sloboda | c037423 | 2018-02-01 15:18:49 +0100 | [diff] [blame] | 353 | }; |
| 354 | |
| 355 | /** \brief Reply for get interface's MAC address request |
| 356 | @param context - returned sender context, to match reply w/ request |
| 357 | @param retval - return code |
| 358 | @param mac_addr - returned interface's MAC address |
| 359 | */ |
| 360 | define sw_interface_get_mac_address_reply |
| 361 | { |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 362 | u32 context; |
| 363 | i32 retval; |
| 364 | u8 mac_address[6]; |
Juraj Sloboda | c037423 | 2018-02-01 15:18:49 +0100 | [diff] [blame] | 365 | }; |
| 366 | |
Steven | ad8015b | 2017-10-29 22:10:46 -0700 | [diff] [blame] | 367 | /** \brief Set an interface's rx-mode |
| 368 | @param client_index - opaque cookie to identify the sender |
| 369 | @param context - sender context, to match reply w/ request |
| 370 | @param sw_if_index - the interface whose rx-mode will be set |
| 371 | @param queue_id_valid - 1 = the queue_id field is valid. 0 means all |
| 372 | queue_id's |
| 373 | @param queue_id - the queue number whose rx-mode will be set. Only valid |
| 374 | if queue_id_valid is 1 |
| 375 | @param mode - polling=1, interrupt=2, adaptive=3 |
| 376 | */ |
| 377 | autoreply define sw_interface_set_rx_mode |
| 378 | { |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 379 | u32 client_index; |
| 380 | u32 context; |
| 381 | u32 sw_if_index; |
| 382 | u8 queue_id_valid; |
| 383 | u32 queue_id; |
| 384 | u8 mode; |
Steven | ad8015b | 2017-10-29 22:10:46 -0700 | [diff] [blame] | 385 | }; |
| 386 | |
Mohsin Kazmi | 54f7c51 | 2018-08-23 18:28:11 +0200 | [diff] [blame] | 387 | /** \brief Set an interface's rx-placement |
Mohsin Kazmi | f0b42f4 | 2018-09-10 18:11:00 +0200 | [diff] [blame] | 388 | Rx-Queue placement on specific thread is operational for only hardware |
| 389 | interface. It will not set queue - thread placement for sub-interfaces, |
| 390 | p2p and pipe interfaces. |
Mohsin Kazmi | 54f7c51 | 2018-08-23 18:28:11 +0200 | [diff] [blame] | 391 | @param client_index - opaque cookie to identify the sender |
| 392 | @param context - sender context, to match reply w/ request |
| 393 | @param sw_if_index - the interface whose rx-placement will be set |
| 394 | @param queue_id - the queue number whose rx-placement will be set. |
| 395 | @param worker_id - the worker number whom rx-placement will be at. |
| 396 | @param is_main - flag to set rx-placement to main thread |
| 397 | */ |
| 398 | autoreply define sw_interface_set_rx_placement |
| 399 | { |
| 400 | u32 client_index; |
| 401 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 402 | u32 sw_if_index; |
Mohsin Kazmi | 54f7c51 | 2018-08-23 18:28:11 +0200 | [diff] [blame] | 403 | u32 queue_id; |
| 404 | u32 worker_id; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 405 | u8 is_main; |
Mohsin Kazmi | 54f7c51 | 2018-08-23 18:28:11 +0200 | [diff] [blame] | 406 | }; |
| 407 | |
Mohsin Kazmi | f0b42f4 | 2018-09-10 18:11:00 +0200 | [diff] [blame] | 408 | /** \brief dump the rx queue placement of interface(s) |
| 409 | @param sw_if_index - optional interface index for which queue placement to |
| 410 | be requested. sw_if_index = ~0 will dump placement information for all |
| 411 | interfaces. It will not dump information related to sub-interfaces, p2p |
| 412 | and pipe interfaces. |
| 413 | */ |
| 414 | define sw_interface_rx_placement_dump |
| 415 | { |
| 416 | u32 client_index; |
| 417 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 418 | u32 sw_if_index; |
Mohsin Kazmi | f0b42f4 | 2018-09-10 18:11:00 +0200 | [diff] [blame] | 419 | }; |
| 420 | |
| 421 | /** \brief show the interface's queue - thread placement |
| 422 | This api is used to display the interface and queue worker |
| 423 | thread placement. One message per rx-queue per interface will |
| 424 | be sent to client. |
| 425 | Each message will contain information about rx-queue id of an |
| 426 | interface, interface index, thread on which this rx-queue is |
| 427 | placed and mode of rx-queue. |
| 428 | @param client_index - opaque cookie to identify the sender |
| 429 | @param context - sender context, to match reply w/ request |
| 430 | @param sw_if_index - the interface whose rx-placement will be dumped |
| 431 | @param queue_id - the queue id |
| 432 | @param worker_id - the worker id on which queue_id is placed, |
| 433 | worker_id = 0 means main thread. |
| 434 | @param mode - polling=1, interrupt=2, adaptive=3 |
| 435 | */ |
| 436 | define sw_interface_rx_placement_details |
| 437 | { |
| 438 | u32 client_index; |
| 439 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 440 | u32 sw_if_index; |
Mohsin Kazmi | f0b42f4 | 2018-09-10 18:11:00 +0200 | [diff] [blame] | 441 | u32 queue_id; |
| 442 | u32 worker_id; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 443 | u8 mode; |
Mohsin Kazmi | f0b42f4 | 2018-09-10 18:11:00 +0200 | [diff] [blame] | 444 | }; |
| 445 | |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 446 | /* Gross kludge, DGMS */ |
| 447 | autoreply define interface_name_renumber |
| 448 | { |
| 449 | u32 client_index; |
| 450 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 451 | u32 sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 452 | u32 new_show_dev_instance; |
| 453 | }; |
| 454 | |
| 455 | define create_subif |
| 456 | { |
| 457 | u32 client_index; |
| 458 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 459 | u32 sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 460 | u32 sub_id; |
| 461 | |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 462 | /* These fields map directly onto the subif template */ |
| 463 | u8 no_tags; |
| 464 | u8 one_tag; |
| 465 | u8 two_tags; |
| 466 | u8 dot1ad; // 0 = dot1q, 1=dot1ad |
| 467 | u8 exact_match; |
| 468 | u8 default_sub; |
| 469 | u8 outer_vlan_id_any; |
| 470 | u8 inner_vlan_id_any; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 471 | u16 outer_vlan_id; |
| 472 | u16 inner_vlan_id; |
| 473 | }; |
| 474 | |
| 475 | define create_subif_reply |
| 476 | { |
| 477 | u32 context; |
| 478 | i32 retval; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 479 | u32 sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 480 | }; |
| 481 | |
| 482 | /** \brief Create a new subinterface with the given vlan id |
| 483 | @param client_index - opaque cookie to identify the sender |
| 484 | @param context - sender context, to match reply w/ request |
| 485 | @param sw_if_index - software index of the new vlan's parent interface |
| 486 | @param vlan_id - vlan tag of the new interface |
| 487 | */ |
| 488 | define create_vlan_subif |
| 489 | { |
| 490 | u32 client_index; |
| 491 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 492 | u32 sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 493 | u32 vlan_id; |
| 494 | }; |
| 495 | |
| 496 | /** \brief Reply for the vlan subinterface create request |
| 497 | @param context - returned sender context, to match reply w/ request |
| 498 | @param retval - return code |
| 499 | @param sw_if_index - software index allocated for the new subinterface |
| 500 | */ |
| 501 | define create_vlan_subif_reply |
| 502 | { |
| 503 | u32 context; |
| 504 | i32 retval; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 505 | u32 sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 506 | }; |
| 507 | |
| 508 | /** \brief Delete sub interface request |
| 509 | @param client_index - opaque cookie to identify the sender |
| 510 | @param context - sender context, to match reply w/ request |
| 511 | @param sw_if_index - sw index of the interface that was created by create_subif |
| 512 | */ |
| 513 | autoreply define delete_subif { |
| 514 | u32 client_index; |
| 515 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 516 | u32 sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 517 | }; |
| 518 | |
| 519 | /** \brief Create loopback interface request |
| 520 | @param client_index - opaque cookie to identify the sender |
| 521 | @param context - sender context, to match reply w/ request |
| 522 | @param mac_address - mac addr to assign to the interface if none-zero |
| 523 | */ |
| 524 | define create_loopback |
| 525 | { |
| 526 | u32 client_index; |
| 527 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 528 | u8 mac_address[6]; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 529 | }; |
| 530 | |
| 531 | /** \brief Create loopback interface response |
| 532 | @param context - sender context, to match reply w/ request |
| 533 | @param sw_if_index - sw index of the interface that was created |
| 534 | @param retval - return code for the request |
| 535 | */ |
| 536 | define create_loopback_reply |
| 537 | { |
| 538 | u32 context; |
| 539 | i32 retval; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 540 | u32 sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 541 | }; |
| 542 | |
| 543 | /** \brief Create loopback interface instance request |
| 544 | @param client_index - opaque cookie to identify the sender |
| 545 | @param context - sender context, to match reply w/ request |
| 546 | @param mac_address - mac addr to assign to the interface if none-zero |
| 547 | @param is_specified - if non-0, a specific user_instance is being requested |
| 548 | @param user_instance - requested instance, ~0 => dynamically allocate |
| 549 | */ |
| 550 | define create_loopback_instance |
| 551 | { |
| 552 | u32 client_index; |
| 553 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 554 | u8 mac_address[6]; |
| 555 | u8 is_specified; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 556 | u32 user_instance; |
| 557 | }; |
| 558 | |
| 559 | /** \brief Create loopback interface instance response |
| 560 | @param context - sender context, to match reply w/ request |
| 561 | @param sw_if_index - sw index of the interface that was created |
| 562 | @param retval - return code for the request |
| 563 | */ |
| 564 | define create_loopback_instance_reply |
| 565 | { |
| 566 | u32 context; |
| 567 | i32 retval; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 568 | u32 sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 569 | }; |
| 570 | |
| 571 | /** \brief Delete loopback interface request |
| 572 | @param client_index - opaque cookie to identify the sender |
| 573 | @param context - sender context, to match reply w/ request |
| 574 | @param sw_if_index - sw index of the interface that was created |
| 575 | */ |
| 576 | autoreply define delete_loopback |
| 577 | { |
| 578 | u32 client_index; |
| 579 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 580 | u32 sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 581 | }; |
| 582 | |
Neale Ranns | 6f4a6be | 2018-03-16 16:26:21 -0700 | [diff] [blame] | 583 | /** \brief Enable or disable detailed interface stats |
| 584 | @param client_index - opaque cookie to identify the sender |
| 585 | @param context - sender context, to match reply w/ request |
Neale Ranns | 0cae3f7 | 2018-03-21 09:44:01 -0400 | [diff] [blame] | 586 | @param sw_if_index - The interface to collect detail stats on. ~0 implies |
| 587 | all interfaces. |
Neale Ranns | 6f4a6be | 2018-03-16 16:26:21 -0700 | [diff] [blame] | 588 | @param enable_disable - set to 1 to enable, 0 to disable detailed stats |
| 589 | */ |
| 590 | autoreply define collect_detailed_interface_stats |
| 591 | { |
| 592 | u32 client_index; |
| 593 | u32 context; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 594 | u32 sw_if_index; |
| 595 | u8 enable_disable; |
Neale Ranns | 6f4a6be | 2018-03-16 16:26:21 -0700 | [diff] [blame] | 596 | }; |
| 597 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 598 | /* |
| 599 | * Local Variables: |
| 600 | * eval: (c-set-style "gnu") |
| 601 | * End: |
| 602 | */ |