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 | /* |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 3 | * Copyright (c) 2015-2019 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 | |
Neale Ranns | 5f8f617 | 2019-04-18 10:23:56 +0000 | [diff] [blame^] | 17 | option version = "2.0.1"; |
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 | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 20 | import "vnet/ip/ip_types.api"; |
| 21 | |
| 22 | /** \brief A GRE tunnel type |
| 23 | */ |
Neale Ranns | 5f8f617 | 2019-04-18 10:23:56 +0000 | [diff] [blame^] | 24 | enum gre_tunnel_type : u8 |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 25 | { |
Alexander Chernavin | d0aed2e | 2019-04-22 09:30:16 -0400 | [diff] [blame] | 26 | GRE_API_TUNNEL_TYPE_L3 = 0, |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 27 | GRE_API_TUNNEL_TYPE_TEB, |
| 28 | GRE_API_TUNNEL_TYPE_ERSPAN, |
| 29 | }; |
| 30 | |
Neale Ranns | 5f8f617 | 2019-04-18 10:23:56 +0000 | [diff] [blame^] | 31 | /** \brief A GRE tunnel mode |
| 32 | */ |
| 33 | enum gre_tunnel_mode : u8 |
| 34 | { |
| 35 | /* point-to-point */ |
| 36 | GRE_API_TUNNEL_MODE_P2P, |
| 37 | /* multi-point */ |
| 38 | GRE_API_TUNNEL_MODE_MP, |
| 39 | }; |
| 40 | |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 41 | /** \brief A GRE tunnel |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 42 | @param client_index - opaque cookie to identify the sender |
| 43 | @param context - sender context, to match reply w/ request |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 44 | @param tunnel_type - 0: L3, 1: TEB, 2: ERSPAN |
| 45 | @param instance - optional unique custom device instance, else ~0. |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 46 | @param src - Source IP address |
| 47 | @param dst - Destination IP address, can be multicast |
Neale Ranns | 5f8f617 | 2019-04-18 10:23:56 +0000 | [diff] [blame^] | 48 | @param outer_table_id - Encap FIB table ID |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 49 | @param session_id - session for ERSPAN tunnel, range 0-1023 |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 50 | @param sw_if_index - ignored on create/delete, present in details. |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 51 | */ |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 52 | typedef gre_tunnel |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 53 | { |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 54 | vl_api_gre_tunnel_type_t type; |
Neale Ranns | 5f8f617 | 2019-04-18 10:23:56 +0000 | [diff] [blame^] | 55 | vl_api_gre_tunnel_mode_t mode; |
| 56 | u16 session_id; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 57 | u32 instance; |
Neale Ranns | 5f8f617 | 2019-04-18 10:23:56 +0000 | [diff] [blame^] | 58 | u32 outer_table_id; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 59 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 60 | vl_api_address_t src; |
| 61 | vl_api_address_t dst; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 62 | }; |
| 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 | |
| 72 | define gre_tunnel_add_del_reply |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 73 | { |
| 74 | u32 context; |
| 75 | i32 retval; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 76 | vl_api_interface_index_t sw_if_index; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 77 | }; |
| 78 | |
| 79 | define gre_tunnel_dump |
| 80 | { |
| 81 | u32 client_index; |
| 82 | u32 context; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 83 | vl_api_interface_index_t sw_if_index; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 84 | }; |
| 85 | |
| 86 | define gre_tunnel_details |
| 87 | { |
| 88 | u32 context; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 89 | vl_api_gre_tunnel_t tunnel; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 90 | }; |
| 91 | |
| 92 | /* |
| 93 | * Local Variables: |
| 94 | * eval: (c-set-style "gnu") |
| 95 | * End: |
| 96 | */ |