Line data Source code
1 : /* SPDX-License-Identifier: BSD-2-Clause 2 : * Copyright(c) HCL TECHNOLOGIES LTD 3 : * Submitted on behalf of a third-party: Intel Corporation, a 4 : * Delaware corporation, having its principal place of business 5 : * at 2200 Mission College Boulevard, 6 : * Santa Clara, California 95052, USA 7 : */ 8 : 9 : #include <string.h> 10 : #include <inttypes.h> 11 : #include "vr_dpdk_n3k_ip.h" 12 : 13 : const char * 14 56 : vr_dpdk_n3k_convert_ip_to_str(char *buff, const union vr_n3k_ip *addr, 15 : const enum vr_n3k_ip_type ip_type) 16 : { 17 56 : if (ip_type == VR_N3K_IP_TYPE_IPV4) 18 28 : sprintf(buff, IPV4_FORMAT, IPV4_VALUE(&addr->ipv4)); 19 : else 20 28 : sprintf(buff, IPV6_FORMAT, IPV6_VALUE(addr->ipv6)); 21 56 : return buff; 22 : }