2 * Copyright (c) 2017 Intel 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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 option version = "2.1.0";
17 import "vnet/interface_types.api";
18 import "vnet/ip/ip_types.api";
20 enum gtpu_forwarding_type
22 GTPU_API_FORWARDING_NONE = 0,
23 GTPU_API_FORWARDING_BAD_HEADER = 1,
24 GTPU_API_FORWARDING_UNKNOWN_TEID = 2,
25 GTPU_API_FORWARDING_UNKNOWN_TYPE = 4,
28 enum gtpu_decap_next_type
30 GTPU_API_DECAP_NEXT_DROP = 0,
31 GTPU_API_DECAP_NEXT_L2 = 1,
32 GTPU_API_DECAP_NEXT_IP4 = 2,
33 GTPU_API_DECAP_NEXT_IP6 = 3,
36 typedef sw_if_counters
44 /** \brief Create or delete a GTPU tunnel
45 @param client_index - opaque cookie to identify the sender
46 @param context - sender context, to match reply w/ request
47 @param is_add - add address if non-zero, else delete
48 @param src_address - GTPU tunnel's source address.
49 @param dst_address - GTPU tunnel's destination address.
50 @param mcast_sw_if_index - version, O-bit and C-bit (see nsh_packet.h)
51 @param encap_vrf_id - fib identifier used for outgoing encapsulated packets
52 @param decap_next_index - the index of the next node if success
53 @param teid - Local (rx) Tunnel Endpoint Identifier
54 @param tteid - Remote (tx) Tunnel Endpoint Identifier
56 define gtpu_add_del_tunnel
61 vl_api_address_t src_address;
62 vl_api_address_t dst_address;
63 vl_api_interface_index_t mcast_sw_if_index;
68 option vat_help = "src <ip-addr> {dst <ip-addr> | group <mcast-ip-addr> {<intfc> | mcast_sw_if_index <nn>}} teid <nn> [tteid <nn>] [encap-vrf-id <nn>] [decap-next <l2|nn>] [del]";
71 /** \brief reply for set or delete an GTPU tunnel
72 @param context - sender context, to match reply w/ request
73 @param retval - return code
74 @param sw_if_index - software index of the interface
76 define gtpu_add_del_tunnel_reply
80 vl_api_interface_index_t sw_if_index;
83 /** \brief Create or delete a GTPU tunnel
84 @param client_index - opaque cookie to identify the sender
85 @param context - sender context, to match reply w/ request
86 @param is_add - add address if non-zero, else delete
87 @param src_address - GTPU tunnel's source address.
88 @param dst_address - GTPU tunnel's destination address.
89 @param mcast_sw_if_index - version, O-bit and C-bit (see nsh_packet.h)
90 @param encap_vrf_id - fib identifier used for outgoing encapsulated packets
91 @param decap_next_index - the index of the next node if success
92 @param teid - Local (rx) Tunnel Endpoint Identifier
93 @param tteid - Remote (tx) Tunnel Endpoint Identifier
94 @param pdu_extension - add PDU session container extension to each packet
95 @param qfi - the QFI to set in the PDU session container, 6 bits only
97 define gtpu_add_del_tunnel_v2
102 vl_api_address_t src_address;
103 vl_api_address_t dst_address;
104 vl_api_interface_index_t mcast_sw_if_index;
106 vl_api_gtpu_decap_next_type_t decap_next_index;
111 option vat_help = "src <ip-addr> {dst <ip-addr> | group <mcast-ip-addr> {<intfc> | mcast_sw_if_index <nn>}} teid <nn> [tteid <nn>] [encap-vrf-id <nn>] [decap-next <l2|nn>] [qfi <nn>] [del]";
115 /** \brief reply for set or delete an GTPU tunnel
116 @param context - sender context, to match reply w/ request
117 @param retval - return code
118 @param sw_if_index - software index of the interface
119 @param counters - Number of packets/bytes that is sent/received via this tunnel. Inaccurate (with in flight packets), sum for the entire set of per-thread counters. Zero for new tunnels.
121 define gtpu_add_del_tunnel_v2_reply
125 vl_api_interface_index_t sw_if_index;
126 vl_api_sw_if_counters_t counters;
130 /** \brief Update GTPU tunnel TX TEID
131 @param client_index - opaque cookie to identify the sender
132 @param context - sender context, to match reply w/ request
133 @param dst_address - GTPU tunnel's destination address.
134 @param encap_vrf_id - fib identifier used for outgoing encapsulated packets
135 @param teid - Local (rx) Tunnel Endpoint Identifier
136 @param tteid - remote (tx) Tunnel Endpoint Identifier
138 autoreply define gtpu_tunnel_update_tteid
142 vl_api_address_t dst_address;
146 option vat_help = "dst <ip-addr> teid <nn> tteid <nn> [encap-vrf-id <nn>]";
149 /** \brief Dump GTPU tunnel
150 @param client_index - opaque cookie to identify the sender
151 @param context - sender context, to match reply w/ request
152 @param sw_if_index - software index of the interface
154 define gtpu_tunnel_dump
158 vl_api_interface_index_t sw_if_index;
159 option vat_help = "[<intfc> | sw_if_index <nn>]";
162 /** \brief dump details of an GTPU tunnel
163 @param context - sender context, to match reply w/ request
164 @param sw_if_index - software index of the interface
165 @param src_address - GTPU tunnel's source address.
166 @param dst_address - GTPU tunnel's destination address.
167 @param mcast_sw_if_index - version, O-bit and C-bit (see nsh_packet.h)
168 @param encap_vrf_id - fib identifier used for outgoing encapsulated packets
169 @param decap_next_index - the index of the next node if success
170 @param teid - Local (rx) Tunnel Endpoint Identifier
171 @param tteid - Remote (tx) Tunnel Endpoint Identifier
173 define gtpu_tunnel_details
176 vl_api_interface_index_t sw_if_index;
177 vl_api_address_t src_address;
178 vl_api_address_t dst_address;
179 vl_api_interface_index_t mcast_sw_if_index;
181 u32 decap_next_index;
187 /** \brief Dump GTPU tunnel
188 @param client_index - opaque cookie to identify the sender
189 @param context - sender context, to match reply w/ request
190 @param sw_if_index - software index of the interface
192 define gtpu_tunnel_v2_dump
196 vl_api_interface_index_t sw_if_index;
197 option vat_help = "[<intfc> | sw_if_index <nn>]";
201 /** \brief dump details of an GTPU tunnel
202 @param context - sender context, to match reply w/ request
203 @param sw_if_index - software index of the interface
204 @param src_address - GTPU tunnel's source address.
205 @param dst_address - GTPU tunnel's destination address.
206 @param mcast_sw_if_index - version, O-bit and C-bit (see nsh_packet.h)
207 @param encap_vrf_id - fib identifier used for outgoing encapsulated packets
208 @param decap_next_index - the index of the next node if success
209 @param teid - Local (rx) Tunnel Endpoint Identifier
210 @param tteid - Remote (tx) Tunnel Endpoint Identifier
211 @param pdu_extension - add PDU session container extension to each packet
212 @param qfi - the QFI to set in the PDU session container, 6 bits only
213 @param is_forwarding - tunnel used for forwarding packets
214 @param forwarding_type - the type of packets forwarded
215 @param counters - Number of packets/bytes that is sent/received via this tunnel. Inaccurate (with in flight packets), sum for the entire set of per-thread counters.
217 define gtpu_tunnel_v2_details
220 vl_api_interface_index_t sw_if_index;
221 vl_api_address_t src_address;
222 vl_api_address_t dst_address;
223 vl_api_interface_index_t mcast_sw_if_index;
225 vl_api_gtpu_decap_next_type_t decap_next_index;
231 vl_api_gtpu_forwarding_type_t forwarding_type;
232 vl_api_sw_if_counters_t counters;
236 /** \brief Interface set gtpu-bypass request
237 @param client_index - opaque cookie to identify the sender
238 @param context - sender context, to match reply w/ request
239 @param sw_if_index - interface used to reach neighbor
240 @param is_ipv6 - if non-zero, enable ipv6-gtpu-bypass, else ipv4-gtpu-bypass
241 @param enable - if non-zero enable, else disable
243 autoreply define sw_interface_set_gtpu_bypass
247 vl_api_interface_index_t sw_if_index;
250 option vat_help = "<intfc> | sw_if_index <id> [ip4 | ip6] [enable | disable]";
253 /** \brief Offload gtpu rx request
254 @param client_index - opaque cookie to identify the sender
255 @param context - sender context, to match reply w/ request
256 @param hw_if_index - rx hw interface
257 @param sw_if_index - gtpu interface to offload
258 @param enable - if non-zero enable, else disable
260 autoreply define gtpu_offload_rx
267 option vat_help = "hw <intfc> rx <tunnel-name> [del]";
270 /** \brief Set gtpu-forward request
271 @param client_index - opaque cookie to identify the sender
272 @param context - sender context, to match reply w/ request
273 @param is_add - add address if non-zero, else delete
274 @param forwarding_type - forward filter (unknown teid, unknown message type or unknown header)
275 @param dst_address - forward destination address.
276 @param encap_vrf_id - fib identifier used for outgoing packets
277 @param decap_next_index - the index of the next node if success
279 define gtpu_add_del_forward
284 vl_api_address_t dst_address;
285 vl_api_gtpu_forwarding_type_t forwarding_type;
287 vl_api_gtpu_decap_next_type_t decap_next_index;
288 option vat_help = "dst <ip-addr> {bad-header|unknown-teid|unknown-type} [decap-next <l2|nn>] [del]";
292 /** \brief reply for set or delete GTPU forwarding
293 @param context - sender context, to match reply w/ request
294 @param retval - return code
295 @param sw_if_index - software index of the interface
297 define gtpu_add_del_forward_reply
301 vl_api_interface_index_t sw_if_index;
305 /** \brief Get list of metrics, use for bulk transfer.
306 @param client_index - opaque cookie to identify the sender
307 @param context - sender context, to match reply w/ request
308 @param sw_if_index_start - software index of the first interface to return data on.
309 @param capacity - max number of interfaces returned.
311 define gtpu_get_transfer_counts
315 vl_api_interface_index_t sw_if_index_start;
317 //option vat_help = "start_index <sw_if_index> count <nn>";
321 /** \brief reply for set or delete GTPU forwarding
322 @param context - sender context, to match reply w/ request
323 @param retval - return code
324 @param count - number of tunnel counters returned, sequential starting at sw_if_index_start.
325 @param tunnels - Number of packets/bytes that is sent/received via this tunnel. Inaccurate (with in flight packets), sum for the entire set of per-thread counters.
327 typedef tunnel_metrics
329 vl_api_interface_index_t sw_if_index;
331 vl_api_sw_if_counters_t counters;
334 define gtpu_get_transfer_counts_reply
339 vl_api_tunnel_metrics_t tunnels[count];
345 * eval: (c-set-style "gnu")