From: Miek Gieben Date: Wed, 14 Sep 2005 11:08:20 +0000 (+0000) Subject: print flags do; instead of flags; 3600; in the edns section X-Git-Tag: release-1.0.0~136 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7156254362cca9de286a74acdb8e45ccc656fae;p=thirdparty%2Fldns.git print flags do; instead of flags; 3600; in the edns section --- diff --git a/host2str.c b/host2str.c index b4c50597..7c53bd36 100644 --- a/host2str.c +++ b/host2str.c @@ -909,6 +909,7 @@ ldns_pkt2buffer_str(ldns_buffer *output, ldns_pkt *pkt) { uint16_t i; ldns_status status = LDNS_STATUS_OK; + ldns_lookup_table *lt; char *tmp; if (!pkt) { @@ -970,10 +971,13 @@ ldns_pkt2buffer_str(ldns_buffer *output, ldns_pkt *pkt) /* add some futher fields */ ldns_buffer_printf(output, ";; Query time: %d msec\n", ldns_pkt_querytime(pkt)); if (ldns_pkt_edns(pkt)) { + lt = ldns_lookup_by_id(ldns_edns_flags, + (int)ldns_pkt_edns_z(pkt)); + ldns_buffer_printf(output, - ";; EDNS: version %u, flags: %u; udp: %u\n", + ";; EDNS: version %u, flags: %s; udp: %u\n", ldns_pkt_edns_version(pkt), - ldns_pkt_edns_z(pkt), + lt->name, ldns_pkt_edns_udp_size(pkt) ); if (ldns_pkt_edns_data(pkt)) { diff --git a/ldns/dns.h b/ldns/dns.h index 8f397c87..ed4d7225 100644 --- a/ldns/dns.h +++ b/ldns/dns.h @@ -62,5 +62,6 @@ extern ldns_lookup_table ldns_rr_classes[]; /* if these are used elsewhere */ extern ldns_lookup_table ldns_rcodes[]; extern ldns_lookup_table ldns_opcodes[]; +extern ldns_lookup_table ldns_edns_flags[]; #endif /* _LDNS_DNS_H_ */ diff --git a/packet.c b/packet.c index d4a353a1..ca188d2e 100644 --- a/packet.c +++ b/packet.c @@ -21,6 +21,12 @@ * do this as functions to get type checking */ +/* TODO defines for 3600 */ +/* convert to and from numerical flag values */ +ldns_lookup_table ldns_edns_flags[] = { + { 3600, "do"}, + { 0, NULL} +}; /* read */ uint16_t