]> granicus.if.org Git - pdns/commitdiff
make DSRecordContent sort and compare
authorbert hubert <bert.hubert@netherlabs.nl>
Thu, 5 Nov 2015 08:20:39 +0000 (09:20 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Thu, 5 Nov 2015 08:20:39 +0000 (09:20 +0100)
pdns/dnsrecords.hh

index 6ff7b535d2d2a5b5d867c3b381b8329b6f4c7993..2e7cadf9ae3ff1d5e231ccdcd6fecd147525102a 100644 (file)
@@ -302,6 +302,17 @@ class DSRecordContent : public DNSRecordContent
 {
 public:
   DSRecordContent();
+  bool operator==(const DSRecordContent& rhs) const
+  {
+    return tie(d_tag, d_algorithm, d_digesttype, d_digest) ==
+      tie(rhs.d_tag, rhs.d_algorithm, rhs.d_digesttype, rhs.d_digest);
+  }
+  bool operator<(const DSRecordContent& rhs) const
+  {
+    return tie(d_tag, d_algorithm, d_digesttype, d_digest) <
+      tie(rhs.d_tag, rhs.d_algorithm, rhs.d_digesttype, rhs.d_digest);
+  }
+
   includeboilerplate(DS)
 
   uint16_t d_tag;