*/
struct GNUNET_SERVER_TransmitHandle *th;
- /**
- * Client that we are transmitting to.
- */
- struct GNUNET_SERVER_Client *client;
-
};
*/
static int cleaning_done;
+
/**
* Function called to notify a client about the socket
* begin ready to queue more data. "buf" will be
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("Transmission to client failed!\n"));
- GNUNET_SERVER_client_drop (tcc->client);
GNUNET_free (tcc->msg);
GNUNET_free (tcc);
return 0;
}
GNUNET_assert (size >= msize);
memcpy (buf, tcc->msg, msize);
- GNUNET_SERVER_client_drop (tcc->client);
GNUNET_free (tcc->msg);
GNUNET_free (tcc);
return msize;
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("Shutdown in progress, aborting transmission.\n"));
- GNUNET_SERVER_client_drop (client);
GNUNET_free (msg);
return;
}
tcc = GNUNET_malloc (sizeof (struct TransmitCallbackContext));
tcc->msg = msg;
- tcc->client = client;
if (NULL ==
(tcc->th =
GNUNET_SERVER_notify_transmit_ready (client,
&transmit_callback, tcc)))
{
GNUNET_break (0);
- GNUNET_SERVER_client_drop (client);
GNUNET_free (msg);
GNUNET_free (tcc);
return;
}
- GNUNET_SERVER_client_keep (client);
GNUNET_CONTAINER_DLL_insert (tcc_head, tcc_tail, tcc);
}
+
#define MarshallPtr(ptr, base, type) \
if (ptr) \
ptr = (type *) ((char *) ptr - (char *) base)
+
void
MarshallWSAQUERYSETW (WSAQUERYSETW *qs, GUID *sc)
{
{
switch (rd[i].record_type)
{
- case GNUNET_GNS_RECORD_A:
+ case GNUNET_DNSPARSER_TYPE_A:
if (rd[i].data_size != sizeof (struct in_addr))
continue;
size += sizeof (CSADDR_INFO) + sizeof (struct sockaddr_in) * 2;
csanum++;
break;
- case GNUNET_GNS_RECORD_AAAA:
+ case GNUNET_DNSPARSER_TYPE_AAAA:
if (rd[i].data_size != sizeof (struct in6_addr))
continue;
size += sizeof (CSADDR_INFO) + sizeof (struct sockaddr_in6) * 2;
blobsize += sizeof (void *); /* For addresses */
for (i = 0; i < rd_count; i++)
{
- if ((rq->af == AF_INET || rq->af == AF_UNSPEC) && rd[i].record_type == GNUNET_GNS_RECORD_A)
+ if ((rq->af == AF_INET || rq->af == AF_UNSPEC) && rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
{
blobsize += sizeof (void *);
blobsize += sizeof (struct in_addr);
blobaddrcount++;
}
- else if (rq->af == AF_INET6 && rd[i].record_type == GNUNET_GNS_RECORD_AAAA)
+ else if (rq->af == AF_INET6 && rd[i].record_type == GNUNET_DNSPARSER_TYPE_AAAA)
{
blobsize += sizeof (void *);
blobsize += sizeof (struct in6_addr);
{
switch (rd[i].record_type)
{
- case GNUNET_GNS_RECORD_A:
+ case GNUNET_DNSPARSER_TYPE_A:
if (rd[i].data_size != sizeof (struct in_addr))
continue;
qs->lpcsaBuffer[j].iSocketType = SOCK_STREAM;
size_recalc += sizeof (CSADDR_INFO) + sizeof (struct sockaddr_in) * 2;
j++;
break;
- case GNUNET_GNS_RECORD_AAAA:
+ case GNUNET_DNSPARSER_TYPE_AAAA:
if (rd[i].data_size != sizeof (struct in6_addr))
continue;
qs->lpcsaBuffer[j].iSocketType = SOCK_STREAM;
for (i = 0; i < rd_count; i++)
{
if ((rq->af == AF_INET || rq->af == AF_UNSPEC) &&
- rd[i].record_type == GNUNET_GNS_RECORD_A)
+ rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
{
he->h_addr_list[j] = (char *) ptr;
ptr += sizeof (struct in_addr);
memcpy (he->h_addr_list[j], rd[i].data, sizeof (struct in_addr));
j++;
}
- else if (rq->af == AF_INET6 && rd[i].record_type == GNUNET_GNS_RECORD_AAAA)
+ else if (rq->af == AF_INET6 && rd[i].record_type == GNUNET_DNSPARSER_TYPE_AAAA)
{
he->h_addr_list[j] = (char *) ptr;
ptr += sizeof (struct in6_addr);
transmit (rq->client, &msg->header);
}
+
static void
get_ip_from_hostname (struct GNUNET_SERVER_Client *client,
const wchar_t *name, int af, GUID sc)
uint32_t rtype;
if (IsEqualGUID (&SVCID_DNS_TYPE_A, &sc))
- rtype = GNUNET_GNS_RECORD_A;
+ rtype = GNUNET_DNSPARSER_TYPE_A;
else if (IsEqualGUID (&SVCID_DNS_TYPE_NS, &sc))
- rtype = GNUNET_GNS_RECORD_NS;
+ rtype = GNUNET_DNSPARSER_TYPE_NS;
else if (IsEqualGUID (&SVCID_DNS_TYPE_CNAME, &sc))
- rtype = GNUNET_GNS_RECORD_CNAME;
+ rtype = GNUNET_DNSPARSER_TYPE_CNAME;
else if (IsEqualGUID (&SVCID_DNS_TYPE_SOA, &sc))
- rtype = GNUNET_GNS_RECORD_SOA;
+ rtype = GNUNET_DNSPARSER_TYPE_SOA;
else if (IsEqualGUID (&SVCID_DNS_TYPE_PTR, &sc))
- rtype = GNUNET_GNS_RECORD_PTR;
+ rtype = GNUNET_DNSPARSER_TYPE_PTR;
else if (IsEqualGUID (&SVCID_DNS_TYPE_MX, &sc))
- rtype = GNUNET_GNS_RECORD_MX;
+ rtype = GNUNET_DNSPARSER_TYPE_MX;
else if (IsEqualGUID (&SVCID_DNS_TYPE_TEXT, &sc))
- rtype = GNUNET_GNS_RECORD_TXT;
+ rtype = GNUNET_DNSPARSER_TYPE_TXT;
else if (IsEqualGUID (&SVCID_DNS_TYPE_AAAA, &sc))
- rtype = GNUNET_GNS_RECORD_AAAA;
+ rtype = GNUNET_DNSPARSER_TYPE_AAAA;
else if (IsEqualGUID (&SVCID_DNS_TYPE_SRV, &sc))
- rtype = GNUNET_GNS_RECORD_SRV;
+ rtype = GNUNET_DNSPARSER_TYPE_SRV;
else if (IsEqualGUID (&SVCID_INET_HOSTADDRBYNAME, &sc))
- rtype = GNUNET_GNS_RECORD_A;
+ rtype = GNUNET_DNSPARSER_TYPE_A;
else
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Lookup launched, waiting for a reply\n");
- GNUNET_SERVER_client_keep (client);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
else
}
}
+
/**
* Handle GET-message.
*
return;
}
get_ip_from_hostname (client, hostname, af, sc);
- return;
}
char* keyfile;
struct GNUNET_CRYPTO_EccPrivateKey *key = NULL;
- struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pkey;
+ struct GNUNET_CRYPTO_EccPublicKey pkey;
struct GNUNET_CRYPTO_ShortHashAsciiEncoded zonename;
if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
GNUNET_CRYPTO_ecc_key_get_public (key, &pkey);
GNUNET_CRYPTO_short_hash(&pkey,
- sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded),
+ sizeof(struct GNUNET_CRYPTO_EccPublicKey),
&user_zone);
zone = &user_zone;
GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename);
return ret;
}
-/* end of gnunet-gns.c */
+/* end of gnunet-gns-helper-service-w32.c */