Line data Source code
1 : /* 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: 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 : #include <vat/vat.h> 17 : #include <vlibapi/api.h> 18 : #include <vlibmemory/api.h> 19 : #include <vnet/format_fns.h> 20 : #include <vnet/ip/ip_types_api.h> 21 : 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); 28 : 29 : clib_error_t * 30 559 : vat_plugin_register (vat_main_t *vam) 31 : { 32 : clib_error_t *err; 33 : 34 559 : if ((err = pot_vat_plugin_register (vam))) 35 0 : return err; 36 : 37 559 : if ((err = vxlan_gpe_ioam_export_vat_plugin_register (vam))) 38 0 : return err; 39 : 40 559 : if ((err = trace_vat_plugin_register (vam))) 41 0 : return err; 42 : 43 559 : if ((err = vxlan_gpe_vat_plugin_register(vam))) 44 0 : return err; 45 : 46 559 : if ((err = udp_ping_vat_plugin_register (vam))) 47 0 : return err; 48 : 49 559 : if ((err = ioam_export_vat_plugin_register (vam))) 50 0 : return err; 51 : 52 559 : return 0; 53 : } 54 0 : uword unformat_ip46_address (unformat_input_t * input, va_list * args) 55 : { 56 0 : ip46_address_t *ip46 = va_arg (*args, ip46_address_t *); 57 0 : ip46_type_t type = va_arg (*args, ip46_type_t); 58 0 : if ((type != IP46_TYPE_IP6) && 59 0 : unformat(input, "%U", unformat_ip4_address, &ip46->ip4)) { 60 0 : ip46_address_mask_ip4(ip46); 61 0 : return 1; 62 0 : } else if ((type != IP46_TYPE_IP4) && 63 0 : unformat(input, "%U", unformat_ip6_address, &ip46->ip6)) { 64 0 : return 1; 65 : } 66 0 : return 0; 67 : }