From d61aefe2fc4d8549f459bdfc2749c9f163449ebc Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 24 Oct 2026 17:23:32 +0200 Subject: Replace libowfat's ip scanner and formatters with own own --- ot_stats.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'ot_stats.c') diff --git a/ot_stats.c b/ot_stats.c index d43f29c..62c59c9 100644 --- a/ot_stats.c +++ b/ot_stats.c @@ -18,13 +18,12 @@ /* Libowfat */ #include "io.h" -#include "ip4.h" -#include "ip6.h" /* Opentracker */ #include "ot_accesslist.h" #include "ot_hex.h" #include "ot_iovec.h" +#include "ot_ip.h" #include "ot_mutex.h" #include "ot_stats.h" #include "trackerlogic.h" @@ -206,7 +205,7 @@ static size_t stats_return_busy_networks(char *reply, stats_network_node *tree, if (scores[i - 1]) { r += sprintf(r, "%08zd: ", scores[i - 1]); // #ifdef WANT_V6 - r += fmt_ip6c(r, networks[i - 1]); + r += ip_format(r, networks[i - 1]); #if 0 // XXX r += fmt_ip4( r, networks[i - 1]); @@ -470,7 +469,7 @@ static void stats_return_fulllog(size_t *iovec_entries, struct iovec **iovector, re = r + 32 * OT_STATS_TMPSIZE; } r += sprintf(r, "%08ld: ", loglist->time); - r += fmt_ip6c(r, loglist->ip); + r += ip_format(r, loglist->ip); *r++ = '\n'; memcpy(r, loglist->data, loglist->size); r += loglist->size; @@ -663,7 +662,7 @@ void stats_issue_event(ot_status_event event, PROTO_FLAG proto, uintptr_t event_ *peerid_hex = 0; } - ip_readable[fmt_ip6c(ip_readable, (char *)&ws->peer)] = 0; + ip_readable[ip_format(ip_readable, (char *)&ws->peer)] = 0; #if 0 /* XXX */ ip_readable[ fmt_ip4( ip_readable, (char*)&ws->peer ) ] = 0; @@ -687,7 +686,7 @@ void stats_issue_event(ot_status_event event, PROTO_FLAG proto, uintptr_t event_ ot_ip6 *ip = (ot_ip6 *)event_data; /* ugly hack to transfer ip to stats */ char _debug[512]; int off = snprintf(_debug, sizeof(_debug), "[%08d] scrp: ", (unsigned int)(g_now_seconds - ot_start_time) / 60); - off += fmt_ip6c(_debug + off, *ip); + off += ip_format(_debug + off, *ip); off += snprintf(_debug + off, sizeof(_debug) - off, " - FULL SCRAPE\n"); (void)write(2, _debug, off); ot_full_scrape_request_count++; @@ -696,7 +695,7 @@ void stats_issue_event(ot_status_event event, PROTO_FLAG proto, uintptr_t event_ ot_ip6 *ip = (ot_ip6 *)event_data; /* ugly hack to transfer ip to stats */ char _debug[512]; int off = snprintf(_debug, sizeof(_debug), "[%08d] scrp: ", (unsigned int)(g_now_seconds - ot_start_time) / 60); - off += fmt_ip6c(_debug + off, *ip); + off += ip_format(_debug + off, *ip); off += snprintf(_debug + off, sizeof(_debug) - off, " - FULL SCRAPE\n"); (void)write(2, _debug, off); ot_full_scrape_request_count++; -- cgit v1.3