BIND 10 trac2096, updated. 11cfdc151d5d949cf8c6fd5b05f888225b6a9d9d [2096] Interface of the RDataReader
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Aug 6 13:24:15 UTC 2012
The branch, trac2096 has been updated
via 11cfdc151d5d949cf8c6fd5b05f888225b6a9d9d (commit)
from 06c7f0d32276b1359868632ba73f2fd5d34ef6fd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 11cfdc151d5d949cf8c6fd5b05f888225b6a9d9d
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Mon Aug 6 15:23:06 2012 +0200
[2096] Interface of the RDataReader
The oposite of the isc::datasrc::memory::RDataEncoder.
Only the methods are drafted, no documentation yet and no member
variables listed.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/memory/Makefile.am | 1 +
.../datasrc/memory/rdata_reader.cc} | 4 +-
src/lib/datasrc/memory/rdata_reader.h | 73 ++++++++++++++++++++
3 files changed, 75 insertions(+), 3 deletions(-)
copy src/{bin/resolver/common.cc => lib/datasrc/memory/rdata_reader.cc} (91%)
create mode 100644 src/lib/datasrc/memory/rdata_reader.h
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/Makefile.am b/src/lib/datasrc/memory/Makefile.am
index 90ab7b8..4d34c77 100644
--- a/src/lib/datasrc/memory/Makefile.am
+++ b/src/lib/datasrc/memory/Makefile.am
@@ -13,4 +13,5 @@ noinst_LTLIBRARIES = libdatasrc_memory.la
libdatasrc_memory_la_SOURCES = \
rdata_encoder.h \
rdata_encoder.cc \
+ rdata_reader.h rdata_reader.cc \
domaintree.h
diff --git a/src/lib/datasrc/memory/rdata_reader.cc b/src/lib/datasrc/memory/rdata_reader.cc
new file mode 100644
index 0000000..2edc7e6
--- /dev/null
+++ b/src/lib/datasrc/memory/rdata_reader.cc
@@ -0,0 +1,15 @@
+// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#include "rdata_reader.h"
diff --git a/src/lib/datasrc/memory/rdata_reader.h b/src/lib/datasrc/memory/rdata_reader.h
new file mode 100644
index 0000000..7d0325f
--- /dev/null
+++ b/src/lib/datasrc/memory/rdata_reader.h
@@ -0,0 +1,73 @@
+// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef DATASRC_MEMORY_RDATA_READER_H
+#define DATASRC_MEMORY_RDATA_READER_H 1
+
+#include <boost/function.hpp>
+
+namespace isc {
+namespace dns{
+class LabelSequence;
+class RRClass;
+class RRType;
+}
+namespace datasrc {
+namespace memory {
+
+class RDataReader {
+public:
+ // The sequence and attributes
+ typedef boost::function<void(const dns::LabelSequence&, unsigned int)>
+ NameAction;
+ typedef boost::function<void(const uint8_t*, size_t)> DataAction;
+
+ // For the default parameters.
+ static void emptyNameAction(const dns::LabelSequence& label,
+ unsigned int attributes);
+ static void emptyDataAction(const uint8_t* data, size_t size);
+
+ RDataReader(const dns::RRClass& rrclass, const dns::RRType& rrtype,
+ size_t size, const uint8_t* data,
+ const NameAction& name_action = &emptyNameAction,
+ const DataAction& data_action = &emptyDataAction);
+
+ enum Action {
+ NAME,
+ DATA,
+ END
+ };
+
+ class Result {
+ public:
+ Action action() const;
+ const uint8_t* data() const;
+ size_t size() const;
+ const dns::LabelSequence& sequence;
+ operator bool() const {
+ return (action() != END);
+ }
+ };
+
+ Result next();
+ void rewind();
+
+ size_t getSize() const;
+};
+
+}
+}
+}
+
+#endif
More information about the bind10-changes
mailing list