Dave Barach | aff7077 | 2016-10-31 11:59:07 -0400 | [diff] [blame] | 1 | /** \brief Set flags on the interface |
| 2 | @param client_index - opaque cookie to identify the sender |
| 3 | @param context - sender context, to match reply w/ request |
| 4 | @param sw_if_index - index of the interface to set flags on |
| 5 | @param admin_up_down - set the admin state, 1 = up, 0 = down |
| 6 | @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] | 7 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 8 | autoreply define sw_interface_set_flags |
Dave Barach | aff7077 | 2016-10-31 11:59:07 -0400 | [diff] [blame] | 9 | { |
| 10 | u32 client_index; |
| 11 | u32 context; |
| 12 | u32 sw_if_index; |
| 13 | /* 1 = up, 0 = down */ |
| 14 | u8 admin_up_down; |
Dave Barach | aff7077 | 2016-10-31 11:59:07 -0400 | [diff] [blame] | 15 | }; |
| 16 | |
Matus Fabian | d162f3d | 2016-12-05 01:05:35 -0800 | [diff] [blame] | 17 | /** \brief Set interface MTU |
| 18 | @param client_index - opaque cookie to identify the sender |
| 19 | @param context - sender context, to match reply w/ request |
| 20 | @param sw_if_index - index of the interface to set MTU on |
| 21 | @param mtu - MTU |
| 22 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 23 | autoreply define sw_interface_set_mtu |
Matus Fabian | d162f3d | 2016-12-05 01:05:35 -0800 | [diff] [blame] | 24 | { |
| 25 | u32 client_index; |
| 26 | u32 context; |
| 27 | u32 sw_if_index; |
| 28 | u16 mtu; |
| 29 | }; |
| 30 | |
Neale Ranns | a07bd70 | 2017-08-07 07:53:49 -0700 | [diff] [blame] | 31 | /** \brief Interface Event generated by want_interface_events |
Neale Ranns | d292ab1 | 2017-08-15 12:29:48 -0700 | [diff] [blame] | 32 | @param client_index - opaque cookie to identify the sender |
| 33 | @param pid - client pid registered to receive notification |
Neale Ranns | a07bd70 | 2017-08-07 07:53:49 -0700 | [diff] [blame] | 34 | @param sw_if_index - index of the interface of the event |
| 35 | @param admin_up_down - The administrative state; 1 = up, 0 = down |
| 36 | @param link_up_down - The operational state; 1 = up, 0 = down |
| 37 | @param deleted - interface was deleted |
| 38 | */ |
| 39 | define sw_interface_event |
| 40 | { |
Neale Ranns | d292ab1 | 2017-08-15 12:29:48 -0700 | [diff] [blame] | 41 | u32 client_index; |
| 42 | u32 pid; |
Neale Ranns | a07bd70 | 2017-08-07 07:53:49 -0700 | [diff] [blame] | 43 | u32 sw_if_index; |
| 44 | u8 admin_up_down; |
| 45 | u8 link_up_down; |
| 46 | u8 deleted; |
| 47 | }; |
| 48 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 49 | /** \brief Register for interface events |
| 50 | @param client_index - opaque cookie to identify the sender |
| 51 | @param context - sender context, to match reply w/ request |
| 52 | @param enable_disable - 1 => register for events, 0 => cancel registration |
| 53 | @param pid - sender's pid |
| 54 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 55 | autoreply define want_interface_events |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 56 | { |
| 57 | u32 client_index; |
| 58 | u32 context; |
| 59 | u32 enable_disable; |
| 60 | u32 pid; |
| 61 | }; |
| 62 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 63 | /** \brief Interface details structure (fix this) |
| 64 | @param sw_if_index - index of the interface |
| 65 | @param sup_sw_if_index - index of parent interface if any, else same as sw_if_index |
| 66 | @param l2_address_length - length of the interface's l2 address |
| 67 | @param pid - the interface's l2 address |
| 68 | @param interface_name - name of the interface |
| 69 | @param link_duplex - 1 if half duplex, 2 if full duplex |
| 70 | @param link_speed - 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G |
Pavel Kotucek | 65e8457 | 2017-01-16 17:01:56 +0100 | [diff] [blame] | 71 | @param link_MTU - max. transmittion unit |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 72 | @param sub_if_id - A number 0-N to uniquely identify this subif on super if |
Pavel Kotucek | 65e8457 | 2017-01-16 17:01:56 +0100 | [diff] [blame] | 73 | @param sub_dot1ad - 0 = dot1q, 1 = dot1ad |
| 74 | @param sub_dot1ah - 1 = dot1ah, 0 = otherwise |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 75 | @param sub_number_of_tags - Number of tags (0 - 2) |
| 76 | @param sub_outer_vlan_id |
| 77 | @param sub_inner_vlan_id |
| 78 | @param sub_exact_match |
| 79 | @param sub_default |
| 80 | @param sub_outer_vlan_id_any |
| 81 | @param sub_inner_vlan_id_any |
| 82 | @param vtr_op - vlan tag rewrite operation |
| 83 | @param vtr_push_dot1q |
| 84 | @param vtr_tag1 |
| 85 | @param vtr_tag2 |
Pavel Kotucek | 65e8457 | 2017-01-16 17:01:56 +0100 | [diff] [blame] | 86 | @param pbb_outer_tag - translate pbb s-tag |
| 87 | @param pbb_b_dmac[6] - B-tag remote mac address |
| 88 | @param pbb_b_smac[6] - B-tag local mac address |
| 89 | @param pbb_b_vlanid - B-tag vlanid |
| 90 | @param pbb_i_sid - I-tag service id |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 91 | */ |
| 92 | define sw_interface_details |
| 93 | { |
| 94 | u32 context; |
| 95 | u32 sw_if_index; |
| 96 | |
| 97 | /* index of sup interface (e.g. hw interface). |
| 98 | equal to sw_if_index for super hw interface. */ |
| 99 | u32 sup_sw_if_index; |
| 100 | |
| 101 | /* Layer 2 address, if applicable */ |
| 102 | u32 l2_address_length; |
| 103 | u8 l2_address[8]; |
| 104 | |
| 105 | /* Interface name */ |
| 106 | u8 interface_name[64]; |
| 107 | |
| 108 | /* 1 = up, 0 = down */ |
| 109 | u8 admin_up_down; |
| 110 | u8 link_up_down; |
| 111 | |
| 112 | /* 1 = half duplex, 2 = full duplex */ |
| 113 | u8 link_duplex; |
| 114 | |
| 115 | /* 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G */ |
| 116 | u8 link_speed; |
| 117 | |
| 118 | /* MTU */ |
| 119 | u16 link_mtu; |
| 120 | |
| 121 | /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */ |
| 122 | u32 sub_id; |
| 123 | |
| 124 | /* 0 = dot1q, 1=dot1ad */ |
| 125 | u8 sub_dot1ad; |
Pavel Kotucek | 65e8457 | 2017-01-16 17:01:56 +0100 | [diff] [blame] | 126 | /* 1 = dot1h, 1=otherwise */ |
| 127 | u8 sub_dot1ah; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 128 | |
| 129 | /* Number of tags 0-2 */ |
| 130 | u8 sub_number_of_tags; |
| 131 | u16 sub_outer_vlan_id; |
| 132 | u16 sub_inner_vlan_id; |
| 133 | u8 sub_exact_match; |
| 134 | u8 sub_default; |
| 135 | u8 sub_outer_vlan_id_any; |
| 136 | u8 sub_inner_vlan_id_any; |
| 137 | |
| 138 | /* vlan tag rewrite state */ |
| 139 | u32 vtr_op; |
| 140 | u32 vtr_push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad |
| 141 | u32 vtr_tag1; // first pushed tag |
| 142 | u32 vtr_tag2; // second pushed tag |
| 143 | u8 tag[64]; |
Pavel Kotucek | 65e8457 | 2017-01-16 17:01:56 +0100 | [diff] [blame] | 144 | |
| 145 | /* pbb tag rewrite info */ |
| 146 | u16 outer_tag; |
| 147 | u8 b_dmac[6]; |
| 148 | u8 b_smac[6]; |
| 149 | u16 b_vlanid; |
| 150 | u32 i_sid; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 151 | }; |
| 152 | |
| 153 | /* works */ |
| 154 | define sw_interface_dump |
| 155 | { |
| 156 | u32 client_index; |
| 157 | u32 context; |
| 158 | u8 name_filter_valid; |
| 159 | u8 name_filter[49]; |
| 160 | }; |
| 161 | |
| 162 | /** \brief Set or delete one or all ip addresses on a specified interface |
| 163 | @param client_index - opaque cookie to identify the sender |
| 164 | @param context - sender context, to match reply w/ request |
| 165 | @param sw_if_index - index of the interface to add/del addresses |
| 166 | @param is_add - add address if non-zero, else delete |
| 167 | @param is_ipv6 - if non-zero the address is ipv6, else ipv4 |
| 168 | @param del_all - if non-zero delete all addresses on the interface |
| 169 | @param address_length - address length in bytes, 4 for ip4, 16 for ip6 |
| 170 | @param address - array of address bytes |
| 171 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 172 | autoreply define sw_interface_add_del_address |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 173 | { |
| 174 | u32 client_index; |
| 175 | u32 context; |
| 176 | u32 sw_if_index; |
| 177 | u8 is_add; |
| 178 | u8 is_ipv6; |
| 179 | u8 del_all; |
| 180 | u8 address_length; |
| 181 | u8 address[16]; |
| 182 | }; |
| 183 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 184 | /** \brief Associate the specified interface with a fib table |
| 185 | @param client_index - opaque cookie to identify the sender |
| 186 | @param context - sender context, to match reply w/ request |
| 187 | @param sw_if_index - index of the interface |
| 188 | @param is_ipv6 - if non-zero ipv6, else ipv4 |
| 189 | @param vrf_id - fib table/vrd id to associate the interface with |
| 190 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 191 | autoreply define sw_interface_set_table |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 192 | { |
| 193 | u32 client_index; |
| 194 | u32 context; |
| 195 | u32 sw_if_index; |
| 196 | u8 is_ipv6; |
| 197 | u32 vrf_id; |
| 198 | }; |
| 199 | |
Juraj Sloboda | dfc1923 | 2016-12-05 13:20:37 +0100 | [diff] [blame] | 200 | /** \brief Get VRF id assigned to interface |
| 201 | @param client_index - opaque cookie to identify the sender |
| 202 | @param context - sender context, to match reply w/ request |
| 203 | @param sw_if_index - index of the interface |
| 204 | */ |
| 205 | define sw_interface_get_table |
| 206 | { |
| 207 | u32 client_index; |
| 208 | u32 context; |
| 209 | u32 sw_if_index; |
| 210 | u8 is_ipv6; |
| 211 | }; |
| 212 | |
| 213 | /** \brief Reply to get_sw_interface_vrf |
| 214 | @param context - sender context which was passed in the request |
| 215 | @param vrf_id - VRF id assigned to the interface |
| 216 | */ |
| 217 | define sw_interface_get_table_reply |
| 218 | { |
| 219 | u32 context; |
| 220 | i32 retval; |
| 221 | u32 vrf_id; |
| 222 | }; |
| 223 | |
Aloys Augustin | ee55198 | 2017-02-17 14:55:29 +0100 | [diff] [blame] | 224 | typeonly manual_print manual_endian define vlib_counter |
| 225 | { |
| 226 | u64 packets; /**< packet counter */ |
| 227 | u64 bytes; /**< byte counter */ |
| 228 | }; |
| 229 | |
| 230 | /** \brief Simple stats counters structure |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 231 | @param vnet_counter_type- such as ip4, ip6, punts, etc |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 232 | @param first_sw_if_index - first sw index in block of index, counts |
Aloys Augustin | ee55198 | 2017-02-17 14:55:29 +0100 | [diff] [blame] | 233 | @param count - number of counters, equal to the number of interfaces in |
| 234 | this stats block |
| 235 | @param data - contiguous block of u64 counters |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 236 | */ |
Aloys Augustin | ee55198 | 2017-02-17 14:55:29 +0100 | [diff] [blame] | 237 | manual_print manual_endian define vnet_interface_simple_counters |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 238 | { |
| 239 | /* enums - plural - in vnet/interface.h */ |
| 240 | u8 vnet_counter_type; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 241 | u32 first_sw_if_index; |
| 242 | u32 count; |
Aloys Augustin | ee55198 | 2017-02-17 14:55:29 +0100 | [diff] [blame] | 243 | u64 data[count]; |
| 244 | }; |
| 245 | |
| 246 | /** \brief Combined stats counters structure |
| 247 | @param vnet_counter_type- such as ip4, ip6, punts, etc |
| 248 | @param first_sw_if_index - first sw index in block of index, counts |
| 249 | @param count - number of counters, equal to the number of interfaces in |
| 250 | this stats block |
| 251 | @param data - contiguous block of vlib_counter_t structures |
| 252 | */ |
| 253 | manual_print manual_endian define vnet_interface_combined_counters |
| 254 | { |
| 255 | /* enums - plural - in vnet/interface.h */ |
| 256 | u8 vnet_counter_type; |
| 257 | u32 first_sw_if_index; |
| 258 | u32 count; |
| 259 | vl_api_vlib_counter_t data[count]; |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 260 | }; |
| 261 | |
| 262 | /** \brief Set unnumbered interface add / del request |
| 263 | @param client_index - opaque cookie to identify the sender |
| 264 | @param context - sender context, to match reply w/ request |
| 265 | @param sw_if_index - interface with an IP address |
| 266 | @param unnumbered_sw_if_index - interface which will use the address |
| 267 | @param is_add - if non-zero set the association, else unset it |
| 268 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 269 | autoreply define sw_interface_set_unnumbered |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 270 | { |
| 271 | u32 client_index; |
| 272 | u32 context; |
| 273 | u32 sw_if_index; /* use this intfc address */ |
| 274 | u32 unnumbered_sw_if_index; /* on this interface */ |
| 275 | u8 is_add; |
| 276 | }; |
| 277 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 278 | /** \brief Clear interface statistics |
| 279 | @param client_index - opaque cookie to identify the sender |
| 280 | @param context - sender context, to match reply w/ request |
| 281 | @param sw_if_index - index of the interface to clear statistics |
| 282 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 283 | autoreply define sw_interface_clear_stats |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 284 | { |
| 285 | u32 client_index; |
| 286 | u32 context; |
| 287 | u32 sw_if_index; |
| 288 | }; |
| 289 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 290 | /** \brief Set / clear software interface tag |
| 291 | @param client_index - opaque cookie to identify the sender |
| 292 | @param context - sender context, to match reply w/ request |
| 293 | @param sw_if_index - the interface |
| 294 | @param add_del - 1 = add, 0 = delete |
| 295 | @param tag - an ascii tag |
| 296 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 297 | autoreply define sw_interface_tag_add_del |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 298 | { |
| 299 | u32 client_index; |
| 300 | u32 context; |
| 301 | u8 is_add; |
| 302 | u32 sw_if_index; |
| 303 | u8 tag[64]; |
| 304 | }; |
| 305 | |
Jon Loeliger | 10c273b | 2017-03-30 08:39:33 -0500 | [diff] [blame] | 306 | /** \brief Set an interface's MAC address |
| 307 | @param client_index - opaque cookie to identify the sender |
| 308 | @param context - sender context, to match reply w/ request |
| 309 | @param sw_if_index - the interface whose MAC will be set |
| 310 | @param mac_addr - the new MAC address |
| 311 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 312 | autoreply define sw_interface_set_mac_address |
Jon Loeliger | 10c273b | 2017-03-30 08:39:33 -0500 | [diff] [blame] | 313 | { |
| 314 | u32 client_index; |
| 315 | u32 context; |
| 316 | u32 sw_if_index; |
| 317 | u8 mac_address[6]; |
| 318 | }; |
| 319 | |
Dave Barach | 6d963c2 | 2016-12-05 09:50:05 -0500 | [diff] [blame] | 320 | /* |
| 321 | * Local Variables: |
| 322 | * eval: (c-set-style "gnu") |
| 323 | * End: |
| 324 | */ |