summaryrefslogtreecommitdiff
path: root/testing/nTox.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/nTox.c')
-rw-r--r--testing/nTox.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/testing/nTox.c b/testing/nTox.c
index 438468bd..6084aeda 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -537,6 +537,9 @@ void print_help(void)
537 537
538int main(int argc, char *argv[]) 538int main(int argc, char *argv[])
539{ 539{
540 /* let use decide by cmdline: TODO */
541 uint8_t ipv6enabled = TOX_ENABLE_IPV6_DEFAULT;
542
540 int on = 0; 543 int on = 0;
541 int c = 0; 544 int c = 0;
542 int i = 0; 545 int i = 0;
@@ -566,7 +569,7 @@ int main(int argc, char *argv[])
566 } 569 }
567 } 570 }
568 571
569 m = tox_new(); 572 m = tox_new_ex(ipv6enabled);
570 573
571 if ( !m ) { 574 if ( !m ) {
572 fputs("Failed to allocate Messenger datastructure", stderr); 575 fputs("Failed to allocate Messenger datastructure", stderr);
@@ -590,20 +593,12 @@ int main(int argc, char *argv[])
590 new_lines(idstring); 593 new_lines(idstring);
591 strcpy(line, ""); 594 strcpy(line, "");
592 595
593 tox_IP_Port bootstrap_ip_port; 596 uint16_t port = htons(atoi(argv[2]));
594 bootstrap_ip_port.port = htons(atoi(argv[2]));
595 int resolved_address = resolve_addr(argv[1]);
596
597 if (resolved_address != 0)
598 bootstrap_ip_port.ip.i = resolved_address;
599 else
600 exit(1);
601
602 unsigned char *binary_string = hex_string_to_bin(argv[3]); 597 unsigned char *binary_string = hex_string_to_bin(argv[3]);
603 tox_bootstrap(m, bootstrap_ip_port, binary_string); 598 tox_bootstrap_ex(m, argv[1], ipv6enabled, port, binary_string);
604 free(binary_string); 599 free(binary_string);
605 nodelay(stdscr, TRUE);
606 600
601 nodelay(stdscr, TRUE);
607 while (1) { 602 while (1) {
608 if (on == 0 && tox_isconnected(m)) { 603 if (on == 0 && tox_isconnected(m)) {
609 new_lines("[i] connected to DHT\n[i] define username with /n"); 604 new_lines("[i] connected to DHT\n[i] define username with /n");