diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-11 17:08:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-11 17:08:57 +0000 |
commit | 0d8ed3bc0b7403e1958c8b1ace40e66caa1be5a3 (patch) | |
tree | 7b070db4e9a5bf61070f7f7a30d6fe29a80e9bb0 /src/exit | |
parent | bd8e710486fb1bcd6529035a13af469ad4f151d6 (diff) | |
download | gnunet-0d8ed3bc0b7403e1958c8b1ace40e66caa1be5a3.tar.gz gnunet-0d8ed3bc0b7403e1958c8b1ace40e66caa1be5a3.zip |
-fix leak, doxygen
Diffstat (limited to 'src/exit')
-rw-r--r-- | src/exit/gnunet-daemon-exit.c | 86 |
1 files changed, 45 insertions, 41 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c index 01c87007d..8d0c7f98e 100644 --- a/src/exit/gnunet-daemon-exit.c +++ b/src/exit/gnunet-daemon-exit.c | |||
@@ -1745,7 +1745,7 @@ prepare_ipv6_packet (const void *payload, size_t payload_length, | |||
1745 | * @param source_address IP and port to use for the TCP packet's source | 1745 | * @param source_address IP and port to use for the TCP packet's source |
1746 | * @param tcp_header header template to use | 1746 | * @param tcp_header header template to use |
1747 | * @param payload payload of the TCP packet | 1747 | * @param payload payload of the TCP packet |
1748 | * @param payload_length number of bytes in 'payload' | 1748 | * @param payload_length number of bytes in @a payload |
1749 | */ | 1749 | */ |
1750 | static void | 1750 | static void |
1751 | send_tcp_packet_via_tun (const struct SocketAddress *destination_address, | 1751 | send_tcp_packet_via_tun (const struct SocketAddress *destination_address, |
@@ -1838,15 +1838,15 @@ send_tcp_packet_via_tun (const struct SocketAddress *destination_address, | |||
1838 | * | 1838 | * |
1839 | * @param cls closure, NULL | 1839 | * @param cls closure, NULL |
1840 | * @param tunnel connection to the other end | 1840 | * @param tunnel connection to the other end |
1841 | * @param tunnel_ctx pointer to our 'struct TunnelState *' | 1841 | * @param tunnel_ctx pointer to our `struct TunnelState *` |
1842 | * @param message the actual message | 1842 | * @param message the actual message |
1843 | * | 1843 | * @return #GNUNET_OK to keep the connection open, |
1844 | * @return GNUNET_OK to keep the connection open, | 1844 | * #GNUNET_SYSERR to close it (signal serious error) |
1845 | * GNUNET_SYSERR to close it (signal serious error) | ||
1846 | */ | 1845 | */ |
1847 | static int | 1846 | static int |
1848 | receive_tcp_service (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, | 1847 | receive_tcp_service (void *cls, |
1849 | void **tunnel_ctx GNUNET_UNUSED, | 1848 | struct GNUNET_MESH_Tunnel *tunnel, |
1849 | void **tunnel_ctx, | ||
1850 | const struct GNUNET_MessageHeader *message) | 1850 | const struct GNUNET_MessageHeader *message) |
1851 | { | 1851 | { |
1852 | struct TunnelState *state = *tunnel_ctx; | 1852 | struct TunnelState *state = *tunnel_ctx; |
@@ -2054,9 +2054,8 @@ receive_tcp_remote (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, | |||
2054 | * @param tunnel connection to the other end | 2054 | * @param tunnel connection to the other end |
2055 | * @param tunnel_ctx pointer to our 'struct TunnelState *' | 2055 | * @param tunnel_ctx pointer to our 'struct TunnelState *' |
2056 | * @param message the actual message | 2056 | * @param message the actual message |
2057 | * | 2057 | * @return #GNUNET_OK to keep the connection open, |
2058 | * @return GNUNET_OK to keep the connection open, | 2058 | * #GNUNET_SYSERR to close it (signal serious error) |
2059 | * GNUNET_SYSERR to close it (signal serious error) | ||
2060 | */ | 2059 | */ |
2061 | static int | 2060 | static int |
2062 | receive_tcp_data (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, | 2061 | receive_tcp_data (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, |
@@ -2133,7 +2132,7 @@ receive_tcp_data (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, | |||
2133 | * @param source_address IP to use for the ICMP packet's source | 2132 | * @param source_address IP to use for the ICMP packet's source |
2134 | * @param icmp_header ICMP header to send | 2133 | * @param icmp_header ICMP header to send |
2135 | * @param payload payload of the ICMP packet (does NOT include ICMP header) | 2134 | * @param payload payload of the ICMP packet (does NOT include ICMP header) |
2136 | * @param payload_length number of bytes of data in payload | 2135 | * @param payload_length number of bytes of data in @a payload |
2137 | */ | 2136 | */ |
2138 | static void | 2137 | static void |
2139 | send_icmp_packet_via_tun (const struct SocketAddress *destination_address, | 2138 | send_icmp_packet_via_tun (const struct SocketAddress *destination_address, |
@@ -2287,13 +2286,13 @@ make_up_icmpv6_payload (struct TunnelState *state, | |||
2287 | * @param tunnel connection to the other end | 2286 | * @param tunnel connection to the other end |
2288 | * @param tunnel_ctx pointer to our 'struct TunnelState *' | 2287 | * @param tunnel_ctx pointer to our 'struct TunnelState *' |
2289 | * @param message the actual message | 2288 | * @param message the actual message |
2290 | * | 2289 | * @return #GNUNET_OK to keep the connection open, |
2291 | * @return GNUNET_OK to keep the connection open, | 2290 | * #GNUNET_SYSERR to close it (signal serious error) |
2292 | * GNUNET_SYSERR to close it (signal serious error) | ||
2293 | */ | 2291 | */ |
2294 | static int | 2292 | static int |
2295 | receive_icmp_remote (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, | 2293 | receive_icmp_remote (void *cls, |
2296 | void **tunnel_ctx GNUNET_UNUSED, | 2294 | struct GNUNET_MESH_Tunnel *tunnel, |
2295 | void **tunnel_ctx, | ||
2297 | const struct GNUNET_MessageHeader *message) | 2296 | const struct GNUNET_MessageHeader *message) |
2298 | { | 2297 | { |
2299 | struct TunnelState *state = *tunnel_ctx; | 2298 | struct TunnelState *state = *tunnel_ctx; |
@@ -2538,12 +2537,12 @@ make_up_icmp_service_payload (struct TunnelState *state, | |||
2538 | * @param tunnel connection to the other end | 2537 | * @param tunnel connection to the other end |
2539 | * @param tunnel_ctx pointer to our 'struct TunnelState *' | 2538 | * @param tunnel_ctx pointer to our 'struct TunnelState *' |
2540 | * @param message the actual message | 2539 | * @param message the actual message |
2541 | * | 2540 | * @return #GNUNET_OK to keep the connection open, |
2542 | * @return GNUNET_OK to keep the connection open, | 2541 | * #GNUNET_SYSERR to close it (signal serious error) |
2543 | * GNUNET_SYSERR to close it (signal serious error) | ||
2544 | */ | 2542 | */ |
2545 | static int | 2543 | static int |
2546 | receive_icmp_service (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, | 2544 | receive_icmp_service (void *cls, |
2545 | struct GNUNET_MESH_Tunnel *tunnel, | ||
2547 | void **tunnel_ctx, | 2546 | void **tunnel_ctx, |
2548 | const struct GNUNET_MessageHeader *message) | 2547 | const struct GNUNET_MessageHeader *message) |
2549 | { | 2548 | { |
@@ -2733,7 +2732,7 @@ receive_icmp_service (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel | |||
2733 | * @param destination_address IP and port to use for the UDP packet's destination | 2732 | * @param destination_address IP and port to use for the UDP packet's destination |
2734 | * @param source_address IP and port to use for the UDP packet's source | 2733 | * @param source_address IP and port to use for the UDP packet's source |
2735 | * @param payload payload of the UDP packet (does NOT include UDP header) | 2734 | * @param payload payload of the UDP packet (does NOT include UDP header) |
2736 | * @param payload_length number of bytes of data in payload | 2735 | * @param payload_length number of bytes of data in @a payload |
2737 | */ | 2736 | */ |
2738 | static void | 2737 | static void |
2739 | send_udp_packet_via_tun (const struct SocketAddress *destination_address, | 2738 | send_udp_packet_via_tun (const struct SocketAddress *destination_address, |
@@ -2826,13 +2825,13 @@ send_udp_packet_via_tun (const struct SocketAddress *destination_address, | |||
2826 | * @param tunnel connection to the other end | 2825 | * @param tunnel connection to the other end |
2827 | * @param tunnel_ctx pointer to our 'struct TunnelState *' | 2826 | * @param tunnel_ctx pointer to our 'struct TunnelState *' |
2828 | * @param message the actual message | 2827 | * @param message the actual message |
2829 | * | 2828 | * @return #GNUNET_OK to keep the connection open, |
2830 | * @return GNUNET_OK to keep the connection open, | 2829 | * #GNUNET_SYSERR to close it (signal serious error) |
2831 | * GNUNET_SYSERR to close it (signal serious error) | ||
2832 | */ | 2830 | */ |
2833 | static int | 2831 | static int |
2834 | receive_udp_remote (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, | 2832 | receive_udp_remote (void *cls, |
2835 | void **tunnel_ctx GNUNET_UNUSED, | 2833 | struct GNUNET_MESH_Tunnel *tunnel, |
2834 | void **tunnel_ctx, | ||
2836 | const struct GNUNET_MessageHeader *message) | 2835 | const struct GNUNET_MessageHeader *message) |
2837 | { | 2836 | { |
2838 | struct TunnelState *state = *tunnel_ctx; | 2837 | struct TunnelState *state = *tunnel_ctx; |
@@ -2937,12 +2936,12 @@ receive_udp_remote (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, | |||
2937 | * @param tunnel connection to the other end | 2936 | * @param tunnel connection to the other end |
2938 | * @param tunnel_ctx pointer to our 'struct TunnelState *' | 2937 | * @param tunnel_ctx pointer to our 'struct TunnelState *' |
2939 | * @param message the actual message | 2938 | * @param message the actual message |
2940 | * | 2939 | * @return #GNUNET_OK to keep the connection open, |
2941 | * @return GNUNET_OK to keep the connection open, | 2940 | * #GNUNET_SYSERR to close it (signal serious error) |
2942 | * GNUNET_SYSERR to close it (signal serious error) | ||
2943 | */ | 2941 | */ |
2944 | static int | 2942 | static int |
2945 | receive_udp_service (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, | 2943 | receive_udp_service (void *cls, |
2944 | struct GNUNET_MESH_Tunnel *tunnel, | ||
2946 | void **tunnel_ctx, | 2945 | void **tunnel_ctx, |
2947 | const struct GNUNET_MessageHeader *message) | 2946 | const struct GNUNET_MessageHeader *message) |
2948 | { | 2947 | { |
@@ -3012,8 +3011,10 @@ receive_udp_service (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, | |||
3012 | * @return initial tunnel context for the tunnel | 3011 | * @return initial tunnel context for the tunnel |
3013 | */ | 3012 | */ |
3014 | static void * | 3013 | static void * |
3015 | new_tunnel (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, | 3014 | new_tunnel (void *cls, |
3016 | const struct GNUNET_PeerIdentity *initiator, uint32_t port) | 3015 | struct GNUNET_MESH_Tunnel *tunnel, |
3016 | const struct GNUNET_PeerIdentity *initiator, | ||
3017 | uint32_t port) | ||
3017 | { | 3018 | { |
3018 | struct TunnelState *s = GNUNET_new (struct TunnelState); | 3019 | struct TunnelState *s = GNUNET_new (struct TunnelState); |
3019 | 3020 | ||
@@ -3034,13 +3035,14 @@ new_tunnel (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, | |||
3034 | * Function called by mesh whenever an inbound tunnel is destroyed. | 3035 | * Function called by mesh whenever an inbound tunnel is destroyed. |
3035 | * Should clean up any associated state. | 3036 | * Should clean up any associated state. |
3036 | * | 3037 | * |
3037 | * @param cls closure (set from GNUNET_MESH_connect) | 3038 | * @param cls closure (set from #GNUNET_MESH_connect) |
3038 | * @param tunnel connection to the other end (henceforth invalid) | 3039 | * @param tunnel connection to the other end (henceforth invalid) |
3039 | * @param tunnel_ctx place where local state associated | 3040 | * @param tunnel_ctx place where local state associated |
3040 | * with the tunnel is stored | 3041 | * with the tunnel is stored |
3041 | */ | 3042 | */ |
3042 | static void | 3043 | static void |
3043 | clean_tunnel (void *cls GNUNET_UNUSED, const struct GNUNET_MESH_Tunnel *tunnel, | 3044 | clean_tunnel (void *cls, |
3045 | const struct GNUNET_MESH_Tunnel *tunnel, | ||
3044 | void *tunnel_ctx) | 3046 | void *tunnel_ctx) |
3045 | { | 3047 | { |
3046 | struct TunnelState *s = tunnel_ctx; | 3048 | struct TunnelState *s = tunnel_ctx; |
@@ -3095,8 +3097,9 @@ clean_tunnel (void *cls GNUNET_UNUSED, const struct GNUNET_MESH_Tunnel *tunnel, | |||
3095 | * @param value value to free | 3097 | * @param value value to free |
3096 | */ | 3098 | */ |
3097 | static int | 3099 | static int |
3098 | free_iterate (void *cls GNUNET_UNUSED, | 3100 | free_iterate (void *cls, |
3099 | const struct GNUNET_HashCode * hash GNUNET_UNUSED, void *value) | 3101 | const struct GNUNET_HashCode * hash, |
3102 | void *value) | ||
3100 | { | 3103 | { |
3101 | GNUNET_free (value); | 3104 | GNUNET_free (value); |
3102 | return GNUNET_YES; | 3105 | return GNUNET_YES; |
@@ -3107,7 +3110,7 @@ free_iterate (void *cls GNUNET_UNUSED, | |||
3107 | * Function scheduled as very last function, cleans up after us | 3110 | * Function scheduled as very last function, cleans up after us |
3108 | */ | 3111 | */ |
3109 | static void | 3112 | static void |
3110 | cleanup (void *cls GNUNET_UNUSED, | 3113 | cleanup (void *cls, |
3111 | const struct GNUNET_SCHEDULER_TaskContext *tskctx) | 3114 | const struct GNUNET_SCHEDULER_TaskContext *tskctx) |
3112 | { | 3115 | { |
3113 | unsigned int i; | 3116 | unsigned int i; |
@@ -3339,7 +3342,7 @@ add_services (int proto, | |||
3339 | * @param section name of section in config, equal to hostname | 3342 | * @param section name of section in config, equal to hostname |
3340 | */ | 3343 | */ |
3341 | static void | 3344 | static void |
3342 | read_service_conf (void *cls GNUNET_UNUSED, const char *section) | 3345 | read_service_conf (void *cls, const char *section) |
3343 | { | 3346 | { |
3344 | char *cpy; | 3347 | char *cpy; |
3345 | 3348 | ||
@@ -3441,8 +3444,9 @@ do_dht_put (void *cls, | |||
3441 | * @param cfg_ configuration | 3444 | * @param cfg_ configuration |
3442 | */ | 3445 | */ |
3443 | static void | 3446 | static void |
3444 | run (void *cls, char *const *args GNUNET_UNUSED, | 3447 | run (void *cls, |
3445 | const char *cfgfile GNUNET_UNUSED, | 3448 | char *const *args, |
3449 | const char *cfgfile, | ||
3446 | const struct GNUNET_CONFIGURATION_Handle *cfg_) | 3450 | const struct GNUNET_CONFIGURATION_Handle *cfg_) |
3447 | { | 3451 | { |
3448 | static struct GNUNET_MESH_MessageHandler handlers[] = { | 3452 | static struct GNUNET_MESH_MessageHandler handlers[] = { |
@@ -3586,7 +3590,7 @@ run (void *cls, char *const *args GNUNET_UNUSED, | |||
3586 | apptypes[app_idx] = GNUNET_APPLICATION_TYPE_INTERNET_RESOLVER; | 3590 | apptypes[app_idx] = GNUNET_APPLICATION_TYPE_INTERNET_RESOLVER; |
3587 | app_idx++; | 3591 | app_idx++; |
3588 | } | 3592 | } |
3589 | 3593 | GNUNET_free_non_null (dns_exit); | |
3590 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup, cls); | 3594 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup, cls); |
3591 | 3595 | ||
3592 | if (GNUNET_OK != | 3596 | if (GNUNET_OK != |