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 | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 17 | option version = "2.0.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 | 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 | */ |
| 24 | enum gre_tunnel_type |
| 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 | |
| 31 | /** \brief A GRE tunnel |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 32 | @param client_index - opaque cookie to identify the sender |
| 33 | @param context - sender context, to match reply w/ request |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 34 | @param tunnel_type - 0: L3, 1: TEB, 2: ERSPAN |
| 35 | @param instance - optional unique custom device instance, else ~0. |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 36 | @param src - Source IP address |
| 37 | @param dst - Destination IP address, can be multicast |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 38 | @param outer_fib_id - Encap FIB table ID |
| 39 | @param session_id - session for ERSPAN tunnel, range 0-1023 |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 40 | @param sw_if_index - ignored on create/delete, present in details. |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 41 | */ |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 42 | typedef gre_tunnel |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 43 | { |
| 44 | u32 client_index; |
| 45 | u32 context; |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 46 | u16 session_id; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 47 | vl_api_gre_tunnel_type_t type; |
| 48 | u32 instance; |
| 49 | u32 outer_fib_id; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 50 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 51 | vl_api_address_t src; |
| 52 | vl_api_address_t dst; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 53 | }; |
| 54 | |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 55 | define gre_tunnel_add_del |
| 56 | { |
| 57 | u32 client_index; |
| 58 | u32 context; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 59 | bool is_add; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 60 | vl_api_gre_tunnel_t tunnel; |
| 61 | }; |
| 62 | |
| 63 | define gre_tunnel_add_del_reply |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 64 | { |
| 65 | u32 context; |
| 66 | i32 retval; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 67 | vl_api_interface_index_t sw_if_index; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 68 | }; |
| 69 | |
| 70 | define gre_tunnel_dump |
| 71 | { |
| 72 | u32 client_index; |
| 73 | u32 context; |
Ole Troan | 814f159 | 2019-06-07 11:02:58 +0200 | [diff] [blame] | 74 | vl_api_interface_index_t sw_if_index; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 75 | }; |
| 76 | |
| 77 | define gre_tunnel_details |
| 78 | { |
| 79 | u32 context; |
Neale Ranns | 5a8844b | 2019-04-16 07:15:35 +0000 | [diff] [blame] | 80 | vl_api_gre_tunnel_t tunnel; |
Pavel Kotucek | 1099b0d | 2016-12-20 08:13:14 +0100 | [diff] [blame] | 81 | }; |
| 82 | |
| 83 | /* |
| 84 | * Local Variables: |
| 85 | * eval: (c-set-style "gnu") |
| 86 | * End: |
| 87 | */ |