/*
This file is part of GNUnet.
- (C) 2012-2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2012-2013 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
* Task run on timeout or shutdown to clean up without
* response.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Number of bytes in 'addr'.
/**
* Task for IPv4 socket.
*/
-static GNUNET_SCHEDULER_TaskIdentifier t4;
+static struct GNUNET_SCHEDULER_Task * t4;
/**
* Task for IPv6 socket.
*/
-static GNUNET_SCHEDULER_TaskIdentifier t6;
+static struct GNUNET_SCHEDULER_Task * t6;
/**
* DNS suffix, suffix of this gateway in DNS; defaults to '.zkey.eu'
/**
* Which GNS zone do we translate incoming DNS requests to?
*/
-static struct GNUNET_CRYPTO_EccPublicSignKey my_zone;
+static struct GNUNET_CRYPTO_EcdsaPublicKey my_zone;
/**
* '-z' option with the main zone to use.
do_shutdown (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- if (GNUNET_SCHEDULER_NO_TASK != t4)
+ if (NULL != t4)
GNUNET_SCHEDULER_cancel (t4);
- if (GNUNET_SCHEDULER_NO_TASK != t6)
+ if (NULL != t6)
GNUNET_SCHEDULER_cancel (t6);
if (NULL != listen_socket4)
{
GNUNET_IDENTITY_disconnect (identity);
identity = NULL;
}
- GNUNET_GNS_disconnect (gns);
- gns = NULL;
- GNUNET_DNSSTUB_stop (dns_stub);
- dns_stub = NULL;
+ if (NULL != gns)
+ {
+ GNUNET_GNS_disconnect (gns);
+ gns = NULL;
+ }
+ if (NULL != dns_stub)
+ {
+ GNUNET_DNSSTUB_stop (dns_stub);
+ dns_stub = NULL;
+ }
}
static void
result_processor (void *cls,
uint32_t rd_count,
- const struct GNUNET_NAMESTORE_RecordData *rd)
+ const struct GNUNET_GNSRECORD_Data *rd)
{
struct Request *request = cls;
struct GNUNET_DNSPARSER_Packet *packet;
//packet->flags.opcode = GNUNET_TUN_DNS_OPCODE_STATUS; // ???
for (i=0;i<rd_count;i++)
{
- // FIXME: do we need to hanlde #GNUNET_NAMESTORE_RF_SHADOW_RECORD
+ // FIXME: do we need to hanlde #GNUNET_GNSRECORD_RF_SHADOW_RECORD
// here? Or should we do this in libgnunetgns?
rec.expiration_time.abs_value_us = rd[i].expiration_time;
switch (rd[i].record_type)
case GNUNET_DNSPARSER_TYPE_AAAA:
GNUNET_assert (sizeof (struct in6_addr) == rd[i].data_size);
rec.name = GNUNET_strdup (packet->queries[0].name);
- rec.data.raw.data = GNUNET_malloc (sizeof (struct in6_addr));
+ rec.data.raw.data = GNUNET_new (struct in6_addr);
rec.dns_traffic_class = GNUNET_TUN_DNS_CLASS_INTERNET;
rec.type = GNUNET_DNSPARSER_TYPE_AAAA;
memcpy (rec.data.raw.data,
break;
case GNUNET_DNSPARSER_TYPE_CNAME:
rec.name = GNUNET_strdup (packet->queries[0].name);
- rec.data.hostname = strdup (rd[i].data);
+ rec.data.hostname = GNUNET_strdup (rd[i].data);
rec.dns_traffic_class = GNUNET_TUN_DNS_CLASS_INTERNET;
rec.type = GNUNET_DNSPARSER_TYPE_CNAME;
memcpy (rec.data.hostname,
strcpy (&name[name_len - strlen (fcfs_suffix)],
".gnu");
use_gns = GNUNET_YES;
- } else if ( (name_len > strlen (dns_suffix)) &&
- (0 == strcasecmp (dns_suffix,
- &name[name_len - strlen (dns_suffix)])) )
+ }
+ else if ( (name_len > strlen (dns_suffix)) &&
+ (0 == strcasecmp (dns_suffix,
+ &name[name_len - strlen (dns_suffix)])) )
{
/* replace ".zkey.eu" with ".zkey" */
strcpy (&name[name_len - strlen (dns_suffix)],
}
if ( (NULL == gns_zone_str) ||
(GNUNET_OK !=
- GNUNET_CRYPTO_ecc_public_sign_key_from_string (gns_zone_str,
+ GNUNET_CRYPTO_ecdsa_public_key_from_string (gns_zone_str,
strlen (gns_zone_str),
&my_zone)) )
{