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