aboutsummaryrefslogtreecommitdiff
path: root/src/vpn/gnunet-daemon-exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpn/gnunet-daemon-exit.c')
-rw-r--r--src/vpn/gnunet-daemon-exit.c73
1 files changed, 27 insertions, 46 deletions
diff --git a/src/vpn/gnunet-daemon-exit.c b/src/vpn/gnunet-daemon-exit.c
index e7d904120..2e8061024 100644
--- a/src/vpn/gnunet-daemon-exit.c
+++ b/src/vpn/gnunet-daemon-exit.c
@@ -170,8 +170,8 @@ struct tunnel_state
170 * Function that frees everything from a hashmap 170 * Function that frees everything from a hashmap
171 */ 171 */
172static int 172static int
173free_iterate (void *cls GNUNET_UNUSED, const GNUNET_HashCode * hash 173free_iterate (void *cls GNUNET_UNUSED,
174 GNUNET_UNUSED, void *value) 174 const GNUNET_HashCode * hash GNUNET_UNUSED, void *value)
175{ 175{
176 GNUNET_free (value); 176 GNUNET_free (value);
177 return GNUNET_YES; 177 return GNUNET_YES;
@@ -181,8 +181,7 @@ free_iterate (void *cls GNUNET_UNUSED, const GNUNET_HashCode * hash
181 * Function scheduled as very last function, cleans up after us 181 * Function scheduled as very last function, cleans up after us
182 */ 182 */
183static void 183static void
184cleanup (void *cls 184cleanup (void *cls GNUNET_UNUSED,
185 GNUNET_UNUSED,
186 const struct GNUNET_SCHEDULER_TaskContext *tskctx) 185 const struct GNUNET_SCHEDULER_TaskContext *tskctx)
187{ 186{
188 GNUNET_assert (0 != (tskctx->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)); 187 GNUNET_assert (0 != (tskctx->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN));
@@ -199,11 +198,9 @@ cleanup (void *cls
199} 198}
200 199
201static void * 200static void *
202new_tunnel (void *cls 201new_tunnel (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
203 GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, 202 const struct GNUNET_PeerIdentity *initiator GNUNET_UNUSED,
204 const struct GNUNET_PeerIdentity *initiator 203 const struct GNUNET_ATS_Information *ats GNUNET_UNUSED)
205 GNUNET_UNUSED, const struct GNUNET_ATS_Information *ats
206 GNUNET_UNUSED)
207{ 204{
208 struct tunnel_state *s = GNUNET_malloc (sizeof *s); 205 struct tunnel_state *s = GNUNET_malloc (sizeof *s);
209 206
@@ -214,8 +211,7 @@ new_tunnel (void *cls
214} 211}
215 212
216static void 213static void
217clean_tunnel (void *cls 214clean_tunnel (void *cls GNUNET_UNUSED, const struct GNUNET_MESH_Tunnel *tunnel,
218 GNUNET_UNUSED, const struct GNUNET_MESH_Tunnel *tunnel,
219 void *tunnel_ctx) 215 void *tunnel_ctx)
220{ 216{
221 GNUNET_free (tunnel_ctx); 217 GNUNET_free (tunnel_ctx);
@@ -531,8 +527,7 @@ tcp_from_helper (struct tcp_pkt *tcp, unsigned char *dadr, size_t addrlen,
531 * Receive packets from the helper-process 527 * Receive packets from the helper-process
532 */ 528 */
533static void 529static void
534message_token (void *cls GNUNET_UNUSED, void *client 530message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED,
535 GNUNET_UNUSED,
536 const struct GNUNET_MessageHeader *message) 531 const struct GNUNET_MessageHeader *message)
537{ 532{
538 GNUNET_assert (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_HELPER); 533 GNUNET_assert (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_HELPER);
@@ -1038,15 +1033,11 @@ prepare_ipv6_packet (size_t len, uint16_t pktlen, void *payload,
1038 * The messages are one GNUNET_HashCode for the service followed by a struct tcp_pkt 1033 * The messages are one GNUNET_HashCode for the service followed by a struct tcp_pkt
1039 */ 1034 */
1040static int 1035static int
1041receive_tcp_service (void *cls 1036receive_tcp_service (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
1042 GNUNET_UNUSED, 1037 void **tunnel_ctx GNUNET_UNUSED,
1043 struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx 1038 const struct GNUNET_PeerIdentity *sender GNUNET_UNUSED,
1044 GNUNET_UNUSED,
1045 const struct GNUNET_PeerIdentity *sender
1046 GNUNET_UNUSED,
1047 const struct GNUNET_MessageHeader *message, 1039 const struct GNUNET_MessageHeader *message,
1048 const struct GNUNET_ATS_Information *atsi 1040 const struct GNUNET_ATS_Information *atsi GNUNET_UNUSED)
1049 GNUNET_UNUSED)
1050{ 1041{
1051 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received TCP-Packet\n"); 1042 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received TCP-Packet\n");
1052 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); 1043 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
@@ -1144,15 +1135,11 @@ receive_tcp_service (void *cls
1144} 1135}
1145 1136
1146static int 1137static int
1147receive_tcp_remote (void *cls 1138receive_tcp_remote (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
1148 GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, 1139 void **tunnel_ctx GNUNET_UNUSED,
1149 void **tunnel_ctx 1140 const struct GNUNET_PeerIdentity *sender GNUNET_UNUSED,
1150 GNUNET_UNUSED,
1151 const struct GNUNET_PeerIdentity *sender
1152 GNUNET_UNUSED,
1153 const struct GNUNET_MessageHeader *message, 1141 const struct GNUNET_MessageHeader *message,
1154 const struct GNUNET_ATS_Information *atsi 1142 const struct GNUNET_ATS_Information *atsi GNUNET_UNUSED)
1155 GNUNET_UNUSED)
1156{ 1143{
1157 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); 1144 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
1158 struct tcp_pkt *pkt = (struct tcp_pkt *) (desc + 1); 1145 struct tcp_pkt *pkt = (struct tcp_pkt *) (desc + 1);
@@ -1220,15 +1207,11 @@ receive_tcp_remote (void *cls
1220} 1207}
1221 1208
1222static int 1209static int
1223receive_udp_remote (void *cls 1210receive_udp_remote (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
1224 GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel, 1211 void **tunnel_ctx GNUNET_UNUSED,
1225 void **tunnel_ctx 1212 const struct GNUNET_PeerIdentity *sender GNUNET_UNUSED,
1226 GNUNET_UNUSED,
1227 const struct GNUNET_PeerIdentity *sender
1228 GNUNET_UNUSED,
1229 const struct GNUNET_MessageHeader *message, 1213 const struct GNUNET_MessageHeader *message,
1230 const struct GNUNET_ATS_Information *atsi 1214 const struct GNUNET_ATS_Information *atsi GNUNET_UNUSED)
1231 GNUNET_UNUSED)
1232{ 1215{
1233 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); 1216 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
1234 struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1); 1217 struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1);
@@ -1300,14 +1283,11 @@ receive_udp_remote (void *cls
1300 * The messages are one GNUNET_HashCode for the service, followed by a struct udp_pkt 1283 * The messages are one GNUNET_HashCode for the service, followed by a struct udp_pkt
1301 */ 1284 */
1302static int 1285static int
1303receive_udp_service (void *cls 1286receive_udp_service (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
1304 GNUNET_UNUSED, 1287 void **tunnel_ctx,
1305 struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx, 1288 const struct GNUNET_PeerIdentity *sender GNUNET_UNUSED,
1306 const struct GNUNET_PeerIdentity *sender
1307 GNUNET_UNUSED,
1308 const struct GNUNET_MessageHeader *message, 1289 const struct GNUNET_MessageHeader *message,
1309 const struct GNUNET_ATS_Information *atsi 1290 const struct GNUNET_ATS_Information *atsi GNUNET_UNUSED)
1310 GNUNET_UNUSED)
1311{ 1291{
1312 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); 1292 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
1313 struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1); 1293 struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1);
@@ -1463,8 +1443,9 @@ connect_to_mesh ()
1463 * @param cfg_ configuration 1443 * @param cfg_ configuration
1464 */ 1444 */
1465static void 1445static void
1466run (void *cls, char *const *args GNUNET_UNUSED, const char *cfgfile 1446run (void *cls, char *const *args GNUNET_UNUSED,
1467 GNUNET_UNUSED, const struct GNUNET_CONFIGURATION_Handle *cfg_) 1447 const char *cfgfile GNUNET_UNUSED,
1448 const struct GNUNET_CONFIGURATION_Handle *cfg_)
1468{ 1449{
1469 cfg = cfg_; 1450 cfg = cfg_;
1470 1451