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, |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 28 | GRE_API_TUNNEL_TYPE_TEB, |
| 29 | GRE_API_TUNNEL_TYPE_ERSPAN, |
| 30 | }; |
| 31 | |
| 32 | /** \brief A GRE tunnel |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 33 | @param client_index - opaque cookie to identify the sender |
| 34 | @param context - sender context, to match reply w/ request |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 35 | @param tunnel_type - 0: L3, 1: TEB, 2: ERSPAN |
| 36 | @param instance - optional unique custom device instance, else ~0. |
Neale Ranns | e5b94dd | 2019-12-31 05:13:14 +0000 | [diff] [blame] | 37 | @param mode - P2P or P2MP |
| 38 | @param flags - to control encap/decap behaviour |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 39 | @param src - Source IP address |
| 40 | @param dst - Destination IP address, can be multicast |
Neale Ranns | 5f8f617 | 2019-04-18 10:23:56 +0000 | [diff] [blame] | 41 | @param outer_table_id - Encap FIB table ID |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 42 | @param session_id - session for ERSPAN tunnel, range 0-1023 |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 43 | @param sw_if_index - ignored on create/delete, present in details. |
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 | |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 58 | define gre_tunnel_add_del |
| 59 | { |
| 60 | u32 client_index; |
| 61 | u32 context; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 62 | bool is_add; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 63 | vl_api_gre_tunnel_t tunnel; |
| 64 | }; |
| 65 | |
| 66 | define gre_tunnel_add_del_reply |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 67 | { |
| 68 | u32 context; |
| 69 | i32 retval; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 70 | vl_api_interface_index_t sw_if_index; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 71 | }; |
| 72 | |
| 73 | define gre_tunnel_dump |
| 74 | { |
| 75 | u32 client_index; |
| 76 | u32 context; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 77 | vl_api_interface_index_t sw_if_index; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 78 | }; |
| 79 | |
| 80 | define gre_tunnel_details |
| 81 | { |
| 82 | u32 context; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 83 | vl_api_gre_tunnel_t tunnel; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 84 | }; |
| 85 | |
| 86 | /* |
| 87 | * Local Variables: |
| 88 | * eval: (c-set-style "gnu") |
| 89 | * End: |
| 90 | */ |