tunnel: Common types for IP tunnels
[vpp.git] / src / vnet / gre / gre.api
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Copyright (c) 2015-2019 Cisco and/or its affiliates.
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
17 option version = "2.0.2";
18
19 import "vnet/interface_types.api";
20 import "vnet/tunnel/tunnel_types.api";
21 import "vnet/ip/ip_types.api";
22
23 /** \brief A GRE tunnel type
24 */
25 enum gre_tunnel_type : u8
26 {
27   GRE_API_TUNNEL_TYPE_L3 = 0,
28   GRE_API_TUNNEL_TYPE_TEB,
29   GRE_API_TUNNEL_TYPE_ERSPAN,
30 };
31
32 /** \brief A GRE tunnel
33     @param client_index - opaque cookie to identify the sender
34     @param context - sender context, to match reply w/ request
35     @param tunnel_type - 0: L3, 1: TEB, 2: ERSPAN
36     @param instance - optional unique custom device instance, else ~0.
37     @param src - Source IP address
38     @param dst - Destination IP address, can be multicast
39     @param outer_table_id - Encap FIB table ID
40     @param session_id - session for ERSPAN tunnel, range 0-1023
41     @param sw_if_index - ignored on create/delete, present in details.
42 */
43 typedef gre_tunnel
44 {
45   vl_api_gre_tunnel_type_t type;
46   vl_api_tunnel_mode_t mode;
47   u16 session_id;
48   u32 instance;
49   u32 outer_table_id;
50   vl_api_interface_index_t sw_if_index;
51   vl_api_address_t src;
52   vl_api_address_t dst;
53 };
54
55 define gre_tunnel_add_del
56 {
57   u32 client_index;
58   u32 context;
59   bool is_add;
60   vl_api_gre_tunnel_t tunnel;
61 };
62
63 define gre_tunnel_add_del_reply
64 {
65   u32 context;
66   i32 retval;
67   vl_api_interface_index_t sw_if_index;
68 };
69
70 define gre_tunnel_dump
71 {
72   u32 client_index;
73   u32 context;
74   vl_api_interface_index_t sw_if_index;
75 };
76
77 define gre_tunnel_details
78 {
79   u32 context;
80   vl_api_gre_tunnel_t tunnel;
81 };
82
83 /*
84  * Local Variables:
85  * eval: (c-set-style "gnu")
86  * End:
87  */