#include "gnunet_dns_service.h"
#include "gnunet_resolver_service.h"
#include "gnunet_dnsparser_lib.h"
-#include "gns_protocol.h"
#include "gnunet_gns_service.h"
-#include "gns_common.h"
#include "gns.h"
#include "gnunet-service-gns_resolver.h"
#include "gnunet_vpn_service.h"
* even though they consist of multiple labels.
*
* Examples:
- * a.b.gads = not canonical
+ * a.b.gnu = not canonical
* a = canonical
* _foo._srv = canonical
* _f.bar = not canonical
struct RecordLookupHandle *rlh = rh->proc_cls;
struct GNUNET_DNSPARSER_Query query;
struct GNUNET_DNSPARSER_Packet packet;
- struct GNUNET_DNSPARSER_Flags flags;
+ struct GNUNET_TUN_DnsFlags flags;
struct in_addr dnsip;
struct sockaddr_in addr;
struct sockaddr *sa;
}
query.name = rh->dns_name;
query.type = rlh->record_type;
- query.class = GNUNET_DNSPARSER_CLASS_INTERNET;
+ query.class = GNUNET_TUN_DNS_CLASS_INTERNET;
memset (&flags, 0, sizeof (flags));
flags.recursion_desired = 1;
flags.checking_disabled = 1;
{
struct RecordLookupHandle *rlh = rh->proc_cls;
struct GNUNET_HashCode serv_desc;
- struct vpn_data* vpn;
+ struct GNUNET_TUN_GnsVpnRecord* vpn;
int af;
/* We cancel here as to not include the ns lookup in the timeout */
rh->priv_key);
}
- vpn = (struct vpn_data*)rd->data;
+ vpn = (struct GNUNET_TUN_GnsVpnRecord*)rd->data;
GNUNET_CRYPTO_hash ((char*)&vpn[1],
strlen ((char*)&vpn[1]) + 1,
&serv_desc);
{
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
"GNS_PHASE_DELEGATE_REV-%llu: Starting background lookup for %s type %d\n",
- rh->id, "+.gads", GNUNET_NAMESTORE_TYPE_REV);
+ rh->id, "+.gnu", GNUNET_NAMESTORE_TYPE_REV);
gns_resolver_lookup_record(rh->authority,
rh->private_local_zone,
char new_mx_data[MAX_MX_LENGTH];
char new_soa_data[MAX_SOA_LENGTH];
char new_srv_data[MAX_SRV_LENGTH];
- struct srv_data *old_srv;
- struct srv_data *new_srv;
- struct soa_data *old_soa;
- struct soa_data *new_soa;
+ struct GNUNET_TUN_DnsSrvRecord *old_srv;
+ struct GNUNET_TUN_DnsSrvRecord *new_srv;
+ struct GNUNET_TUN_DnsSoaRecord *old_soa;
+ struct GNUNET_TUN_DnsSoaRecord *new_soa;
struct GNUNET_NAMESTORE_RecordData p_rd[rd_count];
char* repl_string;
char* pos;
/*
* Prio, weight and port
*/
- new_srv = (struct srv_data*)new_srv_data;
- old_srv = (struct srv_data*)rd[i].data;
+ new_srv = (struct GNUNET_TUN_DnsSrvRecord*)new_srv_data;
+ old_srv = (struct GNUNET_TUN_DnsSrvRecord*)rd[i].data;
new_srv->prio = old_srv->prio;
new_srv->weight = old_srv->weight;
new_srv->port = old_srv->port;
expand_plus((char*)&new_srv[1], (char*)&old_srv[1],
repl_string);
p_rd[i].data = new_srv_data;
- p_rd[i].data_size = sizeof (struct srv_data) + strlen ((char*)&new_srv[1]) + 1;
+ p_rd[i].data_size = sizeof (struct GNUNET_TUN_DnsSrvRecord) + strlen ((char*)&new_srv[1]) + 1;
}
else if (GNUNET_DNSPARSER_TYPE_SOA == rd[i].record_type)
{
/* expand mname and rname */
- old_soa = (struct soa_data*)rd[i].data;
- new_soa = (struct soa_data*)new_soa_data;
- memcpy (new_soa, old_soa, sizeof (struct soa_data));
+ old_soa = (struct GNUNET_TUN_DnsSoaRecord*)rd[i].data;
+ new_soa = (struct GNUNET_TUN_DnsSoaRecord*)new_soa_data;
+ memcpy (new_soa, old_soa, sizeof (struct GNUNET_TUN_DnsSoaRecord));
// FIXME: how do we know that 'new_soa[1]' has enough space for the new name?
expand_plus((char*)&new_soa[1], (char*)&old_soa[1], repl_string);
offset = strlen ((char*)&new_soa[1]) + 1;
expand_plus((char*)&new_soa[1] + offset,
(char*)&old_soa[1] + strlen ((char*)&old_soa[1]) + 1,
repl_string);
- p_rd[i].data_size = sizeof (struct soa_data)
+ p_rd[i].data_size = sizeof (struct GNUNET_TUN_DnsSoaRecord)
+ offset
+ strlen ((char*)&new_soa[1] + offset);
p_rd[i].data = new_soa_data;
query = GNUNET_new (struct GNUNET_DNSPARSER_Query);
query->name = GNUNET_strdup (ac->label);
query->type = rh->record_type;
- query->class = GNUNET_DNSPARSER_CLASS_INTERNET;
+ query->class = GNUNET_TUN_DNS_CLASS_INTERNET;
p = GNUNET_new (struct GNUNET_DNSPARSER_Packet);
p->queries = query;
p->num_queries = 1;
p->id = (uint16_t) GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE,
UINT16_MAX);
- p->flags.opcode = GNUNET_DNSPARSER_OPCODE_QUERY;
+ p->flags.opcode = GNUNET_TUN_DNS_OPCODE_QUERY;
p->flags.recursion_desired = 1;
if (GNUNET_OK !=
GNUNET_DNSPARSER_pack (p, 1024, &dns_request, &dns_request_length))
if ( ( (GNUNET_YES == is_canonical (name)) &&
(0 != strcmp (GNUNET_GNS_TLD, name)) ) ||
- ( (GNUNET_YES != is_gads_tld (name)) &&
+ ( (GNUNET_YES != is_gnu_tld (name)) &&
(GNUNET_YES != is_zkey_tld (name)) ) )
{
/* use standard DNS lookup */
cfg = c;
namestore_handle = nh;
- dht_handle = dh;
+ dht_handle = dht;
dht_lookup_heap =
GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN);
max_allowed_background_queries = max_bg_queries;