X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fnat-auto%2Fgnunet-service-nat-auto.c;h=ae570c351a4df6b18c46333948e4aa531e0cbb6c;hb=5b32752cd7b02adcb8e6fec7798637638c6f63a0;hp=897d6feb25f6fe159e66b9f488ff04d1eed558a2;hpb=c859283e8ccc3a2aa89655698ef5f66793531e16;p=oweals%2Fgnunet.git diff --git a/src/nat-auto/gnunet-service-nat-auto.c b/src/nat-auto/gnunet-service-nat-auto.c index 897d6feb2..ae570c351 100644 --- a/src/nat-auto/gnunet-service-nat-auto.c +++ b/src/nat-auto/gnunet-service-nat-auto.c @@ -27,6 +27,7 @@ * - merge client handle and autoconfig context * - implement "more" autoconfig: * + re-work gnunet-nat-server & integrate! + * + integrate "legacy" code * + test manually punched NAT (how?) */ #include "platform.h" @@ -57,7 +58,7 @@ struct ClientHandle * Kept in a DLL. */ struct ClientHandle *next; - + /** * Kept in a DLL. */ @@ -65,7 +66,7 @@ struct ClientHandle /** * Underlying handle for this client with the service. - */ + */ struct GNUNET_SERVICE_Client *client; /** @@ -97,12 +98,12 @@ struct AutoconfigContext /** * Configuration we are creating. - */ + */ struct GNUNET_CONFIGURATION_Handle *c; /** * Original configuration (for diffing). - */ + */ struct GNUNET_CONFIGURATION_Handle *orig; /** @@ -133,7 +134,7 @@ struct AutoconfigContext * Head of client DLL. */ static struct ClientHandle *ch_head; - + /** * Tail of client DLL. */ @@ -170,7 +171,7 @@ static struct GNUNET_STATISTICS_Handle *stats; */ static int check_autoconfig_request (void *cls, - const struct GNUNET_NAT_AutoconfigRequestMessage *message) + const struct GNUNET_NAT_AUTO_AutoconfigRequestMessage *message) { return GNUNET_OK; /* checked later */ } @@ -203,12 +204,12 @@ conclude_autoconfig_request (void *cls) { struct AutoconfigContext *ac = cls; struct ClientHandle *ch = ac->ch; - struct GNUNET_NAT_AutoconfigResultMessage *arm; + struct GNUNET_NAT_AUTO_AutoconfigResultMessage *arm; struct GNUNET_MQ_Envelope *env; size_t c_size; char *buf; struct GNUNET_CONFIGURATION_Handle *diff; - + ac->timeout_task = NULL; terminate_ac_activities (ac); @@ -295,7 +296,7 @@ update_enable_upnpc_option (struct AutoconfigContext *ac) */ static void handle_autoconfig_request (void *cls, - const struct GNUNET_NAT_AutoconfigRequestMessage *message) + const struct GNUNET_NAT_AUTO_AutoconfigRequestMessage *message) { struct ClientHandle *ch = cls; size_t left = ntohs (message->header.size) - sizeof (*message); @@ -330,7 +331,7 @@ handle_autoconfig_request (void *cls, &conclude_autoconfig_request, ac); ac->enable_upnpc = GNUNET_SYSERR; /* undecided */ - + /* Probe for upnpc */ if (GNUNET_SYSERR == GNUNET_OS_check_helper_binary ("upnpc", @@ -348,7 +349,7 @@ handle_autoconfig_request (void *cls, } update_enable_upnpc_option (ac); - /* Finally, check if we are already done */ + /* Finally, check if we are already done */ check_autoconfig_finished (ac); } @@ -450,7 +451,7 @@ client_disconnect_cb (void *cls, * Define "main" method using service macro. */ GNUNET_SERVICE_MAIN -("nat", +("nat-auto", GNUNET_SERVICE_OPTION_NONE, &run, &client_connect_cb, @@ -458,7 +459,7 @@ GNUNET_SERVICE_MAIN NULL, GNUNET_MQ_hd_var_size (autoconfig_request, GNUNET_MESSAGE_TYPE_NAT_AUTO_REQUEST_CFG, - struct GNUNET_NAT_AutoconfigRequestMessage, + struct GNUNET_NAT_AUTO_AutoconfigRequestMessage, NULL), GNUNET_MQ_handler_end ());