\fBBasic examples\fR
-We are bound to "0.0.0.0:8080" on UDP and want to obtain all applicable IP addresses (BUG: sometimes upnpc fails to create mapping, cause unclear):
+We are bound to "0.0.0.0:8080" on UDP and want to obtain all applicable IP addresses:
# gnunet-nat -i 0.0.0.0:8080 -u
# gnunet-nat -i '[::0]':8080 -t
-We are bound to "127.0.0.1:8080" on UDP and want to obtain all applicable IP addresses (BUG: currently fails, also gives IPs from other interfaces in output!):
+We are bound to "127.0.0.1:8080" on UDP and want to obtain all applicable IP addresses:
# gnunet-nat -i 127.0.0.1:8080 -u
* knowledge about the local network topology.
*
* TODO:
- * - TEST UPnPC/PMP-based NAT traversal
- * - implement STUN processing to classify NAT;
+ * - test ICMP based NAT traversal
+ * - implement & test STUN processing to classify NAT;
* basically, open port & try different methods.
* - implement "more" autoconfig
* - implement NEW logic for external IP detection
*/
struct AddrEntry *prev;
+ /**
+ * Address class of the address.
+ */
+ enum GNUNET_NAT_AddressClass ac;
+
/**
* Number of bytes that follow.
*/
static void
reconnect (struct GNUNET_NAT_Handle *nh)
{
+ struct AddrEntry *ae;
+
if (NULL != nh->mq)
{
GNUNET_MQ_destroy (nh->mq);
nh->mq = NULL;
}
+ while (NULL != (ae = nh->ae_head))
+ {
+ GNUNET_CONTAINER_DLL_remove (nh->ae_head,
+ nh->ae_tail,
+ ae);
+ nh->address_callback (nh->callback_cls,
+ GNUNET_NO,
+ ae->ac,
+ (const struct sockaddr *) &ae[1],
+ ae->addrlen);
+ GNUNET_free (ae);
+ }
nh->reconnect_delay
= GNUNET_TIME_STD_BACKOFF (nh->reconnect_delay);
nh->reconnect_task
if (GNUNET_YES == ntohl (acn->add_remove))
{
ae = GNUNET_malloc (sizeof (*ae) + alen);
+ ae->ac = ac;
ae->addrlen = alen;
GNUNET_memcpy (&ae[1],
sa,