07ee3d7bf77c37e2907bd75312256b52fa18e61f
[vpp.git] / src / vnet / lisp-gpe / lisp_gpe.api
1 /*
2  * Copyright (c) 2015-2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 /** \brief GPE locator structure
17     @param is_ip4 - whether addr is IPv4 or v6
18     @param weight - locator weight
19     @param addr - IPv4/6 address
20 */
21 typeonly manual_print manual_endian define gpe_locator
22 {
23   u8 is_ip4;
24   u8 weight;
25   u8 addr[16];
26 };
27
28 /** \brief add or delete GPE tunnel
29     @param client_index - opaque cookie to identify the sender
30     @param context - sender context, to match reply w/ request
31     @param is_add - add address if non-zero, else delete
32     @param eid_type -
33       0 : ipv4
34       1 : ipv6
35       2 : mac
36     @param rmt_eid - remote eid
37     @param lcl_eid - local eid
38     @param rmt_len - remote prefix len
39     @param lcl_len - local prefix len
40     @param vni - virtual network identifier
41     @param dp_table - vrf/bridge domain id
42     @param action - negative action when 0 locators configured
43     @param loc_num - number of locators
44     @param locs - array of remote locators
45 */
46 manual_print manual_endian define gpe_add_del_fwd_entry
47 {
48   u32 client_index;
49   u32 context;
50   u8 is_add;
51   u8 eid_type;
52   u8 rmt_eid[16];
53   u8 lcl_eid[16];
54   u8 rmt_len;
55   u8 lcl_len;
56   u32 vni;
57   u32 dp_table;
58   u8 action;
59   u32 loc_num;
60   vl_api_gpe_locator_t locs[loc_num];
61 };
62
63 define gpe_add_del_fwd_entry_reply
64 {
65   i32 retval;
66   u32 context;
67   u32 fwd_entry_index;
68 };
69
70 /** \brief enable or disable gpe protocol
71     @param client_index - opaque cookie to identify the sender
72     @param context - sender context, to match reply w/ request
73     @param is_en - enable protocol if non-zero, else disable
74 */
75 autoreply define gpe_enable_disable
76 {
77   u32 client_index;
78   u32 context;
79   u8 is_en;
80 };
81
82 /** \brief add or delete gpe_iface
83     @param client_index - opaque cookie to identify the sender
84     @param context - sender context, to match reply w/ request
85     @param is_add - add address if non-zero, else delete
86 */
87 autoreply define gpe_add_del_iface
88 {
89   u32 client_index;
90   u32 context;
91   u8 is_add;
92   u8 is_l2;
93   u32 dp_table;
94   u32 vni;
95 };
96
97 define gpe_fwd_entry_vnis_get
98 {
99   u32 client_index;
100   u32 context;
101 };
102
103 manual_print manual_endian define gpe_fwd_entry_vnis_get_reply
104 {
105   u32 context;
106   i32 retval;
107   u32 count;
108   u32 vnis[count];
109 };
110
111 define gpe_fwd_entries_get
112 {
113   u32 client_index;
114   u32 context;
115   u32 vni;
116 };
117
118 typeonly manual_print manual_endian define gpe_fwd_entry
119 {
120   u32 fwd_entry_index;
121   u32 dp_table;
122   u8 eid_type;
123   u8 leid_prefix_len;
124   u8 reid_prefix_len;
125   u8 leid[16];
126   u8 reid[16];
127   u32 vni;
128   u8 action;
129 };
130
131 manual_print manual_endian define gpe_fwd_entries_get_reply
132 {
133   u32 context;
134   i32 retval;
135   u32 count;
136   vl_api_gpe_fwd_entry_t entries[count];
137 };
138
139 define gpe_fwd_entry_path_dump
140 {
141   u32 client_index;
142   u32 context;
143   u32 fwd_entry_index;
144 };
145
146 manual_endian manual_print define gpe_fwd_entry_path_details
147 {
148   u32 client_index;
149   u32 context;
150   vl_api_gpe_locator_t lcl_loc;
151   vl_api_gpe_locator_t rmt_loc;
152 };
153
154 /** \brief Set GPE encapsulation mode
155     @param client_index - opaque cookie to identify the sender
156     @param context - sender context, to match reply w/ request
157     @param mode - LISP (value 0) or VXLAN (value 1)
158 */
159 autoreply define gpe_set_encap_mode
160 {
161   u32 client_index;
162   u32 context;
163   u8 mode;
164 };
165
166 /** \brief get GPE encapsulation mode
167     @param client_index - opaque cookie to identify the sender
168     @param context - sender context, to match reply w/ request
169     @param mode - LISP (value 0) or VXLAN (value 1)
170 */
171 define gpe_get_encap_mode
172 {
173   u32 client_index;
174   u32 context;
175 };
176
177 /** \brief Reply for set_encap_mode
178     @param context - returned sender context, to match reply w/ request
179     @param retval - return code
180     @param encap_mode - GPE encapsulation mode
181 */
182 define gpe_get_encap_mode_reply
183 {
184   u32 context;
185   i32 retval;
186   u8 encap_mode;
187 };
188
189 /** \brief Add native fwd rpath
190     @param context - returned sender context, to match reply w/ request
191     @param retval - return code
192     @param is_add - flag to indicate add or del
193     @param table_id - table id for route path
194     @param nh_sw_if_index - next-hop sw_if_index (~0 if not set)
195     @param is_ip4 - flag to indicate if nh is ip4
196     @param nh_addr - next hop ip address
197 */
198 autoreply define gpe_add_del_native_fwd_rpath
199 {
200   u32 client_index;
201   u32 context;
202   u8 is_add;
203   u32 table_id;
204   u32 nh_sw_if_index;
205   u8 is_ip4;
206   u8 nh_addr[16];
207 };
208
209 /** \brief get GPE native fwd rpath
210     @param client_index - opaque cookie to identify the sender
211     @param context - sender context, to match reply w/ request
212 */
213 define gpe_native_fwd_rpaths_get
214 {
215   u32 client_index;
216   u32 context;
217   u8 is_ip4;
218 };
219
220 /** \brief Reply for get native fwd rpath
221     @param context - returned sender context, to match reply w/ request
222     @param retval - return code
223     @param table_id - table id for route path
224     @param nh_sw_if_index - next-hop sw_if_index (~0 if not set)
225     @param nh_addr - next hop address
226 */
227 typeonly manual_print manual_endian define gpe_native_fwd_rpath
228 {
229   u32 fib_index;
230   u32 nh_sw_if_index;
231   u8 is_ip4;
232   u8 nh_addr[16];
233 };
234
235 manual_print manual_endian define gpe_native_fwd_rpaths_get_reply
236 {
237   u32 context;
238   i32 retval;
239   u32 count;
240   vl_api_gpe_native_fwd_rpath_t entries[count];
241 };
242
243 /*
244  * Local Variables:
245  * eval: (c-set-style "gnu")
246  * End:
247  */
248