Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 1 | /* Hey Emacs use -*- mode: C -*- */ |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 2 | /* |
Vratko Polak | 8ab4e50 | 2020-01-31 19:21:25 +0100 | [diff] [blame] | 3 | * Copyright (c) 2015-2020 Cisco and/or its affiliates. |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 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 | |
Vratko Polak | 8ab4e50 | 2020-01-31 19:21:25 +0100 | [diff] [blame] | 17 | option version = "2.1.0"; |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 18 | |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 19 | import "vnet/interface_types.api"; |
Neale Ranns | 59ff918 | 2019-12-29 23:55:18 +0000 | [diff] [blame] | 20 | import "vnet/tunnel/tunnel_types.api"; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 21 | import "vnet/ip/ip_types.api"; |
| 22 | |
| 23 | /** \brief A GRE tunnel type |
| 24 | */ |
Neale Ranns | 5f8f617 | 2019-04-18 10:23:56 +0000 | [diff] [blame] | 25 | enum gre_tunnel_type : u8 |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 26 | { |
Alexander Chernavin | d0aed2e | 2019-04-22 09:30:16 -0400 | [diff] [blame] | 27 | GRE_API_TUNNEL_TYPE_L3 = 0, |
Vratko Polak | 48ac1c2 | 2020-01-31 20:43:33 +0100 | [diff] [blame] | 28 | /* L2 Transparent Ethernet Bridge */ |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 29 | GRE_API_TUNNEL_TYPE_TEB, |
Vratko Polak | 48ac1c2 | 2020-01-31 20:43:33 +0100 | [diff] [blame] | 30 | /* Encapsulated Remote Switched Port ANalyzer */ |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 31 | GRE_API_TUNNEL_TYPE_ERSPAN, |
| 32 | }; |
| 33 | |
Vratko Polak | 48ac1c2 | 2020-01-31 20:43:33 +0100 | [diff] [blame] | 34 | /** \brief A composite type uniquely defining a GRE tunnel. |
| 35 | @param type - tunnel type (see enum definition), 0: L3, 1: TEB, 2: ERSPAN |
Neale Ranns | e5b94dd | 2019-12-31 05:13:14 +0000 | [diff] [blame] | 36 | @param mode - P2P or P2MP |
| 37 | @param flags - to control encap/decap behaviour |
Vratko Polak | 48ac1c2 | 2020-01-31 20:43:33 +0100 | [diff] [blame] | 38 | @param session_id - session for ERSPAN tunnel, range 0-1023 |
| 39 | @param instance - optional unique custom device instance, else ~0. |
| 40 | @param outer_table_id - Encap FIB table ID |
| 41 | @param sw_if_index - ignored on create/delete, present in details. |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 42 | @param src - Source IP address |
| 43 | @param dst - Destination IP address, can be multicast |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 44 | */ |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 45 | typedef gre_tunnel |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 46 | { |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 47 | vl_api_gre_tunnel_type_t type; |
Neale Ranns | 59ff918 | 2019-12-29 23:55:18 +0000 | [diff] [blame] | 48 | vl_api_tunnel_mode_t mode; |
Neale Ranns | e5b94dd | 2019-12-31 05:13:14 +0000 | [diff] [blame] | 49 | vl_api_tunnel_encap_decap_flags_t flags; |
Neale Ranns | 5f8f617 | 2019-04-18 10:23:56 +0000 | [diff] [blame] | 50 | u16 session_id; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 51 | u32 instance; |
Neale Ranns | 5f8f617 | 2019-04-18 10:23:56 +0000 | [diff] [blame] | 52 | u32 outer_table_id; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 53 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 54 | vl_api_address_t src; |
| 55 | vl_api_address_t dst; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 56 | }; |
| 57 | |
Vratko Polak | 48ac1c2 | 2020-01-31 20:43:33 +0100 | [diff] [blame] | 58 | /** \brief Add or delete a single GRE tunnel. |
| 59 | @param client_index - opaque cookie to identify the sender. |
| 60 | @param context - sender context, to match reply w/ request. |
| 61 | @param is_add - add if true, delete if false. |
| 62 | @param tunnel - tunnel definition to add or delete. |
| 63 | */ |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 64 | define gre_tunnel_add_del |
| 65 | { |
| 66 | u32 client_index; |
| 67 | u32 context; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 68 | bool is_add; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 69 | vl_api_gre_tunnel_t tunnel; |
| 70 | }; |
| 71 | |
Vratko Polak | 48ac1c2 | 2020-01-31 20:43:33 +0100 | [diff] [blame] | 72 | /** \brief Add or delete a single GRE tunnel. |
| 73 | @param context - sender context, to match reply w/ request. |
| 74 | @param retval - return code for the request. |
| 75 | @param sw_if_index - the interface corresponding to the affected tunnel. |
| 76 | */ |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 77 | define gre_tunnel_add_del_reply |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 78 | { |
| 79 | u32 context; |
| 80 | i32 retval; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 81 | vl_api_interface_index_t sw_if_index; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 82 | }; |
| 83 | |
Vratko Polak | 48ac1c2 | 2020-01-31 20:43:33 +0100 | [diff] [blame] | 84 | /** \brief Dump details of all or just a single GRE tunnel. |
| 85 | @param client_index - opaque cookie to identify the sender. |
| 86 | @param context - sender context, to match reply w/ request. |
| 87 | @param sw_if_index - filter for tunnel of this interface index, ~0 for all. |
| 88 | */ |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 89 | define gre_tunnel_dump |
| 90 | { |
| 91 | u32 client_index; |
| 92 | u32 context; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 93 | vl_api_interface_index_t sw_if_index; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 94 | }; |
| 95 | |
Vratko Polak | 48ac1c2 | 2020-01-31 20:43:33 +0100 | [diff] [blame] | 96 | /** \brief Details response for one of the requested GRE tunnels. |
| 97 | @param context - sender context, to match reply w/ request. |
| 98 | @param tunnel - definition of the dumped tunnel. |
| 99 | */ |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 100 | define gre_tunnel_details |
| 101 | { |
| 102 | u32 context; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 103 | vl_api_gre_tunnel_t tunnel; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 104 | }; |
| 105 | |
| 106 | /* |
| 107 | * Local Variables: |
| 108 | * eval: (c-set-style "gnu") |
| 109 | * End: |
| 110 | */ |