From 45d6379135504814ab723b57f0eb8be23393a51d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 09:24:22 +0200 Subject: Adding upstream version 1:9.16.44. Signed-off-by: Daniel Baumann --- lib/irs/win32/DLLMain.c | 49 ++++++++ lib/irs/win32/Makefile.in | 19 +++ lib/irs/win32/include/.clang-format | 1 + lib/irs/win32/include/Makefile.in | 19 +++ lib/irs/win32/include/irs/Makefile.in | 28 +++++ lib/irs/win32/include/irs/netdb.h | 207 ++++++++++++++++++++++++++++++++ lib/irs/win32/include/irs/platform.h | 34 ++++++ lib/irs/win32/libirs.def | 27 +++++ lib/irs/win32/libirs.vcxproj.filters.in | 69 +++++++++++ lib/irs/win32/libirs.vcxproj.in | 142 ++++++++++++++++++++++ lib/irs/win32/libirs.vcxproj.user | 3 + lib/irs/win32/resconf.c | 130 ++++++++++++++++++++ lib/irs/win32/version.c | 18 +++ 13 files changed, 746 insertions(+) create mode 100644 lib/irs/win32/DLLMain.c create mode 100644 lib/irs/win32/Makefile.in create mode 120000 lib/irs/win32/include/.clang-format create mode 100644 lib/irs/win32/include/Makefile.in create mode 100644 lib/irs/win32/include/irs/Makefile.in create mode 100644 lib/irs/win32/include/irs/netdb.h create mode 100644 lib/irs/win32/include/irs/platform.h create mode 100644 lib/irs/win32/libirs.def create mode 100644 lib/irs/win32/libirs.vcxproj.filters.in create mode 100644 lib/irs/win32/libirs.vcxproj.in create mode 100644 lib/irs/win32/libirs.vcxproj.user create mode 100644 lib/irs/win32/resconf.c create mode 100644 lib/irs/win32/version.c (limited to 'lib/irs/win32') diff --git a/lib/irs/win32/DLLMain.c b/lib/irs/win32/DLLMain.c new file mode 100644 index 0000000..62c6e53 --- /dev/null +++ b/lib/irs/win32/DLLMain.c @@ -0,0 +1,49 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +#include +#include + +/* + * Called when we enter the DLL + */ +__declspec(dllexport) BOOL WINAPI + DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { + switch (fdwReason) { + /* + * The DLL is loading due to process + * initialization or a call to LoadLibrary. + */ + case DLL_PROCESS_ATTACH: + break; + + /* The attached process creates a new thread. */ + case DLL_THREAD_ATTACH: + break; + + /* The thread of the attached process terminates. */ + case DLL_THREAD_DETACH: + break; + + /* + * The DLL is unloading from a process due to + * process termination or a call to FreeLibrary. + */ + case DLL_PROCESS_DETACH: + break; + + default: + break; + } + return (TRUE); +} diff --git a/lib/irs/win32/Makefile.in b/lib/irs/win32/Makefile.in new file mode 100644 index 0000000..5641e1a --- /dev/null +++ b/lib/irs/win32/Makefile.in @@ -0,0 +1,19 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +srcdir = @srcdir@ +VPATH = @srcdir@ +top_srcdir = @top_srcdir@ + +SUBDIRS = include +TARGETS = + +@BIND9_MAKE_RULES@ diff --git a/lib/irs/win32/include/.clang-format b/lib/irs/win32/include/.clang-format new file mode 120000 index 0000000..e919bba --- /dev/null +++ b/lib/irs/win32/include/.clang-format @@ -0,0 +1 @@ +../../../../.clang-format.headers \ No newline at end of file diff --git a/lib/irs/win32/include/Makefile.in b/lib/irs/win32/include/Makefile.in new file mode 100644 index 0000000..53a5348 --- /dev/null +++ b/lib/irs/win32/include/Makefile.in @@ -0,0 +1,19 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +srcdir = @srcdir@ +VPATH = @srcdir@ +top_srcdir = @top_srcdir@ + +SUBDIRS = irs +TARGETS = + +@BIND9_MAKE_RULES@ diff --git a/lib/irs/win32/include/irs/Makefile.in b/lib/irs/win32/include/irs/Makefile.in new file mode 100644 index 0000000..6d87432 --- /dev/null +++ b/lib/irs/win32/include/irs/Makefile.in @@ -0,0 +1,28 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +srcdir = @srcdir@ +VPATH = @srcdir@ +top_srcdir = @top_srcdir@ + +HEADERS = +SUBDIRS = +TARGETS = + +@BIND9_MAKE_RULES@ + +installdirs: + $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir}/irs + +install:: installdirs + for i in ${HEADERS}; do \ + ${INSTALL_DATA} ${srcdir}/$$i ${DESTDIR}${includedir}/irs || exit 1; \ + done diff --git a/lib/irs/win32/include/irs/netdb.h b/lib/irs/win32/include/irs/netdb.h new file mode 100644 index 0000000..3e3e5d3 --- /dev/null +++ b/lib/irs/win32/include/irs/netdb.h @@ -0,0 +1,207 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +/*! \file */ + +#ifndef IRS_NETDB_H +#define IRS_NETDB_H 1 + +#include /* Required on FreeBSD (and others?) for size_t. */ + +/* + * Define if does not declare struct addrinfo. + */ +#undef ISC_IRS_NEEDADDRINFO + +#ifdef ISC_IRS_NEEDADDRINFO +struct addrinfo { + int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ + int ai_family; /* PF_xxx */ + int ai_socktype; /* SOCK_xxx */ + int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and + * IPv6 */ + size_t ai_addrlen; /* Length of ai_addr */ + char *ai_canonname; /* Canonical name for hostname */ + struct sockaddr *ai_addr; /* Binary address */ + struct addrinfo *ai_next; /* Next structure in linked list */ +}; +#endif /* ifdef ISC_IRS_NEEDADDRINFO */ + +/* + * Undefine all #defines we are interested in as may or may not have + * defined them. + */ + +/* + * Error return codes from gethostbyname() and gethostbyaddr() + * (left in extern int h_errno). + */ + +#undef NETDB_INTERNAL +#undef NETDB_SUCCESS +#undef HOST_NOT_FOUND +#undef TRY_AGAIN +#undef NO_RECOVERY +#undef NO_DATA +#undef NO_ADDRESS + +#define NETDB_INTERNAL -1 /* see errno */ +#define NETDB_SUCCESS 0 /* no problem */ +#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */ +#define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */ +#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ +#define NO_DATA 4 /* Valid name, no data record of requested type */ +#define NO_ADDRESS NO_DATA /* no address, look for MX record */ + +/* + * Error return codes from getaddrinfo(). EAI_INSECUREDATA is our own extension + * and it's very unlikely to be already defined, but undef it just in case; it + * at least doesn't do any harm. + */ + +#undef EAI_ADDRFAMILY +#undef EAI_AGAIN +#undef EAI_BADFLAGS +#undef EAI_FAIL +#undef EAI_FAMILY +#undef EAI_MEMORY +#undef EAI_NODATA +#undef EAI_NONAME +#undef EAI_SERVICE +#undef EAI_SOCKTYPE +#undef EAI_SYSTEM +#undef EAI_BADHINTS +#undef EAI_PROTOCOL +#undef EAI_OVERFLOW +#undef EAI_INSECUREDATA +#undef EAI_MAX + +#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */ +#define EAI_AGAIN 2 /* temporary failure in name resolution */ +#define EAI_BADFLAGS 3 /* invalid value for ai_flags */ +#define EAI_FAIL 4 /* non-recoverable failure in name resolution */ +#define EAI_FAMILY 5 /* ai_family not supported */ +#define EAI_MEMORY 6 /* memory allocation failure */ +#define EAI_NODATA 7 /* no address associated with hostname */ +#define EAI_NONAME 8 /* hostname nor servname provided, or not known */ +#define EAI_SERVICE 9 /* servname not supported for ai_socktype */ +#define EAI_SOCKTYPE 10 /* ai_socktype not supported */ +#define EAI_SYSTEM 11 /* system error returned in errno */ +#define EAI_BADHINTS 12 +#define EAI_PROTOCOL 13 +#define EAI_OVERFLOW 14 +#define EAI_INSECUREDATA 15 +#define EAI_MAX 16 + +/* + * Flag values for getaddrinfo() + */ +#undef AI_PASSIVE +#undef AI_CANONNAME +#undef AI_NUMERICHOST + +#define AI_PASSIVE 0x00000001 +#define AI_CANONNAME 0x00000002 +#define AI_NUMERICHOST 0x00000004 + +/* + * Flag values for getipnodebyname() + */ +#undef AI_V4MAPPED +#undef AI_ALL +#undef AI_ADDRCONFIG +#undef AI_DEFAULT + +#define AI_V4MAPPED 0x00000008 +#define AI_ALL 0x00000010 +#define AI_ADDRCONFIG 0x00000020 +#define AI_DEFAULT (AI_V4MAPPED | AI_ADDRCONFIG) + +/* + * Constants for getnameinfo() + */ +#undef NI_MAXHOST +#undef NI_MAXSERV + +#define NI_MAXHOST 1025 +#define NI_MAXSERV 32 + +/* + * Flag values for getnameinfo() + */ +#undef NI_NOFQDN +#undef NI_NUMERICHOST +#undef NI_NAMEREQD +#undef NI_NUMERICSERV +#undef NI_DGRAM +#undef NI_NUMERICSCOPE + +#define NI_NOFQDN 0x00000001 +#define NI_NUMERICHOST 0x00000002 +#define NI_NAMEREQD 0x00000004 +#define NI_NUMERICSERV 0x00000008 +#define NI_DGRAM 0x00000010 + +/* + * Define to map into irs_ namespace. + */ + +#define IRS_NAMESPACE + +#ifdef IRS_NAMESPACE + +/* + * Use our versions not the ones from the C library. + */ + +#ifdef getnameinfo +#undef getnameinfo +#endif /* ifdef getnameinfo */ +#define getnameinfo irs_getnameinfo + +#ifdef getaddrinfo +#undef getaddrinfo +#endif /* ifdef getaddrinfo */ +#define getaddrinfo irs_getaddrinfo + +#ifdef freeaddrinfo +#undef freeaddrinfo +#endif /* ifdef freeaddrinfo */ +#define freeaddrinfo irs_freeaddrinfo + +#ifdef gai_strerror +#undef gai_strerror +#endif /* ifdef gai_strerror */ +#define gai_strerror irs_gai_strerror + +#endif /* ifdef IRS_NAMESPACE */ + +int +getaddrinfo(const char *, const char *, const struct addrinfo *, + struct addrinfo **); +int +getnameinfo(const struct sockaddr *, socklen_t, char *, DWORD, char *, DWORD, + int); +void +freeaddrinfo(struct addrinfo *); +char * +gai_strerror(int); + +/* + * Tell Emacs to use C mode on this file. + * Local variables: + * mode: c + * End: + */ + +#endif /* IRS_NETDB_H */ diff --git a/lib/irs/win32/include/irs/platform.h b/lib/irs/win32/include/irs/platform.h new file mode 100644 index 0000000..2f0cced --- /dev/null +++ b/lib/irs/win32/include/irs/platform.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +/*! \file */ + +#ifndef IRS_PLATFORM_H +#define IRS_PLATFORM_H 1 + +/***** +***** Platform-dependent defines. +*****/ + +#ifdef LIBIRS_EXPORTS +#define LIBIRS_EXTERNAL_DATA __declspec(dllexport) +#else /* ifdef LIBIRS_EXPORTS */ +#define LIBIRS_EXTERNAL_DATA __declspec(dllimport) +#endif /* ifdef LIBIRS_EXPORTS */ + +/* + * Tell Emacs to use C mode on this file. + * Local Variables: + * mode: c + * End: + */ + +#endif /* IRS_PLATFORM_H */ diff --git a/lib/irs/win32/libirs.def b/lib/irs/win32/libirs.def new file mode 100644 index 0000000..d4e9f6f --- /dev/null +++ b/lib/irs/win32/libirs.def @@ -0,0 +1,27 @@ +LIBRARY libirs + +; Exported Functions +EXPORTS +irs_context_create +irs_context_destroy +irs_context_get +irs_context_getappctx +irs_context_getdnsclient +irs_context_getdnsconf +irs_context_getmctx +irs_context_getresconf +irs_context_gettask +irs_context_gettaskmgr +irs_context_gettimermgr +irs_dnsconf_destroy +irs_dnsconf_gettrustedkeys +irs_dnsconf_load +irs_freeaddrinfo +irs_gai_strerror +irs_getaddrinfo +irs_getnameinfo +irs_resconf_destroy +irs_resconf_getnameservers +irs_resconf_getndots +irs_resconf_getsearchlist +irs_resconf_load diff --git a/lib/irs/win32/libirs.vcxproj.filters.in b/lib/irs/win32/libirs.vcxproj.filters.in new file mode 100644 index 0000000..0ffbc07 --- /dev/null +++ b/lib/irs/win32/libirs.vcxproj.filters.in @@ -0,0 +1,69 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + diff --git a/lib/irs/win32/libirs.vcxproj.in b/lib/irs/win32/libirs.vcxproj.in new file mode 100644 index 0000000..078ec92 --- /dev/null +++ b/lib/irs/win32/libirs.vcxproj.in @@ -0,0 +1,142 @@ + + + + + Debug + @PLATFORM@ + + + Release + @PLATFORM@ + + + + {A4F29CEB-7644-4A7F-BE9E-02B6A90E4919} + Win32Proj + libirs + @WINDOWS_TARGET_PLATFORM_VERSION@ + + + + DynamicLibrary + true + MultiByte + @PLATFORM_TOOLSET@ + + + DynamicLibrary + false + true + MultiByte + @PLATFORM_TOOLSET@ + + + + + + + + + + + + + true + ..\..\..\Build\$(Configuration)\ + .\$(Configuration)\ + None + + + false + ..\..\..\Build\$(Configuration)\ + .\$(Configuration)\ + None + + + + + + Level4 + false + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBIRS_EXPORTS;%(PreprocessorDefinitions);%(PreprocessorDefinitions) + ..\..\..\config.h + .\;..\..\..\;include;..\include;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;..\..\isccfg\include;..\..\dns\include;@LIBXML2_INC@@OPENSSL_INC@@GEOIP_INC@%(AdditionalIncludeDirectories) + true + .\$(Configuration)\$(TargetName).pch + .\$(Configuration)\ + .\$(Configuration)\ + $(OutDir)$(TargetName).pdb + true + CompileAsC + + + Console + true + ..\..\isc\win32\$(Configuration);..\..\dns\win32\$(Configuration);..\..\isccfg\win32\$(Configuration);%(AdditionalLibraryDirectories) + @OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@libisc.lib;libdns.lib;libisccfg.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + .\libirs.def + .\$(Configuration)\$(ProjectName).lib + ..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt) + + + + + Level1 + true + + + MaxSpeed + true + @INTRINSIC@ + WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBIRS_EXPORTS;%(PreprocessorDefinitions);%(PreprocessorDefinitions) + ..\..\..\config.h + .\;..\..\..\;include;..\include;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;..\..\isccfg\include;..\..\dns\include;@LIBXML2_INC@@OPENSSL_INC@@GEOIP_INC@%(AdditionalIncludeDirectories) + OnlyExplicitInline + false + true + .\$(Configuration)\$(TargetName).pch + .\$(Configuration)\ + .\$(Configuration)\ + $(OutDir)$(TargetName).pdb + CompileAsC + + + Console + false + true + true + ..\..\isc\win32\$(Configuration);..\..\dns\win32\$(Configuration);..\..\isccfg\win32\$(Configuration);%(AdditionalLibraryDirectories) + @OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@libisc.lib;libdns.lib;libisccfg.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + .\libirs.def + .\$(Configuration)\$(ProjectName).lib + Default + ..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt) + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/irs/win32/libirs.vcxproj.user b/lib/irs/win32/libirs.vcxproj.user new file mode 100644 index 0000000..ace9a86 --- /dev/null +++ b/lib/irs/win32/libirs.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/lib/irs/win32/resconf.c b/lib/irs/win32/resconf.c new file mode 100644 index 0000000..3b46b8e --- /dev/null +++ b/lib/irs/win32/resconf.c @@ -0,0 +1,130 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +/* + * Note that on Win32 there is normally no resolv.conf since all information + * is stored in the registry. Therefore there is no ordering like the + * contents of resolv.conf. Since the "search" or "domain" keyword, on + * Win32 if a search list is found it is used, otherwise the domain name + * is used since they are mutually exclusive. The search list can be entered + * in the DNS tab of the "Advanced TCP/IP settings" window under the same place + * that you add your nameserver list. + */ + +#define HAVE_GET_WIN32_NAMESERVERS 1 + +#include "../resconf.c" +#include + +#define TCPIP_SUBKEY "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters" + +isc_result_t +get_win32_searchlist(irs_resconf_t *conf) { + isc_result_t result = ISC_R_SUCCESS; + HKEY hKey; + char searchlist[MAX_PATH]; + DWORD searchlen = MAX_PATH; + LSTATUS status; + char *cp; + + REQUIRE(conf != NULL); + + memset(searchlist, 0, MAX_PATH); + status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TCPIP_SUBKEY, 0, KEY_READ, + &hKey); + if (status != ERROR_SUCCESS) { + return (ISC_R_SUCCESS); + } + + status = RegQueryValueEx(hKey, "SearchList", NULL, NULL, + (LPBYTE)searchlist, &searchlen); + RegCloseKey(hKey); + if (status != ERROR_SUCCESS) { + return (ISC_R_SUCCESS); + } + + cp = strtok((char *)searchlist, ", \0"); + while (cp != NULL) { + result = add_search(conf, cp); + if (result != ISC_R_SUCCESS) { + break; + } + cp = strtok(NULL, ", \0"); + } + return (result); +} + +isc_result_t +get_win32_nameservers(irs_resconf_t *conf) { + isc_result_t result; + FIXED_INFO *FixedInfo; + ULONG BufLen = sizeof(FIXED_INFO); + DWORD dwRetVal; + IP_ADDR_STRING *pIPAddr; + + REQUIRE(conf != NULL); + + FixedInfo = (FIXED_INFO *)GlobalAlloc(GPTR, BufLen); + if (FixedInfo == NULL) { + return (ISC_R_NOMEMORY); + } + dwRetVal = GetNetworkParams(FixedInfo, &BufLen); + if (dwRetVal == ERROR_BUFFER_OVERFLOW) { + GlobalFree(FixedInfo); + FixedInfo = GlobalAlloc(GPTR, BufLen); + if (FixedInfo == NULL) { + return (ISC_R_NOMEMORY); + } + dwRetVal = GetNetworkParams(FixedInfo, &BufLen); + } + if (dwRetVal != ERROR_SUCCESS) { + GlobalFree(FixedInfo); + return (ISC_R_FAILURE); + } + + result = get_win32_searchlist(conf); + if (result != ISC_R_SUCCESS) { + goto cleanup; + } + + if (ISC_LIST_EMPTY(conf->searchlist) && + strlen(FixedInfo->DomainName) > 0) + { + result = add_search(conf, FixedInfo->DomainName); + if (result != ISC_R_SUCCESS) { + goto cleanup; + } + } + + /* Get the list of nameservers */ + pIPAddr = &FixedInfo->DnsServerList; + while (pIPAddr) { + if (conf->numns >= RESCONFMAXNAMESERVERS) { + break; + } + + result = add_server(conf->mctx, pIPAddr->IpAddress.String, + &conf->nameservers); + if (result != ISC_R_SUCCESS) { + break; + } + conf->numns++; + pIPAddr = pIPAddr->Next; + } + +cleanup: + if (FixedInfo != NULL) { + GlobalFree(FixedInfo); + } + return (result); +} diff --git a/lib/irs/win32/version.c b/lib/irs/win32/version.c new file mode 100644 index 0000000..3c635ad --- /dev/null +++ b/lib/irs/win32/version.c @@ -0,0 +1,18 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +#include + +#include + +LIBIRS_EXTERNAL_DATA const char irs_version[] = VERSION; -- cgit v1.2.3