summaryrefslogtreecommitdiffstats
path: root/src/lib/resolve/resolve.h
diff options
context:
space:
mode:
authorJelte Jansen <jelte@isc.org>2011-02-17 10:31:09 +0100
committerJelte Jansen <jelte@isc.org>2011-02-17 10:31:09 +0100
commit949f642c90ab8ad7f0f02c35e383b9eb9e65792a (patch)
tree21ace7fb055d96c25fe57d46376cff1b343f19b6 /src/lib/resolve/resolve.h
parent[trac491] Also cache intermediate results (diff)
downloadkea-949f642c90ab8ad7f0f02c35e383b9eb9e65792a.tar.xz
kea-949f642c90ab8ad7f0f02c35e383b9eb9e65792a.zip
[trac491] added isc::resolve::initResponseMessage() functions
Diffstat (limited to 'src/lib/resolve/resolve.h')
-rw-r--r--src/lib/resolve/resolve.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/lib/resolve/resolve.h b/src/lib/resolve/resolve.h
index b08c30c2ff..944691d95b 100644
--- a/src/lib/resolve/resolve.h
+++ b/src/lib/resolve/resolve.h
@@ -42,6 +42,36 @@ namespace resolve {
void makeErrorMessage(isc::dns::MessagePtr answer_message,
const isc::dns::Rcode& error_code);
+
+/// \brief Initialize a response message
+///
+/// Based on the given query message, this fills in the very
+/// first details of the response (i.e. the Question section and
+/// the Opcode). This allows for direct usage of makeErrorMessage(),
+/// as well as ResolveCache.lookup().
+///
+/// \param query_message The query message to take the Question, Qid,
+/// and Opcode from.
+/// \param response_message The fresh response message to initialize
+/// (must be type Message::RENDER)
+void initResponseMessage(const isc::dns::Message& query_message,
+ isc::dns::Message& response_message);
+
+
+/// \brief Initialize a response message
+///
+/// Based on the given question, this fills in the very
+/// first details of the response (i.e. the Question section and the
+/// Opcode Query). This allows for direct usage of makeErrorMessage(),
+/// as well as ResolveCache.lookup().
+///
+/// \param question The question to place in the Question section
+/// \param response_message The fresh response message to initialize
+/// (must be type Message::RENDER)
+void initResponseMessage(const isc::dns::Question& question,
+ isc::dns::Message& response_message);
+
+
/// \brief Copies the parts relevant for a DNS response to the
/// target message
///