diff options
author | Coren[m] <Break@Ocean> | 2013-09-10 16:36:20 +0200 |
---|---|---|
committer | Coren[m] <Break@Ocean> | 2013-09-10 16:36:20 +0200 |
commit | bcb283cf4512f36b189ce2d49eb040c205cbc778 (patch) | |
tree | b0678f9acf245e5620d21c046265a7b3ad98c561 /other/DHT_bootstrap.c | |
parent | bcf251ac3190db4230d42be97b539e4df3af736f (diff) |
big push, putting all the infrastructure in place behind TOX_ENABLE_IPV6
Diffstat (limited to 'other/DHT_bootstrap.c')
-rw-r--r-- | other/DHT_bootstrap.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/other/DHT_bootstrap.c b/other/DHT_bootstrap.c index bc0c592a..7355ca10 100644 --- a/other/DHT_bootstrap.c +++ b/other/DHT_bootstrap.c | |||
@@ -81,10 +81,14 @@ void manage_keys(DHT *dht) | |||
81 | 81 | ||
82 | int main(int argc, char *argv[]) | 82 | int main(int argc, char *argv[]) |
83 | { | 83 | { |
84 | /* let use decide by cmdline: TODO */ | ||
85 | uint8_t ipv6enabled = TOX_ENABLE_IPV6_DEFAULT; | ||
86 | |||
84 | /* Initialize networking - | 87 | /* Initialize networking - |
85 | Bind to ip 0.0.0.0:PORT */ | 88 | Bind to ip 0.0.0.0:PORT */ |
86 | IP4 ip; | 89 | IP ip; |
87 | ip.uint32 = 0; | 90 | ip_init(&ip, ipv6enabled); |
91 | |||
88 | DHT *dht = new_DHT(new_net_crypto(new_networking(ip, PORT))); | 92 | DHT *dht = new_DHT(new_net_crypto(new_networking(ip, PORT))); |
89 | manage_keys(dht); | 93 | manage_keys(dht); |
90 | printf("Public key: "); | 94 | printf("Public key: "); |
@@ -110,11 +114,8 @@ int main(int argc, char *argv[]) | |||
110 | 114 | ||
111 | if (argc > 3) { | 115 | if (argc > 3) { |
112 | printf("Trying to bootstrap into the network...\n"); | 116 | printf("Trying to bootstrap into the network...\n"); |
113 | IP_Port bootstrap_info; | ||
114 | bootstrap_info.ip.uint32 = inet_addr(argv[1]); | ||
115 | bootstrap_info.port = htons(atoi(argv[2])); | ||
116 | uint8_t *bootstrap_key = hex_string_to_bin(argv[3]); | 117 | uint8_t *bootstrap_key = hex_string_to_bin(argv[3]); |
117 | DHT_bootstrap(dht, bootstrap_info, bootstrap_key); | 118 | DHT_bootstrap_ex(dht, argv[1], ipv6enabled, htons(atoi(argv[2])), bootstrap_key); |
118 | free(bootstrap_key); | 119 | free(bootstrap_key); |
119 | } | 120 | } |
120 | 121 | ||