* converted to the DNS response.
*/
struct GNUNET_DNSPARSER_Packet *packet;
-
+
/**
* Our GNS request handle.
*/
/**
* Number of bytes in 'addr'.
- */
+ */
size_t addr_len;
};
{
char *buf;
size_t size;
-
+
if (GNUNET_SYSERR ==
GNUNET_DNSPARSER_pack (request->packet,
UINT16_MAX /* is this not too much? */,
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)
{
if (GNUNET_OK !=
GNUNET_NETWORK_socket_bind (listen_socket4,
(struct sockaddr *) &v4,
- sizeof (v4),
- 0))
+ sizeof (v4)))
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "bind");
GNUNET_NETWORK_socket_close (listen_socket4);
}
}
listen_socket6 = GNUNET_NETWORK_socket_create (PF_INET6,
- SOCK_DGRAM,
+ SOCK_DGRAM,
IPPROTO_UDP);
if (NULL != listen_socket6)
{
if (GNUNET_OK !=
GNUNET_NETWORK_socket_bind (listen_socket6,
(struct sockaddr *) &v6,
- sizeof (v6),
- 0))
+ sizeof (v6)))
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "bind");
GNUNET_NETWORK_socket_close (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
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);