summaryrefslogtreecommitdiffstats
path: root/usr.bin/dig/lib/dns/rdata.c
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2020-02-24 12:06:13 +0000
committerflorian <florian@openbsd.org>2020-02-24 12:06:13 +0000
commita9a8f5b30174fab83157e27cf604851777da76e3 (patch)
treef32c1f81c0342c511ea0c7efb97291b105e3604a /usr.bin/dig/lib/dns/rdata.c
parentStop generating DNS class and type enums. (diff)
downloadwireguard-openbsd-a9a8f5b30174fab83157e27cf604851777da76e3.tar.xz
wireguard-openbsd-a9a8f5b30174fab83157e27cf604851777da76e3.zip
We are always preserving the order of records.
This lets us remove compare_* and casecompare_* functions from RR types. OK jung
Diffstat (limited to 'usr.bin/dig/lib/dns/rdata.c')
-rw-r--r--usr.bin/dig/lib/dns/rdata.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/usr.bin/dig/lib/dns/rdata.c b/usr.bin/dig/lib/dns/rdata.c
index 72a7a604413..4fcdef5afc9 100644
--- a/usr.bin/dig/lib/dns/rdata.c
+++ b/usr.bin/dig/lib/dns/rdata.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdata.c,v 1.14 2020/02/24 12:05:37 florian Exp $ */
+/* $Id: rdata.c,v 1.15 2020/02/24 12:06:13 florian Exp $ */
/*! \file */
@@ -378,42 +378,6 @@ dns_rdata_clone(const dns_rdata_t *src, dns_rdata_t *target) {
target->flags = src->flags;
}
-
-/***
- *** Comparisons
- ***/
-
-int
-dns_rdata_compare(const dns_rdata_t *rdata1, const dns_rdata_t *rdata2) {
- int result = 0;
- isc_boolean_t use_default = ISC_FALSE;
-
- REQUIRE(rdata1 != NULL);
- REQUIRE(rdata2 != NULL);
- REQUIRE(rdata1->length == 0 || rdata1->data != NULL);
- REQUIRE(rdata2->length == 0 || rdata2->data != NULL);
- REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1));
- REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2));
-
- if (rdata1->rdclass != rdata2->rdclass)
- return (rdata1->rdclass < rdata2->rdclass ? -1 : 1);
-
- if (rdata1->type != rdata2->type)
- return (rdata1->type < rdata2->type ? -1 : 1);
-
- COMPARESWITCH
-
- if (use_default) {
- isc_region_t r1;
- isc_region_t r2;
-
- dns_rdata_toregion(rdata1, &r1);
- dns_rdata_toregion(rdata2, &r2);
- result = isc_region_compare(&r1, &r2);
- }
- return (result);
-}
-
/***
*** Conversions
***/