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 | |
Steven Luong | f49734d | 2021-07-26 13:38:05 -0700 | [diff] [blame] | 17 | option version = "3.2.3"; |
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"; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 20 | import "vnet/ethernet/ethernet_types.api"; |
| 21 | import "vnet/ip/ip_types.api"; |
Ole Troan | 53fffa1 | 2018-11-13 12:36:56 +0100 | [diff] [blame] | 22 | |
Marek Gradzki | 51e5968 | 2018-03-06 10:05:44 +0100 | [diff] [blame] | 23 | service { |
| 24 | rpc want_interface_events returns want_interface_events_reply |
| 25 | events sw_interface_event; |
| 26 | }; |
| 27 | |
Dave Barach | aff7077 | 2016-10-31 11:59:07 -0400 | [diff] [blame] | 28 | /** \brief Set flags on the interface |
| 29 | @param client_index - opaque cookie to identify the sender |
| 30 | @param context - sender context, to match reply w/ request |
| 31 | @param sw_if_index - index of the interface to set flags on |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 32 | @param flags - interface_status flags |
| 33 | (only IF_STATUS_API_FLAG_ADMIN_UP used in config) |
Dave Barach | aff7077 | 2016-10-31 11:59:07 -0400 | [diff] [blame] | 34 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 35 | autoreply define sw_interface_set_flags |
Dave Barach | aff7077 | 2016-10-31 11:59:07 -0400 | [diff] [blame] | 36 | { |
| 37 | u32 client_index; |
| 38 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 39 | vl_api_interface_index_t sw_if_index; |
| 40 | vl_api_if_status_flags_t flags; |
Dave Barach | aff7077 | 2016-10-31 11:59:07 -0400 | [diff] [blame] | 41 | }; |
| 42 | |
Nathan Skrzypczak | fd0b399 | 2021-02-04 16:11:18 +0100 | [diff] [blame] | 43 | /** \brief Set interface promiscuous mode |
| 44 | @param client_index - opaque cookie to identify the sender |
| 45 | @param context - sender context, to match reply w/ request |
| 46 | @param sw_if_index - index of the interface to set flags on |
| 47 | @param promisc_on - promiscuous mode is on ? |
| 48 | */ |
| 49 | autoreply define sw_interface_set_promisc |
| 50 | { |
| 51 | u32 client_index; |
| 52 | u32 context; |
| 53 | vl_api_interface_index_t sw_if_index; |
| 54 | bool promisc_on; |
| 55 | }; |
| 56 | |
Ole Troan | d723161 | 2018-06-07 10:17:57 +0200 | [diff] [blame] | 57 | /** \brief Set interface physical MTU |
Matus Fabian | d162f3d | 2016-12-05 01:05:35 -0800 | [diff] [blame] | 58 | @param client_index - opaque cookie to identify the sender |
| 59 | @param context - sender context, to match reply w/ request |
| 60 | @param sw_if_index - index of the interface to set MTU on |
| 61 | @param mtu - MTU |
| 62 | */ |
Ole Troan | d723161 | 2018-06-07 10:17:57 +0200 | [diff] [blame] | 63 | autoreply define hw_interface_set_mtu |
Matus Fabian | d162f3d | 2016-12-05 01:05:35 -0800 | [diff] [blame] | 64 | { |
| 65 | u32 client_index; |
| 66 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 67 | vl_api_interface_index_t sw_if_index; |
Matus Fabian | d162f3d | 2016-12-05 01:05:35 -0800 | [diff] [blame] | 68 | u16 mtu; |
| 69 | }; |
| 70 | |
Ole Troan | d723161 | 2018-06-07 10:17:57 +0200 | [diff] [blame] | 71 | /** \brief Set interface L3 MTU */ |
| 72 | autoreply define sw_interface_set_mtu |
| 73 | { |
| 74 | u32 client_index; |
| 75 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 76 | vl_api_interface_index_t sw_if_index; |
| 77 | u32 mtu[4]; /* vl_api_mtu_proto_t 0 - L3, 1 - IP4, 2 - IP6, 3 - MPLS */ |
Ole Troan | d723161 | 2018-06-07 10:17:57 +0200 | [diff] [blame] | 78 | }; |
| 79 | |
Neale Ranns | 1855b8e | 2018-07-11 10:31:26 -0700 | [diff] [blame] | 80 | /** \brief Set IP4 directed broadcast |
| 81 | The directed broadcast enabled a packet sent to the interface's |
| 82 | subnet address will be broadcast on the interface |
| 83 | @param sw_if_index |
| 84 | @param enable |
| 85 | */ |
| 86 | autoreply define sw_interface_set_ip_directed_broadcast |
| 87 | { |
| 88 | u32 client_index; |
| 89 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 90 | vl_api_interface_index_t sw_if_index; |
| 91 | bool enable; |
Neale Ranns | 1855b8e | 2018-07-11 10:31:26 -0700 | [diff] [blame] | 92 | }; |
| 93 | |
Neale Ranns | a07bd70 | 2017-08-07 07:53:49 -0700 | [diff] [blame] | 94 | /** \brief Interface Event generated by want_interface_events |
Neale Ranns | d292ab1 | 2017-08-15 12:29:48 -0700 | [diff] [blame] | 95 | @param client_index - opaque cookie to identify the sender |
| 96 | @param pid - client pid registered to receive notification |
Neale Ranns | a07bd70 | 2017-08-07 07:53:49 -0700 | [diff] [blame] | 97 | @param sw_if_index - index of the interface of the event |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 98 | @param flags - interface_status flags |
Neale Ranns | a07bd70 | 2017-08-07 07:53:49 -0700 | [diff] [blame] | 99 | @param deleted - interface was deleted |
| 100 | */ |
| 101 | define sw_interface_event |
| 102 | { |
Neale Ranns | d292ab1 | 2017-08-15 12:29:48 -0700 | [diff] [blame] | 103 | u32 client_index; |
| 104 | u32 pid; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 105 | vl_api_interface_index_t sw_if_index; |
| 106 | vl_api_if_status_flags_t flags; |
| 107 | bool deleted; |
Neale Ranns | a07bd70 | 2017-08-07 07:53:49 -0700 | [diff] [blame] | 108 | }; |
| 109 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 110 | /** \brief Register for interface events |
| 111 | @param client_index - opaque cookie to identify the sender |
| 112 | @param context - sender context, to match reply w/ request |
| 113 | @param enable_disable - 1 => register for events, 0 => cancel registration |
| 114 | @param pid - sender's pid |
| 115 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 116 | autoreply define want_interface_events |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 117 | { |
| 118 | u32 client_index; |
| 119 | u32 context; |
| 120 | u32 enable_disable; |
| 121 | u32 pid; |
| 122 | }; |
| 123 | |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 124 | /** \brief Interface details structure (fix this) |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 125 | @param sw_if_index - index of the interface |
Vratko Polak | 4a72406 | 2019-04-17 20:02:56 +0200 | [diff] [blame] | 126 | @param sup_sw_if_index - index of parent interface if any, else same as sw_if_index |
Paul Vinciguerra | 9a29f79 | 2019-04-30 20:44:25 -0700 | [diff] [blame] | 127 | @param l2_address - the interface's l2 address |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 128 | @param flags - interface_status flags |
| 129 | @param type - interface type |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 130 | @param link_duplex - 1 if half duplex, 2 if full duplex |
Damjan Marion | 5100aa9 | 2018-11-08 15:30:16 +0100 | [diff] [blame] | 131 | @param link_speed - value in kbps |
Paul Vinciguerra | bdc0e6b | 2018-09-22 05:32:50 -0700 | [diff] [blame] | 132 | @param link_MTU - max. transmission unit |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 133 | @param sub_id - A number 0-N to uniquely identify this subif on super if |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 134 | @param sub_number_of_tags - Number of tags (0 - 2) |
| 135 | @param sub_outer_vlan_id |
| 136 | @param sub_inner_vlan_id |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 137 | @param sub_if_flags - sub interface flags |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 138 | @param vtr_op - vlan tag rewrite operation |
| 139 | @param vtr_push_dot1q |
| 140 | @param vtr_tag1 |
| 141 | @param vtr_tag2 |
Pavel Kotucek | 65e8457 | 2017-01-16 17:01:56 +0100 | [diff] [blame] | 142 | @param pbb_outer_tag - translate pbb s-tag |
| 143 | @param pbb_b_dmac[6] - B-tag remote mac address |
| 144 | @param pbb_b_smac[6] - B-tag local mac address |
| 145 | @param pbb_b_vlanid - B-tag vlanid |
| 146 | @param pbb_i_sid - I-tag service id |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 147 | @param interface_name - name of the interface |
Mohsin Kazmi | de312c2 | 2019-09-27 13:44:28 +0200 | [diff] [blame] | 148 | @param interface_dev_type - device type of the interface |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 149 | @param tag - an ascii tag |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 150 | */ |
| 151 | define sw_interface_details |
| 152 | { |
| 153 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 154 | vl_api_interface_index_t sw_if_index; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 155 | |
| 156 | /* index of sup interface (e.g. hw interface). |
| 157 | equal to sw_if_index for super hw interface. */ |
| 158 | u32 sup_sw_if_index; |
| 159 | |
| 160 | /* Layer 2 address, if applicable */ |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 161 | vl_api_mac_address_t l2_address; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 162 | |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 163 | vl_api_if_status_flags_t flags; |
Ole Trøan | 3b0d7e4 | 2019-03-15 16:14:41 +0000 | [diff] [blame] | 164 | |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 165 | vl_api_if_type_t type; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 166 | |
| 167 | /* 1 = half duplex, 2 = full duplex */ |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 168 | vl_api_link_duplex_t link_duplex; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 169 | |
Damjan Marion | 5100aa9 | 2018-11-08 15:30:16 +0100 | [diff] [blame] | 170 | /* link speed in kbps */ |
| 171 | u32 link_speed; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 172 | |
| 173 | /* MTU */ |
Damjan Marion | fe7d4a2 | 2018-04-13 19:43:39 +0200 | [diff] [blame] | 174 | u16 link_mtu; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 175 | |
Ole Troan | d723161 | 2018-06-07 10:17:57 +0200 | [diff] [blame] | 176 | /* Per protocol MTUs */ |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 177 | u32 mtu[4]; /* vl_api_mtu_proto_t 0 - L3, 1 - IP4, 2 - IP6, 3 - MPLS */ |
Ole Troan | d723161 | 2018-06-07 10:17:57 +0200 | [diff] [blame] | 178 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 179 | /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */ |
| 180 | u32 sub_id; |
| 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; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 186 | |
| 187 | vl_api_sub_if_flags_t sub_if_flags; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 188 | |
| 189 | /* vlan tag rewrite state */ |
| 190 | u32 vtr_op; |
| 191 | u32 vtr_push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad |
| 192 | u32 vtr_tag1; // first pushed tag |
| 193 | u32 vtr_tag2; // second pushed tag |
Vratko Polak | 4a72406 | 2019-04-17 20:02:56 +0200 | [diff] [blame] | 194 | |
Pavel Kotucek | 65e8457 | 2017-01-16 17:01:56 +0100 | [diff] [blame] | 195 | /* pbb tag rewrite info */ |
| 196 | u16 outer_tag; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 197 | vl_api_mac_address_t b_dmac; |
| 198 | vl_api_mac_address_t b_smac; |
Pavel Kotucek | 65e8457 | 2017-01-16 17:01:56 +0100 | [diff] [blame] | 199 | u16 b_vlanid; |
| 200 | u32 i_sid; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 201 | |
| 202 | /* Interface name */ |
Ole Troan | e5ff5a3 | 2019-08-23 22:55:18 +0200 | [diff] [blame] | 203 | string interface_name[64]; |
Mohsin Kazmi | de312c2 | 2019-09-27 13:44:28 +0200 | [diff] [blame] | 204 | string interface_dev_type[64]; |
Ole Troan | e5ff5a3 | 2019-08-23 22:55:18 +0200 | [diff] [blame] | 205 | string tag[64]; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 206 | }; |
| 207 | |
Paul Vinciguerra | bb2c7b5 | 2019-03-14 09:47:29 -0700 | [diff] [blame] | 208 | /** \brief Request all or filtered subset of sw_interface_details |
| 209 | @param client_index - opaque cookie to identify the sender |
| 210 | @param context - sender context, to match reply w/ request |
Vratko Polak | b8591ac | 2019-04-23 12:26:44 +0200 | [diff] [blame] | 211 | @param sw_if_index - index of the interface to dump info on, 0 or ~0 if on all |
| 212 | TODO: Support selecting only index==0 when CSIT is ready. |
Paul Vinciguerra | bb2c7b5 | 2019-03-14 09:47:29 -0700 | [diff] [blame] | 213 | @param name_filter_valid - 1 if requesting a filtered subset of records else 0 |
Vratko Polak | b8591ac | 2019-04-23 12:26:44 +0200 | [diff] [blame] | 214 | if name filter is set as valid, sw_if_index value is ignored and all interfaces are examined |
Paul Vinciguerra | bb2c7b5 | 2019-03-14 09:47:29 -0700 | [diff] [blame] | 215 | @param name_filter - interface name substring filter. Eg. loop1 returns [loop1, loop10] |
| 216 | */ |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 217 | define sw_interface_dump |
| 218 | { |
| 219 | u32 client_index; |
| 220 | u32 context; |
Ole Troan | 418ebb7 | 2019-11-19 04:38:20 +0100 | [diff] [blame] | 221 | vl_api_interface_index_t sw_if_index [default=0xFFFFFFFF]; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 222 | bool name_filter_valid; |
Ole Troan | e5ff5a3 | 2019-08-23 22:55:18 +0200 | [diff] [blame] | 223 | string name_filter[]; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 224 | }; |
| 225 | |
| 226 | /** \brief Set or delete one or all ip addresses on a specified interface |
| 227 | @param client_index - opaque cookie to identify the sender |
| 228 | @param context - sender context, to match reply w/ request |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 229 | @param sw_if_index - index of the interface to add/del addresses |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 230 | @param is_add - add address if non-zero, else delete |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 231 | @param del_all - if non-zero delete all addresses on the interface |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 232 | @param prefix - address + a prefix length for the implied connected route |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 233 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 234 | autoreply define sw_interface_add_del_address |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 235 | { |
| 236 | u32 client_index; |
| 237 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 238 | vl_api_interface_index_t sw_if_index; |
| 239 | bool is_add; |
| 240 | |
| 241 | bool del_all; |
Ole Troan | 75761b9 | 2019-09-11 17:49:08 +0200 | [diff] [blame] | 242 | vl_api_address_with_prefix_t prefix; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 243 | }; |
| 244 | |
Neale Ranns | 59f7113 | 2020-04-08 12:19:38 +0000 | [diff] [blame] | 245 | /** \brief IP interface address replace begin |
| 246 | |
| 247 | The use-case is that, for some unspecified reason, the control plane |
| 248 | has a different set of interface addresses than VPP |
| 249 | currently has. The CP would thus like to 'replace' VPP's set |
| 250 | only by specifying what the new set shall be, i.e. it is not |
| 251 | going to delete anything that already eixts, rather, is wants any |
| 252 | unspecified interface addresses to be deleted implicitly. |
| 253 | The CP declares the start of this procedure with this replace_begin |
| 254 | API Call, and when it has populated all addresses it wants, it calls |
| 255 | the below replace_end API. From this point on it is of course free |
| 256 | to add and delete interface addresses as usual. |
| 257 | The underlying mechanism by which VPP implements this replace is |
| 258 | intentionally left unspecified. |
| 259 | |
| 260 | @param client_index - opaque cookie to identify the sender |
| 261 | @param context - sender context, to match reply w/ request |
| 262 | */ |
| 263 | autoreply define sw_interface_address_replace_begin |
| 264 | { |
| 265 | u32 client_index; |
| 266 | u32 context; |
| 267 | }; |
| 268 | |
| 269 | /** \brief IP interface address replace end |
| 270 | |
| 271 | see ip_interface_address_replace_begin description. |
| 272 | |
| 273 | @param client_index - opaque cookie to identify the sender |
| 274 | @param context - sender context, to match reply w/ request |
| 275 | */ |
| 276 | autoreply define sw_interface_address_replace_end |
| 277 | { |
| 278 | u32 client_index; |
| 279 | u32 context; |
| 280 | }; |
| 281 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 282 | /** \brief Associate the specified interface with a fib table |
| 283 | @param client_index - opaque cookie to identify the sender |
| 284 | @param context - sender context, to match reply w/ request |
| 285 | @param sw_if_index - index of the interface |
| 286 | @param is_ipv6 - if non-zero ipv6, else ipv4 |
jackiechen1985 | 0ad4a43 | 2019-05-09 16:57:16 +0800 | [diff] [blame] | 287 | @param vrf_id - fib table/vrf id to associate the interface with |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 288 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 289 | autoreply define sw_interface_set_table |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 290 | { |
| 291 | u32 client_index; |
| 292 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 293 | vl_api_interface_index_t sw_if_index; |
| 294 | bool is_ipv6; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 295 | u32 vrf_id; |
| 296 | }; |
| 297 | |
Juraj Sloboda | dfc1923 | 2016-12-05 13:20:37 +0100 | [diff] [blame] | 298 | /** \brief Get VRF id assigned to interface |
| 299 | @param client_index - opaque cookie to identify the sender |
| 300 | @param context - sender context, to match reply w/ request |
| 301 | @param sw_if_index - index of the interface |
| 302 | */ |
| 303 | define sw_interface_get_table |
| 304 | { |
| 305 | u32 client_index; |
| 306 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 307 | vl_api_interface_index_t sw_if_index; |
| 308 | bool is_ipv6; |
Juraj Sloboda | dfc1923 | 2016-12-05 13:20:37 +0100 | [diff] [blame] | 309 | }; |
| 310 | |
| 311 | /** \brief Reply to get_sw_interface_vrf |
| 312 | @param context - sender context which was passed in the request |
| 313 | @param vrf_id - VRF id assigned to the interface |
| 314 | */ |
| 315 | define sw_interface_get_table_reply |
| 316 | { |
| 317 | u32 context; |
| 318 | i32 retval; |
| 319 | u32 vrf_id; |
| 320 | }; |
| 321 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 322 | /** \brief Set unnumbered interface add / del request |
| 323 | @param client_index - opaque cookie to identify the sender |
| 324 | @param context - sender context, to match reply w/ request |
| 325 | @param sw_if_index - interface with an IP address |
| 326 | @param unnumbered_sw_if_index - interface which will use the address |
| 327 | @param is_add - if non-zero set the association, else unset it |
| 328 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 329 | autoreply define sw_interface_set_unnumbered |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 330 | { |
| 331 | u32 client_index; |
| 332 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 333 | vl_api_interface_index_t sw_if_index; /* use this intfc address */ |
| 334 | vl_api_interface_index_t unnumbered_sw_if_index; /* on this interface */ |
| 335 | bool is_add; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 336 | }; |
| 337 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 338 | /** \brief Clear interface statistics |
| 339 | @param client_index - opaque cookie to identify the sender |
| 340 | @param context - sender context, to match reply w/ request |
| 341 | @param sw_if_index - index of the interface to clear statistics |
| 342 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 343 | autoreply define sw_interface_clear_stats |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 344 | { |
| 345 | u32 client_index; |
| 346 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 347 | vl_api_interface_index_t sw_if_index; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 348 | }; |
| 349 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 350 | /** \brief Set / clear software interface tag |
| 351 | @param client_index - opaque cookie to identify the sender |
| 352 | @param context - sender context, to match reply w/ request |
| 353 | @param sw_if_index - the interface |
| 354 | @param add_del - 1 = add, 0 = delete |
| 355 | @param tag - an ascii tag |
| 356 | */ |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 357 | autoreply define sw_interface_tag_add_del |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 358 | { |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 359 | u32 client_index; |
| 360 | u32 context; |
| 361 | bool is_add; |
| 362 | vl_api_interface_index_t sw_if_index; |
Ole Troan | e5ff5a3 | 2019-08-23 22:55:18 +0200 | [diff] [blame] | 363 | string tag[64]; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 364 | }; |
| 365 | |
Matthew Smith | e0792fd | 2019-07-12 11:48:24 -0500 | [diff] [blame] | 366 | /** \brief Add or delete a secondary MAC address on an interface |
| 367 | @param client_index - opaque cookie to identify the sender |
| 368 | @param context - sender context, to match reply w/ request |
| 369 | @param sw_if_index - the interface whose MAC will be set |
| 370 | @param mac_addr - the new MAC address |
| 371 | @param is_add - 0 to delete, != 0 to add |
| 372 | */ |
| 373 | autoreply define sw_interface_add_del_mac_address |
| 374 | { |
| 375 | u32 client_index; |
| 376 | u32 context; |
| 377 | u32 sw_if_index; |
| 378 | vl_api_mac_address_t addr; |
| 379 | u8 is_add; |
| 380 | }; |
| 381 | |
Jon Loeliger | 10c273b | 2017-03-30 08:39:33 -0500 | [diff] [blame] | 382 | /** \brief Set an interface's MAC address |
| 383 | @param client_index - opaque cookie to identify the sender |
| 384 | @param context - sender context, to match reply w/ request |
| 385 | @param sw_if_index - the interface whose MAC will be set |
| 386 | @param mac_addr - the new MAC address |
| 387 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 388 | autoreply define sw_interface_set_mac_address |
Jon Loeliger | 10c273b | 2017-03-30 08:39:33 -0500 | [diff] [blame] | 389 | { |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 390 | u32 client_index; |
| 391 | u32 context; |
| 392 | vl_api_interface_index_t sw_if_index; |
| 393 | vl_api_mac_address_t mac_address; |
Jon Loeliger | 10c273b | 2017-03-30 08:39:33 -0500 | [diff] [blame] | 394 | }; |
| 395 | |
Juraj Sloboda | c037423 | 2018-02-01 15:18:49 +0100 | [diff] [blame] | 396 | /** \brief Get interface's MAC address |
| 397 | @param client_index - opaque cookie to identify the sender |
| 398 | @param context - sender context, to match reply w/ request |
| 399 | @param sw_if_index - the interface whose MAC will be returned |
| 400 | */ |
| 401 | define sw_interface_get_mac_address |
| 402 | { |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 403 | u32 client_index; |
| 404 | u32 context; |
| 405 | vl_api_interface_index_t sw_if_index; |
Juraj Sloboda | c037423 | 2018-02-01 15:18:49 +0100 | [diff] [blame] | 406 | }; |
| 407 | |
| 408 | /** \brief Reply for get interface's MAC address request |
| 409 | @param context - returned sender context, to match reply w/ request |
| 410 | @param retval - return code |
| 411 | @param mac_addr - returned interface's MAC address |
| 412 | */ |
| 413 | define sw_interface_get_mac_address_reply |
| 414 | { |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 415 | u32 context; |
| 416 | i32 retval; |
| 417 | vl_api_mac_address_t mac_address; |
Juraj Sloboda | c037423 | 2018-02-01 15:18:49 +0100 | [diff] [blame] | 418 | }; |
| 419 | |
Steven | ad8015b | 2017-10-29 22:10:46 -0700 | [diff] [blame] | 420 | /** \brief Set an interface's rx-mode |
| 421 | @param client_index - opaque cookie to identify the sender |
| 422 | @param context - sender context, to match reply w/ request |
| 423 | @param sw_if_index - the interface whose rx-mode will be set |
| 424 | @param queue_id_valid - 1 = the queue_id field is valid. 0 means all |
| 425 | queue_id's |
| 426 | @param queue_id - the queue number whose rx-mode will be set. Only valid |
| 427 | if queue_id_valid is 1 |
| 428 | @param mode - polling=1, interrupt=2, adaptive=3 |
| 429 | */ |
| 430 | autoreply define sw_interface_set_rx_mode |
| 431 | { |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 432 | u32 client_index; |
| 433 | u32 context; |
| 434 | vl_api_interface_index_t sw_if_index; |
| 435 | bool queue_id_valid; |
| 436 | u32 queue_id; |
| 437 | vl_api_rx_mode_t mode; |
Steven | ad8015b | 2017-10-29 22:10:46 -0700 | [diff] [blame] | 438 | }; |
| 439 | |
Mohsin Kazmi | 54f7c51 | 2018-08-23 18:28:11 +0200 | [diff] [blame] | 440 | /** \brief Set an interface's rx-placement |
Mohsin Kazmi | f0b42f4 | 2018-09-10 18:11:00 +0200 | [diff] [blame] | 441 | Rx-Queue placement on specific thread is operational for only hardware |
| 442 | interface. It will not set queue - thread placement for sub-interfaces, |
| 443 | p2p and pipe interfaces. |
Mohsin Kazmi | 54f7c51 | 2018-08-23 18:28:11 +0200 | [diff] [blame] | 444 | @param client_index - opaque cookie to identify the sender |
| 445 | @param context - sender context, to match reply w/ request |
| 446 | @param sw_if_index - the interface whose rx-placement will be set |
| 447 | @param queue_id - the queue number whose rx-placement will be set. |
| 448 | @param worker_id - the worker number whom rx-placement will be at. |
| 449 | @param is_main - flag to set rx-placement to main thread |
| 450 | */ |
| 451 | autoreply define sw_interface_set_rx_placement |
| 452 | { |
| 453 | u32 client_index; |
| 454 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 455 | vl_api_interface_index_t sw_if_index; |
Mohsin Kazmi | 54f7c51 | 2018-08-23 18:28:11 +0200 | [diff] [blame] | 456 | u32 queue_id; |
| 457 | u32 worker_id; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 458 | bool is_main; |
Mohsin Kazmi | 54f7c51 | 2018-08-23 18:28:11 +0200 | [diff] [blame] | 459 | }; |
| 460 | |
Steven Luong | f49734d | 2021-07-26 13:38:05 -0700 | [diff] [blame] | 461 | /** \brief Set custom interface name |
| 462 | Set custom interface name for the interface. |
| 463 | @param client_index - opaque cookie to identify the sender |
| 464 | @param context - sender context, to match reply w/ request |
| 465 | @param sw_if_index - the interface whose name will be set |
| 466 | @param name - the custom interface name to be set |
| 467 | k |
| 468 | */ |
| 469 | autoreply define sw_interface_set_interface_name |
| 470 | { |
| 471 | u32 client_index; |
| 472 | u32 context; |
| 473 | vl_api_interface_index_t sw_if_index; |
| 474 | string name[64]; |
| 475 | }; |
| 476 | |
Mohsin Kazmi | f0b42f4 | 2018-09-10 18:11:00 +0200 | [diff] [blame] | 477 | /** \brief dump the rx queue placement of interface(s) |
| 478 | @param sw_if_index - optional interface index for which queue placement to |
| 479 | be requested. sw_if_index = ~0 will dump placement information for all |
| 480 | interfaces. It will not dump information related to sub-interfaces, p2p |
| 481 | and pipe interfaces. |
| 482 | */ |
| 483 | define sw_interface_rx_placement_dump |
| 484 | { |
| 485 | u32 client_index; |
| 486 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 487 | vl_api_interface_index_t sw_if_index; |
Mohsin Kazmi | f0b42f4 | 2018-09-10 18:11:00 +0200 | [diff] [blame] | 488 | }; |
| 489 | |
| 490 | /** \brief show the interface's queue - thread placement |
| 491 | This api is used to display the interface and queue worker |
| 492 | thread placement. One message per rx-queue per interface will |
| 493 | be sent to client. |
| 494 | Each message will contain information about rx-queue id of an |
| 495 | interface, interface index, thread on which this rx-queue is |
| 496 | placed and mode of rx-queue. |
| 497 | @param client_index - opaque cookie to identify the sender |
| 498 | @param context - sender context, to match reply w/ request |
| 499 | @param sw_if_index - the interface whose rx-placement will be dumped |
| 500 | @param queue_id - the queue id |
| 501 | @param worker_id - the worker id on which queue_id is placed, |
| 502 | worker_id = 0 means main thread. |
| 503 | @param mode - polling=1, interrupt=2, adaptive=3 |
| 504 | */ |
| 505 | define sw_interface_rx_placement_details |
| 506 | { |
| 507 | u32 client_index; |
| 508 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 509 | vl_api_interface_index_t sw_if_index; |
Mohsin Kazmi | f0b42f4 | 2018-09-10 18:11:00 +0200 | [diff] [blame] | 510 | u32 queue_id; |
| 511 | u32 worker_id; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 512 | vl_api_rx_mode_t mode; |
Mohsin Kazmi | f0b42f4 | 2018-09-10 18:11:00 +0200 | [diff] [blame] | 513 | }; |
| 514 | |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 515 | /* Gross kludge, DGMS */ |
| 516 | autoreply define interface_name_renumber |
| 517 | { |
| 518 | u32 client_index; |
| 519 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 520 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 521 | u32 new_show_dev_instance; |
| 522 | }; |
| 523 | |
| 524 | define create_subif |
| 525 | { |
| 526 | u32 client_index; |
| 527 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 528 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 529 | u32 sub_id; |
| 530 | |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 531 | vl_api_sub_if_flags_t sub_if_flags; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 532 | u16 outer_vlan_id; |
| 533 | u16 inner_vlan_id; |
| 534 | }; |
| 535 | |
| 536 | define create_subif_reply |
| 537 | { |
| 538 | u32 context; |
| 539 | i32 retval; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 540 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 541 | }; |
| 542 | |
| 543 | /** \brief Create a new subinterface with the given vlan id |
| 544 | @param client_index - opaque cookie to identify the sender |
| 545 | @param context - sender context, to match reply w/ request |
| 546 | @param sw_if_index - software index of the new vlan's parent interface |
| 547 | @param vlan_id - vlan tag of the new interface |
| 548 | */ |
| 549 | define create_vlan_subif |
| 550 | { |
| 551 | u32 client_index; |
| 552 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 553 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 554 | u32 vlan_id; |
| 555 | }; |
| 556 | |
| 557 | /** \brief Reply for the vlan subinterface create request |
| 558 | @param context - returned sender context, to match reply w/ request |
| 559 | @param retval - return code |
| 560 | @param sw_if_index - software index allocated for the new subinterface |
| 561 | */ |
| 562 | define create_vlan_subif_reply |
| 563 | { |
| 564 | u32 context; |
| 565 | i32 retval; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 566 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 567 | }; |
| 568 | |
| 569 | /** \brief Delete sub interface request |
| 570 | @param client_index - opaque cookie to identify the sender |
| 571 | @param context - sender context, to match reply w/ request |
| 572 | @param sw_if_index - sw index of the interface that was created by create_subif |
| 573 | */ |
| 574 | autoreply define delete_subif { |
| 575 | u32 client_index; |
| 576 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 577 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 578 | }; |
| 579 | |
| 580 | /** \brief Create loopback interface request |
| 581 | @param client_index - opaque cookie to identify the sender |
| 582 | @param context - sender context, to match reply w/ request |
| 583 | @param mac_address - mac addr to assign to the interface if none-zero |
| 584 | */ |
| 585 | define create_loopback |
| 586 | { |
| 587 | u32 client_index; |
| 588 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 589 | vl_api_mac_address_t mac_address; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 590 | }; |
| 591 | |
| 592 | /** \brief Create loopback interface response |
| 593 | @param context - sender context, to match reply w/ request |
| 594 | @param sw_if_index - sw index of the interface that was created |
| 595 | @param retval - return code for the request |
| 596 | */ |
| 597 | define create_loopback_reply |
| 598 | { |
| 599 | u32 context; |
| 600 | i32 retval; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 601 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 602 | }; |
| 603 | |
| 604 | /** \brief Create loopback interface instance request |
| 605 | @param client_index - opaque cookie to identify the sender |
| 606 | @param context - sender context, to match reply w/ request |
| 607 | @param mac_address - mac addr to assign to the interface if none-zero |
| 608 | @param is_specified - if non-0, a specific user_instance is being requested |
| 609 | @param user_instance - requested instance, ~0 => dynamically allocate |
| 610 | */ |
| 611 | define create_loopback_instance |
| 612 | { |
| 613 | u32 client_index; |
| 614 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 615 | vl_api_mac_address_t mac_address; |
| 616 | bool is_specified; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 617 | u32 user_instance; |
| 618 | }; |
| 619 | |
| 620 | /** \brief Create loopback interface instance response |
| 621 | @param context - sender context, to match reply w/ request |
| 622 | @param sw_if_index - sw index of the interface that was created |
| 623 | @param retval - return code for the request |
| 624 | */ |
| 625 | define create_loopback_instance_reply |
| 626 | { |
| 627 | u32 context; |
| 628 | i32 retval; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 629 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 630 | }; |
| 631 | |
| 632 | /** \brief Delete loopback interface request |
| 633 | @param client_index - opaque cookie to identify the sender |
| 634 | @param context - sender context, to match reply w/ request |
| 635 | @param sw_if_index - sw index of the interface that was created |
| 636 | */ |
| 637 | autoreply define delete_loopback |
| 638 | { |
| 639 | u32 client_index; |
| 640 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 641 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 642 | }; |
| 643 | |
Neale Ranns | 6f4a6be | 2018-03-16 16:26:21 -0700 | [diff] [blame] | 644 | /** \brief Enable or disable detailed interface stats |
| 645 | @param client_index - opaque cookie to identify the sender |
| 646 | @param context - sender context, to match reply w/ request |
Neale Ranns | 0cae3f7 | 2018-03-21 09:44:01 -0400 | [diff] [blame] | 647 | @param sw_if_index - The interface to collect detail stats on. ~0 implies |
| 648 | all interfaces. |
Neale Ranns | 6f4a6be | 2018-03-16 16:26:21 -0700 | [diff] [blame] | 649 | @param enable_disable - set to 1 to enable, 0 to disable detailed stats |
| 650 | */ |
| 651 | autoreply define collect_detailed_interface_stats |
| 652 | { |
| 653 | u32 client_index; |
| 654 | u32 context; |
Jakub Grajciar | 053204a | 2019-03-18 13:17:53 +0100 | [diff] [blame] | 655 | vl_api_interface_index_t sw_if_index; |
| 656 | bool enable_disable; |
Neale Ranns | 6f4a6be | 2018-03-16 16:26:21 -0700 | [diff] [blame] | 657 | }; |
| 658 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 659 | /* |
| 660 | * Local Variables: |
| 661 | * eval: (c-set-style "gnu") |
| 662 | * End: |
| 663 | */ |