BIND 10 trac2117, updated. e8786c8522ad40b8ecc47764abf74f2a05a12385 updated and tested up to lib dns++ including python

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Jul 5 18:50:48 UTC 2012


The branch, trac2117 has been updated
       via  e8786c8522ad40b8ecc47764abf74f2a05a12385 (commit)
      from  6196c5c4e0b956f285764f2b4c2267adc5b0aca1 (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 e8786c8522ad40b8ecc47764abf74f2a05a12385
Author: Francis Dupont <fdupont at isc.org>
Date:   Thu Jul 5 20:50:20 2012 +0200

    updated and tested up to lib dns++ including python

-----------------------------------------------------------------------

Summary of changes:
 src/lib/bench/benchmark.h                          |   27 +++++++++
 src/lib/dns/benchmarks/message_renderer_bench.cc   |    7 +++
 src/lib/dns/benchmarks/rdatarender_bench.cc        |    7 +++
 src/lib/dns/character_string.cc                    |    2 +
 src/lib/dns/character_string.h                     |    9 ++-
 src/lib/dns/edns.cc                                |    2 +
 src/lib/dns/edns.h                                 |   23 ++++----
 src/lib/dns/exceptions.cc                          |    2 +
 src/lib/dns/exceptions.h                           |    9 +--
 src/lib/dns/gen-rdatacode.py.in                    |    2 +
 ...{gen-rdatacode.py.in => gen-rdatacode.py.win32} |   24 ++++----
 src/lib/dns/labelsequence.cc                       |    2 +
 src/lib/dns/labelsequence.h                        |    3 +-
 src/lib/{log => dns}/lib.h                         |   14 ++---
 src/lib/dns/masterload.cc                          |    6 +-
 src/lib/dns/masterload.h                           |    9 ++-
 src/lib/dns/message.cc                             |    4 +-
 src/lib/dns/message.h                              |   31 +++++-----
 src/lib/dns/messagerenderer.cc                     |    2 +
 src/lib/dns/messagerenderer.h                      |    7 ++-
 src/lib/dns/name.cc                                |    4 +-
 src/lib/dns/name.h                                 |   27 ++++-----
 src/lib/dns/nsec3hash.cc                           |    4 +-
 src/lib/dns/nsec3hash.h                            |   17 +++---
 src/lib/dns/opcode.cc                              |    4 +-
 src/lib/dns/opcode.h                               |   11 ++--
 src/lib/dns/python/edns_python.cc                  |    4 +-
 src/lib/dns/python/edns_python.h                   |    4 +-
 src/lib/{util/io => dns/python}/lib.h              |   14 ++---
 src/lib/dns/python/message_python.cc               |   12 ++--
 src/lib/dns/python/message_python.h                |   12 ++--
 src/lib/dns/python/messagerenderer_python.cc       |    4 +-
 src/lib/dns/python/messagerenderer_python.h        |    3 +-
 src/lib/dns/python/name_python.cc                  |   26 +++++----
 src/lib/dns/python/name_python.h                   |   26 +++++----
 src/lib/dns/python/nsec3hash_python.cc             |    9 ++-
 src/lib/dns/python/nsec3hash_python.h              |    8 ++-
 src/lib/dns/python/opcode_python.cc                |    4 +-
 src/lib/dns/python/opcode_python.h                 |    4 +-
 src/lib/dns/python/pydnspp.cc                      |   60 ++++++++++++++++++++
 src/lib/dns/python/pydnspp_common.cc               |   12 ++--
 src/lib/dns/python/pydnspp_common.h                |    9 ++-
 src/lib/dns/python/pydnspp_towire.h                |    1 +
 src/lib/dns/python/question_python.cc              |    4 +-
 src/lib/dns/python/question_python.h               |    6 +-
 src/lib/dns/python/rcode_python.cc                 |    4 +-
 src/lib/dns/python/rcode_python.h                  |    4 +-
 src/lib/dns/python/rdata_python.cc                 |   10 ++--
 src/lib/dns/python/rdata_python.h                  |    9 +--
 src/lib/dns/python/rrclass_python.cc               |    9 ++-
 src/lib/dns/python/rrclass_python.h                |    8 ++-
 src/lib/dns/python/rrset_python.cc                 |    6 +-
 src/lib/dns/python/rrset_python.h                  |    5 +-
 src/lib/dns/python/rrttl_python.cc                 |    8 ++-
 src/lib/dns/python/rrttl_python.h                  |    8 ++-
 src/lib/dns/python/rrtype_python.cc                |    8 ++-
 src/lib/dns/python/rrtype_python.h                 |    8 ++-
 src/lib/dns/python/serial_python.cc                |    4 +-
 src/lib/dns/python/serial_python.h                 |    4 +-
 src/lib/dns/python/tsig_python.cc                  |    6 +-
 src/lib/dns/python/tsig_python.h                   |    6 +-
 src/lib/dns/python/tsig_rdata_python.cc            |    4 +-
 src/lib/dns/python/tsig_rdata_python.h             |    4 +-
 src/lib/dns/python/tsigerror_python.cc             |    6 +-
 src/lib/dns/python/tsigerror_python.h              |    6 +-
 src/lib/dns/python/tsigkey_python.cc               |    6 +-
 src/lib/dns/python/tsigkey_python.h                |    6 +-
 src/lib/dns/python/tsigrecord_python.cc            |    4 +-
 src/lib/dns/python/tsigrecord_python.h             |    4 +-
 src/lib/dns/question.cc                            |    4 +-
 src/lib/dns/question.h                             |   14 +++--
 src/lib/dns/rcode.cc                               |    4 +-
 src/lib/dns/rcode.h                                |   15 +++--
 src/lib/dns/rdata.cc                               |   12 ++--
 src/lib/dns/rdata.h                                |   33 ++++++-----
 src/lib/dns/rdata/any_255/tsig_250.h               |    5 +-
 src/lib/dns/rdata/ch_3/a_1.h                       |    3 +-
 src/lib/dns/rdata/generic/afsdb_18.h               |    3 +-
 src/lib/dns/rdata/generic/cname_5.h                |    3 +-
 src/lib/dns/rdata/generic/detail/ds_like.h         |    1 +
 .../dns/rdata/generic/detail/nsec3param_common.cc  |    2 +
 .../dns/rdata/generic/detail/nsec3param_common.h   |    1 +
 src/lib/dns/rdata/generic/detail/nsec_bitmap.cc    |    2 +
 src/lib/dns/rdata/generic/detail/nsec_bitmap.h     |    2 +
 src/lib/dns/rdata/generic/detail/txt_like.h        |    2 +
 src/lib/dns/rdata/generic/dlv_32769.h              |    3 +-
 src/lib/dns/rdata/generic/dname_39.h               |    3 +-
 src/lib/dns/rdata/generic/dnskey_48.h              |    3 +-
 src/lib/dns/rdata/generic/ds_43.h                  |    3 +-
 src/lib/dns/rdata/generic/hinfo_13.h               |    3 +-
 src/lib/dns/rdata/generic/minfo_14.h               |    3 +-
 src/lib/dns/rdata/generic/mx_15.h                  |    3 +-
 src/lib/dns/rdata/generic/naptr_35.h               |    3 +-
 src/lib/dns/rdata/generic/ns_2.h                   |    3 +-
 src/lib/dns/rdata/generic/nsec3_50.h               |    3 +-
 src/lib/dns/rdata/generic/nsec3param_51.h          |    3 +-
 src/lib/dns/rdata/generic/nsec_47.h                |    3 +-
 src/lib/dns/rdata/generic/opt_41.h                 |    3 +-
 src/lib/dns/rdata/generic/ptr_12.h                 |    3 +-
 src/lib/dns/rdata/generic/rp_17.h                  |    3 +-
 src/lib/dns/rdata/generic/rrsig_46.h               |    3 +-
 src/lib/dns/rdata/generic/soa_6.h                  |    3 +-
 src/lib/dns/rdata/generic/spf_99.h                 |    3 +-
 src/lib/dns/rdata/generic/sshfp_44.h               |    3 +-
 src/lib/dns/rdata/generic/txt_16.h                 |    3 +-
 src/lib/dns/rdata/hs_4/a_1.h                       |    3 +-
 src/lib/dns/rdata/in_1/a_1.cc                      |   13 ++++-
 src/lib/dns/rdata/in_1/a_1.h                       |    3 +-
 src/lib/dns/rdata/in_1/aaaa_28.cc                  |   13 ++++-
 src/lib/dns/rdata/in_1/aaaa_28.h                   |    3 +-
 src/lib/dns/rdata/in_1/dhcid_49.h                  |    3 +-
 src/lib/dns/rdata/in_1/srv_33.h                    |    3 +-
 src/lib/dns/rdata/template.h                       |    3 +-
 src/lib/dns/rdatafields.cc                         |    2 +
 src/lib/dns/rdatafields.h                          |   10 ++--
 src/lib/dns/rrclass-placeholder.h                  |   19 ++++---
 src/lib/dns/rrclass.cc                             |    4 +-
 src/lib/dns/rrparamregistry-placeholder.cc         |    2 +
 src/lib/dns/rrparamregistry.h                      |    9 +--
 src/lib/dns/rrset.cc                               |    4 +-
 src/lib/dns/rrset.h                                |   34 +++++------
 src/lib/dns/rrsetlist.cc                           |    2 +
 src/lib/dns/rrsetlist.h                            |    5 +-
 src/lib/dns/rrttl.cc                               |    4 +-
 src/lib/dns/rrttl.h                                |   15 ++---
 src/lib/dns/rrtype-placeholder.h                   |   15 ++---
 src/lib/dns/rrtype.cc                              |    4 +-
 src/lib/dns/serial.cc                              |    4 +-
 src/lib/dns/serial.h                               |    7 ++-
 src/lib/dns/tests/edns_unittest.cc                 |    2 +
 src/lib/dns/tests/message_unittest.cc              |    6 +-
 src/lib/dns/tests/name_unittest.cc                 |    2 +
 .../dns/tests/rdata_nsec3param_like_unittest.cc    |    4 +-
 src/lib/dns/tests/rdata_tsig_unittest.cc           |    2 +-
 src/lib/dns/tests/tsig_unittest.cc                 |    2 +-
 src/lib/dns/tsig.cc                                |    6 ++
 src/lib/dns/tsig.h                                 |    5 +-
 src/lib/dns/tsigerror.cc                           |    4 +-
 src/lib/dns/tsigerror.h                            |    6 +-
 src/lib/dns/tsigkey.cc                             |    2 +
 src/lib/dns/tsigkey.h                              |    7 ++-
 src/lib/dns/tsigrecord.cc                          |    4 +-
 src/lib/dns/tsigrecord.h                           |   10 ++--
 ...{bind10_config.py.in => bind10_config.py.win32} |   15 ++---
 src/lib/util/python/lib.h                          |    4 ++
 src/lib/util/pyunittests/pyunittests_util.py.win32 |    6 --
 win32build/VS2010/bind10.sln                       |   53 +++++------------
 .../VS2010/libcryptolink/libcryptolink.vcxproj     |    1 +
 .../libcryptolink/libcryptolink.vcxproj.filters    |    3 +
 win32build/VS2010/libdns++/libdns++.vcxproj        |   15 +++--
 .../VS2010/libdns++/libdns++.vcxproj.filters       |    6 ++
 .../VS2010/libdns++_mbench/libdns++_mbench.vcxproj |    6 +-
 .../VS2010/libdns++_python/libdns++_python.vcxproj |   15 +++--
 .../libdns++_python.vcxproj.filters                |    6 ++
 .../VS2010/libdns++_rbench/libdns++_rbench.vcxproj |    6 +-
 .../VS2010/libdns++_tests/libdns++_tests.vcxproj   |   10 ++--
 win32build/VS2010/liblog/liblog.vcxproj            |    1 +
 win32build/VS2010/liblog/liblog.vcxproj.filters    |    3 +
 win32build/VS2010/pyddns++/pyddns++.vcxproj        |   20 +++----
 159 files changed, 792 insertions(+), 418 deletions(-)
 copy src/lib/dns/{gen-rdatacode.py.in => gen-rdatacode.py.win32} (95%)
 copy src/lib/{log => dns}/lib.h (81%)
 copy src/lib/{util/io => dns/python}/lib.h (78%)
 copy src/lib/python/{bind10_config.py.in => bind10_config.py.win32} (90%)
 delete mode 100644 src/lib/util/pyunittests/pyunittests_util.py.win32

-----------------------------------------------------------------------
diff --git a/src/lib/bench/benchmark.h b/src/lib/bench/benchmark.h
index a5c6fd4..34baa14 100644
--- a/src/lib/bench/benchmark.h
+++ b/src/lib/bench/benchmark.h
@@ -15,7 +15,12 @@
 #ifndef __BENCHMARK_H
 #define __BENCHMARK_H 1
 
+#ifdef _WIN32
+#include <time.h>
+#define gettimeofday(tv, tz) win32_gettimeofday(tv)
+#else
 #include <sys/time.h>
+#endif
 
 #include <cassert>
 #include <iostream>
@@ -24,6 +29,28 @@
 namespace isc {
 namespace bench {
 
+#ifdef _WIN32
+static void
+win32_gettimeofday(struct timeval *tv)
+{
+    SYSTEMTIME epoch = { 1970, 1, 4, 1, 0, 0, 0, 0 };
+    FILETIME temp;
+    SystemTimeToFileTime(&epoch, &temp);
+    ULARGE_INTEGER t;
+    t.LowPart = temp.dwLowDateTime;
+    t.HighPart = temp.dwHighDateTime;
+    FILETIME now;
+    GetSystemTimeAsFileTime(&now);
+    ULARGE_INTEGER n;
+    n.LowPart = now.dwLowDateTime;
+    n.HighPart = now.dwHighDateTime;
+    n.QuadPart -= t.QuadPart;
+    tv->tv_sec = (long) (n.QuadPart / 10000000);
+    n.QuadPart -= tv->tv_sec * 10000000;
+    tv->tv_usec = (long) (n.QuadPart / 10);
+}
+#endif
+
 /// \brief Templated micro benchmark framework.
 ///
 /// "Premature optimization is the root of all evil."
diff --git a/src/lib/dns/benchmarks/message_renderer_bench.cc b/src/lib/dns/benchmarks/message_renderer_bench.cc
index 33cd65b..1ba61df 100644
--- a/src/lib/dns/benchmarks/message_renderer_bench.cc
+++ b/src/lib/dns/benchmarks/message_renderer_bench.cc
@@ -12,6 +12,13 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
+#ifdef _WIN32
+#include <getopt.h>
+#include <winsock2.h>
+#endif
+
 #include <bench/benchmark.h>
 
 #include <dns/name.h>
diff --git a/src/lib/dns/benchmarks/rdatarender_bench.cc b/src/lib/dns/benchmarks/rdatarender_bench.cc
index 368ea6a..21e4353 100644
--- a/src/lib/dns/benchmarks/rdatarender_bench.cc
+++ b/src/lib/dns/benchmarks/rdatarender_bench.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
 #include <iostream>
 #include <fstream>
 #include <string>
@@ -19,6 +21,11 @@
 
 #include <boost/shared_ptr.hpp>
 
+#ifdef _WIN32
+#include <getopt.h>
+#include <winsock2.h>
+#endif
+
 #include <bench/benchmark.h>
 
 #include <util/buffer.h>
diff --git a/src/lib/dns/character_string.cc b/src/lib/dns/character_string.cc
index 3a289ac..2c17f5a 100644
--- a/src/lib/dns/character_string.cc
+++ b/src/lib/dns/character_string.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include "character_string.h"
 #include "rdata.h"
 
diff --git a/src/lib/dns/character_string.h b/src/lib/dns/character_string.h
index 7961274..a3a7661 100644
--- a/src/lib/dns/character_string.h
+++ b/src/lib/dns/character_string.h
@@ -18,6 +18,7 @@
 #include <string>
 #include <exceptions/exceptions.h>
 #include <util/buffer.h>
+#include <dns/lib.h>
 
 namespace isc {
 namespace dns {
@@ -40,15 +41,17 @@ namespace characterstr {
     ///        the iterator will be updated to new position after the function
     ///        is returned
     /// \return A std::string that contains the extracted <character-string>
-    std::string getNextCharacterString(const std::string& input_str,
-                                       std::string::const_iterator& input_iterator);
+    ISC_LIBDNS_API std::string
+    getNextCharacterString(const std::string& input_str,
+                           std::string::const_iterator& input_iterator);
 
     /// Get a <character-string> from a input buffer
     ///
     /// \param buffer The input buffer
     /// \param len The input buffer total length
     /// \return A std::string that contains the extracted <character-string>
-    std::string getNextCharacterString(util::InputBuffer& buffer, size_t len);
+    ISC_LIBDNS_API std::string
+    getNextCharacterString(util::InputBuffer& buffer, size_t len);
 
 } // namespace characterstr
 } // namespace dns
diff --git a/src/lib/dns/edns.cc b/src/lib/dns/edns.cc
index 447b479..32be642 100644
--- a/src/lib/dns/edns.cc
+++ b/src/lib/dns/edns.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <config.h>
 
 #include <stdint.h>
diff --git a/src/lib/dns/edns.h b/src/lib/dns/edns.h
index a7bc4c4..2721801 100644
--- a/src/lib/dns/edns.h
+++ b/src/lib/dns/edns.h
@@ -21,22 +21,23 @@
 
 #include <ostream>
 
+#include <dns/lib.h>
 #include <dns/rdata.h>
 
 namespace isc {
 namespace util {
-class OutputBuffer;
+class ISC_LIBDNS_API OutputBuffer;
 }
 
 namespace dns {
 
-class EDNS;
-class Name;
-class AbstractMessageRenderer;
-class RRClass;
-class RRTTL;
-class RRType;
-class Rcode;
+class ISC_LIBDNS_API EDNS;
+class ISC_LIBDNS_API Name;
+class ISC_LIBDNS_API AbstractMessageRenderer;
+class ISC_LIBDNS_API RRClass;
+class ISC_LIBDNS_API RRTTL;
+class ISC_LIBDNS_API RRType;
+class ISC_LIBDNS_API Rcode;
 
 /// \brief A pointer-like type pointing to an \c EDNS object.
 typedef boost::shared_ptr<EDNS> EDNSPtr;
@@ -128,7 +129,7 @@ typedef boost::shared_ptr<const EDNS> ConstEDNSPtr;
 /// If a future version of the %EDNS protocol introduces further relationship
 /// between the message and the %EDNS, we might reconsider the interface,
 /// probably with higher abstraction.
-class EDNS {
+class ISC_LIBDNS_API EDNS {
 public:
     ///
     /// \name Constructors and Destructor
@@ -421,6 +422,7 @@ private:
 /// \param extended_rcode A placeholder to store the topmost 8 bits of the
 /// extended Rcode.
 /// \return A pointer to the created \c EDNS object.
+ISC_LIBDNS_API
 EDNS* createEDNSFromRR(const Name& name, const RRClass& rrclass,
                        const RRType& rrtype, const RRTTL& ttl,
                        const rdata::Rdata& rdata, uint8_t& extended_rcode);
@@ -435,7 +437,8 @@ EDNS* createEDNSFromRR(const Name& name, const RRClass& rrclass,
 /// \param edns A reference to an \c EDNS object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const EDNS& edns);
+ISC_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const EDNS& edns);
 }
 }
 #endif  // __EDNS_H
diff --git a/src/lib/dns/exceptions.cc b/src/lib/dns/exceptions.cc
index eb823b9..4ee8aab 100644
--- a/src/lib/dns/exceptions.cc
+++ b/src/lib/dns/exceptions.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <dns/exceptions.h>
 #include <dns/rcode.h>
 
diff --git a/src/lib/dns/exceptions.h b/src/lib/dns/exceptions.h
index bd696a5..af43602 100644
--- a/src/lib/dns/exceptions.h
+++ b/src/lib/dns/exceptions.h
@@ -21,6 +21,7 @@
 #define __DNS_EXCEPTIONS_H 1
 
 #include <exceptions/exceptions.h>
+#include <dns/lib.h>
 
 namespace isc {
 namespace dns {
@@ -28,23 +29,23 @@ namespace dns {
 ///
 /// \brief A standard DNS module exception ...[TBD]
 ///
-class Rcode;                    // forward declaration
+class ISC_LIBDNS_API Rcode;                    // forward declaration
 
-class DNSProtocolError : public isc::Exception {
+class ISC_LIBDNS_API DNSProtocolError : public isc::Exception {
 public:
     DNSProtocolError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
     virtual const Rcode& getRcode() const = 0;
 };
 
-class DNSMessageFORMERR : public DNSProtocolError {
+class ISC_LIBDNS_API DNSMessageFORMERR : public DNSProtocolError {
 public:
     DNSMessageFORMERR(const char* file, size_t line, const char* what) :
         DNSProtocolError(file, line, what) {}
     virtual const Rcode& getRcode() const;
 };
 
-class DNSMessageBADVERS : public DNSProtocolError {
+class ISC_LIBDNS_API DNSMessageBADVERS : public DNSProtocolError {
 public:
     DNSMessageBADVERS(const char* file, size_t line, const char* what) :
         DNSProtocolError(file, line, what) {}
diff --git a/src/lib/dns/gen-rdatacode.py.in b/src/lib/dns/gen-rdatacode.py.in
index f3cd5df..107beba 100755
--- a/src/lib/dns/gen-rdatacode.py.in
+++ b/src/lib/dns/gen-rdatacode.py.in
@@ -41,6 +41,8 @@ heading_txt = '''///////////////
 ///////////////
 ///////////////
 
+#define ISC_LIBDNS_EXPORT
+
 '''
 
 def import_classdef(class_txt, file):
diff --git a/src/lib/dns/gen-rdatacode.py.win32 b/src/lib/dns/gen-rdatacode.py.win32
new file mode 100755
index 0000000..8985a62
--- /dev/null
+++ b/src/lib/dns/gen-rdatacode.py.win32
@@ -0,0 +1,310 @@
+#!/usr/bin/python
+
+# Copyright (C) 2010  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.
+
+"""\
+This is a supplemental script to (half) auto-generate DNS Rdata related
+classes and constants.
+"""
+
+import os
+from os.path import getmtime
+import re
+import sys
+
+re_typecode = re.compile('([\da-z]+)_(\d+)')
+classcode2txt = {}
+typecode2txt = {}
+typeandclass = []
+generic_code = 65536            # something larger than any code value
+rdata_declarations = ''
+class_definitions = ''
+classdir_mtime = 0
+rdatadef_mtime = 0
+rdatahdr_mtime = 0
+heading_txt = '''///////////////
+///////////////
+///////////////   THIS FILE IS AUTOMATICALLY GENERATED BY gen-rdatacode.py.
+///////////////   DO NOT EDIT!
+///////////////
+///////////////
+
+#define ISC_LIBDNS_EXPORT
+
+'''
+
+def import_classdef(class_txt, file):
+    content = ''
+    rdata_source = open(file, 'r')
+    for line in rdata_source.readlines():
+        if re.match('// BEGIN_ISC_NAMESPACE', line):
+            content += 'namespace isc {\n'
+            content += 'namespace dns {\n'
+            continue
+        if re.match('// BEGIN_RDATA_NAMESPACE', line):
+            content += 'namespace rdata {\n'
+            content += 'namespace ' + class_txt + ' {\n'
+            continue
+        if re.match('// END_ISC_NAMESPACE', line):
+            content += '} // end of namespace "dns"\n'
+            content += '} // end of namespace "isc"\n'
+            continue
+        if re.match('// END_RDATA_NAMESPACE', line):
+            content += '} // end of namespace "' + class_txt +'"\n'
+            content += '} // end of namespace "rdata"\n'
+            continue
+        content += line
+    rdata_source.close()
+    return content
+
+def import_classheader(class_txt, type_txt, type_code, file):
+    type_utxt = type_txt.upper()
+    class_utxt = class_txt.upper()
+
+    # for each CLASS_n/TYPE_m.h
+    rdata_header = open(file, 'r')
+    content = ''
+    guard_macro = '__' + class_txt.upper() + '_' + type_txt.upper()
+    guard_macro += '_' + type_code + '_H'
+    for line in rdata_header.readlines():
+        if re.match('// BEGIN_HEADER_GUARD', line):
+            content += '#ifndef ' + guard_macro + '\n'
+            content += '#define ' + guard_macro + ' 1\n'
+            continue
+        if re.match('// END_HEADER_GUARD', line):
+            content += '#endif // ' + guard_macro + '\n'
+            continue
+        if re.match('// BEGIN_ISC_NAMESPACE', line):
+            content += 'namespace isc {\n'
+            content += 'namespace util {\n'
+            content += '''
+class InputBuffer;
+class OutputBuffer;\n'''
+            content += '}\n\n'
+            content += 'namespace dns {\n'
+            continue
+        if re.match('// BEGIN_RDATA_NAMESPACE', line):
+            content += 'namespace rdata {\n'
+            content += 'namespace ' + class_txt + ' {\n'
+            continue
+        if re.match('// END_ISC_NAMESPACE', line):
+            content += '} // end of namespace "dns"\n'
+            content += '} // end of namespace "isc"\n'
+            continue
+        if re.match('// END_RDATA_NAMESPACE', line):
+            content += '} // end of namespace "' + class_txt +'"\n'
+            content += '} // end of namespace "rdata"\n'
+            continue
+        if re.match('// Local Variables:', line):
+            break
+        content += line
+        if re.match('// BEGIN_COMMON_DECLARATIONS', line):
+            content += '''
+class AbstractMessageRenderer;\n\n'''
+        if re.match('\s+// BEGIN_COMMON_MEMBERS$', line):
+            content += '''
+    explicit ''' + type_utxt + '''(const std::string& type_str);
+    ''' + type_utxt + '''(isc::util::InputBuffer& buffer, size_t rdata_len);
+    ''' + type_utxt + '''(const ''' + type_utxt + '''& other);
+    virtual std::string toText() const;
+    virtual void toWire(isc::util::OutputBuffer& buffer) const;
+    virtual void toWire(AbstractMessageRenderer& renderer) const;
+    virtual int compare(const Rdata& other) const;\n\n'''
+    rdata_header.close()
+    return content
+
+def import_definitions(classcode2txt, typecode2txt, typeandclass):
+    global rdata_declarations
+    global class_definitions
+    global classdir_mtime
+    global rdatadef_mtime
+    global rdatahdr_mtime
+
+    if classdir_mtime < getmtime('./rdata'):
+        classdir_mtime = getmtime('./rdata')
+
+    # Sort directories before iterating through them so that the directory
+    # list is processed in the same order on all systems.  The resulting
+    # files should compile regardless of the order in which the components
+    # are included but...  Having a fixed order for the directories should
+    # eliminate system-dependent problems.  (Note that the drectory names
+    # in BIND 10 are ASCII, so the order should be locale-independent.)
+    dirlist = os.listdir('./rdata')
+    dirlist.sort()
+    for dir in dirlist:
+        classdir = './rdata' + os.sep + dir
+        m = re_typecode.match(dir)
+        if os.path.isdir(classdir) and (m != None or dir == 'generic'):
+            if dir == 'generic':
+                class_txt = 'generic'
+                class_code = generic_code
+            else:
+                class_txt = m.group(1)
+                class_code = m.group(2)
+                if not class_code in classcode2txt:
+                    classcode2txt[class_code] = class_txt
+
+            # Same considerations as directories regarding sorted order
+            # also apply to files.
+            filelist = os.listdir(classdir)
+            filelist.sort()
+            for file in filelist:
+                file = classdir + os.sep + file
+                m = re_typecode.match(os.path.split(file)[1])
+                if m != None:
+                    type_txt = m.group(1)
+                    type_code = m.group(2)
+                    if not type_code in typecode2txt:
+                        typecode2txt[type_code] = type_txt
+                    if re.search('\cc$', file):
+                        if rdatadef_mtime < getmtime(file):
+                            rdatadef_mtime = getmtime(file)
+                        class_definitions += import_classdef(class_txt, file)
+                    elif re.search('\h$', file):
+                        if rdatahdr_mtime < getmtime(file):
+                            rdatahdr_mtime = getmtime(file)
+                        rdata_declarations += import_classheader(class_txt,
+                                                                 type_txt,
+                                                                 type_code,
+                                                                 file)
+                        typeandclass.append((type_txt, int(type_code),
+                                             (class_txt, class_txt),
+                                             int(class_code)))
+                        if class_txt == 'generic':
+                            typeandclass.append((type_txt, int(type_code),
+                                                 (class_txt, 'in'), 1))
+
+def need_generate(file, mtime):
+    '''Check if we need to generate the specified file.
+
+    To avoid unnecessary compilation, we skip (re)generating the file when
+    the file already exists and newer than the base file.
+    '''
+    if os.path.exists(file) and getmtime(file) > mtime:
+        return False
+    return True
+
+def generate_rdatadef(file, basemtime):
+    if not need_generate(file, basemtime):
+        print('skip generating ' + file);
+        return
+    rdata_deffile = open(file, 'w')
+    rdata_deffile.write(heading_txt)
+    rdata_deffile.write(class_definitions)
+    rdata_deffile.close()
+
+def generate_rdatahdr(file, declarations, basemtime):
+    if not need_generate(file, basemtime):
+        print('skip generating ' + file);
+        return
+    declarations += '''
+// Local Variables:
+// mode: c++
+// End:
+'''
+    rdata_header = open(file, 'w')
+    rdata_header.write(heading_txt)
+    rdata_header.write(declarations)
+    rdata_header.close()
+
+def generate_typeclasscode(fileprefix, basemtime, code2txt, type_or_class):
+    placeholder = './' + fileprefix + '-placeholder.h'
+    outputfile = './' + fileprefix + '.h'
+    upper_key = type_or_class.upper() # TYPE or CLASS
+    lower_key = 'rr' + type_or_class.lower() # rrtype or rrclass
+    cap_key = type_or_class           # Type or Class
+
+    if not need_generate(outputfile, basemtime) and getmtime(outputfile) > getmtime(placeholder):
+        print('skip generating ' + outputfile)
+        return
+
+    declarationtxt = ''
+    deftxt = ''
+    for code in code2txt.keys():
+        codetxt = code2txt[code].upper()
+        declarationtxt += ' ' * 4 + 'static const RR' + cap_key + '& ' + codetxt + '();\n'
+        deftxt += '''inline const RR''' + cap_key + '''&
+RR''' + cap_key + '''::''' + codetxt + '''() {
+    static RR''' + cap_key + ''' ''' + lower_key + '''(''' + code + ''');
+    return (''' + lower_key + ''');
+}\n
+'''
+    header_temp = open(placeholder, 'r')
+    header_out = open(outputfile, 'w')
+    header_out.write(heading_txt)
+    for line in header_temp.readlines():
+        header_out.write(line)
+        if re.match('\s+// BEGIN_WELL_KNOWN_' + upper_key + '_DECLARATIONS$', line):
+            header_out.write(declarationtxt)
+        if re.match('// BEGIN_WELL_KNOWN_' + upper_key + '_DEFINITIONS$', line):
+            header_out.write('\n' + deftxt)
+    header_out.close()
+    header_temp.close()
+
+def generate_rrparam(fileprefix, basemtime):
+    placeholder = './' + fileprefix + '-placeholder.cc'
+    outputfile = './' + fileprefix + '.cc'
+    if not need_generate(outputfile, basemtime) and getmtime(outputfile) > getmtime(placeholder):
+        print('skip generating ' + outputfile)
+        return
+
+    # sort by class, then by type
+    typeandclassparams = ''
+    typeandclass.sort(key = lambda x: (x[3], x[1]))
+    for param in typeandclass:
+        # for rrparamregistry.cc
+        # each param is a tuple of (type_txt, type_code, class_tuple,
+        #                           class_code)
+        (type_txt, type_code, class_tuple, class_code) = param
+        type_utxt = type_txt.upper()
+        class_txt = class_tuple[0]
+        class_utxt = class_tuple[1].upper()
+        indent = ' ' * 8
+        typeandclassparams += indent
+        if class_tuple[1] != 'generic':
+            typeandclassparams += 'add("' + type_utxt + '", '
+            typeandclassparams += str(type_code) + ', "' + class_utxt
+            typeandclassparams += '", ' + str(class_code)
+            typeandclassparams += ', RdataFactoryPtr(new RdataFactory<'
+            typeandclassparams += class_txt + '::' + type_utxt + '>()));\n'
+        else:
+            typeandclassparams += 'add("' + type_utxt + '", ' + str(type_code)
+            typeandclassparams += ', RdataFactoryPtr(new RdataFactory<'
+            typeandclassparams += class_txt + '::' + type_utxt + '>()));\n'
+
+    rrparam_temp = open(placeholder, 'r')
+    rrparam_out = open(outputfile, 'w')
+    rrparam_out.write(heading_txt)
+    for line in rrparam_temp.readlines():
+        rrparam_out.write(line)
+        if re.match('\s+// BEGIN_WELL_KNOWN_PARAMS', line):
+            rrparam_out.write(typeandclassparams)
+    rrparam_temp.close()
+    rrparam_out.close()
+
+if __name__ == "__main__":
+    try:
+        import_definitions(classcode2txt, typecode2txt, typeandclass)
+        generate_rdatadef('./rdataclass.cc', rdatadef_mtime)
+        generate_rdatahdr('./rdataclass.h', rdata_declarations,
+                          rdatahdr_mtime)
+        generate_typeclasscode('rrtype', rdatahdr_mtime, typecode2txt, 'Type')
+        generate_typeclasscode('rrclass', classdir_mtime,
+                               classcode2txt, 'Class')
+        generate_rrparam('rrparamregistry', rdatahdr_mtime)
+    except:
+        sys.stderr.write('Code generation failed due to exception: %s\n' %
+                         sys.exc_info()[1])
+        exit(1)
diff --git a/src/lib/dns/labelsequence.cc b/src/lib/dns/labelsequence.cc
index a9be6bc..a97523d 100644
--- a/src/lib/dns/labelsequence.cc
+++ b/src/lib/dns/labelsequence.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <dns/labelsequence.h>
 #include <dns/name_internal.h>
 #include <exceptions/exceptions.h>
diff --git a/src/lib/dns/labelsequence.h b/src/lib/dns/labelsequence.h
index cf5495b..325ce30 100644
--- a/src/lib/dns/labelsequence.h
+++ b/src/lib/dns/labelsequence.h
@@ -15,6 +15,7 @@
 #ifndef __LABELSEQUENCE_H
 #define __LABELSEQUENCE_H 1
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <util/buffer.h>
 
@@ -40,7 +41,7 @@ namespace dns {
 /// data can be requested (which then points to part of the original
 /// data of the associated Name object).
 ///
-class LabelSequence {
+class ISC_LIBDNS_API LabelSequence {
 public:
     /// \brief Constructs a LabelSequence for the given name
     ///
diff --git a/src/lib/dns/lib.h b/src/lib/dns/lib.h
new file mode 100644
index 0000000..0d7e634
--- /dev/null
+++ b/src/lib/dns/lib.h
@@ -0,0 +1,32 @@
+// 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 __LIBDNS_H
+#define __LIBDNS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBDNS_API
+#else
+#ifdef ISC_LIBDNS_EXPORT
+#define ISC_LIBDNS_API __declspec(dllexport)
+#else
+#define ISC_LIBDNS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBDNS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/dns/masterload.cc b/src/lib/dns/masterload.cc
index 0b195f6..1fe25f4 100644
--- a/src/lib/dns/masterload.cc
+++ b/src/lib/dns/masterload.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <istream>
 #include <fstream>
 #include <sstream>
@@ -60,7 +62,7 @@ stripLine(string& s, const Exception& ex) {
 }
 }
 
-void
+ISC_LIBDNS_API void
 masterLoad(const char* const filename, const Name& origin,
            const RRClass& zone_class, MasterLoadCallback callback)
 {
@@ -77,7 +79,7 @@ masterLoad(const char* const filename, const Name& origin,
     ifs.close();
 }
 
-void
+ISC_LIBDNS_API void
 masterLoad(istream& input, const Name& origin, const RRClass& zone_class,
            MasterLoadCallback callback)
 {
diff --git a/src/lib/dns/masterload.h b/src/lib/dns/masterload.h
index 41d145b..864d58a 100644
--- a/src/lib/dns/masterload.h
+++ b/src/lib/dns/masterload.h
@@ -21,16 +21,17 @@
 
 #include <exceptions/exceptions.h>
 
+#include <dns/lib.h>
 #include <dns/rrset.h>
 
 namespace isc {
 namespace dns {
-class Name;
-class RRClass;
+class ISC_LIBDNS_API Name;
+class ISC_LIBDNS_API RRClass;
 
 /// \brief An exception that is thrown if an error occurs while loading a
 /// master zone data.
-class MasterLoadError : public isc::Exception {
+class ISC_LIBDNS_API MasterLoadError : public isc::Exception {
 public:
     MasterLoadError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -214,6 +215,7 @@ typedef boost::function<void(RRsetPtr)> MasterLoadCallback;
 /// \param zone_class The RR class of the zone.
 /// \param callback A callback functor or function that is to be called
 /// for each RRset.
+ISC_LIBDNS_API
 void masterLoad(const char* const filename, const Name& origin,
                 const RRClass& zone_class, MasterLoadCallback callback);
 
@@ -232,6 +234,7 @@ void masterLoad(const char* const filename, const Name& origin,
 /// \param zone_class The RR class of the zone.
 /// \param callback A callback functor or function that is to be called for
 /// each RRset.
+ISC_LIBDNS_API
 void masterLoad(std::istream& input, const Name& origin,
                 const RRClass& zone_class, MasterLoadCallback callback);
 }
diff --git a/src/lib/dns/message.cc b/src/lib/dns/message.cc
index 0a1625a..3ce7f3c 100644
--- a/src/lib/dns/message.cc
+++ b/src/lib/dns/message.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <stdint.h>
 
 #include <algorithm>
@@ -1149,7 +1151,7 @@ Message::endSection(const Section section) const {
     return (RRsetIterator(RRsetIteratorImpl(impl_->rrsets_[section].end())));
 }
 
-ostream&
+ISC_LIBDNS_API ostream&
 operator<<(ostream& os, const Message& message) {
     return (os << message.toText());
 }
diff --git a/src/lib/dns/message.h b/src/lib/dns/message.h
index 73d0c6e..8e12186 100644
--- a/src/lib/dns/message.h
+++ b/src/lib/dns/message.h
@@ -23,25 +23,26 @@
 
 #include <exceptions/exceptions.h>
 
+#include <dns/lib.h>
 #include <dns/edns.h>
 #include <dns/question.h>
 #include <dns/rrset.h>
 
 namespace isc {
 namespace util {
-class InputBuffer;
+class ISC_LIBDNS_API InputBuffer;
 }
 
 namespace dns {
-class TSIGContext;
-class TSIGRecord;
+class ISC_LIBDNS_API TSIGContext;
+class ISC_LIBDNS_API TSIGRecord;
 
 ///
 /// \brief A standard DNS module exception that is thrown if a wire format
 /// message parser encounters a short length of data that don't even contain
 /// the full header section.
 ///
-class MessageTooShort : public Exception {
+class ISC_LIBDNS_API MessageTooShort : public Exception {
 public:
     MessageTooShort(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -52,7 +53,7 @@ public:
 /// is being constructed for an incompatible section.  Specifically, this
 /// happens RRset iterator is being constructed for a Question section.
 ///
-class InvalidMessageSection : public Exception {
+class ISC_LIBDNS_API InvalidMessageSection : public Exception {
 public:
     InvalidMessageSection(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -63,7 +64,7 @@ public:
 /// class method is called that is prohibited for the current mode of
 /// the message.
 ///
-class InvalidMessageOperation : public Exception {
+class ISC_LIBDNS_API InvalidMessageOperation : public Exception {
 public:
     InvalidMessageOperation(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -74,7 +75,7 @@ public:
 /// smaller than the standard default maximum (DEFAULT_MAX_UDPSIZE) is
 /// being specified for the message.
 ///
-class InvalidMessageUDPSize : public Exception {
+class ISC_LIBDNS_API InvalidMessageUDPSize : public Exception {
 public:
     InvalidMessageUDPSize(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -82,11 +83,11 @@ public:
 
 typedef uint16_t qid_t;
 
-class AbstractMessageRenderer;
-class Message;
+class ISC_LIBDNS_API AbstractMessageRenderer;
+class ISC_LIBDNS_API Message;
 class MessageImpl;
-class Opcode;
-class Rcode;
+class ISC_LIBDNS_API Opcode;
+class ISC_LIBDNS_API Rcode;
 
 template <typename T>
 struct SectionIteratorImpl;
@@ -116,6 +117,9 @@ private:
 typedef SectionIterator<QuestionPtr> QuestionIterator;
 typedef SectionIterator<RRsetPtr> RRsetIterator;
 
+class ISC_LIBDNS_API QuestionIteratorChild : public QuestionIterator {};
+class ISC_LIBDNS_API RRsetIteratorChild : public RRsetIterator {};
+
 /// \brief The \c Message class encapsulates a standard DNS message.
 ///
 /// Details of the design and interfaces of this class are still in flux.
@@ -148,7 +152,7 @@ typedef SectionIterator<RRsetPtr> RRsetIterator;
 ///   so the implementation can only be moderately efficient.
 /// - We may want to provide a "find" method for a specified type
 ///   of RR in the message.
-class Message {
+class ISC_LIBDNS_API Message {
 public:
     /// Constants to specify the operation mode of the \c Message.
     enum Mode {
@@ -681,7 +685,8 @@ typedef boost::shared_ptr<const Message> ConstMessagePtr;
 /// \param message A \c Message object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const Message& message);
+ISC_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const Message& message);
 }
 }
 #endif  // __MESSAGE_H
diff --git a/src/lib/dns/messagerenderer.cc b/src/lib/dns/messagerenderer.cc
index ca4ea54..b71581c 100644
--- a/src/lib/dns/messagerenderer.cc
+++ b/src/lib/dns/messagerenderer.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <exceptions/exceptions.h>
 #include <util/buffer.h>
 #include <dns/name.h>
diff --git a/src/lib/dns/messagerenderer.h b/src/lib/dns/messagerenderer.h
index 4c1c92a..7ec09e2 100644
--- a/src/lib/dns/messagerenderer.h
+++ b/src/lib/dns/messagerenderer.h
@@ -16,12 +16,13 @@
 #define __MESSAGERENDERER_H 1
 
 #include <util/buffer.h>
+#include <dns/lib.h>
 
 namespace isc {
 
 namespace dns {
 // forward declarations
-class Name;
+class ISC_LIBDNS_API Name;
 
 /// \brief The \c AbstractMessageRenderer class is an abstract base class
 /// that provides common interfaces for rendering a DNS message into a buffer
@@ -70,7 +71,7 @@ class Name;
 ///     The only one that is virtual is writeName and it's because this
 ///     function is much more complicated, therefore there's a lot of space
 ///     for different implementations or behaviours.
-class AbstractMessageRenderer {
+class ISC_LIBDNS_API AbstractMessageRenderer {
 public:
     /// \brief Compression mode constants.
     ///
@@ -345,7 +346,7 @@ public:
 /// end of the buffer at the time of construction.  However, if the
 /// pre-existing portion of the buffer contains DNS names, these names won't
 /// be considered for name compression.
-class MessageRenderer : public AbstractMessageRenderer {
+class ISC_LIBDNS_API MessageRenderer : public AbstractMessageRenderer {
 public:
     using AbstractMessageRenderer::CASE_INSENSITIVE;
     using AbstractMessageRenderer::CASE_SENSITIVE;
diff --git a/src/lib/dns/name.cc b/src/lib/dns/name.cc
index a8b080c..62cedc7 100644
--- a/src/lib/dns/name.cc
+++ b/src/lib/dns/name.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <cctype>
 #include <cassert>
 #include <iterator>
@@ -796,7 +798,7 @@ Name::downcase() {
     return (*this);
 }
 
-std::ostream&
+ISC_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const Name& name) {
     os << name.toText();
     return (os);
diff --git a/src/lib/dns/name.h b/src/lib/dns/name.h
index 6cfa546..eb4f18d 100644
--- a/src/lib/dns/name.h
+++ b/src/lib/dns/name.h
@@ -21,20 +21,21 @@
 #include <vector>
 
 #include <exceptions/exceptions.h>
+#include <dns/lib.h>
 
 namespace isc {
 namespace util {
-class InputBuffer;
-class OutputBuffer;
+class ISC_LIBDNS_API InputBuffer;
+class ISC_LIBDNS_API OutputBuffer;
 }
 
 namespace dns {
-class AbstractMessageRenderer;
+class ISC_LIBDNS_API AbstractMessageRenderer;
 
 ///
 /// \brief Base class for name parser exceptions.
 ///
-class NameParserException : public Exception {
+class ISC_LIBDNS_API NameParserException : public Exception {
 public:
     NameParserException(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -44,7 +45,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if the name parser
 /// encounters an empty label in the middle of a name.
 ///
-class EmptyLabel : public NameParserException {
+class ISC_LIBDNS_API EmptyLabel : public NameParserException {
 public:
     EmptyLabel(const char* file, size_t line, const char* what) :
         NameParserException(file, line, what) {}
@@ -54,7 +55,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if the name parser
 /// encounters too long a name.
 ///
-class TooLongName : public NameParserException {
+class ISC_LIBDNS_API TooLongName : public NameParserException {
 public:
     TooLongName(const char* file, size_t line, const char* what) :
         NameParserException(file, line, what) {}
@@ -64,7 +65,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if the name parser
 /// encounters too long a label.
 ///
-class TooLongLabel : public NameParserException {
+class ISC_LIBDNS_API TooLongLabel : public NameParserException {
 public:
     TooLongLabel(const char* file, size_t line, const char* what) :
         NameParserException(file, line, what) {}
@@ -76,7 +77,7 @@ public:
 /// applies to bitstring labels, which would begin with "\[".  Incomplete cases
 /// include an incomplete escaped sequence such as "\12".
 ///
-class BadLabelType : public NameParserException {
+class ISC_LIBDNS_API BadLabelType : public NameParserException {
 public:
     BadLabelType(const char* file, size_t line, const char* what) :
         NameParserException(file, line, what) {}
@@ -86,7 +87,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if the name parser
 /// fails to decode a "\"-escaped sequence.
 ///
-class BadEscape : public NameParserException {
+class ISC_LIBDNS_API BadEscape : public NameParserException {
 public:
     BadEscape(const char* file, size_t line, const char* what) :
         NameParserException(file, line, what) {}
@@ -99,7 +100,7 @@ public:
 /// An attempt of constructing a name from an empty string will trigger this
 /// exception.
 ///
-class IncompleteName : public NameParserException {
+class ISC_LIBDNS_API IncompleteName : public NameParserException {
 public:
     IncompleteName(const char* file, size_t line, const char* what) :
         NameParserException(file, line, what) {}
@@ -114,7 +115,7 @@ public:
 ///   compared
 /// - relationship: see NameComparisonResult::NameRelation
 ///
-class NameComparisonResult {
+class ISC_LIBDNS_API NameComparisonResult {
 public:
     /// The relation of two names under comparison.
     /// Its semantics for the case of
@@ -219,7 +220,7 @@ private:
 /// introduce a parser of master files, we'll introduce the notion of relative
 /// names as a special case.
 ///
-class Name {
+class ISC_LIBDNS_API Name {
     // LabelSequences use knowledge about the internal data structure
     // of this class for efficiency (they use the offsets_ vector and
     // the ndata_ string)
@@ -741,7 +742,7 @@ Name::ROOT_NAME() {
 /// \param name The \c Name object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream&
+ISC_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const Name& name);
 }
 }
diff --git a/src/lib/dns/nsec3hash.cc b/src/lib/dns/nsec3hash.cc
index 159dff3..96f4537 100644
--- a/src/lib/dns/nsec3hash.cc
+++ b/src/lib/dns/nsec3hash.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <stdint.h>
 
 #include <cassert>
@@ -186,7 +188,7 @@ DefaultNSEC3HashCreator::create(const generic::NSEC3& nsec3) const {
                                  nsec3.getSalt()));
 }
 
-void
+ISC_LIBDNS_API void
 setNSEC3HashCreator(const NSEC3HashCreator* new_creator) {
     creator = new_creator;
 }
diff --git a/src/lib/dns/nsec3hash.h b/src/lib/dns/nsec3hash.h
index 2056708..cacf1c0 100644
--- a/src/lib/dns/nsec3hash.h
+++ b/src/lib/dns/nsec3hash.h
@@ -18,15 +18,16 @@
 #include <string>
 
 #include <exceptions/exceptions.h>
+#include <dns/lib.h>
 
 namespace isc {
 namespace dns {
-class Name;
+class ISC_LIBDNS_API Name;
 
 namespace rdata {
 namespace generic {
-class NSEC3;
-class NSEC3PARAM;
+class ISC_LIBDNS_API NSEC3;
+class ISC_LIBDNS_API NSEC3PARAM;
 }
 }
 
@@ -36,7 +37,7 @@ class NSEC3PARAM;
 /// A specific exception class is used so that the caller can selectively
 /// catch this exception, e.g., while loading a zone, and handle it
 /// accordingly.
-class UnknownNSEC3HashAlgorithm : public isc::Exception {
+class ISC_LIBDNS_API UnknownNSEC3HashAlgorithm : public isc::Exception {
 public:
     UnknownNSEC3HashAlgorithm(const char* file, size_t line,
                               const char* what) :
@@ -77,7 +78,7 @@ public:
 /// - Allow producing hash value as binary data
 /// - Allow updating NSEC3 parameters of a class object so we can still reuse
 ///   the internal resources for different sets of parameters.
-class NSEC3Hash {
+class ISC_LIBDNS_API NSEC3Hash {
 protected:
     /// \brief The default constructor.
     ///
@@ -182,7 +183,7 @@ public:
 /// as const member functions for this reason.  But if we see the need for
 /// having a customized creator that benefits from its own state in future,
 /// this condition can be loosened.
-class NSEC3HashCreator {
+class ISC_LIBDNS_API NSEC3HashCreator {
 protected:
     /// \brief The default constructor.
     ///
@@ -221,7 +222,7 @@ public:
 /// convenience of special applications that want to customize the creator
 /// behavior for a particular type of parameters while preserving the default
 /// behavior for others.
-class DefaultNSEC3HashCreator : public NSEC3HashCreator {
+class ISC_LIBDNS_API DefaultNSEC3HashCreator : public NSEC3HashCreator {
 public:
     virtual NSEC3Hash* create(const rdata::generic::NSEC3PARAM& param) const;
     virtual NSEC3Hash* create(const rdata::generic::NSEC3& nsec3) const;
@@ -242,7 +243,7 @@ public:
 ///
 /// \exception None
 /// \param new_creator A pointer to the new creator object or NULL.
-void setNSEC3HashCreator(const NSEC3HashCreator* new_creator);
+ISC_LIBDNS_API void setNSEC3HashCreator(const NSEC3HashCreator* new_creator);
 
 }
 }
diff --git a/src/lib/dns/opcode.cc b/src/lib/dns/opcode.cc
index 570dd81..d5dbdc8 100644
--- a/src/lib/dns/opcode.cc
+++ b/src/lib/dns/opcode.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <string>
 #include <ostream>
 
@@ -59,7 +61,7 @@ Opcode::toText() const {
     return (opcodetext[code_]);
 }
 
-ostream&
+ISC_LIBDNS_API ostream&
 operator<<(std::ostream& os, const Opcode& opcode) {
     return (os << opcode.toText());
 }
diff --git a/src/lib/dns/opcode.h b/src/lib/dns/opcode.h
index dd88062..bd075ff 100644
--- a/src/lib/dns/opcode.h
+++ b/src/lib/dns/opcode.h
@@ -14,12 +14,14 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifndef __OPCODE_H
+#define __OPCODE_H 1
+
 #include <stdint.h>
 
 #include <ostream>
 
-#ifndef __OPCODE_H
-#define __OPCODE_H 1
+#include <dns/lib.h>
 
 namespace isc {
 namespace dns {
@@ -37,7 +39,7 @@ namespace dns {
 /// to handle OPCODEs through this class.  In fact, public interfaces of
 /// this library uses this class to pass or return OPCODEs instead of the
 /// bare code values.
-class Opcode {
+class ISC_LIBDNS_API Opcode {
 public:
     /// Constants for standard OPCODE values.
     enum CodeValue {
@@ -280,7 +282,8 @@ Opcode::RESERVED15() {
 /// \param opcode A reference to an \c Opcode object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const Opcode& opcode);
+ISC_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const Opcode& opcode);
 }
 }
 #endif  // OPCODE_H
diff --git a/src/lib/dns/python/edns_python.cc b/src/lib/dns/python/edns_python.cc
index 8f0f1a4..54749c1 100644
--- a/src/lib/dns/python/edns_python.cc
+++ b/src/lib/dns/python/edns_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <cassert>
@@ -312,7 +314,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_EDNS
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject edns_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject edns_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.EDNS",
     sizeof(s_EDNS),                     // tp_basicsize
diff --git a/src/lib/dns/python/edns_python.h b/src/lib/dns/python/edns_python.h
index 30d92ab..19c4c97 100644
--- a/src/lib/dns/python/edns_python.h
+++ b/src/lib/dns/python/edns_python.h
@@ -17,13 +17,15 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class EDNS;
 
 namespace python {
 
-extern PyTypeObject edns_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject edns_type;
 
 /// This is a simple shortcut to create a python EDNS object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
diff --git a/src/lib/dns/python/lib.h b/src/lib/dns/python/lib.h
new file mode 100644
index 0000000..53352e6
--- /dev/null
+++ b/src/lib/dns/python/lib.h
@@ -0,0 +1,32 @@
+// 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 __LIBDNS_PYTHON_H
+#define __LIBDNS_PYTHON_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define ISC_LIBDNS_PYTHON_API
+#else
+#ifdef ISC_LIBDNS_PYTHON_EXPORT
+#define ISC_LIBDNS_PYTHON_API __declspec(dllexport)
+#else
+#define ISC_LIBDNS_PYTHON_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBDNS_PYTHON_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/dns/python/message_python.cc b/src/lib/dns/python/message_python.cc
index f08f62c..0170fc2 100644
--- a/src/lib/dns/python/message_python.cc
+++ b/src/lib/dns/python/message_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
@@ -789,15 +791,15 @@ namespace python {
 // Initialization and addition of these go in the initModulePart
 // function in pydnspp.cc
 //
-PyObject* po_MessageTooShort;
-PyObject* po_InvalidMessageSection;
-PyObject* po_InvalidMessageOperation;
-PyObject* po_InvalidMessageUDPSize;
+ISC_LIBDNS_PYTHON_API PyObject* po_MessageTooShort;
+ISC_LIBDNS_PYTHON_API PyObject* po_InvalidMessageSection;
+ISC_LIBDNS_PYTHON_API PyObject* po_InvalidMessageOperation;
+ISC_LIBDNS_PYTHON_API PyObject* po_InvalidMessageUDPSize;
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_Message
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject message_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject message_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Message",
     sizeof(s_Message),                  // tp_basicsize
diff --git a/src/lib/dns/python/message_python.h b/src/lib/dns/python/message_python.h
index be23890..a678dd1 100644
--- a/src/lib/dns/python/message_python.h
+++ b/src/lib/dns/python/message_python.h
@@ -17,18 +17,20 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class Message;
 
 namespace python {
 
-extern PyObject* po_MessageTooShort;
-extern PyObject* po_InvalidMessageSection;
-extern PyObject* po_InvalidMessageOperation;
-extern PyObject* po_InvalidMessageUDPSize;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_MessageTooShort;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_InvalidMessageSection;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_InvalidMessageOperation;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_InvalidMessageUDPSize;
 
-extern PyTypeObject message_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject message_type;
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/messagerenderer_python.cc b/src/lib/dns/python/messagerenderer_python.cc
index 5561c12..16a5ed8 100644
--- a/src/lib/dns/python/messagerenderer_python.cc
+++ b/src/lib/dns/python/messagerenderer_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <util/buffer.h>
@@ -180,7 +182,7 @@ MessageRenderer_clear(s_MessageRenderer* self) {
 namespace isc {
 namespace dns {
 namespace python {
-PyTypeObject messagerenderer_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject messagerenderer_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.MessageRenderer",
     sizeof(s_MessageRenderer),          // tp_basicsize
diff --git a/src/lib/dns/python/messagerenderer_python.h b/src/lib/dns/python/messagerenderer_python.h
index ea9a940..6f4207f 100644
--- a/src/lib/dns/python/messagerenderer_python.h
+++ b/src/lib/dns/python/messagerenderer_python.h
@@ -18,6 +18,7 @@
 #include <Python.h>
 
 #include <util/buffer.h>
+#include <dns/python/lib.h>
 
 namespace isc {
 namespace dns {
@@ -25,7 +26,7 @@ class MessageRenderer;
 
 namespace python {
 
-extern PyTypeObject messagerenderer_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject messagerenderer_type;
 
 /// \brief Checks if the given python object is a MessageRenderer object
 ///
diff --git a/src/lib/dns/python/name_python.cc b/src/lib/dns/python/name_python.cc
index c24d24d..f9dd6f0 100644
--- a/src/lib/dns/python/name_python.cc
+++ b/src/lib/dns/python/name_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <util/buffer.h>
@@ -537,23 +539,23 @@ namespace python {
 // Initialization and addition of these go in the module init at the
 // end
 //
-PyObject* po_EmptyLabel;
-PyObject* po_TooLongName;
-PyObject* po_TooLongLabel;
-PyObject* po_BadLabelType;
-PyObject* po_BadEscape;
-PyObject* po_IncompleteName;
-PyObject* po_InvalidBufferPosition;
-PyObject* po_DNSMessageFORMERR;
+ISC_LIBDNS_PYTHON_API PyObject* po_EmptyLabel;
+ISC_LIBDNS_PYTHON_API PyObject* po_TooLongName;
+ISC_LIBDNS_PYTHON_API PyObject* po_TooLongLabel;
+ISC_LIBDNS_PYTHON_API PyObject* po_BadLabelType;
+ISC_LIBDNS_PYTHON_API PyObject* po_BadEscape;
+ISC_LIBDNS_PYTHON_API PyObject* po_IncompleteName;
+ISC_LIBDNS_PYTHON_API PyObject* po_InvalidBufferPosition;
+ISC_LIBDNS_PYTHON_API PyObject* po_DNSMessageFORMERR;
 
 //
 // Definition of enums
 // Initialization and addition of these go in the module init at the
 // end
 //
-PyObject* po_NameRelation;
+ISC_LIBDNS_PYTHON_API PyObject* po_NameRelation;
 
-PyTypeObject name_comparison_result_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject name_comparison_result_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.NameComparisonResult",
     sizeof(s_NameComparisonResult),           // tp_basicsize
@@ -609,7 +611,7 @@ PyTypeObject name_comparison_result_type = {
     0                                         // tp_version_tag
 };
 
-PyTypeObject name_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject name_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Name",
     sizeof(s_Name),                     // tp_basicsize
@@ -664,7 +666,7 @@ PyTypeObject name_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+ISC_LIBDNS_PYTHON_API PyObject*
 createNameObject(const Name& source) {
     NameContainer container(PyObject_New(s_Name, &name_type));
     container.set(new Name(source));
diff --git a/src/lib/dns/python/name_python.h b/src/lib/dns/python/name_python.h
index 86d7fd0..7ff163d 100644
--- a/src/lib/dns/python/name_python.h
+++ b/src/lib/dns/python/name_python.h
@@ -17,30 +17,32 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class Name;
 
 namespace python {
 
-extern PyObject* po_EmptyLabel;
-extern PyObject* po_TooLongName;
-extern PyObject* po_TooLongLabel;
-extern PyObject* po_BadLabelType;
-extern PyObject* po_BadEscape;
-extern PyObject* po_IncompleteName;
-extern PyObject* po_InvalidBufferPosition;
-extern PyObject* po_DNSMessageFORMERR;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_EmptyLabel;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_TooLongName;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_TooLongLabel;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_BadLabelType;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_BadEscape;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_IncompleteName;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_InvalidBufferPosition;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_DNSMessageFORMERR;
 
 //
 // Declaration of enums
 // Initialization and addition of these go in the module init at the
 // end
 //
-extern PyObject* po_NameRelation;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_NameRelation;
 
-extern PyTypeObject name_comparison_result_type;
-extern PyTypeObject name_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject name_comparison_result_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject name_type;
 
 /// This is A simple shortcut to create a python Name object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -49,7 +51,7 @@ extern PyTypeObject name_type;
 /// returns a NULL pointer).
 /// This function is expected to be called with in a try block
 /// followed by necessary setup for python exception.
-PyObject* createNameObject(const Name& source);
+ISC_LIBDNS_PYTHON_API PyObject* createNameObject(const Name& source);
 
 /// \brief Checks if the given python object is a Name object
 ///
diff --git a/src/lib/dns/python/nsec3hash_python.cc b/src/lib/dns/python/nsec3hash_python.cc
index 01e8ae5..46eac79 100644
--- a/src/lib/dns/python/nsec3hash_python.cc
+++ b/src/lib/dns/python/nsec3hash_python.cc
@@ -18,6 +18,9 @@
 
 // Python.h needs to be placed at the head of the program file, see:
 // http://docs.python.org/py3k/extending/extending.html#a-simple-example
+
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <string>
@@ -194,12 +197,12 @@ namespace python {
 // Declaration of the custom exceptions
 // Initialization and addition of these go in pydnspp.cc
 //
-PyObject* po_UnknownNSEC3HashAlgorithm;
+ISC_LIBDNS_PYTHON_API PyObject* po_UnknownNSEC3HashAlgorithm;
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_NSEC3Hash
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject nsec3hash_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject nsec3hash_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "dns.NSEC3Hash",
     sizeof(s_NSEC3Hash),                 // tp_basicsize
@@ -250,7 +253,7 @@ PyTypeObject nsec3hash_type = {
 };
 
 // Module Initialization, all statics (nothing right now) are initialized here
-bool
+ISC_LIBDNS_PYTHON_API bool
 initModulePart_NSEC3Hash(PyObject* mod) {
     // We initialize the static description object with PyType_Ready(),
     // then add it to the module. This is not just a check! (leaving
diff --git a/src/lib/dns/python/nsec3hash_python.h b/src/lib/dns/python/nsec3hash_python.h
index fa9b9b6..c4e435b 100644
--- a/src/lib/dns/python/nsec3hash_python.h
+++ b/src/lib/dns/python/nsec3hash_python.h
@@ -17,6 +17,8 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class NSEC3Hash;
@@ -30,12 +32,12 @@ public:
     NSEC3Hash* cppobj;
 };
 
-extern PyTypeObject nsec3hash_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject nsec3hash_type;
 
 // Public exception object.
-extern PyObject* po_UnknownNSEC3HashAlgorithm;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_UnknownNSEC3HashAlgorithm;
 
-bool initModulePart_NSEC3Hash(PyObject* mod);
+ISC_LIBDNS_PYTHON_API bool initModulePart_NSEC3Hash(PyObject* mod);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/opcode_python.cc b/src/lib/dns/python/opcode_python.cc
index 50436a9..7887964 100644
--- a/src/lib/dns/python/opcode_python.cc
+++ b/src/lib/dns/python/opcode_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <dns/opcode.h>
@@ -290,7 +292,7 @@ namespace isc {
 namespace dns {
 namespace python {
 
-PyTypeObject opcode_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject opcode_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Opcode",
     sizeof(s_Opcode),                   // tp_basicsize
diff --git a/src/lib/dns/python/opcode_python.h b/src/lib/dns/python/opcode_python.h
index d0aec15..8625298 100644
--- a/src/lib/dns/python/opcode_python.h
+++ b/src/lib/dns/python/opcode_python.h
@@ -17,13 +17,15 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class Opcode;
 
 namespace python {
 
-extern PyTypeObject opcode_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject opcode_type;
 
 /// This is a simple shortcut to create a python Opcode object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
diff --git a/src/lib/dns/python/pydnspp.cc b/src/lib/dns/python/pydnspp.cc
index 23ed463..65905f0 100644
--- a/src/lib/dns/python/pydnspp.cc
+++ b/src/lib/dns/python/pydnspp.cc
@@ -766,8 +766,68 @@ PyModuleDef pydnspp = {
 };
 }
 
+#if defined(_WIN32) && defined(USE_STATIC_LINK)
+
+// From src/lib/util/pyunittests/pyunittests_util.cc
+// must be here or there will be two gettimeFunctions in two .pyd!
+
+// see util/time_utilities.h
+namespace isc {
+namespace util {
+namespace detail {
+extern ISC_LIBDNS_API int64_t (*gettimeFunction)();
+}
+}
+}
+
+namespace {
+int64_t fake_current_time;
+
+int64_t
+getFakeTime() {
+    return (fake_current_time);
+}
+
+PyObject*
+fixCurrentTime(PyObject*, PyObject* args) {
+    PyObject* maybe_none;
+    if (PyArg_ParseTuple(args, "L", &fake_current_time)) {
+        isc::util::detail::gettimeFunction = getFakeTime;
+    } else if (PyArg_ParseTuple(args, "O", &maybe_none) &&
+               maybe_none == Py_None) {
+        isc::util::detail::gettimeFunction = NULL;
+    } else {
+         PyErr_SetString(PyExc_TypeError, "Invalid arguments to "
+                         "pyunittests_util.fix_current_time");
+         return (NULL);
+    }
+
+    PyErr_Clear();
+    Py_RETURN_NONE;
+}
+
+PyMethodDef PyUnittestsUtilMethods[] = {
+    { "fix_current_time", fixCurrentTime, METH_VARARGS,
+      "Fix the current system time at the specified (fake) value.\n\n"
+      "This is useful for testing modules that depend on the current time.\n"
+      "Note that it only affects C++ modules that use gettimeWrapper() "
+      "defined in libutil, which allows a hook for testing.\n"
+      "If an integer (signed 64bit) is given, the current time will be fixed "
+      "to that value; if None is specified (which is the default) the use of "
+      "faked time will be canceled."
+    },
+    { NULL, NULL, 0, NULL}
+};
+
+} // end of unnamed namespace
+
+#endif
+
 PyMODINIT_FUNC
 PyInit_pydnspp(void) {
+#if defined(_WIN32) && defined(USE_STATIC_LINK)
+    pydnspp.m_methods = PyUnittestsUtilMethods;
+#endif
     PyObject* mod = PyModule_Create(&pydnspp);
     if (mod == NULL) {
         return (NULL);
diff --git a/src/lib/dns/python/pydnspp_common.cc b/src/lib/dns/python/pydnspp_common.cc
index 8e623c5..0e9cd5a 100644
--- a/src/lib/dns/python/pydnspp_common.cc
+++ b/src/lib/dns/python/pydnspp_common.cc
@@ -12,12 +12,15 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <exceptions/exceptions.h>
 
 #include <util/buffer.h>
 
+#include <dns/python/lib.h>
 #include <dns/exceptions.h>
 #include <dns/name.h>
 #include <dns/messagerenderer.h>
@@ -46,11 +49,11 @@ namespace isc {
 namespace dns {
 namespace python {
 // For our 'general' isc::Exceptions
-PyObject* po_IscException;
-PyObject* po_InvalidParameter;
+ISC_LIBDNS_PYTHON_API PyObject* po_IscException;
+ISC_LIBDNS_PYTHON_API PyObject* po_InvalidParameter;
 
 // For our own isc::dns::Exception
-PyObject* po_DNSMessageBADVERS;
+ISC_LIBDNS_PYTHON_API PyObject* po_DNSMessageBADVERS;
 
 
 int
@@ -81,8 +84,7 @@ readDataFromSequence(uint8_t *data, size_t len, PyObject* sequence) {
     return (0);
 }
 
-
-int
+ISC_LIBDNS_PYTHON_API int
 addClassVariable(PyTypeObject& c, const char* name, PyObject* obj) {
     if (obj == NULL) {
         PyErr_SetString(PyExc_ValueError,
diff --git a/src/lib/dns/python/pydnspp_common.h b/src/lib/dns/python/pydnspp_common.h
index e9e9359..ba6fdbd 100644
--- a/src/lib/dns/python/pydnspp_common.h
+++ b/src/lib/dns/python/pydnspp_common.h
@@ -20,15 +20,17 @@
 #include <stdexcept>
 #include <string>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 namespace python {
 // For our 'general' isc::Exceptions
-extern PyObject* po_IscException;
-extern PyObject* po_InvalidParameter;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_IscException;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_InvalidParameter;
 
 // For our own isc::dns::Exception
-extern PyObject* po_DNSMessageBADVERS;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_DNSMessageBADVERS;
 
 // This function reads 'bytes' from a sequence
 // This sequence can be anything that implements the Sequence interface,
@@ -42,6 +44,7 @@ extern PyObject* po_DNSMessageBADVERS;
 // case nothing is removed
 int readDataFromSequence(uint8_t *data, size_t len, PyObject* sequence);
 
+ISC_LIBDNS_PYTHON_API
 int addClassVariable(PyTypeObject& c, const char* name, PyObject* obj);
 
 // Short term workaround for unifying the return type of tp_hash
diff --git a/src/lib/dns/python/pydnspp_towire.h b/src/lib/dns/python/pydnspp_towire.h
index e987a29..67802c4 100644
--- a/src/lib/dns/python/pydnspp_towire.h
+++ b/src/lib/dns/python/pydnspp_towire.h
@@ -20,6 +20,7 @@
 #include <stdexcept>
 #include <string>
 
+#include <dns/python/lib.h>
 #include <dns/messagerenderer.h>
 
 #include <util/buffer.h>
diff --git a/src/lib/dns/python/question_python.cc b/src/lib/dns/python/question_python.cc
index 44d68a2..1a4ad61 100644
--- a/src/lib/dns/python/question_python.cc
+++ b/src/lib/dns/python/question_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #define PY_SSIZE_T_CLEAN
 #include <Python.h>
 #include <dns/question.h>
@@ -239,7 +241,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_Question
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject question_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject question_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Question",
     sizeof(s_Question),                 // tp_basicsize
diff --git a/src/lib/dns/python/question_python.h b/src/lib/dns/python/question_python.h
index f5d78b1..d8de92e 100644
--- a/src/lib/dns/python/question_python.h
+++ b/src/lib/dns/python/question_python.h
@@ -17,15 +17,17 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class Question;
 
 namespace python {
 
-extern PyObject* po_EmptyQuestion;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_EmptyQuestion;
 
-extern PyTypeObject question_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject question_type;
 
 /// This is a simple shortcut to create a python Question object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
diff --git a/src/lib/dns/python/rcode_python.cc b/src/lib/dns/python/rcode_python.cc
index 42b48e7..d409fdf 100644
--- a/src/lib/dns/python/rcode_python.cc
+++ b/src/lib/dns/python/rcode_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <exceptions/exceptions.h>
@@ -330,7 +332,7 @@ Rcode_richcmp(const s_Rcode* const self, const s_Rcode* const other,
 namespace isc {
 namespace dns {
 namespace python {
-PyTypeObject rcode_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject rcode_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Rcode",
     sizeof(s_Rcode),                    // tp_basicsize
diff --git a/src/lib/dns/python/rcode_python.h b/src/lib/dns/python/rcode_python.h
index a149406..e90e8ff 100644
--- a/src/lib/dns/python/rcode_python.h
+++ b/src/lib/dns/python/rcode_python.h
@@ -17,13 +17,15 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class Rcode;
 
 namespace python {
 
-extern PyTypeObject rcode_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject rcode_type;
 
 /// This is a simple shortcut to create a python Rcode object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
diff --git a/src/lib/dns/python/rdata_python.cc b/src/lib/dns/python/rdata_python.cc
index 20f67c8..baf88f0 100644
--- a/src/lib/dns/python/rdata_python.cc
+++ b/src/lib/dns/python/rdata_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #define PY_SSIZE_T_CLEAN
 #include <Python.h>
 #include <dns/rdata.h>
@@ -284,14 +286,14 @@ namespace python {
 // Initialization and addition of these go in the initModulePart
 // function in pydnspp
 //
-PyObject* po_InvalidRdataLength;
-PyObject* po_InvalidRdataText;
-PyObject* po_CharStringTooLong;
+ISC_LIBDNS_PYTHON_API PyObject* po_InvalidRdataLength;
+ISC_LIBDNS_PYTHON_API PyObject* po_InvalidRdataText;
+ISC_LIBDNS_PYTHON_API PyObject* po_CharStringTooLong;
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_Rdata
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject rdata_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject rdata_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Rdata",
     sizeof(s_Rdata),                    // tp_basicsize
diff --git a/src/lib/dns/python/rdata_python.h b/src/lib/dns/python/rdata_python.h
index c7ddd57..fe11fe6 100644
--- a/src/lib/dns/python/rdata_python.h
+++ b/src/lib/dns/python/rdata_python.h
@@ -17,17 +17,18 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
 #include <dns/rdata.h>
 
 namespace isc {
 namespace dns {
 namespace python {
 
-extern PyObject* po_InvalidRdataLength;
-extern PyObject* po_InvalidRdataText;
-extern PyObject* po_CharStringTooLong;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_InvalidRdataLength;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_InvalidRdataText;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_CharStringTooLong;
 
-extern PyTypeObject rdata_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject rdata_type;
 
 /// This is a simple shortcut to create a python Rdata object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
diff --git a/src/lib/dns/python/rrclass_python.cc b/src/lib/dns/python/rrclass_python.cc
index b94dc02..e78dd46 100644
--- a/src/lib/dns/python/rrclass_python.cc
+++ b/src/lib/dns/python/rrclass_python.cc
@@ -11,6 +11,9 @@
 // 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.
+
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <dns/rrclass.h>
@@ -282,14 +285,14 @@ namespace python {
 // Initialization and addition of these go in the initModulePart
 // function in pydnspp.cc
 //
-PyObject* po_InvalidRRClass;
-PyObject* po_IncompleteRRClass;
+ISC_LIBDNS_PYTHON_API PyObject* po_InvalidRRClass;
+ISC_LIBDNS_PYTHON_API PyObject* po_IncompleteRRClass;
 
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_RRClass
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject rrclass_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject rrclass_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.RRClass",
     sizeof(s_RRClass),                  // tp_basicsize
diff --git a/src/lib/dns/python/rrclass_python.h b/src/lib/dns/python/rrclass_python.h
index f58bba6..d246a8d 100644
--- a/src/lib/dns/python/rrclass_python.h
+++ b/src/lib/dns/python/rrclass_python.h
@@ -17,16 +17,18 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class RRClass;
 
 namespace python {
 
-extern PyObject* po_InvalidRRClass;
-extern PyObject* po_IncompleteRRClass;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_InvalidRRClass;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_IncompleteRRClass;
 
-extern PyTypeObject rrclass_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject rrclass_type;
 
 /// This is a simple shortcut to create a python RRClass object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
diff --git a/src/lib/dns/python/rrset_python.cc b/src/lib/dns/python/rrset_python.cc
index 2992522..6a13e2c 100644
--- a/src/lib/dns/python/rrset_python.cc
+++ b/src/lib/dns/python/rrset_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <util/python/pycppwrapper_util.h>
@@ -347,9 +349,9 @@ namespace python {
 // Initialization and addition of these go in the module init at the
 // end
 //
-PyObject* po_EmptyRRset;
+ISC_LIBDNS_PYTHON_API PyObject* po_EmptyRRset;
 
-PyTypeObject rrset_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject rrset_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.RRset",
     sizeof(s_RRset),                    // tp_basicsize
diff --git a/src/lib/dns/python/rrset_python.h b/src/lib/dns/python/rrset_python.h
index 2435397..638b08b 100644
--- a/src/lib/dns/python/rrset_python.h
+++ b/src/lib/dns/python/rrset_python.h
@@ -17,6 +17,7 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
 #include <dns/rrset.h>
 
 #include <util/python/pycppwrapper_util.h>
@@ -25,9 +26,9 @@ namespace isc {
 namespace dns {
 namespace python {
 
-extern PyObject* po_EmptyRRset;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_EmptyRRset;
 
-extern PyTypeObject rrset_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject rrset_type;
 
 /// This is a simple shortcut to create a python RRset object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
diff --git a/src/lib/dns/python/rrttl_python.cc b/src/lib/dns/python/rrttl_python.cc
index 3a3f067..b54068e 100644
--- a/src/lib/dns/python/rrttl_python.cc
+++ b/src/lib/dns/python/rrttl_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 #include <vector>
 
@@ -230,13 +232,13 @@ namespace python {
 // Initialization and addition of these go in the initModulePart
 // function in pydnspp.cc
 //
-PyObject* po_InvalidRRTTL;
-PyObject* po_IncompleteRRTTL;
+ISC_LIBDNS_PYTHON_API PyObject* po_InvalidRRTTL;
+ISC_LIBDNS_PYTHON_API PyObject* po_IncompleteRRTTL;
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_RRTTL
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject rrttl_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject rrttl_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.RRTTL",
     sizeof(s_RRTTL),                    // tp_basicsize
diff --git a/src/lib/dns/python/rrttl_python.h b/src/lib/dns/python/rrttl_python.h
index 9dbc982..74fc864 100644
--- a/src/lib/dns/python/rrttl_python.h
+++ b/src/lib/dns/python/rrttl_python.h
@@ -17,16 +17,18 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class RRTTL;
 
 namespace python {
 
-extern PyObject* po_InvalidRRTTL;
-extern PyObject* po_IncompleteRRTTL;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_InvalidRRTTL;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_IncompleteRRTTL;
 
-extern PyTypeObject rrttl_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject rrttl_type;
 
 /// This is a simple shortcut to create a python RRTTL object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
diff --git a/src/lib/dns/python/rrtype_python.cc b/src/lib/dns/python/rrtype_python.cc
index bf20b7c..b131b27 100644
--- a/src/lib/dns/python/rrtype_python.cc
+++ b/src/lib/dns/python/rrtype_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 #include <vector>
 
@@ -374,13 +376,13 @@ namespace isc {
 namespace dns {
 namespace python {
 
-PyObject* po_InvalidRRType;
-PyObject* po_IncompleteRRType;
+ISC_LIBDNS_PYTHON_API PyObject* po_InvalidRRType;
+ISC_LIBDNS_PYTHON_API PyObject* po_IncompleteRRType;
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_RRType
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject rrtype_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject rrtype_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.RRType",
     sizeof(s_RRType),                   // tp_basicsize
diff --git a/src/lib/dns/python/rrtype_python.h b/src/lib/dns/python/rrtype_python.h
index 596598e..6683b56 100644
--- a/src/lib/dns/python/rrtype_python.h
+++ b/src/lib/dns/python/rrtype_python.h
@@ -17,16 +17,18 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class RRType;
 
 namespace python {
 
-extern PyObject* po_InvalidRRType;
-extern PyObject* po_IncompleteRRType;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_InvalidRRType;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_IncompleteRRType;
 
-extern PyTypeObject rrtype_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject rrtype_type;
 
 /// This is a simple shortcut to create a python RRType object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
diff --git a/src/lib/dns/python/serial_python.cc b/src/lib/dns/python/serial_python.cc
index e2bd809..7ced27c 100644
--- a/src/lib/dns/python/serial_python.cc
+++ b/src/lib/dns/python/serial_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <dns/serial.h>
@@ -193,7 +195,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_Serial
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject serial_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject serial_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Serial",
     sizeof(s_Serial),                   // tp_basicsize
diff --git a/src/lib/dns/python/serial_python.h b/src/lib/dns/python/serial_python.h
index 48b5199..a4658a0 100644
--- a/src/lib/dns/python/serial_python.h
+++ b/src/lib/dns/python/serial_python.h
@@ -17,13 +17,15 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class Serial;
 
 namespace python {
 
-extern PyTypeObject serial_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject serial_type;
 
 /// This is a simple shortcut to create a python Serial object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
diff --git a/src/lib/dns/python/tsig_python.cc b/src/lib/dns/python/tsig_python.cc
index 0764e33..932f0bd 100644
--- a/src/lib/dns/python/tsig_python.cc
+++ b/src/lib/dns/python/tsig_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #define PY_SSIZE_T_CLEAN        // need for "y#" below
 #include <Python.h>
 
@@ -240,12 +242,12 @@ namespace isc {
 namespace dns {
 namespace python {
 // Definition of class specific exception(s)
-PyObject* po_TSIGContextError;
+ISC_LIBDNS_PYTHON_API PyObject* po_TSIGContextError;
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_TSIGContext
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject tsigcontext_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject tsigcontext_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.TSIGContext",
     sizeof(s_TSIGContext),                 // tp_basicsize
diff --git a/src/lib/dns/python/tsig_python.h b/src/lib/dns/python/tsig_python.h
index e4e9fff..0fd5f3d 100644
--- a/src/lib/dns/python/tsig_python.h
+++ b/src/lib/dns/python/tsig_python.h
@@ -17,16 +17,18 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class TSIGContext;
 
 namespace python {
 
-extern PyTypeObject tsigcontext_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject tsigcontext_type;
 
 // Class specific exceptions
-extern PyObject* po_TSIGContextError;
+extern ISC_LIBDNS_PYTHON_API PyObject* po_TSIGContextError;
 
 /// \brief Checks if the given python object is a TSIGContext object
 ///
diff --git a/src/lib/dns/python/tsig_rdata_python.cc b/src/lib/dns/python/tsig_rdata_python.cc
index 6ec0f09..d93ee34 100644
--- a/src/lib/dns/python/tsig_rdata_python.cc
+++ b/src/lib/dns/python/tsig_rdata_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
@@ -285,7 +287,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_TSIG
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject tsig_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject tsig_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.TSIG",
     sizeof(s_TSIG),                 // tp_basicsize
diff --git a/src/lib/dns/python/tsig_rdata_python.h b/src/lib/dns/python/tsig_rdata_python.h
index a84d9e8..ffdc3d7 100644
--- a/src/lib/dns/python/tsig_rdata_python.h
+++ b/src/lib/dns/python/tsig_rdata_python.h
@@ -17,6 +17,8 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 namespace rdata {
@@ -27,7 +29,7 @@ class TSIG;
 
 namespace python {
 
-extern PyTypeObject tsig_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject tsig_type;
 
 /// This is A simple shortcut to create a python TSIG object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
diff --git a/src/lib/dns/python/tsigerror_python.cc b/src/lib/dns/python/tsigerror_python.cc
index 7a0217e..e842ff8 100644
--- a/src/lib/dns/python/tsigerror_python.cc
+++ b/src/lib/dns/python/tsigerror_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <string>
@@ -228,7 +230,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_TSIGError
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject tsigerror_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject tsigerror_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.TSIGError",
     sizeof(s_TSIGError),                 // tp_basicsize
@@ -280,7 +282,7 @@ PyTypeObject tsigerror_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+ISC_LIBDNS_PYTHON_API PyObject*
 createTSIGErrorObject(const TSIGError& source) {
     TSIGErrorContainer container(PyObject_New(s_TSIGError, &tsigerror_type));
     container.set(new TSIGError(source));
diff --git a/src/lib/dns/python/tsigerror_python.h b/src/lib/dns/python/tsigerror_python.h
index 0b5b630..08bb9f5 100644
--- a/src/lib/dns/python/tsigerror_python.h
+++ b/src/lib/dns/python/tsigerror_python.h
@@ -17,13 +17,15 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class TSIGError;
 
 namespace python {
 
-extern PyTypeObject tsigerror_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject tsigerror_type;
 
 /// This is A simple shortcut to create a python TSIGError object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -32,7 +34,7 @@ extern PyTypeObject tsigerror_type;
 /// returns a NULL pointer).
 /// This function is expected to be called with in a try block
 /// followed by necessary setup for python exception.
-PyObject* createTSIGErrorObject(const TSIGError& source);
+ISC_LIBDNS_PYTHON_API PyObject* createTSIGErrorObject(const TSIGError& source);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/tsigkey_python.cc b/src/lib/dns/python/tsigkey_python.cc
index cf79c1a..9547323 100644
--- a/src/lib/dns/python/tsigkey_python.cc
+++ b/src/lib/dns/python/tsigkey_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <stdexcept>
@@ -181,7 +183,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_EDNS
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject tsigkey_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject tsigkey_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.TSIGKey",
     sizeof(s_TSIGKey),                  // tp_basicsize
@@ -394,7 +396,7 @@ TSIGKeyRing_find(const s_TSIGKeyRing* self, PyObject* args) {
 namespace isc {
 namespace dns {
 namespace python {
-PyTypeObject tsigkeyring_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject tsigkeyring_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.TSIGKeyRing",
     sizeof(s_TSIGKeyRing),              // tp_basicsize
diff --git a/src/lib/dns/python/tsigkey_python.h b/src/lib/dns/python/tsigkey_python.h
index 6c3d2e3..358852d 100644
--- a/src/lib/dns/python/tsigkey_python.h
+++ b/src/lib/dns/python/tsigkey_python.h
@@ -17,6 +17,8 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class TSIGKey;
@@ -24,8 +26,8 @@ class TSIGKeyRing;
 
 namespace python {
 
-extern PyTypeObject tsigkey_type;
-extern PyTypeObject tsigkeyring_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject tsigkey_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject tsigkeyring_type;
 
 /// \brief Checks if the given python object is a TSIGKey object
 ///
diff --git a/src/lib/dns/python/tsigrecord_python.cc b/src/lib/dns/python/tsigrecord_python.cc
index c754dd2..180fbcb 100644
--- a/src/lib/dns/python/tsigrecord_python.cc
+++ b/src/lib/dns/python/tsigrecord_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <string>
@@ -212,7 +214,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_TSIGRecord
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject tsigrecord_type = {
+ISC_LIBDNS_PYTHON_API PyTypeObject tsigrecord_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.TSIGRecord",
     sizeof(s_TSIGRecord),                 // tp_basicsize
diff --git a/src/lib/dns/python/tsigrecord_python.h b/src/lib/dns/python/tsigrecord_python.h
index d6252e1..819d7fd 100644
--- a/src/lib/dns/python/tsigrecord_python.h
+++ b/src/lib/dns/python/tsigrecord_python.h
@@ -17,6 +17,8 @@
 
 #include <Python.h>
 
+#include <dns/python/lib.h>
+
 namespace isc {
 namespace dns {
 class TSIGRecord;
@@ -24,7 +26,7 @@ class TSIGRecord;
 namespace python {
 
 
-extern PyTypeObject tsigrecord_type;
+extern ISC_LIBDNS_PYTHON_API PyTypeObject tsigrecord_type;
 
 /// This is A simple shortcut to create a python TSIGRecord object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
diff --git a/src/lib/dns/question.cc b/src/lib/dns/question.cc
index 6ccb164..4789eaa 100644
--- a/src/lib/dns/question.cc
+++ b/src/lib/dns/question.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <iostream>
 #include <string>
 
@@ -73,7 +75,7 @@ Question::toWire(AbstractMessageRenderer& renderer) const {
     return (1);                 // number of "entries"
 }
 
-ostream&
+ISC_LIBDNS_API ostream&
 operator<<(std::ostream& os, const Question& question) {
     os << question.toText();
     return (os);
diff --git a/src/lib/dns/question.h b/src/lib/dns/question.h
index 5d2783b..83db42f 100644
--- a/src/lib/dns/question.h
+++ b/src/lib/dns/question.h
@@ -20,20 +20,21 @@
 
 #include <boost/shared_ptr.hpp>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rrclass.h>
 #include <dns/rrtype.h>
 
 namespace isc {
 namespace util {
-class InputBuffer;
-class OutputBuffer;
+class ISC_LIBDNS_API InputBuffer;
+class ISC_LIBDNS_API OutputBuffer;
 }
 
 namespace dns {
 
-class AbstractMessageRenderer;
-class Question;
+class ISC_LIBDNS_API AbstractMessageRenderer;
+class ISC_LIBDNS_API Question;
 
 /// \brief A pointer-like type pointing to an \c Question object.
 typedef boost::shared_ptr<Question> QuestionPtr;
@@ -100,7 +101,7 @@ typedef boost::shared_ptr<const Question> ConstQuestionPtr;
 /// \c AbstractRRset such as \c %getName() or \c %toWire().
 /// So the user class may use a template function that is applicable to both
 /// \c Question and \c RRset to avoid writing duplicate code logic.
-class Question {
+class ISC_LIBDNS_API Question {
     ///
     /// \name Constructors and Destructor
     ///
@@ -285,7 +286,8 @@ private:
 /// operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const Question& question);
+ISC_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const Question& question);
 } // end of namespace dns
 } // end of namespace isc
 #endif  // __QUESTION_H
diff --git a/src/lib/dns/rcode.cc b/src/lib/dns/rcode.cc
index ee41b1e..de9b359 100644
--- a/src/lib/dns/rcode.cc
+++ b/src/lib/dns/rcode.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <string>
 #include <sstream>
 #include <ostream>
@@ -93,7 +95,7 @@ Rcode::toText() const {
     return (oss.str());
 }
 
-ostream&
+ISC_LIBDNS_API ostream&
 operator<<(std::ostream& os, const Rcode& rcode) {
     return (os << rcode.toText());
 }
diff --git a/src/lib/dns/rcode.h b/src/lib/dns/rcode.h
index 0c63285..722894b 100644
--- a/src/lib/dns/rcode.h
+++ b/src/lib/dns/rcode.h
@@ -14,12 +14,18 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifndef __RCODE_H
+#define __RCODE_H 1
+
 #include <stdint.h>
 
 #include <ostream>
 
-#ifndef __RCODE_H
-#define __RCODE_H 1
+#include <dns/lib.h>
+
+#if defined(_WIN32) && defined(NOERROR)
+#undef NOERROR
+#endif
 
 namespace isc {
 namespace dns {
@@ -45,7 +51,7 @@ namespace dns {
 /// to handle RCODEs through this class.  In fact, public interfaces of
 /// this library uses this class to pass or return RCODEs instead of the
 /// bare code values.
-class Rcode {
+class ISC_LIBDNS_API Rcode {
 public:
     /// Constants for pre-defined RCODE values.
     enum CodeValue {
@@ -336,7 +342,8 @@ Rcode::BADVERS() {
 /// \param rcode A reference to an \c Rcode object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const Rcode& rcode);
+ISC_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const Rcode& rcode);
 }
 }
 #endif  // RCODE_H
diff --git a/src/lib/dns/rdata.cc b/src/lib/dns/rdata.cc
index 59a5887..18d2640 100644
--- a/src/lib/dns/rdata.cc
+++ b/src/lib/dns/rdata.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <algorithm>
 #include <cctype>
 #include <string>
@@ -44,7 +46,7 @@ namespace rdata {
 
 // XXX: we need to specify std:: for string to help doxygen match the
 // function signature with that given in the header file.
-RdataPtr
+ISC_LIBDNS_API RdataPtr
 createRdata(const RRType& rrtype, const RRClass& rrclass,
             const std::string& rdata_string)
 {
@@ -52,7 +54,7 @@ createRdata(const RRType& rrtype, const RRClass& rrclass,
                                                        rdata_string));
 }
 
-RdataPtr
+ISC_LIBDNS_API RdataPtr
 createRdata(const RRType& rrtype, const RRClass& rrclass,
             isc::util::InputBuffer& buffer, size_t len)
 {
@@ -74,14 +76,14 @@ createRdata(const RRType& rrtype, const RRClass& rrclass,
     return (rdata);
 }
 
-RdataPtr
+ISC_LIBDNS_API RdataPtr
 createRdata(const RRType& rrtype, const RRClass& rrclass, const Rdata& source)
 {
     return (RRParamRegistry::getRegistry().createRdata(rrtype, rrclass,
                                                        source));
 }
 
-int
+ISC_LIBDNS_API int
 compareNames(const Name& n1, const Name& n2) {
     size_t len1 = n1.getLength();
     size_t len2 = n2.getLength();
@@ -263,7 +265,7 @@ Generic::compare(const Rdata& other) const {
     return (compare_internal(*impl_, *other_rdata.impl_));
 }
 
-std::ostream&
+ISC_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const Generic& rdata) {
     return (os << rdata.toText());
 }
diff --git a/src/lib/dns/rdata.h b/src/lib/dns/rdata.h
index afcf4b3..910f49c 100644
--- a/src/lib/dns/rdata.h
+++ b/src/lib/dns/rdata.h
@@ -20,17 +20,18 @@
 #include <boost/shared_ptr.hpp>
 
 #include <exceptions/exceptions.h>
+#include <dns/lib.h>
 
 namespace isc {
 namespace util {
-class InputBuffer;
-class OutputBuffer;
+class ISC_LIBDNS_API InputBuffer;
+class ISC_LIBDNS_API OutputBuffer;
 }
 namespace dns {
-class AbstractMessageRenderer;
-class RRType;
-class RRClass;
-class Name;
+class ISC_LIBDNS_API AbstractMessageRenderer;
+class ISC_LIBDNS_API RRType;
+class ISC_LIBDNS_API RRClass;
+class ISC_LIBDNS_API Name;
 
 namespace rdata {
 
@@ -38,7 +39,7 @@ namespace rdata {
 /// \brief A standard DNS module exception that is thrown if RDATA parser
 /// encounters an invalid or inconsistent data length.
 ///
-class InvalidRdataLength : public Exception {
+class ISC_LIBDNS_API InvalidRdataLength : public Exception {
 public:
     InvalidRdataLength(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -48,7 +49,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if RDATA parser
 /// fails to recognize a given textual representation.
 ///
-class InvalidRdataText : public Exception {
+class ISC_LIBDNS_API InvalidRdataText : public Exception {
 public:
     InvalidRdataText(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -59,14 +60,14 @@ public:
 /// parser encounters a character-string (as defined in RFC1035) exceeding
 /// the maximum allowable length (\c MAX_CHARSTRING_LEN).
 ///
-class CharStringTooLong : public Exception {
+class ISC_LIBDNS_API CharStringTooLong : public Exception {
 public:
     CharStringTooLong(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
 };
 
 // Forward declaration to define RdataPtr.
-class Rdata;
+class ISC_LIBDNS_API Rdata;
 
 ///
 /// The \c RdataPtr type is a pointer-like type, pointing to an
@@ -124,7 +125,7 @@ const unsigned int MAX_CHARSTRING_LEN = 255;
 /// specifically concerned about a particular type.
 /// So, this API generally handles \c Rdata in a polymorphic way through
 /// a pointer or reference to this base abstract class.
-class Rdata {
+class ISC_LIBDNS_API Rdata {
     ///
     /// \name Constructors and Destructor
     ///
@@ -235,7 +236,7 @@ struct GenericImpl;
 /// This class is used as a placeholder for all non well-known type of RDATA.
 /// By definition, the stored data is regarded as opaque binary without
 /// assuming any structure.
-class Generic : public Rdata {
+class ISC_LIBDNS_API Generic : public Rdata {
 public:
     ///
     /// \name Constructors, Assignment Operator and Destructor.
@@ -385,7 +386,8 @@ private:
 /// \param rdata The \c Generic object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const Generic& rdata);
+ISC_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const Generic& rdata);
 } // end of namespace "generic"
 
 //
@@ -430,6 +432,7 @@ std::ostream& operator<<(std::ostream& os, const Generic& rdata);
 /// \param rdata_string A string of textual representation of the \c Rdata.
 /// \return An \c RdataPtr object pointing to the created \c Rdata
 /// object.
+ISC_LIBDNS_API
 RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
                      const std::string& rdata_string);
 
@@ -454,6 +457,7 @@ RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
 /// \param len The length in buffer of the \c Rdata.  In bytes.
 /// \return An \c RdataPtr object pointing to the created \c Rdata
 /// object.
+ISC_LIBDNS_API
 RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
                      isc::util::InputBuffer& buffer, size_t len);
 
@@ -470,6 +474,7 @@ RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
 /// is to be copied to the created \c Rdata object.
 /// \return An \c RdataPtr object pointing to the created
 /// \c Rdata object.
+ISC_LIBDNS_API
 RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
                      const Rdata& source);
 //@}
@@ -504,7 +509,7 @@ RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
 /// \return 0 if \c n1 is identical to \c n2 in terms of sorting order.
 /// \return 1 if \c n1 would be sorted after \c n2.
 ///
-int compareNames(const Name& n1, const Name& n2);
+ISC_LIBDNS_API int compareNames(const Name& n1, const Name& n2);
 
 } // end of namespace "rdata"
 }
diff --git a/src/lib/dns/rdata/any_255/tsig_250.h b/src/lib/dns/rdata/any_255/tsig_250.h
index ff24925..4e56dd3 100644
--- a/src/lib/dns/rdata/any_255/tsig_250.h
+++ b/src/lib/dns/rdata/any_255/tsig_250.h
@@ -18,11 +18,12 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/rdata.h>
 
 namespace isc {
 namespace dns {
-class Name;
+class ISC_LIBDNS_API Name;
 }
 }
 
@@ -39,7 +40,7 @@ class Name;
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// TSIG RDATA.
-class TSIG : public Rdata {
+class ISC_LIBDNS_API TSIG : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/ch_3/a_1.h b/src/lib/dns/rdata/ch_3/a_1.h
index 6d75952..fbfb926 100644
--- a/src/lib/dns/rdata/ch_3/a_1.h
+++ b/src/lib/dns/rdata/ch_3/a_1.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -25,7 +26,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class A : public Rdata {
+class ISC_LIBDNS_API A : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/afsdb_18.h b/src/lib/dns/rdata/generic/afsdb_18.h
index 4a46775..2055e1f 100644
--- a/src/lib/dns/rdata/generic/afsdb_18.h
+++ b/src/lib/dns/rdata/generic/afsdb_18.h
@@ -18,6 +18,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -34,7 +35,7 @@
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// AFSDB RDATA.
-class AFSDB : public Rdata {
+class ISC_LIBDNS_API AFSDB : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/cname_5.h b/src/lib/dns/rdata/generic/cname_5.h
index 92dffad..457940e 100644
--- a/src/lib/dns/rdata/generic/cname_5.h
+++ b/src/lib/dns/rdata/generic/cname_5.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -26,7 +27,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class CNAME : public Rdata {
+class ISC_LIBDNS_API CNAME : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/detail/ds_like.h b/src/lib/dns/rdata/generic/detail/ds_like.h
index b5a35cd..3231054 100644
--- a/src/lib/dns/rdata/generic/detail/ds_like.h
+++ b/src/lib/dns/rdata/generic/detail/ds_like.h
@@ -26,6 +26,7 @@
 
 #include <exceptions/exceptions.h>
 
+#include <dns/lib.h>
 #include <dns/messagerenderer.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
diff --git a/src/lib/dns/rdata/generic/detail/nsec3param_common.cc b/src/lib/dns/rdata/generic/detail/nsec3param_common.cc
index 6eea2c7..35f1b71 100644
--- a/src/lib/dns/rdata/generic/detail/nsec3param_common.cc
+++ b/src/lib/dns/rdata/generic/detail/nsec3param_common.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <exceptions/exceptions.h>
 
 #include <util/encode/hex.h>
diff --git a/src/lib/dns/rdata/generic/detail/nsec3param_common.h b/src/lib/dns/rdata/generic/detail/nsec3param_common.h
index 515777b..0b2ded6 100644
--- a/src/lib/dns/rdata/generic/detail/nsec3param_common.h
+++ b/src/lib/dns/rdata/generic/detail/nsec3param_common.h
@@ -16,6 +16,7 @@
 #define __NSEC3PARAM_COMMON_H 1
 
 #include <util/buffer.h>
+#include <dns/lib.h>
 
 #include <stdint.h>
 
diff --git a/src/lib/dns/rdata/generic/detail/nsec_bitmap.cc b/src/lib/dns/rdata/generic/detail/nsec_bitmap.cc
index bb48705..1c84856 100644
--- a/src/lib/dns/rdata/generic/detail/nsec_bitmap.cc
+++ b/src/lib/dns/rdata/generic/detail/nsec_bitmap.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <exceptions/exceptions.h>
 
 #include <dns/exceptions.h>
diff --git a/src/lib/dns/rdata/generic/detail/nsec_bitmap.h b/src/lib/dns/rdata/generic/detail/nsec_bitmap.h
index 85cae2e..2c3fcd1 100644
--- a/src/lib/dns/rdata/generic/detail/nsec_bitmap.h
+++ b/src/lib/dns/rdata/generic/detail/nsec_bitmap.h
@@ -20,6 +20,8 @@
 #include <sstream>
 #include <vector>
 
+#include <dns/lib.h>
+
 namespace isc {
 namespace dns {
 namespace rdata {
diff --git a/src/lib/dns/rdata/generic/detail/txt_like.h b/src/lib/dns/rdata/generic/detail/txt_like.h
index a0ab7ac..f3e7699 100644
--- a/src/lib/dns/rdata/generic/detail/txt_like.h
+++ b/src/lib/dns/rdata/generic/detail/txt_like.h
@@ -20,6 +20,8 @@
 #include <string>
 #include <vector>
 
+#include <dns/lib.h>
+
 using namespace std;
 using namespace isc::util;
 
diff --git a/src/lib/dns/rdata/generic/dlv_32769.h b/src/lib/dns/rdata/generic/dlv_32769.h
index 86cd98c..e181bd8 100644
--- a/src/lib/dns/rdata/generic/dlv_32769.h
+++ b/src/lib/dns/rdata/generic/dlv_32769.h
@@ -18,6 +18,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -40,7 +41,7 @@ template <class Type, uint16_t typeCode> class DSLikeImpl;
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// DLV RDATA.
-class DLV : public Rdata {
+class ISC_LIBDNS_API DLV : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/dname_39.h b/src/lib/dns/rdata/generic/dname_39.h
index 5e12167..6c31beb 100644
--- a/src/lib/dns/rdata/generic/dname_39.h
+++ b/src/lib/dns/rdata/generic/dname_39.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -26,7 +27,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class DNAME : public Rdata {
+class ISC_LIBDNS_API DNAME : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/dnskey_48.h b/src/lib/dns/rdata/generic/dnskey_48.h
index 14fad9f..3b0d946 100644
--- a/src/lib/dns/rdata/generic/dnskey_48.h
+++ b/src/lib/dns/rdata/generic/dnskey_48.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -32,7 +33,7 @@
 
 struct DNSKEYImpl;
 
-class DNSKEY : public Rdata {
+class ISC_LIBDNS_API DNSKEY : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/ds_43.h b/src/lib/dns/rdata/generic/ds_43.h
index 2697f51..a976bc6 100644
--- a/src/lib/dns/rdata/generic/ds_43.h
+++ b/src/lib/dns/rdata/generic/ds_43.h
@@ -18,6 +18,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -40,7 +41,7 @@ template <class Type, uint16_t typeCode> class DSLikeImpl;
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// DS RDATA.
-class DS : public Rdata {
+class ISC_LIBDNS_API DS : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/hinfo_13.h b/src/lib/dns/rdata/generic/hinfo_13.h
index 8513419..a9c2b71 100644
--- a/src/lib/dns/rdata/generic/hinfo_13.h
+++ b/src/lib/dns/rdata/generic/hinfo_13.h
@@ -17,6 +17,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 #include <util/buffer.h>
@@ -34,7 +35,7 @@
 /// This class implements the basic interfaces inherited from the
 /// \c rdata::Rdata class, and provides accessors specific to the
 /// HINFO rdata.
-class HINFO : public Rdata {
+class ISC_LIBDNS_API HINFO : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/minfo_14.h b/src/lib/dns/rdata/generic/minfo_14.h
index f3ee1d0..2125636 100644
--- a/src/lib/dns/rdata/generic/minfo_14.h
+++ b/src/lib/dns/rdata/generic/minfo_14.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -32,7 +33,7 @@
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// MINFO RDATA.
-class MINFO : public Rdata {
+class ISC_LIBDNS_API MINFO : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/mx_15.h b/src/lib/dns/rdata/generic/mx_15.h
index 1381f18..bcf3bd8 100644
--- a/src/lib/dns/rdata/generic/mx_15.h
+++ b/src/lib/dns/rdata/generic/mx_15.h
@@ -18,6 +18,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -28,7 +29,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class MX : public Rdata {
+class ISC_LIBDNS_API MX : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/naptr_35.h b/src/lib/dns/rdata/generic/naptr_35.h
index ca16b3c..2b8a201 100644
--- a/src/lib/dns/rdata/generic/naptr_35.h
+++ b/src/lib/dns/rdata/generic/naptr_35.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 #include <util/buffer.h>
@@ -33,7 +34,7 @@
 /// This class implements the basic interfaces inherited from the
 /// \c rdata::Rdata class, and provides accessors specific to the
 /// NAPTR rdata.
-class NAPTR : public Rdata {
+class ISC_LIBDNS_API NAPTR : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/ns_2.h b/src/lib/dns/rdata/generic/ns_2.h
index fa44f22..33b1f96 100644
--- a/src/lib/dns/rdata/generic/ns_2.h
+++ b/src/lib/dns/rdata/generic/ns_2.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -26,7 +27,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class NS : public Rdata {
+class ISC_LIBDNS_API NS : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/nsec3_50.h b/src/lib/dns/rdata/generic/nsec3_50.h
index c766ade..ae773c8 100644
--- a/src/lib/dns/rdata/generic/nsec3_50.h
+++ b/src/lib/dns/rdata/generic/nsec3_50.h
@@ -17,6 +17,7 @@
 #include <string>
 #include <vector>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -33,7 +34,7 @@
 
 struct NSEC3Impl;
 
-class NSEC3 : public Rdata {
+class ISC_LIBDNS_API NSEC3 : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/nsec3param_51.h b/src/lib/dns/rdata/generic/nsec3param_51.h
index 130c759..81eb448 100644
--- a/src/lib/dns/rdata/generic/nsec3param_51.h
+++ b/src/lib/dns/rdata/generic/nsec3param_51.h
@@ -17,6 +17,7 @@
 #include <string>
 #include <vector>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -33,7 +34,7 @@
 
 struct NSEC3PARAMImpl;
 
-class NSEC3PARAM : public Rdata {
+class ISC_LIBDNS_API NSEC3PARAM : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/nsec_47.h b/src/lib/dns/rdata/generic/nsec_47.h
index 005dd3a..3fe239f 100644
--- a/src/lib/dns/rdata/generic/nsec_47.h
+++ b/src/lib/dns/rdata/generic/nsec_47.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -32,7 +33,7 @@
 
 struct NSECImpl;
 
-class NSEC : public Rdata {
+class ISC_LIBDNS_API NSEC : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/opt_41.h b/src/lib/dns/rdata/generic/opt_41.h
index 0cb7043..454a9e6 100644
--- a/src/lib/dns/rdata/generic/opt_41.h
+++ b/src/lib/dns/rdata/generic/opt_41.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -25,7 +26,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class OPT : public Rdata {
+class ISC_LIBDNS_API OPT : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/ptr_12.h b/src/lib/dns/rdata/generic/ptr_12.h
index 5d2d048..acd70a2 100644
--- a/src/lib/dns/rdata/generic/ptr_12.h
+++ b/src/lib/dns/rdata/generic/ptr_12.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -26,7 +27,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class PTR : public Rdata {
+class ISC_LIBDNS_API PTR : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/rp_17.h b/src/lib/dns/rdata/generic/rp_17.h
index a90a530..ee40dfe 100644
--- a/src/lib/dns/rdata/generic/rp_17.h
+++ b/src/lib/dns/rdata/generic/rp_17.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -32,7 +33,7 @@
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// RP RDATA.
-class RP : public Rdata {
+class ISC_LIBDNS_API RP : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/rrsig_46.h b/src/lib/dns/rdata/generic/rrsig_46.h
index b32c17f..8e49e61 100644
--- a/src/lib/dns/rdata/generic/rrsig_46.h
+++ b/src/lib/dns/rdata/generic/rrsig_46.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -32,7 +33,7 @@
 
 struct RRSIGImpl;
 
-class RRSIG : public Rdata {
+class ISC_LIBDNS_API RRSIG : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/soa_6.h b/src/lib/dns/rdata/generic/soa_6.h
index 2c180b2..9f601e4 100644
--- a/src/lib/dns/rdata/generic/soa_6.h
+++ b/src/lib/dns/rdata/generic/soa_6.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 #include <dns/serial.h>
@@ -27,7 +28,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class SOA : public Rdata {
+class ISC_LIBDNS_API SOA : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/spf_99.h b/src/lib/dns/rdata/generic/spf_99.h
index 04ac99b..3a9a02e 100644
--- a/src/lib/dns/rdata/generic/spf_99.h
+++ b/src/lib/dns/rdata/generic/spf_99.h
@@ -19,6 +19,7 @@
 #include <string>
 #include <vector>
 
+#include <dns/lib.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -36,7 +37,7 @@ template<class Type, uint16_t typeCode> class TXTLikeImpl;
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class. The semantics of the class is provided by
 /// a copy of instantiated TXTLikeImpl class common to both TXT and SPF.
-class SPF : public Rdata {
+class ISC_LIBDNS_API SPF : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/sshfp_44.h b/src/lib/dns/rdata/generic/sshfp_44.h
index c3ba944..69f5e07 100644
--- a/src/lib/dns/rdata/generic/sshfp_44.h
+++ b/src/lib/dns/rdata/generic/sshfp_44.h
@@ -18,6 +18,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -28,7 +29,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class SSHFP : public Rdata {
+class ISC_LIBDNS_API SSHFP : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/txt_16.h b/src/lib/dns/rdata/generic/txt_16.h
index d99d69b..713837a 100644
--- a/src/lib/dns/rdata/generic/txt_16.h
+++ b/src/lib/dns/rdata/generic/txt_16.h
@@ -19,6 +19,7 @@
 #include <string>
 #include <vector>
 
+#include <dns/lib.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -30,7 +31,7 @@
 
 template<class Type, uint16_t typeCode> class TXTLikeImpl;
 
-class TXT : public Rdata {
+class ISC_LIBDNS_API TXT : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/hs_4/a_1.h b/src/lib/dns/rdata/hs_4/a_1.h
index 6d75952..fbfb926 100644
--- a/src/lib/dns/rdata/hs_4/a_1.h
+++ b/src/lib/dns/rdata/hs_4/a_1.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -25,7 +26,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class A : public Rdata {
+class ISC_LIBDNS_API A : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/in_1/a_1.cc b/src/lib/dns/rdata/in_1/a_1.cc
index 3b15a4c..f764df8 100644
--- a/src/lib/dns/rdata/in_1/a_1.cc
+++ b/src/lib/dns/rdata/in_1/a_1.cc
@@ -17,8 +17,12 @@
 
 #include <string>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h> // XXX: for inet_pton/ntop(), not exist in C++ standards
 #include <sys/socket.h> // for AF_INET/AF_INET6
+#endif
 
 #include <exceptions/exceptions.h>
 
@@ -78,7 +82,14 @@ string
 A::toText() const {
     char addr_string[sizeof("255.255.255.255")];
 
-    if (inet_ntop(AF_INET, &addr_, addr_string, sizeof(addr_string)) == NULL) {
+#ifdef _WIN32
+#define DECONST (void *)
+#else
+#define DECONST
+#endif
+
+    if (inet_ntop(AF_INET, DECONST &addr_,
+                  addr_string, sizeof(addr_string)) == NULL) {
         isc_throw(Unexpected,
                   "Failed to convert IN/A RDATA to textual IPv4 address");
     }
diff --git a/src/lib/dns/rdata/in_1/a_1.h b/src/lib/dns/rdata/in_1/a_1.h
index 6e98f0d..1125a62 100644
--- a/src/lib/dns/rdata/in_1/a_1.h
+++ b/src/lib/dns/rdata/in_1/a_1.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -25,7 +26,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class A : public Rdata {
+class ISC_LIBDNS_API A : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/in_1/aaaa_28.cc b/src/lib/dns/rdata/in_1/aaaa_28.cc
index ce49a04..58db753 100644
--- a/src/lib/dns/rdata/in_1/aaaa_28.cc
+++ b/src/lib/dns/rdata/in_1/aaaa_28.cc
@@ -17,8 +17,12 @@
 
 #include <string>
 
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h> // XXX: for inet_pton/ntop(), not exist in C++ standards
 #include <sys/socket.h> // for AF_INET/AF_INET6
+#endif
 
 #include <exceptions/exceptions.h>
 
@@ -75,7 +79,14 @@ string
 AAAA::toText() const {
     char addr_string[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
 
-    if (inet_ntop(AF_INET6, &addr_, addr_string, sizeof(addr_string)) == NULL) {
+#ifdef _WIN32
+#define DECONST (void *)
+#else
+#define DECONST
+#endif
+
+    if (inet_ntop(AF_INET6, DECONST &addr_,
+                  addr_string, sizeof(addr_string)) == NULL) {
         isc_throw(Unexpected,
                   "Failed to convert IN/AAAA RDATA to textual IPv6 address");
     }
diff --git a/src/lib/dns/rdata/in_1/aaaa_28.h b/src/lib/dns/rdata/in_1/aaaa_28.h
index 3093017..afea13c 100644
--- a/src/lib/dns/rdata/in_1/aaaa_28.h
+++ b/src/lib/dns/rdata/in_1/aaaa_28.h
@@ -18,6 +18,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -27,7 +28,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class AAAA : public Rdata {
+class ISC_LIBDNS_API AAAA : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/in_1/dhcid_49.h b/src/lib/dns/rdata/in_1/dhcid_49.h
index 90f5fab..564d8f1 100644
--- a/src/lib/dns/rdata/in_1/dhcid_49.h
+++ b/src/lib/dns/rdata/in_1/dhcid_49.h
@@ -17,6 +17,7 @@
 #include <string>
 #include <vector>
 
+#include <dns/lib.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -32,7 +33,7 @@
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// DHCID RDATA.
-class DHCID : public Rdata {
+class ISC_LIBDNS_API DHCID : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/in_1/srv_33.h b/src/lib/dns/rdata/in_1/srv_33.h
index 32b7dc0..598163a 100644
--- a/src/lib/dns/rdata/in_1/srv_33.h
+++ b/src/lib/dns/rdata/in_1/srv_33.h
@@ -16,6 +16,7 @@
 
 #include <stdint.h>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -34,7 +35,7 @@ struct SRVImpl;
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// SRV RDATA.
-class SRV : public Rdata {
+class ISC_LIBDNS_API SRV : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/template.h b/src/lib/dns/rdata/template.h
index 9e84cc3..3889657 100644
--- a/src/lib/dns/rdata/template.h
+++ b/src/lib/dns/rdata/template.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -40,7 +41,7 @@
 // These are markers used by a script for auto-generating build-able source
 // files.
 
-class MyType : public Rdata {
+class ISC_LIBDNS_API MyType : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // Do not remove the BEGIN_xxx and END_xxx comment lines.
diff --git a/src/lib/dns/rdatafields.cc b/src/lib/dns/rdatafields.cc
index 94c9dbf..030cec6 100644
--- a/src/lib/dns/rdatafields.cc
+++ b/src/lib/dns/rdatafields.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <stdint.h>
 
 #include <cassert>
diff --git a/src/lib/dns/rdatafields.h b/src/lib/dns/rdatafields.h
index 16880f0..d4024bf 100644
--- a/src/lib/dns/rdatafields.h
+++ b/src/lib/dns/rdatafields.h
@@ -19,15 +19,17 @@
 
 #include <cstddef>
 
+#include <dns/lib.h>
+
 namespace isc {
 namespace util {
-class OutputBuffer;
+class ISC_LIBDNS_API OutputBuffer;
 }
 namespace dns {
-class AbstractMessageRenderer;
+class ISC_LIBDNS_API AbstractMessageRenderer;
 
 namespace rdata {
-class Rdata;
+class ISC_LIBDNS_API Rdata;
 
 /// A low-level, RR type-independent representation of DNS RDATA.
 ///
@@ -156,7 +158,7 @@ getFieldSpecData()-> { compressible name { compressible name { other data
 /// future version.  One possibility is to store offset information as well
 /// as the name data (at the cost of increasing memory footprint), and
 /// to use the pair of data for faster rendering.
-class RdataFields {
+class ISC_LIBDNS_API RdataFields {
 public:
     /// Types of \c RdataFields fields.
     ///
diff --git a/src/lib/dns/rrclass-placeholder.h b/src/lib/dns/rrclass-placeholder.h
index 80035d8..77fb590 100644
--- a/src/lib/dns/rrclass-placeholder.h
+++ b/src/lib/dns/rrclass-placeholder.h
@@ -21,23 +21,28 @@
 #include <ostream>
 
 #include <exceptions/exceptions.h>
+#include <dns/lib.h>
+
+#if defined(_WIN32) && defined(IN)
+#undef IN
+#endif
 
 namespace isc {
 namespace util {
-class InputBuffer;
-class OutputBuffer;
+class ISC_LIBDNS_API InputBuffer;
+class ISC_LIBDNS_API OutputBuffer;
 }
 
 namespace dns {
 
 // forward declarations
-class AbstractMessageRenderer;
+class ISC_LIBDNS_API AbstractMessageRenderer;
 
 ///
 /// \brief A standard DNS module exception that is thrown if an RRClass object
 /// is being constructed from an unrecognized string.
 ///
-class InvalidRRClass : public Exception {
+class ISC_LIBDNS_API InvalidRRClass : public Exception {
 public:
     InvalidRRClass(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -47,7 +52,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if an RRClass object
 /// is being constructed from a incomplete (too short) wire-format data.
 ///
-class IncompleteRRClass : public Exception {
+class ISC_LIBDNS_API IncompleteRRClass : public Exception {
 public:
     IncompleteRRClass(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -87,7 +92,7 @@ public:
 /// the proxy function.
 ///
 /// Note to developers: same note as \c RRType applies.
-class RRClass {
+class ISC_LIBDNS_API RRClass {
 public:
     ///
     /// \name Constructors and Destructor
@@ -279,7 +284,7 @@ RRClass::NONE() {
 /// \param rrclass The \c RRClass object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream&
+ISC_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const RRClass& rrclass);
 }
 }
diff --git a/src/lib/dns/rrclass.cc b/src/lib/dns/rrclass.cc
index ac5823c..49192f0 100644
--- a/src/lib/dns/rrclass.cc
+++ b/src/lib/dns/rrclass.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <stdint.h>
 
 #include <string>
@@ -56,7 +58,7 @@ RRClass::toWire(AbstractMessageRenderer& renderer) const {
     renderer.writeUint16(classcode_);
 }
 
-ostream&
+ISC_LIBDNS_API ostream&
 operator<<(ostream& os, const RRClass& rrclass) {
     os << rrclass.toText();
     return (os);
diff --git a/src/lib/dns/rrparamregistry-placeholder.cc b/src/lib/dns/rrparamregistry-placeholder.cc
index f7f3a1a..acb07c1 100644
--- a/src/lib/dns/rrparamregistry-placeholder.cc
+++ b/src/lib/dns/rrparamregistry-placeholder.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <cassert>
 #include <algorithm>
 #include <cctype>
diff --git a/src/lib/dns/rrparamregistry.h b/src/lib/dns/rrparamregistry.h
index ae41b5f..ae84274 100644
--- a/src/lib/dns/rrparamregistry.h
+++ b/src/lib/dns/rrparamregistry.h
@@ -23,6 +23,7 @@
 
 #include <exceptions/exceptions.h>
 
+#include <dns/lib.h>
 #include <dns/rdata.h>
 
 namespace isc {
@@ -35,7 +36,7 @@ struct RRParamRegistryImpl;
 /// \brief A standard DNS module exception that is thrown if a new RR type is
 /// being registered with a different type string.
 ///
-class RRTypeExists : public Exception {
+class ISC_LIBDNS_API RRTypeExists : public Exception {
 public:
     RRTypeExists(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -45,7 +46,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if a new RR class is
 /// being registered with a different type string.
 ///
-class RRClassExists : public Exception {
+class ISC_LIBDNS_API RRClassExists : public Exception {
 public:
     RRClassExists(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -62,7 +63,7 @@ namespace rdata {
 /// For other users of this API normally do not have to care about this class
 /// or its derived classes; this class is generally intended to be used
 /// as an internal utility of the API implementation.
-class AbstractRdataFactory {
+class ISC_LIBDNS_API AbstractRdataFactory {
     ///
     /// \name Constructors and Destructor
     ///
@@ -166,7 +167,7 @@ typedef boost::shared_ptr<AbstractRdataFactory> RdataFactoryPtr;
 /// Note: the implementation of this class is incomplete: we should at least
 /// add RDATA related parameters.  This will be done in a near future version,
 /// at which point some of method signatures will be changed.
-class RRParamRegistry {
+class ISC_LIBDNS_API RRParamRegistry {
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/dns/rrset.cc b/src/lib/dns/rrset.cc
index 4d8e262..df2279a 100644
--- a/src/lib/dns/rrset.cc
+++ b/src/lib/dns/rrset.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <algorithm>
 #include <string>
 #include <vector>
@@ -147,7 +149,7 @@ AbstractRRset::isSameKind(const AbstractRRset& other) const {
 	  getClass() == other.getClass());
 }
 
-ostream&
+ISC_LIBDNS_API ostream&
 operator<<(ostream& os, const AbstractRRset& rrset) {
     os << rrset.toText();
     return (os);
diff --git a/src/lib/dns/rrset.h b/src/lib/dns/rrset.h
index 74380ce..8b0bffb 100644
--- a/src/lib/dns/rrset.h
+++ b/src/lib/dns/rrset.h
@@ -22,12 +22,13 @@
 
 #include <exceptions/exceptions.h>
 
+#include <dns/lib.h>
 #include <dns/rdata.h>
 #include <dns/rrtype.h>
 
 namespace isc {
 namespace util {
-class OututBuffer;
+class ISC_LIBDNS_API OututBuffer;
 }
 
 namespace dns {
@@ -36,23 +37,23 @@ namespace dns {
 /// \brief A standard DNS module exception that is thrown if an RRset object
 /// does not contain any RDATA where required.
 ///
-class EmptyRRset : public Exception {
+class ISC_LIBDNS_API EmptyRRset : public Exception {
 public:
     EmptyRRset(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
 };
 
 // forward declarations
-class Name;
-class RRType;
-class RRClass;
-class RRTTL;
-class AbstractMessageRenderer;
-class AbstractRRset;
-class BasicRRset;
-class RdataIterator;
+class ISC_LIBDNS_API Name;
+class ISC_LIBDNS_API RRType;
+class ISC_LIBDNS_API RRClass;
+class ISC_LIBDNS_API RRTTL;
+class ISC_LIBDNS_API AbstractMessageRenderer;
+class ISC_LIBDNS_API AbstractRRset;
+class ISC_LIBDNS_API BasicRRset;
+class ISC_LIBDNS_API RdataIterator;
 class BasicRRsetImpl;
-class RRset;
+class ISC_LIBDNS_API RRset;
 
 /// \brief A pointer-like type pointing to an \c RRset object.
 ///
@@ -159,7 +160,7 @@ typedef boost::shared_ptr<RdataIterator> RdataIteratorPtr;
 ///     monolithic.)
 ///   - Do we need to allow the user to remove specific Rdata?
 ///     Probably not, according to the current usage of the BIND9 code.
-class AbstractRRset {
+class ISC_LIBDNS_API AbstractRRset {
     ///
     /// \name Constructors and Destructor
     ///
@@ -523,7 +524,7 @@ public:
 /// Most applications will simply go through the RDATA objects contained in
 /// an RRset, examining (and possibly using) each object, as one path
 /// operation.
-class RdataIterator {
+class ISC_LIBDNS_API RdataIterator {
     ///
     /// \name Constructors and Destructor
     ///
@@ -594,7 +595,7 @@ public:
 /// Highly performance-sensitive applications, such as a large scale
 /// authoritative or caching name servers will implement and use a customized
 /// version of derived \c AbstractRRset class.
-class BasicRRset : public AbstractRRset {
+class ISC_LIBDNS_API BasicRRset : public AbstractRRset {
     ///
     /// \name Constructors and Destructor
     ///
@@ -803,7 +804,7 @@ private:
 /// containing associated RRSIG records.  This allows DNSSEC aware
 /// applications to treat data associated with a particular
 /// QNAME/QTYPE/QCLASS as a single object.
-class RRset : public BasicRRset {
+class ISC_LIBDNS_API RRset : public BasicRRset {
 public:
     RRset(const Name& name, const RRClass& rrclass,
           const RRType& rrtype, const RRTTL& ttl);
@@ -887,7 +888,8 @@ private:
 /// output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const AbstractRRset& rrset);
+ISC_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const AbstractRRset& rrset);
 } // end of namespace dns
 } // end of namespace isc
 #endif  // __RRSET_H
diff --git a/src/lib/dns/rrsetlist.cc b/src/lib/dns/rrsetlist.cc
index fcdcfbb..927f24c 100644
--- a/src/lib/dns/rrsetlist.cc
+++ b/src/lib/dns/rrsetlist.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <vector>
 
 #include <boost/foreach.hpp>
diff --git a/src/lib/dns/rrsetlist.h b/src/lib/dns/rrsetlist.h
index 0e05b5b..4bdcf67 100644
--- a/src/lib/dns/rrsetlist.h
+++ b/src/lib/dns/rrsetlist.h
@@ -21,6 +21,7 @@
 
 #include <boost/shared_ptr.hpp>
 
+#include <dns/lib.h>
 #include <dns/rrset.h>
 #include <dns/rrclass.h>
 #include <dns/rrtype.h>
@@ -28,7 +29,7 @@
 namespace isc {
 namespace dns {
 
-class DuplicateRRset : public Exception {
+class ISC_LIBDNS_API DuplicateRRset : public Exception {
 public:
     DuplicateRRset(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -94,7 +95,7 @@ private:
 /// reason and is actually quite specific to a particular need for libdatasrc.
 /// If you are tempted to use it, think twice to assess if this class
 /// is really what you want.  Again, in many cases the answer will be no.
-class RRsetList {
+class ISC_LIBDNS_API RRsetList {
 private:
     RRsetList(const RRsetList& source);
     RRsetList& operator=(const RRsetList& source);
diff --git a/src/lib/dns/rrttl.cc b/src/lib/dns/rrttl.cc
index 49c63be..e89adc7 100644
--- a/src/lib/dns/rrttl.cc
+++ b/src/lib/dns/rrttl.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <stdint.h>
 
 #include <sstream>
@@ -67,7 +69,7 @@ RRTTL::toWire(AbstractMessageRenderer& renderer) const {
     renderer.writeUint32(ttlval_);
 }
 
-ostream&
+ISC_LIBDNS_API ostream&
 operator<<(ostream& os, const RRTTL& rrttl) {
     os << rrttl.toText();
     return (os);
diff --git a/src/lib/dns/rrttl.h b/src/lib/dns/rrttl.h
index bf23295..fe44610 100644
--- a/src/lib/dns/rrttl.h
+++ b/src/lib/dns/rrttl.h
@@ -18,23 +18,24 @@
 #include <stdint.h>
 
 #include <exceptions/exceptions.h>
+#include <dns/lib.h>
 
 namespace isc {
 namespace util {
-class InputBuffer;
-class OutputBuffer;
+class ISC_LIBDNS_API InputBuffer;
+class ISC_LIBDNS_API OutputBuffer;
 }
 
 namespace dns {
 
 // forward declarations
-class AbstractMessageRenderer;
+class ISC_LIBDNS_API AbstractMessageRenderer;
 
 ///
 /// \brief A standard DNS module exception that is thrown if an RRTTL object
 /// is being constructed from an unrecognized string.
 ///
-class InvalidRRTTL : public Exception {
+class ISC_LIBDNS_API InvalidRRTTL : public Exception {
 public:
     InvalidRRTTL(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -44,7 +45,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if an RRTTL object
 /// is being constructed from a incomplete (too short) wire-format data.
 ///
-class IncompleteRRTTL : public Exception {
+class ISC_LIBDNS_API IncompleteRRTTL : public Exception {
 public:
     IncompleteRRTTL(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -58,7 +59,7 @@ public:
 /// of this class is to provide convenient interfaces to convert a textual
 /// representation into the integer TTL value and vice versa, and to handle
 /// wire-format representations.
-class RRTTL {
+class ISC_LIBDNS_API RRTTL {
 public:
     ///
     /// \name Constructors and Destructor
@@ -251,7 +252,7 @@ private:
 /// \param rrttl The \c RRTTL object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream&
+ISC_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const RRTTL& rrttl);
 }
 }
diff --git a/src/lib/dns/rrtype-placeholder.h b/src/lib/dns/rrtype-placeholder.h
index dad1b2b..1f74a5e 100644
--- a/src/lib/dns/rrtype-placeholder.h
+++ b/src/lib/dns/rrtype-placeholder.h
@@ -21,6 +21,7 @@
 #include <ostream>
 
 #include <exceptions/exceptions.h>
+#include <dns/lib.h>
 
 // Solaris x86 defines DS in <sys/regset.h>, which gets pulled in by Boost
 #if defined(__sun) && defined(DS)
@@ -29,20 +30,20 @@
 
 namespace isc {
 namespace util {
-class InputBuffer;
-class OutputBuffer;
+class ISC_LIBDNS_API InputBuffer;
+class ISC_LIBDNS_API OutputBuffer;
 }
 
 namespace dns {
 
 // forward declarations
-class AbstractMessageRenderer;
+class ISC_LIBDNS_API AbstractMessageRenderer;
 
 ///
 /// \brief A standard DNS module exception that is thrown if an RRType object
 /// is being constructed from an unrecognized string.
 ///
-class InvalidRRType : public Exception {
+class ISC_LIBDNS_API InvalidRRType : public Exception {
 public:
     InvalidRRType(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -52,7 +53,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if an RRType object
 /// is being constructed from a incomplete (too short) wire-format data.
 ///
-class IncompleteRRType : public Exception {
+class ISC_LIBDNS_API IncompleteRRType : public Exception {
 public:
     IncompleteRRType(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -104,7 +105,7 @@ public:
 /// this assumption, but if we encounter memory bloat due to this problem with
 /// particular compilers we need to revisit the design or think about
 /// workaround.
-class RRType {
+class ISC_LIBDNS_API RRType {
 public:
     ///
     /// \name Constructors and Destructor
@@ -313,7 +314,7 @@ RRType::ANY() {
 /// \param rrtype The \c RRType object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream&
+ISC_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const RRType& rrtype);
 }
 }
diff --git a/src/lib/dns/rrtype.cc b/src/lib/dns/rrtype.cc
index 4ef4e67..dc856a9 100644
--- a/src/lib/dns/rrtype.cc
+++ b/src/lib/dns/rrtype.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <stdint.h>
 
 #include <string>
@@ -57,7 +59,7 @@ RRType::toWire(AbstractMessageRenderer& renderer) const {
     renderer.writeUint16(typecode_);
 }
 
-ostream&
+ISC_LIBDNS_API ostream&
 operator<<(ostream& os, const RRType& rrtype) {
     os << rrtype.toText();
     return (os);
diff --git a/src/lib/dns/serial.cc b/src/lib/dns/serial.cc
index 90bc242..cca3d38 100644
--- a/src/lib/dns/serial.cc
+++ b/src/lib/dns/serial.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <dns/serial.h>
 
 namespace isc {
@@ -66,7 +68,7 @@ Serial::operator+(const Serial& other) const {
     return (operator+(other.getValue()));
 }
 
-std::ostream&
+ISC_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const Serial& serial) {
     return (os << serial.getValue());
 }
diff --git a/src/lib/dns/serial.h b/src/lib/dns/serial.h
index 3549860..7f1e3b4 100644
--- a/src/lib/dns/serial.h
+++ b/src/lib/dns/serial.h
@@ -18,6 +18,8 @@
 #include <stdint.h>
 #include <iostream>
 
+#include <dns/lib.h>
+
 namespace isc {
 namespace dns {
 
@@ -46,7 +48,7 @@ const uint64_t MAX_SERIAL_VALUE = 4294967296ull;
 /// \note RFC 1982 defines everything based on the value SERIAL_BITS. Since
 /// the serial number has a fixed length of 32 bits, the values we use are
 /// hard-coded, and not computed based on variable bit lengths.
-class Serial {
+class ISC_LIBDNS_API Serial {
 public:
     /// \brief Constructor with value
     ///
@@ -147,7 +149,8 @@ private:
 /// \param os The ostream to write to
 /// \param serial The Serial to write
 /// \return the output stream
-std::ostream& operator<<(std::ostream& os, const Serial& serial);
+ISC_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const Serial& serial);
 
 } // end namespace dns
 } // end namespace isc
diff --git a/src/lib/dns/tests/edns_unittest.cc b/src/lib/dns/tests/edns_unittest.cc
index de2d244..9906448 100644
--- a/src/lib/dns/tests/edns_unittest.cc
+++ b/src/lib/dns/tests/edns_unittest.cc
@@ -38,7 +38,9 @@ using namespace isc::dns;
 using namespace isc::util;
 using namespace isc::dns::rdata;
 
+#ifndef _MSC_VER
 const uint8_t EDNS::SUPPORTED_VERSION;
+#endif
 
 namespace {
 class EDNSTest : public ::testing::Test {
diff --git a/src/lib/dns/tests/message_unittest.cc b/src/lib/dns/tests/message_unittest.cc
index f30a2ac..7ca4e2f 100644
--- a/src/lib/dns/tests/message_unittest.cc
+++ b/src/lib/dns/tests/message_unittest.cc
@@ -61,19 +61,23 @@ using namespace isc::dns::rdata;
 // class, at which point we'll also revise the tests including more cases.
 //
 
+#ifndef _MSC_VER
 const uint16_t Message::DEFAULT_MAX_UDPSIZE;
+#endif
 
 namespace isc {
 namespace util {
 namespace detail {
-extern int64_t (*gettimeFunction)();
+extern ISC_LIBDNS_API int64_t (*gettimeFunction)();
 }
 }
 }
 
 // XXX: this is defined as class static constants, but some compilers
 // seemingly cannot find the symbol when used in the EXPECT_xxx macros.
+#ifndef _MSC_VER
 const uint16_t TSIGContext::DEFAULT_FUDGE;
+#endif
 
 namespace {
 class MessageTest : public ::testing::Test {
diff --git a/src/lib/dns/tests/name_unittest.cc b/src/lib/dns/tests/name_unittest.cc
index c327bdc..5c1dd77 100644
--- a/src/lib/dns/tests/name_unittest.cc
+++ b/src/lib/dns/tests/name_unittest.cc
@@ -37,8 +37,10 @@ using namespace isc::util;
 // XXX: these are defined as class static constants, but some compilers
 // seemingly cannot find the symbols when used in the EXPECT_xxx macros.
 //
+#ifndef _MSC_VER
 const size_t Name::MAX_WIRE;
 const size_t Name::MAX_LABELS;
+#endif
 
 namespace {
 class NameTest : public ::testing::Test {
diff --git a/src/lib/dns/tests/rdata_nsec3param_like_unittest.cc b/src/lib/dns/tests/rdata_nsec3param_like_unittest.cc
index 51fef01..547f4ae 100644
--- a/src/lib/dns/tests/rdata_nsec3param_like_unittest.cc
+++ b/src/lib/dns/tests/rdata_nsec3param_like_unittest.cc
@@ -175,10 +175,10 @@ TYPED_TEST(NSEC3PARAMLikeTest, badText) {
 
 TYPED_TEST(NSEC3PARAMLikeTest, toText) {
     // normal case
-    EXPECT_EQ(this->salt_txt, this->fromText(this->salt_txt).toText());
+    EXPECT_TRUE(this->salt_txt == this->fromText(this->salt_txt).toText());
 
     // empty salt case
-    EXPECT_EQ(this->nosalt_txt, this->fromText(this->nosalt_txt).toText());
+    EXPECT_TRUE(this->nosalt_txt == this->fromText(this->nosalt_txt).toText());
 }
 
 TYPED_TEST(NSEC3PARAMLikeTest, createFromWire) {
diff --git a/src/lib/dns/tests/rdata_tsig_unittest.cc b/src/lib/dns/tests/rdata_tsig_unittest.cc
index 76f91a6..c8ee8ac 100644
--- a/src/lib/dns/tests/rdata_tsig_unittest.cc
+++ b/src/lib/dns/tests/rdata_tsig_unittest.cc
@@ -230,7 +230,7 @@ TEST_F(Rdata_TSIG_Test, createFromParams) {
                   any::TSIG(Name("hmac-sha1"), 1286779327, 300, 12,
                             fake_data, 16020, 18, 6, fake_data2)));
 
-    EXPECT_THROW(any::TSIG(Name("hmac-sha256"), 1LLU << 48, 300, 12,
+    EXPECT_THROW(any::TSIG(Name("hmac-sha256"), 1ULL << 48, 300, 12,
                            fake_data, 16020, 18, 6, fake_data2),
                  isc::OutOfRange);
     EXPECT_THROW(any::TSIG(Name("hmac-sha256"), 0, 300, 0, fake_data, 16020,
diff --git a/src/lib/dns/tests/tsig_unittest.cc b/src/lib/dns/tests/tsig_unittest.cc
index ac503e5..2bd4f93 100644
--- a/src/lib/dns/tests/tsig_unittest.cc
+++ b/src/lib/dns/tests/tsig_unittest.cc
@@ -53,7 +53,7 @@ using isc::UnitTestUtil;
 namespace isc {
 namespace util {
 namespace detail {
-extern int64_t (*gettimeFunction)();
+extern ISC_LIBDNS_API int64_t (*gettimeFunction)();
 }
 }
 }
diff --git a/src/lib/dns/tsig.cc b/src/lib/dns/tsig.cc
index 1bda021..b66772d 100644
--- a/src/lib/dns/tsig.cc
+++ b/src/lib/dns/tsig.cc
@@ -12,7 +12,13 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
+#include <config.h>
+
+#ifndef _WIN32
 #include <sys/time.h>
+#endif
 
 #include <stdint.h>
 
diff --git a/src/lib/dns/tsig.h b/src/lib/dns/tsig.h
index 028d295..3a68b2f 100644
--- a/src/lib/dns/tsig.h
+++ b/src/lib/dns/tsig.h
@@ -19,6 +19,7 @@
 
 #include <exceptions/exceptions.h>
 
+#include <dns/lib.h>
 #include <dns/tsigerror.h>
 #include <dns/tsigkey.h>
 #include <dns/tsigrecord.h>
@@ -32,7 +33,7 @@ namespace dns {
 /// Note that this exception is not thrown for TSIG protocol errors such as
 /// verification failures.  In general, this exception indicates an internal
 /// program bug.
-class TSIGContextError : public isc::Exception {
+class ISC_LIBDNS_API TSIGContextError : public isc::Exception {
 public:
     TSIGContextError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -172,7 +173,7 @@ public:
 /// direct or indirect dependencies.  The interface of \c sign() that takes
 /// opaque data (instead of, e.g., a \c Message or \c MessageRenderer object)
 /// is therefore a deliberate design decision.
-class TSIGContext : boost::noncopyable {
+class ISC_LIBDNS_API TSIGContext : boost::noncopyable {
 public:
     /// Internal state of context
     ///
diff --git a/src/lib/dns/tsigerror.cc b/src/lib/dns/tsigerror.cc
index 36ef47d..238688c 100644
--- a/src/lib/dns/tsigerror.cc
+++ b/src/lib/dns/tsigerror.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <ostream>
 #include <string>
 
@@ -60,7 +62,7 @@ TSIGError::toRcode() const {
     return (Rcode::NOTAUTH());
 }
 
-std::ostream&
+ISC_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const TSIGError& error) {
     return (os << error.toText());
 }
diff --git a/src/lib/dns/tsigerror.h b/src/lib/dns/tsigerror.h
index 8efd3ae..3eb322d 100644
--- a/src/lib/dns/tsigerror.h
+++ b/src/lib/dns/tsigerror.h
@@ -18,6 +18,7 @@
 #include <ostream>
 #include <string>
 
+#include <dns/lib.h>
 #include <dns/rcode.h>
 
 namespace isc {
@@ -27,7 +28,7 @@ namespace dns {
 /// The \c TSIGError class objects represent standard errors related to
 /// TSIG protocol operations as defined in related specifications, mainly
 /// in RFC2845.
-class TSIGError {
+class ISC_LIBDNS_API TSIGError {
 public:
     /// Constants for pre-defined TSIG error values.
     ///
@@ -327,7 +328,8 @@ TSIGError::BAD_TIME() {
 /// \param tsig_error An \c TSIGError object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const TSIGError& tsig_error);
+ISC_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const TSIGError& tsig_error);
 }
 }
 
diff --git a/src/lib/dns/tsigkey.cc b/src/lib/dns/tsigkey.cc
index d7d60eb..1e96ca4 100644
--- a/src/lib/dns/tsigkey.cc
+++ b/src/lib/dns/tsigkey.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <map>
 #include <utility>
 #include <vector>
diff --git a/src/lib/dns/tsigkey.h b/src/lib/dns/tsigkey.h
index 6081dd3..de4c625 100644
--- a/src/lib/dns/tsigkey.h
+++ b/src/lib/dns/tsigkey.h
@@ -16,11 +16,12 @@
 #define __TSIGKEY_H 1
 
 #include <cryptolink/cryptolink.h>
+#include <dns/lib.h>
 
 namespace isc {
 namespace dns {
 
-class Name;
+class ISC_LIBDNS_API Name;
 
 /// \brief TSIG key.
 ///
@@ -60,7 +61,7 @@ class Name;
 /// remember the actual domain names defined in the protocol specification.
 /// We may also have to add conversion routines between domain names
 /// and more intuitive representations (e.g. strings) for algorithms.
-class TSIGKey {
+class ISC_LIBDNS_API TSIGKey {
 public:
     ///
     /// \name Constructors, Assignment Operator and Destructor.
@@ -234,7 +235,7 @@ private:
 /// in different DNS transactions).
 /// If this assumption does not hold and memory consumption becomes an issue
 /// we may have to revisit the design.
-class TSIGKeyRing {
+class ISC_LIBDNS_API TSIGKeyRing {
 public:
     /// Result codes of various public methods of \c TSIGKeyRing
     enum Result {
diff --git a/src/lib/dns/tsigrecord.cc b/src/lib/dns/tsigrecord.cc
index 9dd3f78..101202a 100644
--- a/src/lib/dns/tsigrecord.cc
+++ b/src/lib/dns/tsigrecord.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define ISC_LIBDNS_EXPORT
+
 #include <ostream>
 #include <string>
 
@@ -139,7 +141,7 @@ TSIGRecord::toText() const {
             rdata_.toText() + "\n");
 }
 
-std::ostream&
+ISC_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const TSIGRecord& record) {
     return (os << record.toText());
 }
diff --git a/src/lib/dns/tsigrecord.h b/src/lib/dns/tsigrecord.h
index 03de746..bfbf988 100644
--- a/src/lib/dns/tsigrecord.h
+++ b/src/lib/dns/tsigrecord.h
@@ -22,15 +22,16 @@
 
 #include <util/buffer.h>
 
+#include <dns/lib.h>
 #include <dns/name.h>
 #include <dns/rdataclass.h>
 
 namespace isc {
 namespace util {
-class OutputBuffer;
+class ISC_LIBDNS_API OutputBuffer;
 }
 namespace dns {
-class AbstractMessageRenderer;
+class ISC_LIBDNS_API AbstractMessageRenderer;
 
 /// TSIG resource record.
 ///
@@ -59,7 +60,7 @@ class AbstractMessageRenderer;
 /// handle it through a generic interface in a polymorphic way.
 /// We therefore chose to define it as a separate class.  This is also
 /// similar to why \c EDNS is a separate class.
-class TSIGRecord {
+class ISC_LIBDNS_API TSIGRecord {
 public:
     ///
     /// \name Constructors
@@ -297,7 +298,8 @@ typedef boost::shared_ptr<const TSIGRecord> ConstTSIGRecordPtr;
 /// \param record A \c TSIGRecord object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const TSIGRecord& record);
+ISC_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const TSIGRecord& record);
 }
 }
 
diff --git a/src/lib/python/bind10_config.py.win32 b/src/lib/python/bind10_config.py.win32
new file mode 100644
index 0000000..4a0679e
--- /dev/null
+++ b/src/lib/python/bind10_config.py.win32
@@ -0,0 +1,80 @@
+# Copyright (C) 2010  Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
+
+# This is a base-level module intended to provide configure-time
+# variables to python scripts and libraries.
+import os
+
+def reload():
+    # In a function, for testing purposes
+    global BIND10_MSGQ_SOCKET_FILE
+    global DATA_PATH
+    global PLUGIN_PATHS
+    global PREFIX
+    global LIBEXECPATH
+    BIND10_MSGQ_SOCKET_FILE = os.path.join("c:/Temp",
+                                           "bind10-devel",
+                                           "msgq_socket").replace("${prefix}",
+                                                                  "/Temp")
+    PREFIX = "/Temp"
+
+    # B10_FROM_SOURCE is set in the environment for internal tests and
+    # an experimental run without installagion.  In that case we need to
+    # specialize some configuration variables, generally so that they refer
+    # to somewhere in the source tree instead of the appropriate places
+    # after installation.
+    #
+    # DATA_PATH: used by the config manager to find configuration files.
+    #  When "FROM_SOURCE", we use data files from a directory relative to the
+    #  value of that variable, or, if defined, relative to the value of
+    #  B10_FROM_SOURCE_LOCALSTATEDIR.  Otherwise we use the ones installed on
+    #  the system.
+    # PLUGIN_PATHS: configuration modules that are not associated to specific
+    #  process
+    # LIBEXECPATH: Paths to programs invoked by the boss process
+    #  The boss process (directly or via a helper module) uses this as
+    #  the prefererred PATH before starting a child process.
+    #  When "FROM_SOURCE", it lists the directories where the programs are
+    #  built so that when BIND 10 is experimentally started on the source
+    #  tree the programs in the tree (not installed ones) will be used.
+    #
+    # B10_FROM_SOURCE_LOCALSTATEDIR is specifically intended to be used for
+    # tests where we want to use variuos types of configuration within the test
+    # environment.  (We may want to make it even more generic so that the path
+    # is passed from the boss process)
+    if "B10_FROM_SOURCE" in os.environ:
+        if "B10_FROM_SOURCE_LOCALSTATEDIR" in os.environ:
+            DATA_PATH = os.environ["B10_FROM_SOURCE_LOCALSTATEDIR"]
+        else:
+            DATA_PATH = os.environ["B10_FROM_SOURCE"]
+        PLUGIN_PATHS = [os.environ["B10_FROM_SOURCE"] +
+                            '/src/bin/cfgmgr/plugins']
+        programdirs = ['auth', 'cfgmgr', 'cmdctl', 'ddns', 'dhcp6', 'msgq',
+                       'resolver', 'sockcreator', 'stats', 'xfrin', 'xfrout',
+                       'zonemgr']
+        BIND10HOME = os.environ["BIND10HOME"]
+        LIBEXECPATH = ':'.join([BIND10HOME + '/src/bin/' + p for p in
+                                programdirs])
+    else:
+        DATA_PATH = "c:/Temp/bind10-devel".replace("${prefix}", PREFIX)
+        PLUGIN_PATHS = ["/Temp/share/bind10-devel/config_plugins"]
+        LIBEXECPATH = ("@libexecdir@/@PACKAGE@"). \
+            replace("${exec_prefix}", "@exec_prefix@"). \
+            replace("${prefix}", "@prefix@")
+    # For testing the plugins so they can find their own spec files
+    if "B10_TEST_PLUGIN_DIR" in os.environ:
+        PLUGIN_PATHS = os.environ["B10_TEST_PLUGIN_DIR"].split(':')
+
+reload()
diff --git a/src/lib/util/python/lib.h b/src/lib/util/python/lib.h
index 18313c1..92a5d1b 100644
--- a/src/lib/util/python/lib.h
+++ b/src/lib/util/python/lib.h
@@ -15,6 +15,10 @@
 #ifndef __LIBUTIL_PYTHON_H
 #define __LIBUTIL_PYTHON_H 1
 
+#ifdef ISC_LIBDNS_PYTHON_EXPORT
+#define ISC_LIBUTIL_PYTHON_EXPORT
+#endif
+
 #if !defined(_WIN32) || defined(USE_STATIC_LINK)
 #define ISC_LIBUTIL_PYTHON_API
 #else
diff --git a/src/lib/util/pyunittests/pyunittests_util.py.win32 b/src/lib/util/pyunittests/pyunittests_util.py.win32
deleted file mode 100644
index d5113bf..0000000
--- a/src/lib/util/pyunittests/pyunittests_util.py.win32
+++ /dev/null
@@ -1,6 +0,0 @@
-"""fake pyunittests_util module"""
-
-import pydnspp
-
-fix_current_time = pydnspp.fix_current_time
-
diff --git a/win32build/VS2010/bind10.sln b/win32build/VS2010/bind10.sln
index 852d0a2..4bc6b0c 100755
--- a/win32build/VS2010/bind10.sln
+++ b/win32build/VS2010/bind10.sln
@@ -3,63 +3,28 @@ Microsoft Visual Studio Solution File, Format Version 11.00
 # Visual C++ Express 2010
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BINDInstall", "BINDInstall\BINDInstall.vcxproj", "{41B1A417-2276-422A-A054-2691F6E40A54}"
 	ProjectSection(ProjectDependencies) = postProject
-		{69048307-9655-4AAA-B07E-B67345C1DEF9} = {69048307-9655-4AAA-B07E-B67345C1DEF9}
 		{9F69DE07-D285-4B5C-8528-DF975C59ED3B} = {9F69DE07-D285-4B5C-8528-DF975C59ED3B}
-		{3FFD260A-C606-49D1-A34F-74B78D8DC76F} = {3FFD260A-C606-49D1-A34F-74B78D8DC76F}
 		{1AB80214-A605-4453-8960-F618C72C4CF3} = {1AB80214-A605-4453-8960-F618C72C4CF3}
-		{4D551D14-3C0F-4554-B20C-4B600249E42A} = {4D551D14-3C0F-4554-B20C-4B600249E42A}
-		{5D857B14-7763-466C-9D4E-D7C2E57C0E7F} = {5D857B14-7763-466C-9D4E-D7C2E57C0E7F}
-		{32624520-5341-471B-B88D-2599DBCDABF5} = {32624520-5341-471B-B88D-2599DBCDABF5}
-		{831EDB24-3B0A-44AE-A192-6F3DEA1A9BA6} = {831EDB24-3B0A-44AE-A192-6F3DEA1A9BA6}
-		{33927325-C9B5-4FE6-B69F-318433AFF4BD} = {33927325-C9B5-4FE6-B69F-318433AFF4BD}
-		{D781E925-FE57-4C75-9E26-BBC102B6A24A} = {D781E925-FE57-4C75-9E26-BBC102B6A24A}
-		{1ADF152B-0153-424D-B195-5821B30128D6} = {1ADF152B-0153-424D-B195-5821B30128D6}
 		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
 		{DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2} = {DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}
-		{D728B037-F63F-4CB5-B840-9AC54BDFBED5} = {D728B037-F63F-4CB5-B840-9AC54BDFBED5}
-		{6D55503E-0B43-4273-B6A5-4CEB39E114AC} = {6D55503E-0B43-4273-B6A5-4CEB39E114AC}
+		{E7E6EC32-E109-4334-9BCD-BC8190489070} = {E7E6EC32-E109-4334-9BCD-BC8190489070}
 		{13215E3E-E75D-463D-A0EF-93A1C9A20896} = {13215E3E-E75D-463D-A0EF-93A1C9A20896}
-		{48B8644A-79FB-4D03-A981-1CA21FEE3286} = {48B8644A-79FB-4D03-A981-1CA21FEE3286}
-		{635B804D-1B52-433E-9ECD-84F507FDB1F1} = {635B804D-1B52-433E-9ECD-84F507FDB1F1}
-		{67046450-CCEA-4CAC-A05B-17516F3FB540} = {67046450-CCEA-4CAC-A05B-17516F3FB540}
-		{55BCB364-62B0-4F93-8B88-38F3349B22C8} = {55BCB364-62B0-4F93-8B88-38F3349B22C8}
+		{9FBAAE48-1543-41C9-80EA-A65E7C1D1A98} = {9FBAAE48-1543-41C9-80EA-A65E7C1D1A98}
+		{6A29BC58-CA6E-4196-8E88-C675FE944BBF} = {6A29BC58-CA6E-4196-8E88-C675FE944BBF}
 		{8F120666-1A69-4506-8546-0F665E80FFB7} = {8F120666-1A69-4506-8546-0F665E80FFB7}
-		{47052F67-D9A0-433E-A074-5E50247B5F48} = {47052F67-D9A0-433E-A074-5E50247B5F48}
 		{8412D26C-6C2B-4FCC-ABB4-E9509E833951} = {8412D26C-6C2B-4FCC-ABB4-E9509E833951}
-		{DC86E86E-BB80-4C93-8A1F-E409C1FA38D2} = {DC86E86E-BB80-4C93-8A1F-E409C1FA38D2}
 		{2C518972-FF5F-4D33-9D3E-5BCC6357EDD7} = {2C518972-FF5F-4D33-9D3E-5BCC6357EDD7}
-		{E5640378-81D0-4769-B108-4DF4E2B0AD0C} = {E5640378-81D0-4769-B108-4DF4E2B0AD0C}
-		{F8616086-9CE9-4F32-BC97-8494EADAEC6F} = {F8616086-9CE9-4F32-BC97-8494EADAEC6F}
-		{761E7D88-6CCB-4E41-9F1E-6C1FBBD062F5} = {761E7D88-6CCB-4E41-9F1E-6C1FBBD062F5}
-		{D9178188-26B3-466B-A85A-C3C3344438BE} = {D9178188-26B3-466B-A85A-C3C3344438BE}
-		{6280D58A-5E05-45D1-8B79-DF677C114CD4} = {6280D58A-5E05-45D1-8B79-DF677C114CD4}
-		{D09B618B-D0E4-468D-A4BD-E204B4344C18} = {D09B618B-D0E4-468D-A4BD-E204B4344C18}
-		{FAF93094-D5F8-45AC-8C6C-29BCC522204B} = {FAF93094-D5F8-45AC-8C6C-29BCC522204B}
-		{3D451C9D-2AE7-4E8D-93B8-4E5470064FF5} = {3D451C9D-2AE7-4E8D-93B8-4E5470064FF5}
-		{6AC4F7A4-9BDC-415F-81DB-6332CACA38B3} = {6AC4F7A4-9BDC-415F-81DB-6332CACA38B3}
+		{08075CA0-4E2C-451E-BAA6-E422353A5FC1} = {08075CA0-4E2C-451E-BAA6-E422353A5FC1}
 		{D85833AC-23A9-4710-9911-8AAEC4BF6E8F} = {D85833AC-23A9-4710-9911-8AAEC4BF6E8F}
-		{B5D971AD-D95B-4A15-9E31-38AEF4F69627} = {B5D971AD-D95B-4A15-9E31-38AEF4F69627}
-		{B681A9B5-8BA0-4553-B3EC-F94DC4986CA3} = {B681A9B5-8BA0-4553-B3EC-F94DC4986CA3}
-		{EB54F7B8-FAEF-4348-989C-D4E6B42CEFB1} = {EB54F7B8-FAEF-4348-989C-D4E6B42CEFB1}
+		{1CCFABAC-5A0B-499F-914E-AAD0371EEC4F} = {1CCFABAC-5A0B-499F-914E-AAD0371EEC4F}
 		{13D541BC-8365-42F7-840F-A117CA0413DD} = {13D541BC-8365-42F7-840F-A117CA0413DD}
-		{813BA1C9-8CD8-4B06-B1C0-FDAB576AC4B6} = {813BA1C9-8CD8-4B06-B1C0-FDAB576AC4B6}
-		{FEFFE0CB-CD6B-4E61-854C-39506D6DCD5D} = {FEFFE0CB-CD6B-4E61-854C-39506D6DCD5D}
 		{2E64F6CC-3AD9-4DA7-8E05-ABBB83F9AFC4} = {2E64F6CC-3AD9-4DA7-8E05-ABBB83F9AFC4}
-		{F27BC0D0-A334-4DC0-9DC9-880D5DA74524} = {F27BC0D0-A334-4DC0-9DC9-880D5DA74524}
 		{AC4806D1-C2CC-444B-8F0D-209851A969D2} = {AC4806D1-C2CC-444B-8F0D-209851A969D2}
-		{7BA6A1D1-3C42-40B9-9336-342982DD408B} = {7BA6A1D1-3C42-40B9-9336-342982DD408B}
 		{65B0B6D2-94CE-4A21-85E7-A047C79044F9} = {65B0B6D2-94CE-4A21-85E7-A047C79044F9}
 		{F6E728D3-A0B2-40F6-9B91-7D4474D778F3} = {F6E728D3-A0B2-40F6-9B91-7D4474D778F3}
 		{564B0ADE-76A4-4833-9610-8DEEA6A15423} = {564B0ADE-76A4-4833-9610-8DEEA6A15423}
-		{7EB244E7-D381-4CF4-A2D4-739B81F77588} = {7EB244E7-D381-4CF4-A2D4-739B81F77588}
 		{C90961EC-3DDF-432F-8E3D-BDA06E4859D9} = {C90961EC-3DDF-432F-8E3D-BDA06E4859D9}
-		{66C9A5EC-514B-4BDC-AC74-ED4CB465CAAF} = {66C9A5EC-514B-4BDC-AC74-ED4CB465CAAF}
 		{C7DEAFEC-423B-486D-BBD8-896B0DE69DDE} = {C7DEAFEC-423B-486D-BBD8-896B0DE69DDE}
-		{9C5774EF-E833-4150-8B7A-B6082D879775} = {9C5774EF-E833-4150-8B7A-B6082D879775}
-		{7B80F6F0-E0CD-40D3-87B7-95C2EA2581BA} = {7B80F6F0-E0CD-40D3-87B7-95C2EA2581BA}
-		{F1C335F5-32B3-4401-8CEF-CB0990D4FE7E} = {F1C335F5-32B3-4401-8CEF-CB0990D4FE7E}
-		{CC29C1F9-A77B-476C-803E-8830F8312571} = {CC29C1F9-A77B-476C-803E-8830F8312571}
-		{165C00FA-A384-450C-95D4-7069FBAEE072} = {165C00FA-A384-450C-95D4-7069FBAEE072}
 		{2844FDFB-A0A1-4FA4-A654-15D69CC717DD} = {2844FDFB-A0A1-4FA4-A654-15D69CC717DD}
 		{AEF3DFFE-B566-4E6A-B299-B59B81022C06} = {AEF3DFFE-B566-4E6A-B299-B59B81022C06}
 	EndProjectSection
@@ -78,7 +43,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcryptolink", "libcryptol
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdns++", "libdns++\libdns++.vcxproj", "{F6E728D3-A0B2-40F6-9B91-7D4474D778F3}"
 	ProjectSection(ProjectDependencies) = postProject
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
 		{13215E3E-E75D-463D-A0EF-93A1C9A20896} = {13215E3E-E75D-463D-A0EF-93A1C9A20896}
+		{8F120666-1A69-4506-8546-0F665E80FFB7} = {8F120666-1A69-4506-8546-0F665E80FFB7}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libexceptions_tests", "libexceptions_tests\libexceptions_tests.vcxproj", "{DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}"
@@ -121,6 +88,10 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyddns++", "pyddns++\pyddns++.vcxproj", "{13D541BC-8365-42F7-840F-A117CA0413DD}"
 	ProjectSection(ProjectDependencies) = postProject
 		{1AB80214-A605-4453-8960-F618C72C4CF3} = {1AB80214-A605-4453-8960-F618C72C4CF3}
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
+		{13215E3E-E75D-463D-A0EF-93A1C9A20896} = {13215E3E-E75D-463D-A0EF-93A1C9A20896}
+		{8F120666-1A69-4506-8546-0F665E80FFB7} = {8F120666-1A69-4506-8546-0F665E80FFB7}
+		{F6E728D3-A0B2-40F6-9B91-7D4474D778F3} = {F6E728D3-A0B2-40F6-9B91-7D4474D778F3}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcc", "libcc\libcc.vcxproj", "{CC29C1F9-A77B-476C-803E-8830F8312571}"
@@ -432,6 +403,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyddatasrc", "pyddatasrc\py
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdns++_python", "libdns++_python\libdns++_python.vcxproj", "{1AB80214-A605-4453-8960-F618C72C4CF3}"
 	ProjectSection(ProjectDependencies) = postProject
+		{7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
+		{8F120666-1A69-4506-8546-0F665E80FFB7} = {8F120666-1A69-4506-8546-0F665E80FFB7}
 		{F6E728D3-A0B2-40F6-9B91-7D4474D778F3} = {F6E728D3-A0B2-40F6-9B91-7D4474D778F3}
 	EndProjectSection
 EndProject
diff --git a/win32build/VS2010/libcryptolink/libcryptolink.vcxproj b/win32build/VS2010/libcryptolink/libcryptolink.vcxproj
index 51c75f1..0bcdc5f 100755
--- a/win32build/VS2010/libcryptolink/libcryptolink.vcxproj
+++ b/win32build/VS2010/libcryptolink/libcryptolink.vcxproj
@@ -13,6 +13,7 @@
   <ItemGroup>
     <ClInclude Include="..\..\..\src\lib\cryptolink\cryptolink.h" />
     <ClInclude Include="..\..\..\src\lib\cryptolink\crypto_hmac.h" />
+    <ClInclude Include="..\..\..\src\lib\cryptolink\lib.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\cryptolink\cryptolink.cc" />
diff --git a/win32build/VS2010/libcryptolink/libcryptolink.vcxproj.filters b/win32build/VS2010/libcryptolink/libcryptolink.vcxproj.filters
index d0d8dfa..755d917 100755
--- a/win32build/VS2010/libcryptolink/libcryptolink.vcxproj.filters
+++ b/win32build/VS2010/libcryptolink/libcryptolink.vcxproj.filters
@@ -21,6 +21,9 @@
     <ClInclude Include="..\..\..\src\lib\cryptolink\cryptolink.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\cryptolink\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\cryptolink\crypto_hmac.cc">
diff --git a/win32build/VS2010/libdns++/libdns++.vcxproj b/win32build/VS2010/libdns++/libdns++.vcxproj
index 242a513..7d3559d 100755
--- a/win32build/VS2010/libdns++/libdns++.vcxproj
+++ b/win32build/VS2010/libdns++/libdns++.vcxproj
@@ -15,6 +15,7 @@
     <ClInclude Include="..\..\..\src\lib\dns\edns.h" />
     <ClInclude Include="..\..\..\src\lib\dns\exceptions.h" />
     <ClInclude Include="..\..\..\src\lib\dns\labelsequence.h" />
+    <ClInclude Include="..\..\..\src\lib\dns\lib.h" />
     <ClInclude Include="..\..\..\src\lib\dns\masterload.h" />
     <ClInclude Include="..\..\..\src\lib\dns\message.h" />
     <ClInclude Include="..\..\..\src\lib\dns\messagerenderer.h" />
@@ -72,6 +73,7 @@
     <ClCompile Include="..\..\..\src\lib\dns\tsigerror.cc" />
     <ClCompile Include="..\..\..\src\lib\dns\tsigkey.cc" />
     <ClCompile Include="..\..\..\src\lib\dns\tsigrecord.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{F6E728D3-A0B2-40F6-9B91-7D4474D778F3}</ProjectGuid>
@@ -80,12 +82,12 @@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
@@ -101,10 +103,11 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
+    <TargetName>$(ProjectName)d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -118,6 +121,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\botan\v100\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libcryptolinkd.lib;botand.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\dns
@@ -142,6 +147,8 @@ python gen-rdatacode.py
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\botan\v100\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;libcryptolink.lib;botan.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\dns
diff --git a/win32build/VS2010/libdns++/libdns++.vcxproj.filters b/win32build/VS2010/libdns++/libdns++.vcxproj.filters
index ead5674..2cfd369 100755
--- a/win32build/VS2010/libdns++/libdns++.vcxproj.filters
+++ b/win32build/VS2010/libdns++/libdns++.vcxproj.filters
@@ -108,6 +108,9 @@
     <ClInclude Include="..\..\..\src\lib\dns\serial.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\dns\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\dns\rdata\generic\detail\nsec_bitmap.cc">
@@ -194,5 +197,8 @@
     <ClCompile Include="..\..\..\src\lib\dns\serial.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\dllmain.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/win32build/VS2010/libdns++_mbench/libdns++_mbench.vcxproj b/win32build/VS2010/libdns++_mbench/libdns++_mbench.vcxproj
index 9dc06ab..90e7249 100755
--- a/win32build/VS2010/libdns++_mbench/libdns++_mbench.vcxproj
+++ b/win32build/VS2010/libdns++_mbench/libdns++_mbench.vcxproj
@@ -60,8 +60,8 @@
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <OutputFile>$(OutDir)message_renderer_bench$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libdns++\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libdns++.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libdns++d.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -81,7 +81,7 @@
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <OutputFile>$(OutDir)message_renderer_bench$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libdns++\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <AdditionalDependencies>libexceptions.lib;libutil.lib;libdns++.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
diff --git a/win32build/VS2010/libdns++_python/libdns++_python.vcxproj b/win32build/VS2010/libdns++_python/libdns++_python.vcxproj
index 9f9ef92..2fac677 100755
--- a/win32build/VS2010/libdns++_python/libdns++_python.vcxproj
+++ b/win32build/VS2010/libdns++_python/libdns++_python.vcxproj
@@ -12,6 +12,7 @@
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\src\lib\dns\python\edns_python.h" />
+    <ClInclude Include="..\..\..\src\lib\dns\python\lib.h" />
     <ClInclude Include="..\..\..\src\lib\dns\python\messagerenderer_python.h" />
     <ClInclude Include="..\..\..\src\lib\dns\python\message_python.h" />
     <ClInclude Include="..\..\..\src\lib\dns\python\name_python.h" />
@@ -57,6 +58,7 @@
     <ClCompile Include="..\..\..\src\lib\dns\python\tsigrecord_python.cc" />
     <ClCompile Include="..\..\..\src\lib\dns\python\tsig_python.cc" />
     <ClCompile Include="..\..\..\src\lib\dns\python\tsig_rdata_python.cc" />
+    <ClCompile Include="..\..\dllmain.cc" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{1AB80214-A605-4453-8960-F618C72C4CF3}</ProjectGuid>
@@ -65,12 +67,12 @@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
@@ -86,10 +88,11 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
+    <TargetName>$(ProjectName)d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -103,6 +106,8 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\$(Configuration);C:\Python32\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libdns++d.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -121,6 +126,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\$(Configuration);C:\Python32\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptions.lib;libutil.lib;libdns++.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/win32build/VS2010/libdns++_python/libdns++_python.vcxproj.filters b/win32build/VS2010/libdns++_python/libdns++_python.vcxproj.filters
index 9338fc6..abbe67c 100755
--- a/win32build/VS2010/libdns++_python/libdns++_python.vcxproj.filters
+++ b/win32build/VS2010/libdns++_python/libdns++_python.vcxproj.filters
@@ -78,6 +78,9 @@
     <ClInclude Include="..\..\..\src\lib\dns\python\serial_python.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\dns\python\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\dns\python\message_python_inc.cc">
@@ -149,5 +152,8 @@
     <ClCompile Include="..\..\..\src\lib\dns\python\nsec3hash_python_inc.cc">
       <Filter>Header Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\dllmain.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/win32build/VS2010/libdns++_rbench/libdns++_rbench.vcxproj b/win32build/VS2010/libdns++_rbench/libdns++_rbench.vcxproj
index d5da08b..9bc4e85 100755
--- a/win32build/VS2010/libdns++_rbench/libdns++_rbench.vcxproj
+++ b/win32build/VS2010/libdns++_rbench/libdns++_rbench.vcxproj
@@ -61,8 +61,8 @@
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <OutputFile>$(OutDir)rdatarender_bench$(TargetExt)</OutputFile>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libdns++.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libdns++\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libdns++d.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -83,7 +83,7 @@
       <OptimizeReferences>true</OptimizeReferences>
       <OutputFile>$(OutDir)rdatarender_bench$(TargetExt)</OutputFile>
       <AdditionalDependencies>libexceptions.lib;libutil.lib;libdns++.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libdns++\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>..\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
diff --git a/win32build/VS2010/libdns++_tests/libdns++_tests.vcxproj b/win32build/VS2010/libdns++_tests/libdns++_tests.vcxproj
index 41a9996..b330ed4 100755
--- a/win32build/VS2010/libdns++_tests/libdns++_tests.vcxproj
+++ b/win32build/VS2010/libdns++_tests/libdns++_tests.vcxproj
@@ -52,15 +52,15 @@
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
       <WarningLevel>Level4</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;TEST_DATA_SRCDIR="%BIND10HOME%/src/lib/dns/tests/testdata";TEST_DATA_BUILDDIR="%BIND10HOME%/src/lib/dns/tests/testdata";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;TEST_DATA_SRCDIR="%BIND10HOME%/src/lib/dns/tests/testdata";TEST_DATA_BUILDDIR="%BIND10HOME%/src/lib/dns/tests/testdata";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\src\lib\dns;..\..\..\src\lib\util;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;libcryptolink.lib;libdns++.lib;gtestd.lib;botan.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\libcryptolink\$(Configuration);..\libdns++\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);..\..\..\..\botan\md10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libutil_unittestsd.lib;libcryptolinkd.lib;libdns++d.lib;gtestd.lib;botand.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);..\..\..\..\botan\v100\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\dns\tests\testdata
@@ -191,7 +191,7 @@ python %BIND10HOME%/src/lib/util/python/gen_wiredata.py -o tsig_verify9.wire tsi
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;TEST_DATA_SRCDIR="%BIND10HOME%/src/lib/dns/tests/testdata";TEST_DATA_BUILDDIR="%BIND10HOME%/src/lib/dns/tests/testdata";NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;GTEST_LINKED_AS_SHARED_LIBRARY=1;TEST_DATA_SRCDIR="%BIND10HOME%/src/lib/dns/tests/testdata";TEST_DATA_BUILDDIR="%BIND10HOME%/src/lib/dns/tests/testdata";NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\src\lib\dns;..\..\..\src\lib\util;..\..\..\..\gtest\include;%BOOST%;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
@@ -201,7 +201,7 @@ python %BIND10HOME%/src/lib/util/python/gen_wiredata.py -o tsig_verify9.wire tsi
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;libcryptolink.lib;libdns++.lib;gtest.lib;botan.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libutil_unittests\$(Configuration);..\libcryptolink\$(Configuration);..\libdns++\$(Configuration);..\..\..\..\gtest\md10\$(Configuration);..\..\..\..\botan\md10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\gtest\v100\$(Configuration);..\..\..\..\botan\v100\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\dns\tests\testdata
diff --git a/win32build/VS2010/liblog/liblog.vcxproj b/win32build/VS2010/liblog/liblog.vcxproj
index 80d56f9..41b3bc6 100755
--- a/win32build/VS2010/liblog/liblog.vcxproj
+++ b/win32build/VS2010/liblog/liblog.vcxproj
@@ -12,6 +12,7 @@
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\src\lib\log\dummylog.h" />
+    <ClInclude Include="..\..\..\src\lib\log\lib.h" />
     <ClInclude Include="..\..\..\src\lib\log\log_dbglevels.h" />
     <ClInclude Include="..\..\..\src\lib\log\log_formatter.h" />
     <ClInclude Include="..\..\..\src\lib\log\logger.h" />
diff --git a/win32build/VS2010/liblog/liblog.vcxproj.filters b/win32build/VS2010/liblog/liblog.vcxproj.filters
index 9a7f23d..d53367e 100755
--- a/win32build/VS2010/liblog/liblog.vcxproj.filters
+++ b/win32build/VS2010/liblog/liblog.vcxproj.filters
@@ -81,6 +81,9 @@
     <ClInclude Include="..\..\..\src\lib\log\log_dbglevels.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\lib\log\lib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\src\lib\log\dummylog.cc">
diff --git a/win32build/VS2010/pyddns++/pyddns++.vcxproj b/win32build/VS2010/pyddns++/pyddns++.vcxproj
index 0cf75c3..cff2242 100755
--- a/win32build/VS2010/pyddns++/pyddns++.vcxproj
+++ b/win32build/VS2010/pyddns++/pyddns++.vcxproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -40,13 +40,13 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
     <TargetName>pydnspp_d</TargetName>
     <TargetExt>.pyd</TargetExt>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
-    <OutDir>$(Configuration)\</OutDir>
+    <OutDir>$(Solutiondir)$(Configuration)\</OutDir>
     <TargetName>pydnspp</TargetName>
     <TargetExt>.pyd</TargetExt>
   </PropertyGroup>
@@ -63,8 +63,8 @@
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <OutputFile>$(OutDir)pydnspp_d.pyd</OutputFile>
-      <AdditionalDependencies>libexceptions.lib;libutil.lib;libcryptolink.lib;libdns++.lib;libdns++_python.lib;botan.lib;python32_d.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libcryptolink\$(Configuration);..\libdns++\$(Configuration);..\libdns++_python\$(Configuration);..\..\..\..\botan\md10\$(Configuration);C:\Python32\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libexceptionsd.lib;libutild.lib;libcryptolinkd.lib;libdns++d.lib;libdns++_pythond.lib;botand.lib;python32_d.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\botan\v100\$(Configuration);C:\Python32\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\python
@@ -72,8 +72,8 @@ copy bind10_config.py.win32 bind10_config.py
 </Command>
     </PreBuildEvent>
     <PostBuildEvent>
-      <Command>copy ..\..\..\src\lib\util\pyunittests\pyunittests_util.py.win32 ..\..\..\src\lib\dns\python\tests\pyunittests_util.py
-</Command>
+      <Command>
+      </Command>
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -94,7 +94,7 @@ copy bind10_config.py.win32 bind10_config.py
       <OptimizeReferences>true</OptimizeReferences>
       <OutputFile>$(OutDir)pydnspp.pyd</OutputFile>
       <AdditionalDependencies>libexceptions.lib;libutil.lib;libcryptolink.lib;libdns++.lib;libdns++_python.lib;botan.lib;python32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>..\libexceptions\$(Configuration);..\libutil\$(Configuration);..\libcryptolink\$(Configuration);..\libdns++\$(Configuration);..\libdns++_python\$(Configuration);..\..\..\..\botan\md10\$(Configuration);C:\Python32\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>..\$(Configuration);..\..\..\..\botan\v100\$(Configuration);C:\Python32\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
       <Command>cd ..\..\..\src\lib\python
@@ -102,8 +102,8 @@ copy bind10_config.py.win32 bind10_config.py
 </Command>
     </PreBuildEvent>
     <PostBuildEvent>
-      <Command>copy ..\..\..\src\lib\util\pyunittests\pyunittests_util.py.win32 ..\..\..\src\lib\dns\python\tests\pyunittests_util.py
-</Command>
+      <Command>
+      </Command>
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>



More information about the bind10-changes mailing list