From 3708022dfa24cf250cb34f0d5e5f990711f91d1b Mon Sep 17 00:00:00 2001 From: Henning Westerholt Date: Mon, 23 Mar 2020 15:05:51 +0100 Subject: [PATCH] Revert "core: add new function buf_print_ip(..) to print an IP address to an buffer" This reverts commit 4acca8ad2f31f465b08f15d98cc4780236e2beb0. --- src/core/ip_addr.c | 29 ----------------------------- src/core/ip_addr.h | 2 -- 2 files changed, 31 deletions(-) diff --git a/src/core/ip_addr.c b/src/core/ip_addr.c index 82f746e0d6b..9989063fff0 100644 --- a/src/core/ip_addr.c +++ b/src/core/ip_addr.c @@ -274,35 +274,6 @@ void stdout_print_ip(struct ip_addr* ip) } -void buf_print_ip(char *buf, struct ip_addr* ip, unsigned int len) -{ - if (len < INET6_ADDRSTRLEN) { - LM_ERR("insufficent buffer length\n"); - return; - } - switch(ip->af){ - case AF_INET: - snprintf(buf, len, "%d.%d.%d.%d", ip->u.addr[0], - ip->u.addr[1], - ip->u.addr[2], - ip->u.addr[3]); - break; - case AF_INET6: - snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x", htons(ip->u.addr16[0]), - htons(ip->u.addr16[1]), - htons(ip->u.addr16[2]), - htons(ip->u.addr16[3]), - htons(ip->u.addr16[4]), - htons(ip->u.addr16[5]), - htons(ip->u.addr16[6]), - htons(ip->u.addr16[7]) - ); - break; - default: - snprintf(buf, len, "warning unknown address family %d\n", ip->af); - } -} - void print_net(struct net* net) { diff --git a/src/core/ip_addr.h b/src/core/ip_addr.h index 896d4b757eb..9a7b67ac5da 100644 --- a/src/core/ip_addr.h +++ b/src/core/ip_addr.h @@ -265,8 +265,6 @@ int mk_net_str(struct net* dst, str* s); void print_ip(char* prefix, struct ip_addr* ip, char* suffix); void stdout_print_ip(struct ip_addr* ip); -void buf_print_ip(char *buf, struct ip_addr* ip, unsigned int len); - void print_net(struct net* net); char* get_proto_name(unsigned int proto);