From 7372210b9b64bacf24c711c49074032cc8527db2 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 26 Sep 2013 11:10:39 +0200 Subject: [PATCH] Remove unused LDNS_RDF_TYPE_TSIG and associated functions. --- Changelog | 1 + .../python/docs/source/modules/ldns_rdf.rst | 2 +- contrib/python/ldns_rdf.i | 2 +- host2str.c | 10 ----- ldns/host2str.h | 9 ----- ldns/rdata.h | 5 ++- ldns/str2host.h | 8 ---- lua/rns-lib.lua | 38 ++++++++++--------- rdata.c | 3 -- str2host.c | 9 ----- wire2host.c | 1 - 11 files changed, 27 insertions(+), 61 deletions(-) diff --git a/Changelog b/Changelog index 54902051..2821668e 100644 --- a/Changelog +++ b/Changelog @@ -45,6 +45,7 @@ ldns 1.7.0 will have shared library version (SONAME) 2.0.0 * bugfix #521: drill trace continue on empty non-terminals with NSEC3 * bugfix #525: Fix documentation of ldns_resolver_set_retry + * Remove unused LDNS_RDF_TYPE_TSIG and associated functions. 1.6.16 2012-11-13 * Fix Makefile to build pyldns with BSD make diff --git a/contrib/python/docs/source/modules/ldns_rdf.rst b/contrib/python/docs/source/modules/ldns_rdf.rst index 5ed1799b..4a482e44 100644 --- a/contrib/python/docs/source/modules/ldns_rdf.rst +++ b/contrib/python/docs/source/modules/ldns_rdf.rst @@ -35,7 +35,7 @@ Predefined constants * LDNS_RDF_TYPE_TIME, * LDNS_RDF_TYPE_PERIOD, * LDNS_RDF_TYPE_TSIGTIME, - * LDNS_RDF_TYPE_TSIG, + * LDNS_RDF_TYPE_HIP, * LDNS_RDF_TYPE_INT16_DATA, * LDNS_RDF_TYPE_SERVICE, * LDNS_RDF_TYPE_LOC, diff --git a/contrib/python/ldns_rdf.i b/contrib/python/ldns_rdf.i index 9bd32727..7b69d8b2 100644 --- a/contrib/python/ldns_rdf.i +++ b/contrib/python/ldns_rdf.i @@ -205,7 +205,7 @@ case LDNS_RDF_TYPE_TIME: return "TIME"; case LDNS_RDF_TYPE_PERIOD: return "PERIOD"; case LDNS_RDF_TYPE_TSIGTIME: return "TSIGTIME"; - case LDNS_RDF_TYPE_TSIG: return "TSIG"; + case LDNS_RDF_TYPE_HIP: return "HIP"; case LDNS_RDF_TYPE_INT16_DATA: return "INT16_DATA"; case LDNS_RDF_TYPE_SERVICE: return "SERVICE"; case LDNS_RDF_TYPE_LOC: return "LOC"; diff --git a/host2str.c b/host2str.c index 798a049f..d28da4b0 100644 --- a/host2str.c +++ b/host2str.c @@ -1159,13 +1159,6 @@ ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf) return ldns_buffer_status(output); } -ldns_status -ldns_rdf2buffer_str_tsig(ldns_buffer *output, const ldns_rdf *rdf) -{ - /* TSIG RRs have no presentation format, make them #size */ - return ldns_rdf2buffer_str_unknown(output, rdf); -} - ldns_status ldns_rdf2buffer_str_ilnp64(ldns_buffer *output, const ldns_rdf *rdf) { @@ -1334,9 +1327,6 @@ ldns_rdf2buffer_str_fmt(ldns_buffer *buffer, case LDNS_RDF_TYPE_IPSECKEY: res = ldns_rdf2buffer_str_ipseckey(buffer, rdf); break; - case LDNS_RDF_TYPE_TSIG: - res = ldns_rdf2buffer_str_tsig(buffer, rdf); - break; case LDNS_RDF_TYPE_INT16_DATA: res = ldns_rdf2buffer_str_int16_data(buffer, rdf); break; diff --git a/ldns/host2str.h b/ldns/host2str.h index 0a020ed5..18e3d15f 100644 --- a/ldns/host2str.h +++ b/ldns/host2str.h @@ -466,15 +466,6 @@ ldns_status ldns_rdf2buffer_str_int16_data(ldns_buffer *output, const ldns_rdf * */ ldns_status ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf); -/** - * Converts an LDNS_RDF_TYPE_TSIG rdata element to string format and adds it to the output buffer - * \param[in] *rdf The rdata to convert - * \param[in] *output The buffer to add the data to - * \return LDNS_STATUS_OK on success, and error status on failure - */ -ldns_status ldns_rdf2buffer_str_tsig(ldns_buffer *output, const ldns_rdf *rdf); - - /** * Converts the data in the rdata field to presentation * format (as char *) and appends it to the given buffer diff --git a/ldns/rdata.h b/ldns/rdata.h index 1d86b0fc..7a9afb45 100644 --- a/ldns/rdata.h +++ b/ldns/rdata.h @@ -86,7 +86,10 @@ enum ldns_enum_rdf_type LDNS_RDF_TYPE_PERIOD, /** tsig time 48 bits */ LDNS_RDF_TYPE_TSIGTIME, - LDNS_RDF_TYPE_TSIG, + /** Represents the Public Key Algorithm, HIT and Public Key fields + for the HIP RR types. A HIP specific rdf type is used because of + the unusual layout in wireformat (see RFC 5205 Section 5) */ + LDNS_RDF_TYPE_HIP, /** variable length any type rdata where the length is specified by the first 2 bytes */ LDNS_RDF_TYPE_INT16_DATA, diff --git a/ldns/str2host.h b/ldns/str2host.h index b8371f7c..6dbf68a5 100644 --- a/ldns/str2host.h +++ b/ldns/str2host.h @@ -180,14 +180,6 @@ ldns_status ldns_str2rdf_alg(ldns_rdf **rd, const char *str); */ ldns_status ldns_str2rdf_unknown(ldns_rdf **rd, const char *str); -/** - * convert string with a tsig? RR into wireformat - * \param[in] rd the rdf where to put the data - * \param[in] str the string to be converted - * \return ldns_status - */ -ldns_status ldns_str2rdf_tsig(ldns_rdf **rd, const char *str); - /** * convert string with a protocol service into wireformat * \param[in] rd the rdf where to put the data diff --git a/lua/rns-lib.lua b/lua/rns-lib.lua index b6e910c0..c32568a5 100644 --- a/lua/rns-lib.lua +++ b/lua/rns-lib.lua @@ -16,24 +16,26 @@ LDNS_RDF_TYPE_A = 5 LDNS_RDF_TYPE_AAAA = 6 LDNS_RDF_TYPE_STR = 7 LDNS_RDF_TYPE_APL = 8 -LDNS_RDF_TYPE_B64 = 9 -LDNS_RDF_TYPE_HEX = 10 -LDNS_RDF_TYPE_NSEC = 11 -LDNS_RDF_TYPE_TYPE = 12 -LDNS_RDF_TYPE_CLASS = 13 -LDNS_RDF_TYPE_CERT = 14 -LDNS_RDF_TYPE_ALG = 15 -LDNS_RDF_TYPE_UNKNOWN = 16 -LDNS_RDF_TYPE_TIME = 17 -LDNS_RDF_TYPE_PERIOD = 18 -LDNS_RDF_TYPE_TSIGTIME = 19 -LDNS_RDF_TYPE_TSIG = 20 -LDNS_RDF_TYPE_INT16_DATA = 21 -LDNS_RDF_TYPE_SERVICE = 22 -LDNS_RDF_TYPE_LOC = 23 -LDNS_RDF_TYPE_WKS = 24 -LDNS_RDF_TYPE_NSA = 25 -LDNS_RDF_TYPE_IPSECKEY = 26 +LDNS_RDF_TYPE_B32_EXT = 9 +LDNS_RDF_TYPE_B64 = 10 +LDNS_RDF_TYPE_HEX = 11 +LDNS_RDF_TYPE_NSEC = 12 +LDNS_RDF_TYPE_TYPE = 13 +LDNS_RDF_TYPE_CLASS = 14 +LDNS_RDF_TYPE_CERT = 15 +LDNS_RDF_TYPE_ALG = 16 +LDNS_RDF_TYPE_UNKNOWN = 17 +LDNS_RDF_TYPE_TIME = 18 +LDNS_RDF_TYPE_PERIOD = 19 +LDNS_RDF_TYPE_TSIGTIME = 20 +LDNS_RDF_TYPE_HIP = 21 +LDNS_RDF_TYPE_INT16_DATA = 22 +LDNS_RDF_TYPE_SERVICE = 23 +LDNS_RDF_TYPE_LOC = 24 +LDNS_RDF_TYPE_WKS = 25 +LDNS_RDF_TYPE_NSAP = 26 +LDNS_RDF_TYPE_ATMA = 27 +LDNS_RDF_TYPE_IPSECKEY = 28 function lua_debug(...) print("[lua]", unpack(arg)) diff --git a/rdata.c b/rdata.c index 5b53c4a9..9b3236db 100644 --- a/rdata.c +++ b/rdata.c @@ -309,9 +309,6 @@ ldns_rdf_new_frm_str(ldns_rdf_type type, const char *str) case LDNS_RDF_TYPE_PERIOD: status = ldns_str2rdf_period(&rdf, str); break; - case LDNS_RDF_TYPE_TSIG: - status = ldns_str2rdf_tsig(&rdf, str); - break; case LDNS_RDF_TYPE_SERVICE: status = ldns_str2rdf_service(&rdf, str); break; diff --git a/str2host.c b/str2host.c index 623f06dd..3c2f9584 100644 --- a/str2host.c +++ b/str2host.c @@ -812,15 +812,6 @@ ldns_str2rdf_unknown( ATTR_UNUSED(ldns_rdf **rd) return LDNS_STATUS_NOT_IMPL; } -ldns_status -ldns_str2rdf_tsig( ATTR_UNUSED(ldns_rdf **rd) - , ATTR_UNUSED(const char *str) - ) -{ - /* there is no string representation for TSIG rrs */ - return LDNS_STATUS_NOT_IMPL; -} - ldns_status ldns_str2rdf_service( ATTR_UNUSED(ldns_rdf **rd) , ATTR_UNUSED(const char *str) diff --git a/wire2host.c b/wire2host.c index 02be4917..40484c07 100644 --- a/wire2host.c +++ b/wire2host.c @@ -333,7 +333,6 @@ ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos) case LDNS_RDF_TYPE_NSAP: case LDNS_RDF_TYPE_ATMA: case LDNS_RDF_TYPE_IPSECKEY: - case LDNS_RDF_TYPE_TSIG: case LDNS_RDF_TYPE_LONG_STR: case LDNS_RDF_TYPE_NONE: /* -- 2.47.3