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 --- opentracker.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'opentracker.c') diff --git a/opentracker.c b/opentracker.c index 354e837..8a39bde 100644 --- a/opentracker.c +++ b/opentracker.c @@ -24,17 +24,17 @@ /* Libowfat */ #include "io.h" #include "iob.h" -#include "ip6.h" #include "socket.h" /* Opentracker */ #include "ot_accesslist.h" #include "ot_hex.h" #include "ot_http.h" +#include "ot_ip.h" #include "ot_livesync.h" #include "ot_mutex.h" -#include "ot_scan.h" #include "ot_random.h" +#include "ot_scan.h" #include "ot_stats.h" #include "ot_udp.h" #include "trackerlogic.h" @@ -346,7 +346,7 @@ static int64_t ot_try_bind(ot_ip6 ip, uint16_t port, PROTO_FLAG proto) { char *protos[] = {"TCP", "UDP", "UDP mcast"}; char _debug[512]; int off = snprintf(_debug, sizeof(_debug), "Binding socket type %s to address [", protos[proto]); - off += fmt_ip6c(_debug + off, ip); + off += ip_format(_debug + off, ip); snprintf(_debug + off, sizeof(_debug) - off, "]:%d...", port); fputs(_debug, stderr); } @@ -394,14 +394,14 @@ static int scan_ip6_port(const char *src, ot_ip6 ip, uint16_t *port) { ++s; if (*s == '[') ++s, ++bracket; /* for v6 style notation */ - if (!(off = scan_ip6(s, ip))) + if (!(off = ip_scan(s, ip))) return 0; s += off; if (bracket && *s == ']') ++s; if (*s == 0 || isspace(*s)) return s - src; - if (!ip6_isv4mapped(ip)) { + if (!ip_is_v4mapped(ip)) { if (*s != ':' && *s != '.') return 0; if (!bracket && *(s) == ':') @@ -423,7 +423,7 @@ static int scan_ip6_net(const char *src, ot_net *net) { int off; while (isspace(*s)) ++s; - if (!(off = scan_ip6(s, net->address))) + if (!(off = ip_scan(s, net->address))) return 0; s += off; if (*s != '/') @@ -433,7 +433,7 @@ static int scan_ip6_net(const char *src, ot_net *net) { if (!(off = scan_udec(s, &value, 128))) return 0; net->bits = (int)value; - if (ip6_isv4mapped(net->address)) + if (ip_is_v4mapped(net->address)) net->bits += 96; if (net->bits > 128) return 0; @@ -761,7 +761,7 @@ int main(int argc, char **argv) { scanon = 0; break; case 'i': - if (!scan_ip6(optarg, serverip)) { + if (!ip_scan(optarg, serverip)) { usage(argv[0]); exit(1); } -- cgit v1.3