blob: d79beebb94de835aa950fe7a3880d0ad09cae633 [file] [log] [blame]
Neale Ranns5a8844b2019-04-16 07:15:35 +00001/* Hey Emacs use -*- mode: C -*- */
Pavel Kotucek1099b0d2016-12-20 08:13:14 +01002/*
Neale Ranns5a8844b2019-04-16 07:15:35 +00003 * Copyright (c) 2015-2019 Cisco and/or its affiliates.
Pavel Kotucek1099b0d2016-12-20 08:13:14 +01004 * 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 Ranns5f8f6172019-04-18 10:23:56 +000017option version = "2.0.1";
Dave Barach0d056e52017-09-28 15:11:16 -040018
Ole Troan814f1592019-06-07 11:02:58 +020019import "vnet/interface_types.api";
Neale Ranns5a8844b2019-04-16 07:15:35 +000020import "vnet/ip/ip_types.api";
21
22/** \brief A GRE tunnel type
23*/
Neale Ranns5f8f6172019-04-18 10:23:56 +000024enum gre_tunnel_type : u8
Neale Ranns5a8844b2019-04-16 07:15:35 +000025{
Alexander Chernavind0aed2e2019-04-22 09:30:16 -040026 GRE_API_TUNNEL_TYPE_L3 = 0,
Neale Ranns5a8844b2019-04-16 07:15:35 +000027 GRE_API_TUNNEL_TYPE_TEB,
28 GRE_API_TUNNEL_TYPE_ERSPAN,
29};
30
Neale Ranns5f8f6172019-04-18 10:23:56 +000031/** \brief A GRE tunnel mode
32*/
33enum 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 Ranns5a8844b2019-04-16 07:15:35 +000041/** \brief A GRE tunnel
John Loa43ccae2018-02-13 17:15:23 -050042 @param client_index - opaque cookie to identify the sender
43 @param context - sender context, to match reply w/ request
John Loa43ccae2018-02-13 17:15:23 -050044 @param tunnel_type - 0: L3, 1: TEB, 2: ERSPAN
45 @param instance - optional unique custom device instance, else ~0.
Neale Ranns5a8844b2019-04-16 07:15:35 +000046 @param src - Source IP address
47 @param dst - Destination IP address, can be multicast
Neale Ranns5f8f6172019-04-18 10:23:56 +000048 @param outer_table_id - Encap FIB table ID
John Loa43ccae2018-02-13 17:15:23 -050049 @param session_id - session for ERSPAN tunnel, range 0-1023
Neale Ranns5a8844b2019-04-16 07:15:35 +000050 @param sw_if_index - ignored on create/delete, present in details.
John Loa43ccae2018-02-13 17:15:23 -050051*/
Neale Ranns5a8844b2019-04-16 07:15:35 +000052typedef gre_tunnel
Pavel Kotucek1099b0d2016-12-20 08:13:14 +010053{
Neale Ranns5a8844b2019-04-16 07:15:35 +000054 vl_api_gre_tunnel_type_t type;
Neale Ranns5f8f6172019-04-18 10:23:56 +000055 vl_api_gre_tunnel_mode_t mode;
56 u16 session_id;
Neale Ranns5a8844b2019-04-16 07:15:35 +000057 u32 instance;
Neale Ranns5f8f6172019-04-18 10:23:56 +000058 u32 outer_table_id;
Ole Troan814f1592019-06-07 11:02:58 +020059 vl_api_interface_index_t sw_if_index;
Neale Ranns5a8844b2019-04-16 07:15:35 +000060 vl_api_address_t src;
61 vl_api_address_t dst;
Pavel Kotucek1099b0d2016-12-20 08:13:14 +010062};
63
Neale Ranns5a8844b2019-04-16 07:15:35 +000064define gre_tunnel_add_del
65{
66 u32 client_index;
67 u32 context;
Ole Troan814f1592019-06-07 11:02:58 +020068 bool is_add;
Neale Ranns5a8844b2019-04-16 07:15:35 +000069 vl_api_gre_tunnel_t tunnel;
70};
71
72define gre_tunnel_add_del_reply
Pavel Kotucek1099b0d2016-12-20 08:13:14 +010073{
74 u32 context;
75 i32 retval;
Ole Troan814f1592019-06-07 11:02:58 +020076 vl_api_interface_index_t sw_if_index;
Pavel Kotucek1099b0d2016-12-20 08:13:14 +010077};
78
79define gre_tunnel_dump
80{
81 u32 client_index;
82 u32 context;
Ole Troan814f1592019-06-07 11:02:58 +020083 vl_api_interface_index_t sw_if_index;
Pavel Kotucek1099b0d2016-12-20 08:13:14 +010084};
85
86define gre_tunnel_details
87{
88 u32 context;
Neale Ranns5a8844b2019-04-16 07:15:35 +000089 vl_api_gre_tunnel_t tunnel;
Pavel Kotucek1099b0d2016-12-20 08:13:14 +010090};
91
92/*
93 * Local Variables:
94 * eval: (c-set-style "gnu")
95 * End:
96 */