2 * Copyright (c) 2018 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:
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.
17 #include <vlibapi/api.h>
18 #include <vlibmemory/api.h>
19 #include <vnet/format_fns.h>
20 #include <vnet/ip/ip_types_api.h>
22 clib_error_t * vxlan_gpe_ioam_export_vat_plugin_register (vat_main_t * vam);
23 clib_error_t * pot_vat_plugin_register (vat_main_t *vam);
24 clib_error_t * trace_vat_plugin_register (vat_main_t * vam);
25 clib_error_t * vxlan_gpe_vat_plugin_register (vat_main_t * vam);
26 clib_error_t * udp_ping_vat_plugin_register (vat_main_t * vam);
27 clib_error_t * ioam_export_vat_plugin_register (vat_main_t * vam);
30 vat_plugin_register (vat_main_t *vam)
34 if ((err = pot_vat_plugin_register (vam)))
37 if ((err = vxlan_gpe_ioam_export_vat_plugin_register (vam)))
40 if ((err = trace_vat_plugin_register (vam)))
43 if ((err = vxlan_gpe_vat_plugin_register(vam)))
46 if ((err = udp_ping_vat_plugin_register (vam)))
49 if ((err = ioam_export_vat_plugin_register (vam)))
54 uword unformat_ip46_address (unformat_input_t * input, va_list * args)
56 ip46_address_t *ip46 = va_arg (*args, ip46_address_t *);
57 ip46_type_t type = va_arg (*args, ip46_type_t);
58 if ((type != IP46_TYPE_IP6) &&
59 unformat(input, "%U", unformat_ip4_address, &ip46->ip4)) {
60 ip46_address_mask_ip4(ip46);
62 } else if ((type != IP46_TYPE_IP4) &&
63 unformat(input, "%U", unformat_ip6_address, &ip46->ip6)) {