summaryrefslogtreecommitdiff
path: root/opentracker.c
diff options
context:
space:
mode:
Diffstat (limited to 'opentracker.c')
-rw-r--r--opentracker.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/opentracker.c b/opentracker.c
index 354e837..8a39bde 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -24,17 +24,17 @@
24/* Libowfat */ 24/* Libowfat */
25#include "io.h" 25#include "io.h"
26#include "iob.h" 26#include "iob.h"
27#include "ip6.h"
28#include "socket.h" 27#include "socket.h"
29 28
30/* Opentracker */ 29/* Opentracker */
31#include "ot_accesslist.h" 30#include "ot_accesslist.h"
32#include "ot_hex.h" 31#include "ot_hex.h"
33#include "ot_http.h" 32#include "ot_http.h"
33#include "ot_ip.h"
34#include "ot_livesync.h" 34#include "ot_livesync.h"
35#include "ot_mutex.h" 35#include "ot_mutex.h"
36#include "ot_scan.h"
37#include "ot_random.h" 36#include "ot_random.h"
37#include "ot_scan.h"
38#include "ot_stats.h" 38#include "ot_stats.h"
39#include "ot_udp.h" 39#include "ot_udp.h"
40#include "trackerlogic.h" 40#include "trackerlogic.h"
@@ -346,7 +346,7 @@ static int64_t ot_try_bind(ot_ip6 ip, uint16_t port, PROTO_FLAG proto) {
346 char *protos[] = {"TCP", "UDP", "UDP mcast"}; 346 char *protos[] = {"TCP", "UDP", "UDP mcast"};
347 char _debug[512]; 347 char _debug[512];
348 int off = snprintf(_debug, sizeof(_debug), "Binding socket type %s to address [", protos[proto]); 348 int off = snprintf(_debug, sizeof(_debug), "Binding socket type %s to address [", protos[proto]);
349 off += fmt_ip6c(_debug + off, ip); 349 off += ip_format(_debug + off, ip);
350 snprintf(_debug + off, sizeof(_debug) - off, "]:%d...", port); 350 snprintf(_debug + off, sizeof(_debug) - off, "]:%d...", port);
351 fputs(_debug, stderr); 351 fputs(_debug, stderr);
352 } 352 }
@@ -394,14 +394,14 @@ static int scan_ip6_port(const char *src, ot_ip6 ip, uint16_t *port) {
394 ++s; 394 ++s;
395 if (*s == '[') 395 if (*s == '[')
396 ++s, ++bracket; /* for v6 style notation */ 396 ++s, ++bracket; /* for v6 style notation */
397 if (!(off = scan_ip6(s, ip))) 397 if (!(off = ip_scan(s, ip)))
398 return 0; 398 return 0;
399 s += off; 399 s += off;
400 if (bracket && *s == ']') 400 if (bracket && *s == ']')
401 ++s; 401 ++s;
402 if (*s == 0 || isspace(*s)) 402 if (*s == 0 || isspace(*s))
403 return s - src; 403 return s - src;
404 if (!ip6_isv4mapped(ip)) { 404 if (!ip_is_v4mapped(ip)) {
405 if (*s != ':' && *s != '.') 405 if (*s != ':' && *s != '.')
406 return 0; 406 return 0;
407 if (!bracket && *(s) == ':') 407 if (!bracket && *(s) == ':')
@@ -423,7 +423,7 @@ static int scan_ip6_net(const char *src, ot_net *net) {
423 int off; 423 int off;
424 while (isspace(*s)) 424 while (isspace(*s))
425 ++s; 425 ++s;
426 if (!(off = scan_ip6(s, net->address))) 426 if (!(off = ip_scan(s, net->address)))
427 return 0; 427 return 0;
428 s += off; 428 s += off;
429 if (*s != '/') 429 if (*s != '/')
@@ -433,7 +433,7 @@ static int scan_ip6_net(const char *src, ot_net *net) {
433 if (!(off = scan_udec(s, &value, 128))) 433 if (!(off = scan_udec(s, &value, 128)))
434 return 0; 434 return 0;
435 net->bits = (int)value; 435 net->bits = (int)value;
436 if (ip6_isv4mapped(net->address)) 436 if (ip_is_v4mapped(net->address))
437 net->bits += 96; 437 net->bits += 96;
438 if (net->bits > 128) 438 if (net->bits > 128)
439 return 0; 439 return 0;
@@ -761,7 +761,7 @@ int main(int argc, char **argv) {
761 scanon = 0; 761 scanon = 0;
762 break; 762 break;
763 case 'i': 763 case 'i':
764 if (!scan_ip6(optarg, serverip)) { 764 if (!ip_scan(optarg, serverip)) {
765 usage(argv[0]); 765 usage(argv[0]);
766 exit(1); 766 exit(1);
767 } 767 }