* - 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"
* Kept in a DLL.
*/
struct ClientHandle *next;
-
+
/**
* Kept in a DLL.
*/
/**
* Underlying handle for this client with the service.
- */
+ */
struct GNUNET_SERVICE_Client *client;
/**
/**
* Configuration we are creating.
- */
+ */
struct GNUNET_CONFIGURATION_Handle *c;
/**
* Original configuration (for diffing).
- */
+ */
struct GNUNET_CONFIGURATION_Handle *orig;
/**
* Head of client DLL.
*/
static struct ClientHandle *ch_head;
-
+
/**
* Tail of client DLL.
*/
*/
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 */
}
{
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);
*/
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);
&conclude_autoconfig_request,
ac);
ac->enable_upnpc = GNUNET_SYSERR; /* undecided */
-
+
/* Probe for upnpc */
if (GNUNET_SYSERR ==
GNUNET_OS_check_helper_binary ("upnpc",
}
update_enable_upnpc_option (ac);
- /* Finally, check if we are already done */
+ /* Finally, check if we are already done */
check_autoconfig_finished (ac);
}
* Define "main" method using service macro.
*/
GNUNET_SERVICE_MAIN
-("nat",
+("nat-auto",
GNUNET_SERVICE_OPTION_NONE,
&run,
&client_connect_cb,
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 ());