diff options
-rw-r--r-- | src/exit/gnunet-daemon-exit.c | 12 | ||||
-rw-r--r-- | src/gns/Makefile.am | 2 | ||||
-rw-r--r-- | src/gns/gnunet-service-gns_resolver.c | 6 | ||||
-rw-r--r-- | src/include/gnunet_tun_lib.h | 12 | ||||
-rw-r--r-- | src/regex/regex_api.c | 4 | ||||
-rw-r--r-- | src/tun/regex.c | 18 | ||||
-rw-r--r-- | src/vpn/Makefile.am | 5 | ||||
-rw-r--r-- | src/vpn/gnunet-vpn.c | 13 | ||||
-rw-r--r-- | src/vpn/vpn_api.c | 6 |
9 files changed, 57 insertions, 21 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c index 743b5bf31..6afb38fd9 100644 --- a/src/exit/gnunet-daemon-exit.c +++ b/src/exit/gnunet-daemon-exit.c | |||
@@ -787,7 +787,7 @@ store_service (struct GNUNET_CONTAINER_MultiHashMap *service_map, | |||
787 | char key[sizeof (struct GNUNET_HashCode) + sizeof (uint16_t)]; | 787 | char key[sizeof (struct GNUNET_HashCode) + sizeof (uint16_t)]; |
788 | struct GNUNET_HashCode desc; | 788 | struct GNUNET_HashCode desc; |
789 | 789 | ||
790 | GNUNET_CRYPTO_hash (name, strlen (name) + 1, &desc); | 790 | GNUNET_TUN_service_name_to_hash (name, &desc); |
791 | service->name = GNUNET_strdup (name); | 791 | service->name = GNUNET_strdup (name); |
792 | memcpy (&key[0], &destination_port, sizeof (uint16_t)); | 792 | memcpy (&key[0], &destination_port, sizeof (uint16_t)); |
793 | memcpy (&key[sizeof(uint16_t)], &desc, sizeof (struct GNUNET_HashCode)); | 793 | memcpy (&key[sizeof(uint16_t)], &desc, sizeof (struct GNUNET_HashCode)); |
@@ -3220,7 +3220,7 @@ add_services (int proto, | |||
3220 | if (NULL == (hostname = strstr (redirect, ":"))) | 3220 | if (NULL == (hostname = strstr (redirect, ":"))) |
3221 | { | 3221 | { |
3222 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 3222 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
3223 | "option `%s' for domain `%s' is not formatted correctly!\n", | 3223 | _("Option `%s' for domain `%s' is not formatted correctly!\n"), |
3224 | redirect, | 3224 | redirect, |
3225 | name); | 3225 | name); |
3226 | continue; | 3226 | continue; |
@@ -3230,7 +3230,7 @@ add_services (int proto, | |||
3230 | if (NULL == (hostport = strstr (hostname, ":"))) | 3230 | if (NULL == (hostport = strstr (hostname, ":"))) |
3231 | { | 3231 | { |
3232 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 3232 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
3233 | "option `%s' for domain `%s' is not formatted correctly!\n", | 3233 | _("Option `%s' for domain `%s' is not formatted correctly!\n"), |
3234 | redirect, | 3234 | redirect, |
3235 | name); | 3235 | name); |
3236 | continue; | 3236 | continue; |
@@ -3244,14 +3244,16 @@ add_services (int proto, | |||
3244 | if (!((local_port > 0) && (local_port < 65536))) | 3244 | if (!((local_port > 0) && (local_port < 65536))) |
3245 | { | 3245 | { |
3246 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 3246 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
3247 | "`%s' is not a valid port number (for domain `%s')!", redirect, | 3247 | _("`%s' is not a valid port number (for domain `%s')!"), |
3248 | redirect, | ||
3248 | name); | 3249 | name); |
3249 | continue; | 3250 | continue; |
3250 | } | 3251 | } |
3251 | if (!((remote_port > 0) && (remote_port < 65536))) | 3252 | if (!((remote_port > 0) && (remote_port < 65536))) |
3252 | { | 3253 | { |
3253 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 3254 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
3254 | "`%s' is not a valid port number (for domain `%s')!", hostport, | 3255 | _("`%s' is not a valid port number (for domain `%s')!"), |
3256 | hostport, | ||
3255 | name); | 3257 | name); |
3256 | continue; | 3258 | continue; |
3257 | } | 3259 | } |
diff --git a/src/gns/Makefile.am b/src/gns/Makefile.am index 36d50ac2e..79f5c0513 100644 --- a/src/gns/Makefile.am +++ b/src/gns/Makefile.am | |||
@@ -190,6 +190,7 @@ gnunet_service_gns_LDADD = \ | |||
190 | $(top_builddir)/src/dns/libgnunetdnsparser.la \ | 190 | $(top_builddir)/src/dns/libgnunetdnsparser.la \ |
191 | $(top_builddir)/src/dns/libgnunetdnsstub.la \ | 191 | $(top_builddir)/src/dns/libgnunetdnsstub.la \ |
192 | $(top_builddir)/src/dht/libgnunetdht.la \ | 192 | $(top_builddir)/src/dht/libgnunetdht.la \ |
193 | $(top_builddir)/src/tun/libgnunettun.la \ | ||
193 | $(top_builddir)/src/namecache/libgnunetnamecache.la \ | 194 | $(top_builddir)/src/namecache/libgnunetnamecache.la \ |
194 | $(top_builddir)/src/namestore/libgnunetnamestore.la \ | 195 | $(top_builddir)/src/namestore/libgnunetnamestore.la \ |
195 | $(USE_VPN) \ | 196 | $(USE_VPN) \ |
@@ -199,6 +200,7 @@ gnunet_service_gns_DEPENDENCIES = \ | |||
199 | $(top_builddir)/src/revocation/libgnunetrevocation.la \ | 200 | $(top_builddir)/src/revocation/libgnunetrevocation.la \ |
200 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 201 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
201 | $(top_builddir)/src/util/libgnunetutil.la \ | 202 | $(top_builddir)/src/util/libgnunetutil.la \ |
203 | $(top_builddir)/src/tun/libgnunettun.la \ | ||
202 | $(top_builddir)/src/dns/libgnunetdns.la \ | 204 | $(top_builddir)/src/dns/libgnunetdns.la \ |
203 | $(top_builddir)/src/dns/libgnunetdnsparser.la \ | 205 | $(top_builddir)/src/dns/libgnunetdnsparser.la \ |
204 | $(top_builddir)/src/dht/libgnunetdht.la \ | 206 | $(top_builddir)/src/dht/libgnunetdht.la \ |
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index 14e714a85..f046702e3 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include "gnunet_resolver_service.h" | 41 | #include "gnunet_resolver_service.h" |
42 | #include "gnunet_revocation_service.h" | 42 | #include "gnunet_revocation_service.h" |
43 | #include "gnunet_dnsparser_lib.h" | 43 | #include "gnunet_dnsparser_lib.h" |
44 | #include "gnunet_tun_lib.h" | ||
44 | #include "gnunet_gns_service.h" | 45 | #include "gnunet_gns_service.h" |
45 | #include "gns.h" | 46 | #include "gns.h" |
46 | #include "gnunet-service-gns_resolver.h" | 47 | #include "gnunet-service-gns_resolver.h" |
@@ -1413,9 +1414,8 @@ handle_gns_resolution_result (void *cls, | |||
1413 | GNS_resolver_lookup_cancel (rh); | 1414 | GNS_resolver_lookup_cancel (rh); |
1414 | return; | 1415 | return; |
1415 | } | 1416 | } |
1416 | GNUNET_CRYPTO_hash (vname, | 1417 | GNUNET_TUN_service_name_to_hash (vname, |
1417 | strlen (vname), // FIXME: +1? | 1418 | &vhash); |
1418 | &vhash); | ||
1419 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1419 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1420 | "Attempting VPN allocation for %s-%s (AF: %d, proto %d)\n", | 1420 | "Attempting VPN allocation for %s-%s (AF: %d, proto %d)\n", |
1421 | GNUNET_i2s (&vpn->peer), | 1421 | GNUNET_i2s (&vpn->peer), |
diff --git a/src/include/gnunet_tun_lib.h b/src/include/gnunet_tun_lib.h index 87b60a479..7d1e7cfed 100644 --- a/src/include/gnunet_tun_lib.h +++ b/src/include/gnunet_tun_lib.h | |||
@@ -887,4 +887,16 @@ char * | |||
887 | GNUNET_TUN_ipv4policy2regex (const char *policy); | 887 | GNUNET_TUN_ipv4policy2regex (const char *policy); |
888 | 888 | ||
889 | 889 | ||
890 | /** | ||
891 | * Hash the service name of a hosted service to the | ||
892 | * hash code that is used to identify the service on | ||
893 | * the network. | ||
894 | * | ||
895 | * @param service_name a string | ||
896 | * @param hc corresponding hash | ||
897 | */ | ||
898 | void | ||
899 | GNUNET_TUN_service_name_to_hash (const char *service_name, | ||
900 | struct GNUNET_HashCode *hc); | ||
901 | |||
890 | #endif | 902 | #endif |
diff --git a/src/regex/regex_api.c b/src/regex/regex_api.c index 0da97d072..979f58d47 100644 --- a/src/regex/regex_api.c +++ b/src/regex/regex_api.c | |||
@@ -186,7 +186,7 @@ struct GNUNET_REGEX_Search | |||
186 | GNUNET_REGEX_Found callback; | 186 | GNUNET_REGEX_Found callback; |
187 | 187 | ||
188 | /** | 188 | /** |
189 | * Closure for 'callback'. | 189 | * Closure for @e callback. |
190 | */ | 190 | */ |
191 | void *callback_cls; | 191 | void *callback_cls; |
192 | 192 | ||
@@ -201,7 +201,7 @@ struct GNUNET_REGEX_Search | |||
201 | * We got a response or disconnect after asking regex | 201 | * We got a response or disconnect after asking regex |
202 | * to do the search. Handle it. | 202 | * to do the search. Handle it. |
203 | * | 203 | * |
204 | * @param cls the 'struct GNUNET_REGEX_Search' to retry | 204 | * @param cls the `struct GNUNET_REGEX_Search` to retry |
205 | * @param msg NULL on disconnect | 205 | * @param msg NULL on disconnect |
206 | */ | 206 | */ |
207 | static void | 207 | static void |
diff --git a/src/tun/regex.c b/src/tun/regex.c index 056062e5f..f37c35122 100644 --- a/src/tun/regex.c +++ b/src/tun/regex.c | |||
@@ -460,4 +460,22 @@ GNUNET_TUN_ipv6policy2regex (const char *policy) | |||
460 | } | 460 | } |
461 | 461 | ||
462 | 462 | ||
463 | /** | ||
464 | * Hash the service name of a hosted service to the | ||
465 | * hash code that is used to identify the service on | ||
466 | * the network. | ||
467 | * | ||
468 | * @param service_name a string | ||
469 | * @param hc corresponding hash | ||
470 | */ | ||
471 | void | ||
472 | GNUNET_TUN_service_name_to_hash (const char *service_name, | ||
473 | struct GNUNET_HashCode *hc) | ||
474 | { | ||
475 | GNUNET_CRYPTO_hash (service_name, | ||
476 | strlen (service_name), | ||
477 | hc); | ||
478 | } | ||
479 | |||
480 | |||
463 | /* end of regex.c */ | 481 | /* end of regex.c */ |
diff --git a/src/vpn/Makefile.am b/src/vpn/Makefile.am index c4581df6f..e22c0e2c3 100644 --- a/src/vpn/Makefile.am +++ b/src/vpn/Makefile.am | |||
@@ -40,7 +40,7 @@ bin_PROGRAMS = \ | |||
40 | 40 | ||
41 | if MINGW | 41 | if MINGW |
42 | gnunet_helper_vpn_LDFLAGS = \ | 42 | gnunet_helper_vpn_LDFLAGS = \ |
43 | -no-undefined -Wl,--export-all-symbols | 43 | -no-undefined -Wl,--export-all-symbols |
44 | 44 | ||
45 | gnunet_helper_vpn_LDADD = \ | 45 | gnunet_helper_vpn_LDADD = \ |
46 | -lsetupapi -lnewdev -lshell32 -liconv -lstdc++ \ | 46 | -lsetupapi -lnewdev -lshell32 -liconv -lstdc++ \ |
@@ -53,7 +53,7 @@ else | |||
53 | gnunet-helper-vpn.c | 53 | gnunet-helper-vpn.c |
54 | endif | 54 | endif |
55 | gnunet_service_vpn_SOURCES = \ | 55 | gnunet_service_vpn_SOURCES = \ |
56 | gnunet-service-vpn.c | 56 | gnunet-service-vpn.c |
57 | gnunet_service_vpn_LDADD = \ | 57 | gnunet_service_vpn_LDADD = \ |
58 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 58 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
59 | $(top_builddir)/src/tun/libgnunettun.la \ | 59 | $(top_builddir)/src/tun/libgnunettun.la \ |
@@ -68,6 +68,7 @@ gnunet_vpn_SOURCES = \ | |||
68 | gnunet-vpn.c | 68 | gnunet-vpn.c |
69 | gnunet_vpn_LDADD = \ | 69 | gnunet_vpn_LDADD = \ |
70 | $(top_builddir)/src/vpn/libgnunetvpn.la \ | 70 | $(top_builddir)/src/vpn/libgnunetvpn.la \ |
71 | $(top_builddir)/src/tun/libgnunettun.la \ | ||
71 | $(top_builddir)/src/util/libgnunetutil.la \ | 72 | $(top_builddir)/src/util/libgnunetutil.la \ |
72 | $(GN_LIBINTL) | 73 | $(GN_LIBINTL) |
73 | gnunet_vpn_DEPENDENCIES = \ | 74 | gnunet_vpn_DEPENDENCIES = \ |
diff --git a/src/vpn/gnunet-vpn.c b/src/vpn/gnunet-vpn.c index a68fdc45b..d2e5eec4e 100644 --- a/src/vpn/gnunet-vpn.c +++ b/src/vpn/gnunet-vpn.c | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | #include "gnunet_tun_lib.h" | ||
29 | #include "gnunet_vpn_service.h" | 30 | #include "gnunet_vpn_service.h" |
30 | 31 | ||
31 | 32 | ||
@@ -227,16 +228,16 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
227 | protocol = IPPROTO_UDP; | 228 | protocol = IPPROTO_UDP; |
228 | if (GNUNET_OK != | 229 | if (GNUNET_OK != |
229 | GNUNET_CRYPTO_eddsa_public_key_from_string (peer_id, | 230 | GNUNET_CRYPTO_eddsa_public_key_from_string (peer_id, |
230 | strlen (peer_id), | 231 | strlen (peer_id), |
231 | &peer.public_key)) | 232 | &peer.public_key)) |
232 | { | 233 | { |
233 | FPRINTF (stderr, _("`%s' is not a valid peer identifier.\n"), | 234 | FPRINTF (stderr, |
235 | _("`%s' is not a valid peer identifier.\n"), | ||
234 | peer_id); | 236 | peer_id); |
235 | goto error; | 237 | goto error; |
236 | } | 238 | } |
237 | GNUNET_CRYPTO_hash (service_name, | 239 | GNUNET_TUN_service_name_to_hash (service_name, |
238 | strlen (service_name), | 240 | &sd); |
239 | &sd); | ||
240 | request = GNUNET_VPN_redirect_to_peer (handle, | 241 | request = GNUNET_VPN_redirect_to_peer (handle, |
241 | req_af, | 242 | req_af, |
242 | protocol, | 243 | protocol, |
diff --git a/src/vpn/vpn_api.c b/src/vpn/vpn_api.c index cf493cc52..95ef8c46d 100644 --- a/src/vpn/vpn_api.c +++ b/src/vpn/vpn_api.c | |||
@@ -120,7 +120,7 @@ struct GNUNET_VPN_RedirectionRequest | |||
120 | /** | 120 | /** |
121 | * For service redirection, service descriptor. | 121 | * For service redirection, service descriptor. |
122 | */ | 122 | */ |
123 | struct GNUNET_HashCode serv; | 123 | struct GNUNET_HashCode serv; |
124 | 124 | ||
125 | /** | 125 | /** |
126 | * At what time should the created service mapping expire? | 126 | * At what time should the created service mapping expire? |
@@ -162,7 +162,7 @@ reconnect (struct GNUNET_VPN_Handle *vh); | |||
162 | /** | 162 | /** |
163 | * Function called when we receive a message from the VPN service. | 163 | * Function called when we receive a message from the VPN service. |
164 | * | 164 | * |
165 | * @param cls the 'struct GNUNET_VPN_Handle' | 165 | * @param cls the `struct GNUNET_VPN_Handle` |
166 | * @param msg message received, NULL on timeout or fatal error | 166 | * @param msg message received, NULL on timeout or fatal error |
167 | */ | 167 | */ |
168 | static void | 168 | static void |
@@ -475,7 +475,7 @@ GNUNET_VPN_redirect_to_peer (struct GNUNET_VPN_Handle *vh, | |||
475 | return rr; | 475 | return rr; |
476 | } | 476 | } |
477 | 477 | ||
478 | 478 | ||
479 | /** | 479 | /** |
480 | * Tell the VPN that forwarding to the Internet via some exit node is | 480 | * Tell the VPN that forwarding to the Internet via some exit node is |
481 | * requested. Note that both UDP and TCP traffic will be forwarded, | 481 | * requested. Note that both UDP and TCP traffic will be forwarded, |