* converted to the DNS response.
*/
struct GNUNET_DNSPARSER_Packet *packet;
-
+
/**
* Our GNS request handle.
*/
/**
* Number of bytes in 'addr'.
- */
+ */
size_t addr_len;
};
/**
* 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.
{
char *buf;
size_t size;
-
+
if (GNUNET_SYSERR ==
GNUNET_DNSPARSER_pack (request->packet,
UINT16_MAX /* is this not too much? */,
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_A:
GNUNET_assert (sizeof (struct in_addr) == rd[i].data_size);
rec.name = GNUNET_strdup (packet->queries[0].name);
- rec.class = GNUNET_TUN_DNS_CLASS_INTERNET;
+ rec.dns_traffic_class = GNUNET_TUN_DNS_CLASS_INTERNET;
rec.type = GNUNET_DNSPARSER_TYPE_A;
rec.data.raw.data = GNUNET_new (struct in_addr);
memcpy (rec.data.raw.data,
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.class = GNUNET_TUN_DNS_CLASS_INTERNET;
+ rec.dns_traffic_class = GNUNET_TUN_DNS_CLASS_INTERNET;
rec.type = GNUNET_DNSPARSER_TYPE_AAAA;
memcpy (rec.data.raw.data,
rd[i].data,
case GNUNET_DNSPARSER_TYPE_CNAME:
rec.name = GNUNET_strdup (packet->queries[0].name);
rec.data.hostname = strdup (rd[i].data);
- rec.class = GNUNET_TUN_DNS_CLASS_INTERNET;
+ rec.dns_traffic_class = GNUNET_TUN_DNS_CLASS_INTERNET;
rec.type = GNUNET_DNSPARSER_TYPE_CNAME;
memcpy (rec.data.hostname,
rd[i].data,
* @param addr address to use for sending the reply
* @param addr_len number of bytes in @a addr
* @param udp_msg DNS request payload
- * @param udp_msg_size number of bytes in @a udp_msg
+ * @param udp_msg_size number of bytes in @a udp_msg
*/
static void
handle_request (struct GNUNET_NETWORK_Handle *lsock,
(int) packet->num_answers,
(int) packet->num_authority_records,
(int) packet->num_additional_records);
- if ( (0 != packet->flags.query_or_response) ||
+ if ( (0 != packet->flags.query_or_response) ||
(0 != packet->num_answers) ||
(0 != packet->num_authority_records))
{
name_len = strlen (name);
use_gns = GNUNET_NO;
-
+
if ( (name_len > strlen (fcfs_suffix)) &&
(0 == strcasecmp (fcfs_suffix,
&name[name_len - strlen (fcfs_suffix)])) )
else
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Using DNS resolver IP `%s' to resolve `%s'\n",
+ "Using DNS resolver IP `%s' to resolve `%s'\n",
dns_ip,
name);
GNUNET_DNSPARSER_free_packet (request->packet);
*
* @param cls the 'listen_socket4'
* @param tc scheduler context
- */
+ */
static void
read_dns4 (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
}
{
char buf[size];
-
+
addrlen = sizeof (v4);
- GNUNET_break (size ==
+ GNUNET_break (size ==
GNUNET_NETWORK_socket_recvfrom (listen_socket4,
buf,
size,
*
* @param cls the 'listen_socket6'
* @param tc scheduler context
- */
+ */
static void
read_dns6 (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
}
{
char buf[size];
-
+
addrlen = sizeof (v6);
- GNUNET_break (size ==
+ GNUNET_break (size ==
GNUNET_NETWORK_socket_recvfrom (listen_socket6,
buf,
size,
return;
}
listen_socket4 = GNUNET_NETWORK_socket_create (PF_INET,
- SOCK_DGRAM,
+ SOCK_DGRAM,
IPPROTO_UDP);
if (NULL != listen_socket4)
{
}
}
listen_socket6 = GNUNET_NETWORK_socket_create (PF_INET6,
- SOCK_DGRAM,
+ SOCK_DGRAM,
IPPROTO_UDP);
if (NULL != listen_socket6)
{
}
-/**
+/**
* Method called to inform about the egos of this peer.
*
* When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get,
* @a ego does indicate an error (i.e. name is taken or no default
* value is known). If @a ego is non-NULL and if '*ctx'
* is set in those callbacks, the value WILL be passed to a subsequent
- * call to the identity callback of #GNUNET_IDENTITY_connect (if
+ * call to the identity callback of #GNUNET_IDENTITY_connect (if
* that one was not NULL).
*
* @param cls closure, NULL
}
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)) )
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("No valid GNS zone specified!\n"));
GNUNET_SCHEDULER_shutdown ();
return;
* @return 0 ok, 1 on error
*/
int
-main (int argc,
+main (int argc,
char *const *argv)
{
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
ret =
(GNUNET_OK ==
GNUNET_PROGRAM_run (argc, argv, "gnunet-dns2gns",
- _("GNUnet DNS-to-GNS proxy (a DNS server)"),
+ _("GNUnet DNS-to-GNS proxy (a DNS server)"),
options,
&run, NULL)) ? 0 : 1;
GNUNET_free ((void*) argv);