aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-12 19:07:40 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-12 19:07:40 +0000
commit6c471eeb15e27f8226492b4860a3c2acb94c5f25 (patch)
treea3a9dcba12ee5356c03056c10b7aba5367b2ef34 /src/vpn
parent16bcbbea7133fd2265d46bd2ae1dc70e8c9ba96f (diff)
downloadgnunet-6c471eeb15e27f8226492b4860a3c2acb94c5f25.tar.gz
gnunet-6c471eeb15e27f8226492b4860a3c2acb94c5f25.zip
-consistently use struct GNUNET_HashCode
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/gnunet-service-vpn.c32
-rw-r--r--src/vpn/gnunet-vpn.c2
-rw-r--r--src/vpn/vpn.h2
-rw-r--r--src/vpn/vpn_api.c4
4 files changed, 20 insertions, 20 deletions
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c
index b7756a35a..219949bd3 100644
--- a/src/vpn/gnunet-service-vpn.c
+++ b/src/vpn/gnunet-service-vpn.c
@@ -62,7 +62,7 @@ struct DestinationEntry
62 * Key under which this entry is in the 'destination_map' (only valid 62 * Key under which this entry is in the 'destination_map' (only valid
63 * if 'heap_node != NULL'). 63 * if 'heap_node != NULL').
64 */ 64 */
65 GNUNET_HashCode key; 65 struct GNUNET_HashCode key;
66 66
67 /** 67 /**
68 * Pre-allocated tunnel for this destination, or NULL for none. 68 * Pre-allocated tunnel for this destination, or NULL for none.
@@ -91,7 +91,7 @@ struct DestinationEntry
91 /** 91 /**
92 * The description of the service (only used for service tunnels). 92 * The description of the service (only used for service tunnels).
93 */ 93 */
94 GNUNET_HashCode service_descriptor; 94 struct GNUNET_HashCode service_descriptor;
95 95
96 /** 96 /**
97 * Peer offering the service. 97 * Peer offering the service.
@@ -371,7 +371,7 @@ static unsigned long long max_tunnel_mappings;
371static void 371static void
372get_destination_key_from_ip (int af, 372get_destination_key_from_ip (int af,
373 const void *address, 373 const void *address,
374 GNUNET_HashCode *key) 374 struct GNUNET_HashCode *key)
375{ 375{
376 switch (af) 376 switch (af)
377 { 377 {
@@ -411,11 +411,11 @@ get_tunnel_key_from_ips (int af,
411 uint16_t source_port, 411 uint16_t source_port,
412 const void *destination_ip, 412 const void *destination_ip,
413 uint16_t destination_port, 413 uint16_t destination_port,
414 GNUNET_HashCode *key) 414 struct GNUNET_HashCode *key)
415{ 415{
416 char *off; 416 char *off;
417 417
418 memset (key, 0, sizeof (GNUNET_HashCode)); 418 memset (key, 0, sizeof (struct GNUNET_HashCode));
419 /* the GNUnet hashmap only uses the first sizeof(unsigned int) of the hash, 419 /* the GNUnet hashmap only uses the first sizeof(unsigned int) of the hash,
420 so we put the ports in there (and hope for few collisions) */ 420 so we put the ports in there (and hope for few collisions) */
421 off = (char*) key; 421 off = (char*) key;
@@ -501,7 +501,7 @@ send_client_reply (struct GNUNET_SERVER_Client *client,
501static void 501static void
502free_tunnel_state (struct TunnelState *ts) 502free_tunnel_state (struct TunnelState *ts)
503{ 503{
504 GNUNET_HashCode key; 504 struct GNUNET_HashCode key;
505 struct TunnelMessageQueueEntry *tnq; 505 struct TunnelMessageQueueEntry *tnq;
506 struct GNUNET_MESH_Tunnel *tunnel; 506 struct GNUNET_MESH_Tunnel *tunnel;
507 507
@@ -872,7 +872,7 @@ route_packet (struct DestinationEntry *destination,
872 const void *payload, 872 const void *payload,
873 size_t payload_length) 873 size_t payload_length)
874{ 874{
875 GNUNET_HashCode key; 875 struct GNUNET_HashCode key;
876 struct TunnelState *ts; 876 struct TunnelState *ts;
877 struct TunnelMessageQueueEntry *tnq; 877 struct TunnelMessageQueueEntry *tnq;
878 size_t alen; 878 size_t alen;
@@ -1510,7 +1510,7 @@ message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED,
1510{ 1510{
1511 const struct GNUNET_TUN_Layer2PacketHeader *tun; 1511 const struct GNUNET_TUN_Layer2PacketHeader *tun;
1512 size_t mlen; 1512 size_t mlen;
1513 GNUNET_HashCode key; 1513 struct GNUNET_HashCode key;
1514 struct DestinationEntry *de; 1514 struct DestinationEntry *de;
1515 1515
1516 GNUNET_STATISTICS_update (stats, 1516 GNUNET_STATISTICS_update (stats,
@@ -2336,7 +2336,7 @@ allocate_v4_address (struct in_addr *v4)
2336 struct in_addr addr; 2336 struct in_addr addr;
2337 struct in_addr mask; 2337 struct in_addr mask;
2338 struct in_addr rnd; 2338 struct in_addr rnd;
2339 GNUNET_HashCode key; 2339 struct GNUNET_HashCode key;
2340 unsigned int tries; 2340 unsigned int tries;
2341 2341
2342 GNUNET_assert (1 == inet_pton (AF_INET, ipv4addr, &addr)); 2342 GNUNET_assert (1 == inet_pton (AF_INET, ipv4addr, &addr));
@@ -2387,7 +2387,7 @@ allocate_v6_address (struct in6_addr *v6)
2387 struct in6_addr mask; 2387 struct in6_addr mask;
2388 struct in6_addr rnd; 2388 struct in6_addr rnd;
2389 int i; 2389 int i;
2390 GNUNET_HashCode key; 2390 struct GNUNET_HashCode key;
2391 unsigned int tries; 2391 unsigned int tries;
2392 2392
2393 GNUNET_assert (1 == inet_pton (AF_INET6, ipv6addr, &addr)); 2393 GNUNET_assert (1 == inet_pton (AF_INET6, ipv6addr, &addr));
@@ -2564,7 +2564,7 @@ service_redirect_to_ip (void *cls GNUNET_UNUSED, struct GNUNET_SERVER_Client *cl
2564 struct in6_addr v6; 2564 struct in6_addr v6;
2565 void *addr; 2565 void *addr;
2566 struct DestinationEntry *de; 2566 struct DestinationEntry *de;
2567 GNUNET_HashCode key; 2567 struct GNUNET_HashCode key;
2568 struct TunnelState *ts; 2568 struct TunnelState *ts;
2569 2569
2570 /* validate and parse request */ 2570 /* validate and parse request */
@@ -2703,7 +2703,7 @@ service_redirect_to_service (void *cls GNUNET_UNUSED, struct GNUNET_SERVER_Clien
2703 struct in6_addr v6; 2703 struct in6_addr v6;
2704 void *addr; 2704 void *addr;
2705 struct DestinationEntry *de; 2705 struct DestinationEntry *de;
2706 GNUNET_HashCode key; 2706 struct GNUNET_HashCode key;
2707 struct TunnelState *ts; 2707 struct TunnelState *ts;
2708 2708
2709 /* parse request */ 2709 /* parse request */
@@ -2835,7 +2835,7 @@ tunnel_cleaner (void *cls, const struct GNUNET_MESH_Tunnel *tunnel, void *tunnel
2835 */ 2835 */
2836static int 2836static int
2837cleanup_destination (void *cls, 2837cleanup_destination (void *cls,
2838 const GNUNET_HashCode *key, 2838 const struct GNUNET_HashCode *key,
2839 void *value) 2839 void *value)
2840{ 2840{
2841 struct DestinationEntry *de = value; 2841 struct DestinationEntry *de = value;
@@ -2855,7 +2855,7 @@ cleanup_destination (void *cls,
2855 */ 2855 */
2856static int 2856static int
2857cleanup_tunnel (void *cls, 2857cleanup_tunnel (void *cls,
2858 const GNUNET_HashCode *key, 2858 const struct GNUNET_HashCode *key,
2859 void *value) 2859 void *value)
2860{ 2860{
2861 struct TunnelState *ts = value; 2861 struct TunnelState *ts = value;
@@ -2940,7 +2940,7 @@ cleanup (void *cls GNUNET_UNUSED,
2940 */ 2940 */
2941static int 2941static int
2942cleanup_tunnel_client (void *cls, 2942cleanup_tunnel_client (void *cls,
2943 const GNUNET_HashCode *key, 2943 const struct GNUNET_HashCode *key,
2944 void *value) 2944 void *value)
2945{ 2945{
2946 struct GNUNET_SERVER_Client *client = cls; 2946 struct GNUNET_SERVER_Client *client = cls;
@@ -2965,7 +2965,7 @@ cleanup_tunnel_client (void *cls,
2965 */ 2965 */
2966static int 2966static int
2967cleanup_destination_client (void *cls, 2967cleanup_destination_client (void *cls,
2968 const GNUNET_HashCode *key, 2968 const struct GNUNET_HashCode *key,
2969 void *value) 2969 void *value)
2970{ 2970{
2971 struct GNUNET_SERVER_Client *client = cls; 2971 struct GNUNET_SERVER_Client *client = cls;
diff --git a/src/vpn/gnunet-vpn.c b/src/vpn/gnunet-vpn.c
index b75b1d29a..a03a12e87 100644
--- a/src/vpn/gnunet-vpn.c
+++ b/src/vpn/gnunet-vpn.c
@@ -173,7 +173,7 @@ run (void *cls, char *const *args, const char *cfgfile,
173 int dst_af; 173 int dst_af;
174 int req_af; 174 int req_af;
175 struct GNUNET_PeerIdentity peer; 175 struct GNUNET_PeerIdentity peer;
176 GNUNET_HashCode sd; 176 struct GNUNET_HashCode sd;
177 const void *addr; 177 const void *addr;
178 struct in_addr v4; 178 struct in_addr v4;
179 struct in6_addr v6; 179 struct in6_addr v6;
diff --git a/src/vpn/vpn.h b/src/vpn/vpn.h
index bec3a5b59..12c9a7c81 100644
--- a/src/vpn/vpn.h
+++ b/src/vpn/vpn.h
@@ -115,7 +115,7 @@ struct RedirectToServiceRequestMessage
115 /** 115 /**
116 * Service descriptor identifying the service. 116 * Service descriptor identifying the service.
117 */ 117 */
118 GNUNET_HashCode service_descriptor; 118 struct GNUNET_HashCode service_descriptor;
119 119
120 /** 120 /**
121 * Unique ID to match a future response to this request. 121 * Unique ID to match a future response to this request.
diff --git a/src/vpn/vpn_api.c b/src/vpn/vpn_api.c
index 5b70d19df..e4da5fae0 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 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?
@@ -464,7 +464,7 @@ GNUNET_VPN_redirect_to_peer (struct GNUNET_VPN_Handle *vh,
464 int result_af, 464 int result_af,
465 uint8_t protocol, 465 uint8_t protocol,
466 const struct GNUNET_PeerIdentity *peer, 466 const struct GNUNET_PeerIdentity *peer,
467 const GNUNET_HashCode *serv, 467 const struct GNUNET_HashCode *serv,
468 int nac, 468 int nac,
469 struct GNUNET_TIME_Absolute expiration_time, 469 struct GNUNET_TIME_Absolute expiration_time,
470 GNUNET_VPN_AllocationCallback cb, 470 GNUNET_VPN_AllocationCallback cb,