[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: do work on more record type
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: do work on more record types |
Date: |
Fri, 06 Apr 2018 20:09:05 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new e0d986941 do work on more record types
e0d986941 is described below
commit e0d9869415af5a5752e3b27ea14b249a52ac9877
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Apr 6 20:08:52 2018 +0200
do work on more record types
---
src/dns/dnsparser.c | 5 ++-
src/dns/gnunet-zoneimport.c | 88 ++++++++++++++++++++++++++++++++++++++
src/include/gnunet_dnsparser_lib.h | 27 +++++++++++-
3 files changed, 118 insertions(+), 2 deletions(-)
diff --git a/src/dns/dnsparser.c b/src/dns/dnsparser.c
index 1fe6f595f..ab833f7c5 100644
--- a/src/dns/dnsparser.c
+++ b/src/dns/dnsparser.c
@@ -615,6 +615,7 @@ GNUNET_DNSPARSER_parse_record (const char *udp_payload,
{
case GNUNET_DNSPARSER_TYPE_NS:
case GNUNET_DNSPARSER_TYPE_CNAME:
+ case GNUNET_DNSPARSER_TYPE_DNAME:
case GNUNET_DNSPARSER_TYPE_PTR:
r->data.hostname = GNUNET_DNSPARSER_parse_name (udp_payload,
udp_payload_length,
@@ -659,7 +660,9 @@ GNUNET_DNSPARSER_parse_record (const char *udp_payload,
default:
r->data.raw.data = GNUNET_malloc (data_len);
r->data.raw.data_len = data_len;
- GNUNET_memcpy (r->data.raw.data, &udp_payload[*off], data_len);
+ GNUNET_memcpy (r->data.raw.data,
+ &udp_payload[*off],
+ data_len);
break;
}
(*off) += data_len;
diff --git a/src/dns/gnunet-zoneimport.c b/src/dns/gnunet-zoneimport.c
index c1897d6e6..914868af4 100644
--- a/src/dns/gnunet-zoneimport.c
+++ b/src/dns/gnunet-zoneimport.c
@@ -189,6 +189,94 @@ process_record (struct Request *req,
(unsigned int) rec->data.mx->preference,
rec->data.mx->mxhost);
break;
+ case GNUNET_DNSPARSER_TYPE_SOA:
+ fprintf (stdout,
+ "%s SOA %s %s %u %u %u %u %u\n",
+ req->hostname,
+ rec->data.soa->mname,
+ rec->data.soa->rname,
+ (unsigned int) rec->data.soa->serial,
+ (unsigned int) rec->data.soa->refresh,
+ (unsigned int) rec->data.soa->retry,
+ (unsigned int) rec->data.soa->expire,
+ (unsigned int) rec->data.soa->minimum_ttl);
+ break;
+ case GNUNET_DNSPARSER_TYPE_SRV:
+ fprintf (stdout,
+ "%s SRV %s %u %u %u\n",
+ req->hostname,
+ rec->data.srv->target,
+ rec->data.srv->priority,
+ rec->data.srv->weight,
+ rec->data.srv->port);
+ break;
+ case GNUNET_DNSPARSER_TYPE_PTR:
+ fprintf (stdout,
+ "%s PTR %s\n",
+ req->hostname,
+ rec->data.hostname);
+ break;
+ case GNUNET_DNSPARSER_TYPE_TXT:
+ fprintf (stdout,
+ "%s TXT %.*s\n",
+ req->hostname,
+ (int) rec->data.raw.data_len,
+ (char *) rec->data.raw.data);
+ break;
+ case GNUNET_DNSPARSER_TYPE_DNAME:
+ fprintf (stdout,
+ "%s DNAME %s\n",
+ req->hostname,
+ rec->data.hostname);
+ break;
+
+ /* obscure records */
+ case GNUNET_DNSPARSER_TYPE_AFSDB:
+ case GNUNET_DNSPARSER_TYPE_NAPTR:
+ case GNUNET_DNSPARSER_TYPE_APL:
+ case GNUNET_DNSPARSER_TYPE_DHCID:
+ case GNUNET_DNSPARSER_TYPE_HIP:
+ case GNUNET_DNSPARSER_TYPE_LOC:
+ case GNUNET_DNSPARSER_TYPE_RP:
+ case GNUNET_DNSPARSER_TYPE_TKEY:
+ case GNUNET_DNSPARSER_TYPE_TSIG:
+ case GNUNET_DNSPARSER_TYPE_URI:
+ case GNUNET_DNSPARSER_TYPE_TA:
+
+ /* DNSSEC */
+ case GNUNET_DNSPARSER_TYPE_DS:
+ case GNUNET_DNSPARSER_TYPE_RRSIG:
+ case GNUNET_DNSPARSER_TYPE_NSEC:
+ case GNUNET_DNSPARSER_TYPE_DNSKEY:
+ case GNUNET_DNSPARSER_TYPE_NSEC3:
+ case GNUNET_DNSPARSER_TYPE_NSEC3PARAM:
+ case GNUNET_DNSPARSER_TYPE_CDS:
+ case GNUNET_DNSPARSER_TYPE_CDNSKEY:
+
+ /* DNSSEC payload */
+ case GNUNET_DNSPARSER_TYPE_CERT:
+ case GNUNET_DNSPARSER_TYPE_SSHFP:
+ case GNUNET_DNSPARSER_TYPE_IPSECKEY:
+ case GNUNET_DNSPARSER_TYPE_TLSA:
+ case GNUNET_DNSPARSER_TYPE_OPENPGPKEY:
+
+ /* obsolete records */
+ case GNUNET_DNSPARSER_TYPE_SIG:
+ case GNUNET_DNSPARSER_TYPE_KEY:
+ case GNUNET_DNSPARSER_TYPE_KX:
+ {
+ char *base32;
+
+ base32 = GNUNET_STRINGS_data_to_string_alloc (rec->data.raw.data,
+ rec->data.raw.data_len);
+ fprintf (stdout,
+ "%s (%u) %s\n",
+ req->hostname,
+ rec->type,
+ base32);
+ GNUNET_free (base32);
+ }
+ break;
default:
fprintf (stderr,
"Unsupported type %u\n",
diff --git a/src/include/gnunet_dnsparser_lib.h
b/src/include/gnunet_dnsparser_lib.h
index 57709d5f7..3a2f785d3 100644
--- a/src/include/gnunet_dnsparser_lib.h
+++ b/src/include/gnunet_dnsparser_lib.h
@@ -57,11 +57,36 @@
#define GNUNET_DNSPARSER_TYPE_PTR 12
#define GNUNET_DNSPARSER_TYPE_MX 15
#define GNUNET_DNSPARSER_TYPE_TXT 16
+#define GNUNET_DNSPARSER_TYPE_RP 17
+#define GNUNET_DNSPARSER_TYPE_AFSDB 18
+#define GNUNET_DNSPARSER_TYPE_SIG 24
+#define GNUNET_DNSPARSER_TYPE_KEY 25
#define GNUNET_DNSPARSER_TYPE_AAAA 28
+#define GNUNET_DNSPARSER_TYPE_LOC 29
#define GNUNET_DNSPARSER_TYPE_SRV 33
+#define GNUNET_DNSPARSER_TYPE_NAPTR 35
+#define GNUNET_DNSPARSER_TYPE_KX 36
#define GNUNET_DNSPARSER_TYPE_CERT 37
+#define GNUNET_DNSPARSER_TYPE_DNAME 39
+#define GNUNET_DNSPARSER_TYPE_APL 42
+#define GNUNET_DNSPARSER_TYPE_DS 43
+#define GNUNET_DNSPARSER_TYPE_SSHFP 44
+#define GNUNET_DNSPARSER_TYPE_IPSECKEY 45
+#define GNUNET_DNSPARSER_TYPE_RRSIG 46
+#define GNUNET_DNSPARSER_TYPE_NSEC 47
+#define GNUNET_DNSPARSER_TYPE_DNSKEY 48
+#define GNUNET_DNSPARSER_TYPE_DHCID 49
+#define GNUNET_DNSPARSER_TYPE_NSEC3 50
+#define GNUNET_DNSPARSER_TYPE_NSEC3PARAM 51
#define GNUNET_DNSPARSER_TYPE_TLSA 52
-
+#define GNUNET_DNSPARSER_TYPE_HIP 55
+#define GNUNET_DNSPARSER_TYPE_CDS 59
+#define GNUNET_DNSPARSER_TYPE_CDNSKEY 60
+#define GNUNET_DNSPARSER_TYPE_OPENPGPKEY 61
+#define GNUNET_DNSPARSER_TYPE_TKEY 249
+#define GNUNET_DNSPARSER_TYPE_TSIG 250
+#define GNUNET_DNSPARSER_TYPE_URI 256
+#define GNUNET_DNSPARSER_TYPE_TA 32768
/**
* A DNS query.
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: do work on more record types,
gnunet <=