diff options
Diffstat (limited to 'src/nat/nat.c')
-rw-r--r-- | src/nat/nat.c | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/src/nat/nat.c b/src/nat/nat.c index 57961ffaf..1c60e4e0d 100644 --- a/src/nat/nat.c +++ b/src/nat/nat.c | |||
@@ -463,11 +463,9 @@ start_gnunet_nat_server (struct GNUNET_NAT_Handle *h); | |||
463 | * Call task to process STUN | 463 | * Call task to process STUN |
464 | * | 464 | * |
465 | * @param cls handle to NAT | 465 | * @param cls handle to NAT |
466 | * @param tc TaskContext | ||
467 | */ | 466 | */ |
468 | static void | 467 | static void |
469 | process_stun (void *cls, | 468 | process_stun (void *cls); |
470 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
471 | 469 | ||
472 | 470 | ||
473 | /** | 471 | /** |
@@ -662,10 +660,9 @@ add_ip_to_address_list (struct GNUNET_NAT_Handle *h, | |||
662 | * get DynDNS-IP addresses. | 660 | * get DynDNS-IP addresses. |
663 | * | 661 | * |
664 | * @param cls the NAT handle | 662 | * @param cls the NAT handle |
665 | * @param tc scheduler context | ||
666 | */ | 663 | */ |
667 | static void | 664 | static void |
668 | resolve_dns (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 665 | resolve_dns (void *cls); |
669 | 666 | ||
670 | 667 | ||
671 | /** | 668 | /** |
@@ -716,11 +713,9 @@ process_external_ip (void *cls, | |||
716 | * Task to do a lookup on our hostname for IP addresses. | 713 | * Task to do a lookup on our hostname for IP addresses. |
717 | * | 714 | * |
718 | * @param cls the NAT handle | 715 | * @param cls the NAT handle |
719 | * @param tc scheduler context | ||
720 | */ | 716 | */ |
721 | static void | 717 | static void |
722 | resolve_hostname (void *cls, | 718 | resolve_hostname (void *cls); |
723 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
724 | 719 | ||
725 | 720 | ||
726 | /** | 721 | /** |
@@ -938,14 +933,15 @@ process_interfaces (void *cls, | |||
938 | * after a certain delay. | 933 | * after a certain delay. |
939 | * | 934 | * |
940 | * @param cls the `struct GNUNET_NAT_Handle` | 935 | * @param cls the `struct GNUNET_NAT_Handle` |
941 | * @param tc scheduler context | ||
942 | */ | 936 | */ |
943 | static void | 937 | static void |
944 | restart_nat_server (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 938 | restart_nat_server (void *cls) |
945 | { | 939 | { |
946 | struct GNUNET_NAT_Handle *h = cls; | 940 | struct GNUNET_NAT_Handle *h = cls; |
941 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
947 | 942 | ||
948 | h->server_read_task = NULL; | 943 | h->server_read_task = NULL; |
944 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
949 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 945 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
950 | return; | 946 | return; |
951 | start_gnunet_nat_server (h); | 947 | start_gnunet_nat_server (h); |
@@ -958,11 +954,9 @@ restart_nat_server (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
958 | * function to be called again once more is available. | 954 | * function to be called again once more is available. |
959 | * | 955 | * |
960 | * @param cls the NAT handle | 956 | * @param cls the NAT handle |
961 | * @param tc the scheduling context | ||
962 | */ | 957 | */ |
963 | static void | 958 | static void |
964 | nat_server_read (void *cls, | 959 | nat_server_read (void *cls) |
965 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
966 | { | 960 | { |
967 | struct GNUNET_NAT_Handle *h = cls; | 961 | struct GNUNET_NAT_Handle *h = cls; |
968 | char mybuf[40]; | 962 | char mybuf[40]; |
@@ -971,8 +965,10 @@ nat_server_read (void *cls, | |||
971 | int port; | 965 | int port; |
972 | const char *port_start; | 966 | const char *port_start; |
973 | struct sockaddr_in sin_addr; | 967 | struct sockaddr_in sin_addr; |
968 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
974 | 969 | ||
975 | h->server_read_task = NULL; | 970 | h->server_read_task = NULL; |
971 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
976 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) | 972 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) |
977 | return; | 973 | return; |
978 | memset (mybuf, 0, sizeof (mybuf)); | 974 | memset (mybuf, 0, sizeof (mybuf)); |
@@ -1099,11 +1095,9 @@ start_gnunet_nat_server (struct GNUNET_NAT_Handle *h) | |||
1099 | * Task to scan the local network interfaces for IP addresses. | 1095 | * Task to scan the local network interfaces for IP addresses. |
1100 | * | 1096 | * |
1101 | * @param cls the NAT handle | 1097 | * @param cls the NAT handle |
1102 | * @param tc scheduler context | ||
1103 | */ | 1098 | */ |
1104 | static void | 1099 | static void |
1105 | list_interfaces (void *cls, | 1100 | list_interfaces (void *cls) |
1106 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1107 | { | 1101 | { |
1108 | struct GNUNET_NAT_Handle *h = cls; | 1102 | struct GNUNET_NAT_Handle *h = cls; |
1109 | 1103 | ||
@@ -1209,11 +1203,9 @@ GNUNET_NAT_is_valid_stun_packet (void *cls, | |||
1209 | * Task to do a STUN request | 1203 | * Task to do a STUN request |
1210 | * | 1204 | * |
1211 | * @param cls the NAT handle | 1205 | * @param cls the NAT handle |
1212 | * @param tc scheduler context | ||
1213 | */ | 1206 | */ |
1214 | static void | 1207 | static void |
1215 | process_stun (void *cls, | 1208 | process_stun (void *cls) |
1216 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1217 | { | 1209 | { |
1218 | struct GNUNET_NAT_Handle *h = cls; | 1210 | struct GNUNET_NAT_Handle *h = cls; |
1219 | struct StunServerList* elem = h->actual_stun_server; | 1211 | struct StunServerList* elem = h->actual_stun_server; |
@@ -1264,11 +1256,9 @@ process_stun (void *cls, | |||
1264 | * Task to do a lookup on our hostname for IP addresses. | 1256 | * Task to do a lookup on our hostname for IP addresses. |
1265 | * | 1257 | * |
1266 | * @param cls the NAT handle | 1258 | * @param cls the NAT handle |
1267 | * @param tc scheduler context | ||
1268 | */ | 1259 | */ |
1269 | static void | 1260 | static void |
1270 | resolve_hostname (void *cls, | 1261 | resolve_hostname (void *cls) |
1271 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1272 | { | 1262 | { |
1273 | struct GNUNET_NAT_Handle *h = cls; | 1263 | struct GNUNET_NAT_Handle *h = cls; |
1274 | 1264 | ||
@@ -1285,11 +1275,9 @@ resolve_hostname (void *cls, | |||
1285 | * get DynDNS-IP addresses. | 1275 | * get DynDNS-IP addresses. |
1286 | * | 1276 | * |
1287 | * @param cls the NAT handle | 1277 | * @param cls the NAT handle |
1288 | * @param tc scheduler context | ||
1289 | */ | 1278 | */ |
1290 | static void | 1279 | static void |
1291 | resolve_dns (void *cls, | 1280 | resolve_dns (void *cls) |
1292 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1293 | { | 1281 | { |
1294 | struct GNUNET_NAT_Handle *h = cls; | 1282 | struct GNUNET_NAT_Handle *h = cls; |
1295 | struct LocalAddressList *pos; | 1283 | struct LocalAddressList *pos; |