mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
deps: update c-ares to 1.19.0
Refs: https://c-ares.org/changelog.html#1_19_0 PR-URL: https://github.com/nodejs/node/pull/46415 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
bb14a2b098
commit
7e7e2d037b
91 files changed
+4510
-3788
No files matched your search
Vendored
+443
-164
@@ -1,5 +1,448 @@
|
||||
Changelog for the c-ares project. Generated with git2changes.pl
|
||||
|
||||
Version 1.19.0 (18 Jan 2023)
|
||||
|
||||
bradh352 (18 Jan 2023)
|
||||
- Prep for 1.19.0 release
|
||||
|
||||
- Fix inverted logic in 25523e2
|
||||
|
||||
Fix .localhost. handling in prior commit
|
||||
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
- RFC6761 localhost definition includes subdomains
|
||||
|
||||
RFC6761 6.3 states:
|
||||
The domain "localhost." and any names falling within ".localhost."
|
||||
|
||||
We were only honoring "localhost".
|
||||
|
||||
Fixes: #477
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
- docs: ARES_OPT_UDP_PORT and ARES_OPT_TCP_PORT docs wrong byte order
|
||||
|
||||
As per #487, documentation states the port should be in network byte
|
||||
order, but we can see from the test cases using MockServers on
|
||||
different ports that this is not the case, it is definitely in host
|
||||
byte order.
|
||||
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
GitHub (18 Jan 2023)
|
||||
- [hopper-vul brought this change]
|
||||
|
||||
Add str len check in config_sortlist to avoid stack overflow (#497)
|
||||
|
||||
In ares_set_sortlist, it calls config_sortlist(..., sortstr) to parse
|
||||
the input str and initialize a sortlist configuration.
|
||||
|
||||
However, ares_set_sortlist has not any checks about the validity of the input str.
|
||||
It is very easy to create an arbitrary length stack overflow with the unchecked
|
||||
`memcpy(ipbuf, str, q-str);` and `memcpy(ipbufpfx, str, q-str);`
|
||||
statements in the config_sortlist call, which could potentially cause severe
|
||||
security impact in practical programs.
|
||||
|
||||
This commit add necessary check for `ipbuf` and `ipbufpfx` which avoid the
|
||||
potential stack overflows.
|
||||
|
||||
fixes #496
|
||||
|
||||
Fix By: @hopper-vul
|
||||
|
||||
bradh352 (18 Jan 2023)
|
||||
- Fix build due to str-split sed gone wrong
|
||||
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
- cirrus-ci: switch to scan-build-py for MacOS
|
||||
|
||||
MacOS seems to work better with scan-build-py
|
||||
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
- ares_strsplit* -> ares__strsplit* to comply with internal function naming
|
||||
|
||||
Inspired by #495, but was missing test cases and would failed to build.
|
||||
|
||||
Fix By: Brad House (@bradh352), Daniel Stenberg (@bagder)
|
||||
|
||||
- Cirrus-CI: MacOS Homebrew has changed from /usr/local/opt to /opt/homebrew
|
||||
|
||||
Fix paths for homebrew.
|
||||
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
- cirrus-ci: iOS build needs to use ARM MacOS image
|
||||
|
||||
CirrusCI removed Intel-based MacOS images. Need to switch
|
||||
iOS builds to use new ARM images as well.
|
||||
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
- cirrus-ci: new MacOS image
|
||||
|
||||
Cirrus-CI has recently EOL'd Intel MacOS VMs, switch to the latest
|
||||
ARM-based image.
|
||||
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
- acountry was passing stack variable to callback
|
||||
|
||||
Recent ASAN versions picked up that acountry was passing stack
|
||||
variables to ares_gethostbyname() then leaving the stack context.
|
||||
We will now allocate a buffer for this.
|
||||
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
GitHub (13 Dec 2022)
|
||||
- [Daniel Stenberg brought this change]
|
||||
|
||||
docs: reformat/cleanup man pages SYNOPSIS sections (#494)
|
||||
|
||||
To make them render "nicer" in both terminals and on the website.
|
||||
|
||||
- Removes the bold
|
||||
- Removes .PP lines
|
||||
- Indents them more like proper code style
|
||||
|
||||
Fix By: Daniel Stenberg (@bagder)
|
||||
|
||||
- [Nikolaos Chatzikonstantinou brought this change]
|
||||
|
||||
bug fix: new ares_strsplit (#492)
|
||||
|
||||
* add ares_strsplit unit test
|
||||
|
||||
The test reveals a bug in the implementation of ares_strsplit when the
|
||||
make_set parameter is set to 1, as distinct domains are confused for
|
||||
equal:
|
||||
|
||||
out = ares_strsplit("example.com, example.co", ", ", 1, &n);
|
||||
|
||||
evaluates to n = 1 with out = { "example.com" }.
|
||||
|
||||
* bugfix and cleanup of ares_strsplit
|
||||
|
||||
The purpose of ares_strsplit in c-ares is to split a comma-delimited
|
||||
string of unique (up to letter case) domains. However, because the
|
||||
terminating NUL byte was not checked in the substrings when comparing
|
||||
for uniqueness, the function would sometimes drop domains it should
|
||||
not. For example,
|
||||
|
||||
ares_strsplit("example.com, example.co", ",")
|
||||
|
||||
would only result in a single domain "example.com".
|
||||
|
||||
Aside from this bugfix, the following cleanup is performed:
|
||||
|
||||
1. The tokenization now happens with the help of strcspn instead of the
|
||||
custom function is_delim.
|
||||
2. The function list_contains has been inlined.
|
||||
3. The interface of ares_strsplit has been simplified by removing the
|
||||
parameter make_set since in practice it was always 1.
|
||||
4. There are fewer passes over the input string.
|
||||
5. We resize the table using realloc() down to its minimum size.
|
||||
6. The docstring of ares_strsplit is updated and also a couple typos
|
||||
are fixed.
|
||||
|
||||
There occurs a single use of ares_strsplit and since the make_set
|
||||
parameter has been removed, the call in ares_init.c is modified
|
||||
accordingly. The unit test for ares_strsplit is also updated.
|
||||
|
||||
Fix By: Nikolaos Chatzikonstantinou (@createyourpersonalaccount)
|
||||
|
||||
bradh352 (23 Oct 2022)
|
||||
- CirrusCI: update freebsd image
|
||||
|
||||
Old FreeBSD image for CirrusCI has issues with newer symbols, update to later one.
|
||||
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
GitHub (23 Oct 2022)
|
||||
- [Stephen Sachs brought this change]
|
||||
|
||||
Fix Intel compiler deprecated options (#485)
|
||||
|
||||
Options `-we ###` and `-wd ###` should not include a whitespace. They are also deprecated and `-diag-error` and `-diag-disable` are their replacements.
|
||||
|
||||
Intel compiler 2021.6 is not able to be used in configure without the proposed patch.
|
||||
|
||||
Fix By: Stephen Sachs (@stephenmsachs)
|
||||
|
||||
- [Jonathan Ringer brought this change]
|
||||
|
||||
Allow for CMake to use absolute install paths (#486)
|
||||
|
||||
Generated libcares.pc could have bad paths when using absolute paths.
|
||||
|
||||
Fix By: Jonathan Ringer (@jonringer)
|
||||
|
||||
- [Thomas Dreibholz brought this change]
|
||||
|
||||
Fix for issue #488: ensure that the number of iovec entries does not exceed system limits. (#489)
|
||||
|
||||
c-ares could try to exceed maximum number of iovec entries supported by system.
|
||||
|
||||
Fix By: Thomas Dreibholz (@dreibh)
|
||||
|
||||
- [bsergean brought this change]
|
||||
|
||||
Add include guards to ares_data.h (#491)
|
||||
|
||||
All the other header files in the src/lib folder do have an include guard so it look like an overthought.
|
||||
|
||||
Fix By: @bsergean
|
||||
|
||||
- [Brad Spencer brought this change]
|
||||
|
||||
Fix typo in docs for ares_process_fd (#490)
|
||||
|
||||
A single letter was missing
|
||||
|
||||
Fix By: Brad Spencer (@b-spencer)
|
||||
|
||||
- [lifenjoiner brought this change]
|
||||
|
||||
tools: refine help (#481)
|
||||
|
||||
fix invalid help options and documentation typos
|
||||
|
||||
Fix By: @lifenjoiner
|
||||
|
||||
- [lifenjoiner brought this change]
|
||||
|
||||
Git: ignore CMake temporary files (#480)
|
||||
|
||||
exclude more files from git
|
||||
|
||||
Fix By: @lifenjoiner
|
||||
|
||||
- [lifenjoiner brought this change]
|
||||
|
||||
adig: fix `-T` option (#479)
|
||||
|
||||
Helper was missing flag to enable TCP mode of operation.
|
||||
|
||||
Fix By: @lifenjoiner
|
||||
|
||||
- [Frank brought this change]
|
||||
|
||||
Add vcpkg installation instructions (#478)
|
||||
|
||||
Update to include vcpkg installation instructions
|
||||
|
||||
Fix By: @FrankXie05
|
||||
|
||||
- [marc-groundctl brought this change]
|
||||
|
||||
Convert total timeout to per-query (#467)
|
||||
|
||||
On Apple platforms, libresolv reports the total timeout in retrans, not the per-query time. This patch undoes that math to get the per-query time, which is what c-ares expects. This is not perfect because libresolv is inconsistent on whether the timeout is multiplied by retry or retry+1, but I don't see any way to distinguish these cases.
|
||||
|
||||
Fix By: Marc Aldorasi (@marc-groundctl)
|
||||
|
||||
- [marc-groundctl brought this change]
|
||||
|
||||
Don't include version info in the static library (#468)
|
||||
|
||||
The static library should not contain version info, since it would be linked into an executable or dll with its own version info.
|
||||
|
||||
Fix By: @marc-groundctl
|
||||
|
||||
- [Ridge Kennedy brought this change]
|
||||
|
||||
Fix ares_getaddrinfo() numerical address fast path with AF_UNSPEC (#469)
|
||||
|
||||
The conversion of numeric IPv4 addresses in fake_addrinfo() is broken when
|
||||
the family is AF_UNSPEC. The initial call to ares_inet_pton with AF_INET
|
||||
will succeed, but the subsequent call using AF_INET6 will fail. This results
|
||||
in the fake_addrinfo() fast path failing, and ares_getaddrinfo() making a
|
||||
query when none should be required.
|
||||
|
||||
Resolve this by only attempting the call to ares_inet_pton with AF_INET6
|
||||
if the initial call with AF_INET was unsuccessful.
|
||||
|
||||
Fix By: Ridge Kennedy (@ridgek)
|
||||
|
||||
- [Manish Mehra brought this change]
|
||||
|
||||
Configurable hosts path for file_lookup (#465)
|
||||
|
||||
This changeset adds support for configurable hosts file
|
||||
ARES_OPT_HOSTS_FILE (similar to ARES_OPT_RESOLVCONF).
|
||||
|
||||
Co-authored-by: Manish Mehra (@mmehra)
|
||||
|
||||
bradh352 (27 Apr 2022)
|
||||
- CMake: Windows DLLs lack version information
|
||||
|
||||
The cares.rc was not included in the build for CMake. Conditionally
|
||||
add it when building for Windows.
|
||||
|
||||
Fix By: Brad House (@bradh352)
|
||||
Fixes Bug: #460
|
||||
|
||||
GitHub (27 Apr 2022)
|
||||
- [Kai Pastor brought this change]
|
||||
|
||||
CMake: Guard target creation in exported config (#464)
|
||||
|
||||
User projects may call 'find_package(c-ares)' multiple times (e.g.
|
||||
via dependencies), but targets must be created only once.
|
||||
Shared and static target must be treated independently.
|
||||
|
||||
Fix By: Kai Pastor (@dg0yt)
|
||||
|
||||
bradh352 (27 Apr 2022)
|
||||
- Honor valid DNS result even if other class returned an error
|
||||
|
||||
When using ares_getaddrinfo() with PF_UNSPEC, if a DNS server returned
|
||||
good data on an A record, followed by bad data on an AAAA record, the
|
||||
good record would be thrown away and an error returned.
|
||||
|
||||
If we got a good response from one of the two queries, regardless of
|
||||
the order returned, we should honor that.
|
||||
|
||||
Fix By: Dmitry Karpov (dkarpov@roku.com)
|
||||
Signed Off By: Brad House (@bradh352)
|
||||
|
||||
GitHub (2 Apr 2022)
|
||||
- [Sam James brought this change]
|
||||
|
||||
configure.ac: fix STDC_HEADERS typo (#459)
|
||||
|
||||
There is no autoconf macro called STDC_HEADERS. AC_HEADER_STDC however does
|
||||
exist and it defines the STDC_HEADERS macro for use.
|
||||
|
||||
Not clear that STDC_HEADERS from its use in the repo is needed but
|
||||
would rather not meddle with it for now.
|
||||
|
||||
Fixes an annoying warning on `./configure`:
|
||||
```
|
||||
/var/tmp/portage/net-dns/c-ares-1.18.1/work/c-ares-1.18.1/configure: 24546: STDC_HEADERS: not found
|
||||
```
|
||||
|
||||
Signed-off-by: Sam James <sam@gentoo.org>
|
||||
|
||||
bradh352 (2 Mar 2022)
|
||||
- Asterisks should be allowed in host validation as CNAMEs may reference wildcard domains
|
||||
|
||||
CloudFlare appears to use this logic in CNAMEs as per
|
||||
https://github.com/nodejs/node/issues/42171
|
||||
|
||||
Fixes: #457
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
- Don't return on file lookup failure, set status
|
||||
|
||||
When resolving a host via /etc/hosts, don't return with a predefined
|
||||
error as there may be other tries.
|
||||
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
- 'localhost' special treatment enhancement
|
||||
|
||||
Since localhost is special-cased, any errors should be ignored when
|
||||
reading /etc/hosts as otherwise we could return an error if there
|
||||
were for instance an invalidly formatted /etc/hosts or if /etc/hosts
|
||||
had a permissions error while reading.
|
||||
|
||||
This exact behavior appears to have been seen on OS/400 PASE
|
||||
environments which allows AIX binares to run.
|
||||
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
- If chain building c-ares as part of another project, detect of res_servicename could fail (#451)
|
||||
|
||||
If libresolv is already included with the build, c-ares wouldn't properly detect its use.
|
||||
|
||||
May fix: #451
|
||||
Fix by: Brad House (@bradh352)
|
||||
|
||||
- no analyze capability on ios
|
||||
|
||||
- attempt to use scan-build on ios
|
||||
|
||||
- disable tests on ios
|
||||
|
||||
- fix switch statement
|
||||
|
||||
- code coverage had gotten disabled
|
||||
|
||||
- looks like shell expansion doesn't work with cirrus-ci, lets do it another way
|
||||
|
||||
- attempt to autobuild for iOS
|
||||
|
||||
GitHub (8 Dec 2021)
|
||||
- [Brad House brought this change]
|
||||
|
||||
Windows: rework/simplify initialization code, drop long EOL systems (#445)
|
||||
|
||||
There was a lot of windows initialization code specific to the era that predates Windows Vista such as reading DNS configuration from the registry, and dynamically loading libraries to get access to functions that didn't exist in XP or earlier releases.
|
||||
|
||||
Vista was released in January 2007, and was EOL'd in 2017, and support for Vista is still maintained with this patch set.
|
||||
|
||||
XP was EOL'd in Apr 8 2014.
|
||||
|
||||
I believe the last OS based on something earlier than Vista was POSReady 2009, as it was XP based for some reason, and that was EOL'd in January 2019. Considering any POS system falls under the PCI-DSS rules, they aren't allow to run POSReady 2009 any more so there is no reason to try to continue supporting such systems.
|
||||
|
||||
We have also targeted with our build system Vista support for the last few years, and while developers could change the target, we haven't had any reports that they have.
|
||||
|
||||
bradh352 (9 Nov 2021)
|
||||
- Fix memory leak in reading /etc/hosts
|
||||
|
||||
When an /etc/hosts lookup is performed, but fails with ENOTFOUND, and
|
||||
a valid RFC6761 Section 6.3 fallback is performed, it could overwrite
|
||||
variables that were already set and therefore leave the pointers
|
||||
dangling, never to be cleaned up.
|
||||
|
||||
Clean up explicitly on ENOTFOUND when returning from the file parser.
|
||||
|
||||
Fixes: #439
|
||||
Fix By: Brad House (@bradh352)
|
||||
|
||||
GitHub (2 Nov 2021)
|
||||
- [Bobby Reynolds brought this change]
|
||||
|
||||
Fix cross-compilation from Windows to Linux due to CPACK logic (#436)
|
||||
|
||||
When determining value for CPACK_PACKAGE_ARCHITECTURE, prefer to use
|
||||
value from CMAKE_SYSTEM_PROCESSOR before falling back to uname output.
|
||||
|
||||
Additionally, if building from a Windows host, emit a fatal error
|
||||
instead of attempting to call uname.
|
||||
|
||||
Fix By: Bobby Reynolds (@reynoldsbd)
|
||||
|
||||
bradh352 (1 Nov 2021)
|
||||
- fix coveralls link
|
||||
|
||||
- coveralls needs token
|
||||
|
||||
- coveralls appears to require git
|
||||
|
||||
- fix a couple of coveralls vars
|
||||
|
||||
- more coveralls fixes
|
||||
|
||||
- add code coverage libs to LDADD instead of _LIBS
|
||||
|
||||
- make verbose
|
||||
|
||||
- try to fix code coverage building
|
||||
|
||||
- need -y for install
|
||||
|
||||
- try to fix asan/ubsan/lsan when built with clang. try to support code coverage properly.
|
||||
|
||||
- try another path
|
||||
|
||||
- fix pip
|
||||
|
||||
- attempt to enable some other build types that travis supported
|
||||
|
||||
Version 1.18.1 (26 Oct 2021)
|
||||
|
||||
bradh352 (26 Oct 2021)
|
||||
@@ -4955,167 +5398,3 @@ Yang Tse (30 Dec 2009)
|
||||
|
||||
Daniel Stenberg (30 Nov 2009)
|
||||
- start working on 1.7.1
|
||||
|
||||
Version 1.7.0 (27 Nov 2009)
|
||||
|
||||
Yang Tse (27 Nov 2009)
|
||||
- Preserve empty line following last target
|
||||
|
||||
- - Larry Lansing fixed ares_parse_srv_reply to properly parse replies
|
||||
which might contain non-SRV answers, skipping over potential non-SRV
|
||||
ones such as CNAMEs.
|
||||
|
||||
- When using icc, compile with -fpic and link with intel dynamic libraries.
|
||||
|
||||
- Added 'currently' in italics to insist on transient situation.
|
||||
|
||||
- Fix language
|
||||
|
||||
- Daniel wants upcoming release to be 1.7.0
|
||||
|
||||
- Mention last changes
|
||||
|
||||
- - Removed from external interface preprocessor symbol definition for
|
||||
CARES_HAVE_ARES_FREE_DATA. Current functionality of ares_free_data()
|
||||
makes it unnecessary.
|
||||
|
||||
- Added README.msvc
|
||||
|
||||
- Changed c-ares naming conventions when using MSVC as described in README.msvc
|
||||
|
||||
- - Mention other recent changes
|
||||
|
||||
- - Jakub Hrozek renamed addrttl and addr6ttl structs to ares_addrttl and
|
||||
ares_addr6ttl in order to prevent name space pollution, along with
|
||||
necessary changes to code base and man pages.This change does not break
|
||||
ABI, there is no need to recompile existing applications. But existing
|
||||
applications using these structs with the old name will need source code
|
||||
adjustments when recompiled using c-ares 1.6.1.
|
||||
|
||||
- - Jakub Hrozek fixed more function prototypes in man pages to sync them
|
||||
with the ones declared in ares.h
|
||||
|
||||
- Make configure remove the ares_build.h file included in distribution tarballs.
|
||||
|
||||
- Fix macro redefinition.
|
||||
|
||||
- Fix name space pollution.
|
||||
|
||||
- Allow using different extra import libraries for debug and release builds.
|
||||
|
||||
- Add manifest stuff to msvc makefile
|
||||
|
||||
- Sync man page with reality
|
||||
|
||||
- Add missing external API decoration for ares_set_socket_callback()
|
||||
|
||||
- Add ares_free_data() man page.
|
||||
|
||||
- - Provide in external interface preprocessor symbol definitions for
|
||||
CARES_HAVE_ARES_FREE_DATA as an indication of function availability.
|
||||
|
||||
- Remove typecast
|
||||
|
||||
- Fix comment
|
||||
|
||||
- Add ares_data.c and ares_data.h
|
||||
|
||||
- Jakub Hrozek modified ares_parse_srv_reply() and ares_parse_txt_reply() API
|
||||
to return a linked lists of results. These were also modified to internally
|
||||
use the ares_data memory struct and as such its result must be free'ed with
|
||||
ares_free_data().
|
||||
|
||||
- Initial support for the generic ares_free_data() function that will allow
|
||||
applications to free memory allocated and returned by some c-ares funtions.
|
||||
|
||||
- Make usage of calloc()'s arguments consistent with rest of code base
|
||||
|
||||
- workaround icc 9.1 optimizer issue
|
||||
|
||||
- Add icc fvisibility bug test
|
||||
|
||||
- Fix icc 9.0 compiler warning: external definition with no prior declaration
|
||||
|
||||
- Fix three var names
|
||||
|
||||
- Add check for assert.h header file
|
||||
|
||||
- getaddrinfo is fully thread safe on solaris versions which
|
||||
implement the function even when h_errno is not a macro.
|
||||
|
||||
The h_errno macro test now only done on systems for which there
|
||||
is no hard coded knowledge about getaddrinfo's thread safeness.
|
||||
|
||||
- Remove files generated on previous buildconf/configure run
|
||||
|
||||
- Remove enable-thread / disable-thread configure option. These were only placebo
|
||||
options. The library is always built as thread safe as possible on every system.
|
||||
|
||||
- Refactor how preprocessor symbol _THREAD_SAFE definition is done.
|
||||
|
||||
- Assume that getaddrinfo is thread safe, unless hard coded
|
||||
knowledge says the contrary or h_errno is not defined.
|
||||
|
||||
- Related with the threadsafe capability of getaddrinfo:
|
||||
|
||||
- Constantine Sapuntzakis reported that Darwin 6.0 a.k.a. MAC OS X 10.2
|
||||
and newer have a threadsafe getaddrinfo.
|
||||
|
||||
- Fix Dragonfly BSD triplet detection.
|
||||
|
||||
- In case the hard-coded knowledge says that getaddrinfo is threadsafe,
|
||||
an additional check is done to verify that h_errno is also defined.
|
||||
If h_errno isn't defined, we finally assume that it isn't threadsafe.
|
||||
Jamie Lokier provided the inspiration for this extra check.
|
||||
|
||||
- AIX 5.2 and newer have threadsafe getaddrinfo.
|
||||
|
||||
Add some comments to better understand what the regex's pretend to achieve.
|
||||
|
||||
- HP-UX 11.11 and later have threadsafe getaddrinfo
|
||||
|
||||
- Check if getaddrinfo is threadsafe when function check allows it to be used
|
||||
|
||||
- Renamed fpGetNetworkParams and fpSystemFunction036 to avoid namespace pollution with static library
|
||||
|
||||
- Add kernel32.lib
|
||||
|
||||
- Mention last changes
|
||||
|
||||
- Reinstate copyright symbol lost in previous commit
|
||||
|
||||
- Make some strings different in resource file for debug or release builds
|
||||
|
||||
- Ignore more subdirs
|
||||
|
||||
- Fix compiler warning: conditional expression is constant
|
||||
|
||||
- Sync linker and resource compiler options with Makefile.msvc
|
||||
|
||||
- Follow Makefile.msvc subdirectory naming scheme, and sync compiler options
|
||||
|
||||
- Updated MSVC makefile that allows building dynamic and static
|
||||
c-ares libraries in debug and release flavours.
|
||||
|
||||
Additionally each of the three sample programs is built against
|
||||
each of the four possible c-ares libraries, generating all this
|
||||
a total number of 12 executables and 4 libraries.
|
||||
|
||||
- Test for USE_WINSOCK since it is more restrictive than WIN32
|
||||
|
||||
- Make header inclusion depend on HAVE_*_H definition
|
||||
|
||||
- Remove unneeded preprocessor directives
|
||||
|
||||
- Adjust c-ares include paths for memory tracking enabled (--enable-curldebug) builds
|
||||
|
||||
- source files used by sample programs
|
||||
|
||||
- Renamed c-ares setup.h to ares_setup.h
|
||||
|
||||
- Adjust include paths to take in account that currently:
|
||||
|
||||
c-ares with --enable-curldebug uses memdebug.h from libcurl's lib subdirectory.
|
||||
|
||||
memdebug.h needs access to libcurl's setup.h from libcurl's lib subdirectory
|
||||
and also needs access to libcurl's generated curl_config.h
|
||||
Vendored
+15
-4
@@ -8,10 +8,10 @@ INCLUDE (CheckCSourceCompiles)
|
||||
INCLUDE (CheckStructHasMember)
|
||||
INCLUDE (CheckLibraryExists)
|
||||
|
||||
PROJECT (c-ares LANGUAGES C VERSION "1.18.0" )
|
||||
PROJECT (c-ares LANGUAGES C VERSION "1.19.0" )
|
||||
|
||||
# Set this version before release
|
||||
SET (CARES_VERSION "1.18.1")
|
||||
SET (CARES_VERSION "1.19.0")
|
||||
|
||||
INCLUDE (GNUInstallDirs) # include this *AFTER* PROJECT(), otherwise paths are wrong.
|
||||
|
||||
@@ -26,7 +26,7 @@ INCLUDE (GNUInstallDirs) # include this *AFTER* PROJECT(), otherwise paths are w
|
||||
# For example, a version of 4:0:2 would generate output such as:
|
||||
# libname.so -> libname.so.2
|
||||
# libname.so.2 -> libname.so.2.2.0
|
||||
SET (CARES_LIB_VERSIONINFO "7:1:5")
|
||||
SET (CARES_LIB_VERSIONINFO "8:0:6")
|
||||
|
||||
|
||||
OPTION (CARES_STATIC "Build as a static library" OFF)
|
||||
@@ -82,9 +82,14 @@ SET (TARGETS_INST_DEST
|
||||
|
||||
# Function in Library
|
||||
# CHECK_LIBRARY_EXISTS can't be used as it will return true if the function
|
||||
# is found in a different dependent library.
|
||||
# is found in a different required/dependent library.
|
||||
MACRO (CARES_FUNCTION_IN_LIBRARY func lib var)
|
||||
|
||||
SET (_ORIG_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
|
||||
SET (CMAKE_REQUIRED_LIBRARIES )
|
||||
CHECK_FUNCTION_EXISTS ("${func}" "_CARES_FUNC_IN_LIB_GLOBAL_${func}")
|
||||
SET (CMAKE_REQUIRED_LIBRARIES "${_ORIG_CMAKE_REQUIRED_LIBRARIES}")
|
||||
|
||||
IF ("${_CARES_FUNC_IN_LIB_GLOBAL_${func}}")
|
||||
SET (${var} FALSE)
|
||||
ELSE ()
|
||||
@@ -689,6 +694,12 @@ IF (CARES_INSTALL)
|
||||
if( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
|
||||
|
||||
if ( "${CPACK_PACKAGE_ARCHITECTURE}" STREQUAL "" )
|
||||
set( CPACK_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}" )
|
||||
endif()
|
||||
if ( "${CPACK_PACKAGE_ARCHITECTURE}" STREQUAL "" )
|
||||
if ( "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows" )
|
||||
message( FATAL_ERROR "Failed to determine CPACK_PACKAGE_ARCHITECTURE. Is CMAKE_SYSTEM_PROCESSOR set?" )
|
||||
endif()
|
||||
# Note: the architecture should default to the local architecture, but it
|
||||
# in fact comes up empty. We call `uname -m` to ask the kernel instead.
|
||||
EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE )
|
||||
|
||||
Vendored
+14
@@ -382,6 +382,20 @@ sure that the var `OSTYPE` contains the string 'linux'; set the var
|
||||
`NDKBASE` to point to the base of your Novell NDK; and then type
|
||||
`make -f Makefile.netware` from the top source directory;
|
||||
|
||||
VCPKG
|
||||
=====
|
||||
|
||||
You can build and install c-ares using [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
|
||||
|
||||
```sh or powershell
|
||||
git clone https://github.com/Microsoft/vcpkg.git
|
||||
cd vcpkg
|
||||
./bootstrap-vcpkg.sh
|
||||
./vcpkg integrate install
|
||||
./vcpkg install c-ares
|
||||
```
|
||||
|
||||
The c-ares port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
|
||||
|
||||
PORTS
|
||||
=====
|
||||
|
||||
Vendored
+1
@@ -297,6 +297,7 @@ EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GCOV = @GCOV@
|
||||
GENHTML = @GENHTML@
|
||||
GREP = @GREP@
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@ c-ares
|
||||
|
||||
[](https://cirrus-ci.com/github/c-ares/c-ares)
|
||||
[](https://ci.appveyor.com/project/c-ares/c-ares/branch/master)
|
||||
[](https://coveralls.io/github/c-ares/c-ares?branch=master)
|
||||
[](https://coveralls.io/github/c-ares/c-ares)
|
||||
[](https://bestpractices.coreinfrastructure.org/projects/291)
|
||||
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:c-ares)
|
||||
[](https://coderelease.io/github/repository/c-ares/c-ares)
|
||||
|
||||
Vendored
+78
-72
@@ -1,85 +1,91 @@
|
||||
c-ares version 1.18.1
|
||||
|
||||
This is an urgent bugfix release for a regression made in 1.18.0.
|
||||
|
||||
Bug fixes:
|
||||
o ares_getaddrinfo() would return ai_addrlen of 16 for ipv6
|
||||
adddresses rather than the sizeof(struct sockaddr_in6)
|
||||
|
||||
|
||||
|
||||
c-ares version 1.18.0
|
||||
c-ares version 1.19.0
|
||||
|
||||
This is a feature and bugfix release. It addresses a couple of new feature
|
||||
requests as well as a couple of bug fixes.
|
||||
|
||||
Security:
|
||||
o Low. Stack overflow in ares_set_sortlist() which is used during c-ares
|
||||
initialization and typically provided by an administrator and not an
|
||||
end user. [24]
|
||||
|
||||
Changes:
|
||||
o Add support for URI(Uniform Resource Identifier) records via
|
||||
ares_parse_uri_reply() [1]
|
||||
o Provide ares_nameser.h as a public interface as needed by NodeJS [5]
|
||||
o Update URLs from c-ares.haxx.se to c-ares.org [9]
|
||||
o During a domain search, treat ARES_ENODATA as ARES_NXDOMAIN so that the
|
||||
search process will continue to the next domain in the search. [11]
|
||||
o Turn ares_gethostbyname() into a wrapper for ares_getaddrinfo() as they
|
||||
followed very similar code paths and ares_gethostbyaddr() has some more
|
||||
desirable features such as priority sorting and parallel queries for
|
||||
AF_UNSPEC. [12]
|
||||
o ares_getaddrinfo() now contains a name element in the address info
|
||||
structure as the last element. This is not an API or ABI break due to
|
||||
the structure always being internally allocated and it being the last
|
||||
element. [12]
|
||||
o ares_parse_a_reply() and ares_parse_aaaa_reply() were nearly identical, those
|
||||
now use the same helper functions for parsing rather than having their own
|
||||
code. [12]
|
||||
o RFC6761 Section 6.3 says "localhost" lookups need to be special cased to
|
||||
return loopback addresses, and not forward queries to recursive dns servers.
|
||||
On Windows this now returns all loopback addresses, on other systems it
|
||||
returns 127.0.0.1 or ::1 always, and will never forward a request for
|
||||
"localhost" to outside DNS servers. [13]
|
||||
o Haiki: port [14]
|
||||
o Windows: Drop support for XP and derivatives which greatly cleans up
|
||||
initialization code. [3]
|
||||
o Add ARES_OPT_HOSTS_FILE similar to ARES_OPT_RESOLVCONF for specifying a
|
||||
custom hosts file location. [10]
|
||||
o Add vcpkg installation instructions [13]
|
||||
|
||||
Bug fixes:
|
||||
o add build to .gitignore [2]
|
||||
o z/OS minor update, add missing semicolon in ares_init.c [3]
|
||||
o Fix building when latest ax_code_coverage.m4 is imported [4]
|
||||
o Work around autotools 'error: too many loops' and other newer autotools
|
||||
import related bugs.
|
||||
o MinGW cross builds need advapi32 link as lower case [6]
|
||||
o Cygwin build fix due to containing both socket.h and winsock2.h [7]
|
||||
o ares_expand_name should allow underscores (_) as SRV records legitimately use
|
||||
them [8]
|
||||
o Allow '/' as a valid character for a returned name for CNAME in-addr.arpa
|
||||
delegation [10]
|
||||
o ares_getaddrinfo() was not honoring HOSTALIASES [12]
|
||||
o ares_getaddrinfo() had some test cases disabled due to a bug in the test
|
||||
framework itself which has now been resolved [12]
|
||||
o Due to Travis-CI becoming unfriendly to open-source, Cirrus-CI has now been
|
||||
brought online for automated unit testing.
|
||||
o Fix cross-compilation from Windows to Linux due to CPACK logic. [1]
|
||||
o Fix memory leak in reading /etc/hosts when using localhost fallback. [2]
|
||||
o Fix chain building c-ares when libresolv is already included by another
|
||||
project [4]
|
||||
o File lookup should not immediately abort as there may be other tries due to
|
||||
search criteria.
|
||||
o Asterisks should be allowed in host validation as CNAMEs may reference
|
||||
wildcard domains [5]
|
||||
o AutoTools build system referenced bad STDC_HEADERS macro [6]
|
||||
o Even if one address class returns a failure for ares_getaddrinfo() we should
|
||||
still return the results we have
|
||||
o CMake Windows: DLLs did not include resource file to include versions [7] [8]
|
||||
o CMake: Guard target creation in exported config [9]
|
||||
o Fix ares_getaddrinfo() numerical address resolution with AF_UNSPEC [11]
|
||||
o Apple: fix libresolv configured query times. [12]
|
||||
o Fix tools and help information [14] [15]
|
||||
o Various documentation fixes and cleanups [16] [22] [25]
|
||||
o Add include guards to ares_data.h [17]
|
||||
o c-ares could try to exceed maximum number of iovec entries supported by
|
||||
system [18]
|
||||
o CMake package config generation allow for absolute install paths [19]
|
||||
o Intel compiler fixes [20]
|
||||
o ares_strsplit bugs [21] [23]
|
||||
o The RFC6761 6.3 states localhost subdomains must be offline too. [26]
|
||||
|
||||
Thanks go to these friendly people for their efforts and contributions:
|
||||
Biswapriyo Nath (@Biswa96)
|
||||
Boby Reynolds (@reynoldsbd)
|
||||
Brad House (@bradh352)
|
||||
Daniel Bevenius (@danbev)
|
||||
Brad Spencer (@b-spencer)
|
||||
@bsergean
|
||||
Daniel Stenberg (@bagder)
|
||||
Dhrumil Rana (@dhrumilrana)
|
||||
Felix Yan (@felixonmars)
|
||||
Jérôme Duval (@korli)
|
||||
Martin Holeš (@martin-256)
|
||||
Sinan Kaya
|
||||
(9 contributors)
|
||||
Dmitry Karpov
|
||||
@FrankXie05
|
||||
@hopper-vul
|
||||
Jonathan Ringer (@jonringer)
|
||||
Kai Pastor (@dg0yt)
|
||||
@lifenjoiner
|
||||
Manish Mehra (@mmehra)
|
||||
@marc-groundctl
|
||||
Nikolaos Chatzikonstantinou (@createyourpersonalaccount)
|
||||
Ridge Kennedy (@ridgek)
|
||||
Sam James (@thesamesam)
|
||||
Stephen Sachs (@stephenmsachs)
|
||||
Thomas Dreibholz (@dreibh)
|
||||
(18 contributors)
|
||||
|
||||
References to bug reports and discussions on issues:
|
||||
[1] = https://github.com/c-ares/c-ares/pull/411
|
||||
[2] = https://github.com/c-ares/c-ares/pull/410
|
||||
[3] = https://github.com/c-ares/c-ares/pull/414
|
||||
[4] = https://github.com/c-ares/c-ares/pull/418
|
||||
[5] = https://github.com/c-ares/c-ares/pull/417
|
||||
[6] = https://github.com/c-ares/c-ares/pull/420
|
||||
[7] = https://github.com/c-ares/c-ares/pull/422
|
||||
[8] = https://github.com/c-ares/c-ares/issues/424
|
||||
[9] = https://github.com/c-ares/c-ares/issues/423
|
||||
[10] = https://github.com/c-ares/c-ares/issues/427
|
||||
[11] = https://github.com/c-ares/c-ares/issues/426
|
||||
[12] = https://github.com/c-ares/c-ares/pull/428
|
||||
[13] = https://github.com/c-ares/c-ares/pull/430
|
||||
[14] = https://github.com/c-ares/c-ares/pull/431
|
||||
[1] = https://github.com/c-ares/c-ares/pull/436
|
||||
[2] = https://github.com/c-ares/c-ares/issues/439
|
||||
[3] = https://github.com/c-ares/c-ares/pull/445
|
||||
[4] = https://github.com/c-ares/c-ares/pull/451
|
||||
[5] = https://github.com/c-ares/c-ares/issues/457
|
||||
[6] = https://github.com/c-ares/c-ares/pull/459
|
||||
[7] = https://github.com/c-ares/c-ares/issues/460
|
||||
[8] = https://github.com/c-ares/c-ares/pull/468
|
||||
[9] = https://github.com/c-ares/c-ares/pull/464
|
||||
[10] = https://github.com/c-ares/c-ares/pull/465
|
||||
[11] = https://github.com/c-ares/c-ares/pull/469
|
||||
[12] = https://github.com/c-ares/c-ares/pull/467
|
||||
[13] = https://github.com/c-ares/c-ares/pull/478
|
||||
[14] = https://github.com/c-ares/c-ares/pull/479
|
||||
[15] = https://github.com/c-ares/c-ares/pull/481
|
||||
[16] = https://github.com/c-ares/c-ares/pull/490
|
||||
[17] = https://github.com/c-ares/c-ares/pull/491
|
||||
[18] = https://github.com/c-ares/c-ares/pull/489
|
||||
[19] = https://github.com/c-ares/c-ares/pull/486
|
||||
[20] = https://github.com/c-ares/c-ares/pull/485
|
||||
[21] = https://github.com/c-ares/c-ares/pull/492
|
||||
[22] = https://github.com/c-ares/c-ares/pull/494
|
||||
[23] = https://github.com/c-ares/c-ares/pull/495
|
||||
[24] = https://github.com/c-ares/c-ares/pull/497
|
||||
[25] = https://github.com/c-ares/c-ares/issues/487
|
||||
[26] = https://github.com/c-ares/c-ares/issues/477
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
|
||||
# aminclude_static.am generated automatically by Autoconf
|
||||
# from AX_AM_MACROS_STATIC on Wed Oct 27 08:06:13 CEST 2021
|
||||
# from AX_AM_MACROS_STATIC on Sat Jan 28 22:07:59 CET 2023
|
||||
|
||||
|
||||
# Code coverage
|
||||
|
||||
Vendored
+8
-5
@@ -8,14 +8,17 @@ include("${CMAKE_CURRENT_LIST_DIR}/c-ares-targets.cmake")
|
||||
set(c-ares_LIBRARY c-ares::cares)
|
||||
|
||||
if(@CARES_SHARED@)
|
||||
add_library(c-ares::cares_shared INTERFACE IMPORTED)
|
||||
set_target_properties(c-ares::cares_shared PROPERTIES INTERFACE_LINK_LIBRARIES "c-ares::cares")
|
||||
if(NOT TARGET c-ares::cares_shared)
|
||||
add_library(c-ares::cares_shared INTERFACE IMPORTED)
|
||||
set_target_properties(c-ares::cares_shared PROPERTIES INTERFACE_LINK_LIBRARIES "c-ares::cares")
|
||||
endif()
|
||||
set(c-ares_SHARED_LIBRARY c-ares::cares_shared)
|
||||
elseif(@CARES_STATIC@)
|
||||
add_library(c-ares::cares_static INTERFACE IMPORTED)
|
||||
set_target_properties(c-ares::cares_static PROPERTIES INTERFACE_LINK_LIBRARIES "c-ares::cares")
|
||||
endif()
|
||||
|
||||
if(@CARES_STATIC@)
|
||||
if(NOT TARGET c-ares::cares_static)
|
||||
add_library(c-ares::cares_static INTERFACE IMPORTED)
|
||||
set_target_properties(c-ares::cares_static PROPERTIES INTERFACE_LINK_LIBRARIES "c-ares::cares")
|
||||
endif()
|
||||
set(c-ares_STATIC_LIBRARY c-ares::cares_static)
|
||||
endif()
|
||||
Vendored
+887
-613
File diff suppressed because it is too large.
Load diff
Vendored
+1472
-1383
File diff suppressed because it is too large.
Load diff
Vendored
+347
-127
File diff suppressed because it is too large.
Load diff
Vendored
+3
-3
@@ -1,9 +1,9 @@
|
||||
AC_PREREQ([2.60])
|
||||
|
||||
AC_INIT([c-ares], [1.18.1],
|
||||
AC_INIT([c-ares], [1.19.0],
|
||||
[c-ares mailing list: http://lists.haxx.se/listinfo/c-ares])
|
||||
|
||||
CARES_VERSION_INFO="7:1:5"
|
||||
CARES_VERSION_INFO="8:0:6"
|
||||
dnl This flag accepts an argument of the form current[:revision[:age]]. So,
|
||||
dnl passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
|
||||
dnl 1.
|
||||
@@ -493,7 +493,7 @@ dnl Back to "normal" configuring
|
||||
dnl **********************************************************************
|
||||
|
||||
dnl Checks for header files.
|
||||
STDC_HEADERS
|
||||
AC_HEADER_STDC
|
||||
|
||||
AC_PROG_EGREP
|
||||
|
||||
|
||||
Vendored
+1
@@ -224,6 +224,7 @@ EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GCOV = @GCOV@
|
||||
GENHTML = @GENHTML@
|
||||
GREP = @GREP@
|
||||
|
||||
Vendored
+1
-1
@@ -17,7 +17,7 @@ This utility comes with the \fBc\-ares\fR asynchronous resolver library.
|
||||
\fB\-d\fR
|
||||
Print some extra debugging output.
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
\fB\-h\fR, \fB\-?\fR
|
||||
Display this help and exit.
|
||||
.TP
|
||||
\fB\-v\fR
|
||||
|
||||
Vendored
+15
-9
@@ -18,34 +18,40 @@ This utility comes with the \fBc\-ares\fR asynchronous resolver library.
|
||||
\fB\-c\fR class
|
||||
Set the query class.
|
||||
Possible values for class are
|
||||
NY, CHAOS, HS, IN (default).
|
||||
ANY, CHAOS, HS and IN (default).
|
||||
.TP
|
||||
\fB\-d\fR
|
||||
Print some extra debugging output.
|
||||
.TP
|
||||
\fB\-f\fR flag
|
||||
Add a flag.
|
||||
Add a behavior control flag.
|
||||
Possible values for flag are
|
||||
igntc, noaliases, norecurse, primary, stayopen, usevc.
|
||||
igntc - ignore to query in TCP to get truncated UDP answer,
|
||||
noaliases - don't honor the HOSTALIASES environment variable,
|
||||
norecurse - don't query upstream servers recursively,
|
||||
primary - use the first server,
|
||||
stayopen - don't close the communication sockets, and
|
||||
usevc - always use TCP.
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
\fB\-h\fR, \fB\-?\fR
|
||||
Display this help and exit.
|
||||
.TP
|
||||
\fB\-T\fR port
|
||||
Use specified TCP port to connect to DNS server.
|
||||
.TP
|
||||
\fB\-s\fR server
|
||||
Connect to specified DNS server, instead of the system's default one(s).
|
||||
Servers are tried in round-robin, if the previous one failed.
|
||||
.TP
|
||||
\fB\-t\fR type
|
||||
Query records of specified type.
|
||||
Possible values for type are
|
||||
A (default), AAAA, AFSDB, ANY, AXFR, CNAME, GPOS, HINFO, ISDN, KEY, LOC, MAILA,
|
||||
MAILB, MB, MD, MF, MG, MINFO, MR, MX, NAPTR, NS, NSAP, NSAP_PTR, NULL,
|
||||
PTR, PX, RP, RT, SIG, SOA, SRV, TXT, URI, WKS, X25,
|
||||
PTR, PX, RP, RT, SIG, SOA, SRV, TXT, URI, WKS and X25.
|
||||
.TP
|
||||
\fB\-T\fR port
|
||||
Connect to the specified TCP port of DNS server.
|
||||
.TP
|
||||
\fB\-U\fR port
|
||||
Use specified UDP port to connect to DNS server.
|
||||
Connect to the specified UDP port of DNS server.
|
||||
.TP
|
||||
\fB\-x\fR
|
||||
For an IPv4 \fB-t PTR a.b.c.d\fR lookup, query for
|
||||
|
||||
Vendored
+1
-1
@@ -17,7 +17,7 @@ This utility comes with the \fBc\-ares\fR asynchronous resolver library.
|
||||
\fB\-d\fR
|
||||
Print some extra debugging output.
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
\fB\-h\fR, \fB\-?\fR
|
||||
Display this help and exit.
|
||||
.TP
|
||||
\fB\-t\fR type
|
||||
|
||||
+3
-3
@@ -18,9 +18,9 @@
|
||||
ares_destroy_options \- Destroy options initialized with ares_save_options
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B void ares_destroy_options(struct ares_options *\fIoptions\fP)
|
||||
#include <ares.h>
|
||||
|
||||
void ares_destroy_options(struct ares_options *\fIoptions\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_destroy_options(3)\fP function destroys the options struct
|
||||
|
||||
Vendored
+3
-3
@@ -18,9 +18,9 @@
|
||||
ares_dup \- Duplicate a resolver channel
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_dup(ares_channel *\fIdest\fP, ares_channel \fIsource\fP)
|
||||
#include <ares.h>
|
||||
|
||||
int ares_dup(ares_channel *\fIdest\fP, ares_channel \fIsource\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_dup(3)\fP function duplicates an existing communications channel
|
||||
|
||||
Vendored
+5
-5
@@ -18,11 +18,11 @@
|
||||
ares_expand_name \- Expand a DNS-encoded domain name
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_expand_name(const unsigned char *\fIencoded\fP,
|
||||
.B const unsigned char *\fIabuf\fP, int \fIalen\fP, char **\fIs\fP,
|
||||
.B long *\fIenclen\fP)
|
||||
#include <ares.h>
|
||||
|
||||
int ares_expand_name(const unsigned char *\fIencoded\fP,
|
||||
const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
char **\fIs\fP, long *\fIenclen\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
Vendored
+5
-5
@@ -18,11 +18,11 @@
|
||||
ares_expand_string \- Expand a length encoded string
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_expand_string(const unsigned char *\fIencoded\fP,
|
||||
.B const unsigned char *\fIabuf\fP, int \fIalen\fP, unsigned char **\fIs\fP,
|
||||
.B long *\fIenclen\fP)
|
||||
#include <ares.h>
|
||||
|
||||
int ares_expand_string(const unsigned char *\fIencoded\fP,
|
||||
const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
unsigned char **\fIs\fP, long *\fIenclen\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
Vendored
+3
-5
@@ -19,11 +19,9 @@
|
||||
ares_free_data \- Free data allocated by several c-ares functions
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B void ares_free_data(void *\fIdataptr\fP)
|
||||
.PP
|
||||
.B cc file.c -lcares
|
||||
#include <ares.h>
|
||||
|
||||
void ares_free_data(void *\fIdataptr\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
|
||||
Vendored
+3
-3
@@ -18,9 +18,9 @@
|
||||
ares_free_hostent \- Free host structure allocated by ares functions
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B void ares_free_hostent(struct hostent *\fIhost\fP)
|
||||
#include <ares.h>
|
||||
|
||||
void ares_free_hostent(struct hostent *\fIhost\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
Vendored
+3
-3
@@ -18,9 +18,9 @@
|
||||
ares_free_string \- Free strings allocated by ares functions
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B void ares_free_string(void *\fIstr\fP)
|
||||
#include <ares.h>
|
||||
|
||||
void ares_free_string(void *\fIstr\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fIares_free_string(3)\fP function frees a string allocated by an ares
|
||||
|
||||
Vendored
+7
-4
@@ -19,10 +19,13 @@
|
||||
ares_get_servers, ares_get_servers_ports \- Retrieve name servers from an initialized ares_channel
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_get_servers(ares_channel \fIchannel\fP, struct ares_addr_node **\fIservers\fP)
|
||||
.B int ares_get_servers_ports(ares_channel \fIchannel\fP, struct ares_addr_port_node **\fIservers\fP)
|
||||
#include <ares.h>
|
||||
|
||||
int ares_get_servers(ares_channel \fIchannel\fP,
|
||||
struct ares_addr_node **\fIservers\fP)
|
||||
|
||||
int ares_get_servers_ports(ares_channel \fIchannel\fP,
|
||||
struct ares_addr_port_node **\fIservers\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_get_servers(3)\fP function retrieves name servers configuration
|
||||
|
||||
Vendored
+10
-8
@@ -18,14 +18,16 @@
|
||||
ares_getaddrinfo \- Initiate a host query by name and service
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B typedef void (*ares_addrinfo_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
.B int \fItimeouts\fP, struct ares_addrinfo *\fIresult\fP)
|
||||
.PP
|
||||
.B void ares_getaddrinfo(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||
.B const char* \fIservice\fP, const struct ares_addrinfo_hints *\fIhints\fP,
|
||||
.B ares_addrinfo_callback \fIcallback\fP, void *\fIarg\fP)
|
||||
#include <ares.h>
|
||||
|
||||
typedef void (*ares_addrinfo_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
int \fItimeouts\fP,
|
||||
struct ares_addrinfo *\fIresult\fP)
|
||||
|
||||
void ares_getaddrinfo(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||
const char* \fIservice\fP,
|
||||
const struct ares_addrinfo_hints *\fIhints\fP,
|
||||
ares_addrinfo_callback \fIcallback\fP, void *\fIarg\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
Vendored
+9
-8
@@ -18,14 +18,15 @@
|
||||
ares_gethostbyaddr \- Initiate a host query by address
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B typedef void (*ares_host_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
.B int \fItimeouts\fP, struct hostent *\fIhostent\fP)
|
||||
.PP
|
||||
.B void ares_gethostbyaddr(ares_channel \fIchannel\fP, const void *\fIaddr\fP,
|
||||
.B int \fIaddrlen\fP, int \fIfamily\fP, ares_host_callback \fIcallback\fP,
|
||||
.B void *\fIarg\fP)
|
||||
#include <ares.h>
|
||||
|
||||
typedef void (*ares_host_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
int \fItimeouts\fP,
|
||||
struct hostent *\fIhostent\fP)
|
||||
|
||||
void ares_gethostbyaddr(ares_channel \fIchannel\fP, const void *\fIaddr\fP,
|
||||
int \fIaddrlen\fP, int \fIfamily\fP,
|
||||
ares_host_callback \fIcallback\fP, void *\fIarg\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
Vendored
+9
-7
@@ -18,13 +18,15 @@
|
||||
ares_gethostbyname \- Initiate a host query by name
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B typedef void (*ares_host_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
.B int \fItimeouts\fP, struct hostent *\fIhostent\fP)
|
||||
.PP
|
||||
.B void ares_gethostbyname(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||
.B int \fIfamily\fP, ares_host_callback \fIcallback\fP, void *\fIarg\fP)
|
||||
#include <ares.h>
|
||||
|
||||
typedef void (*ares_host_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
int \fItimeouts\fP,
|
||||
struct hostent *\fIhostent\fP)
|
||||
|
||||
void ares_gethostbyname(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||
int \fIfamily\fP, ares_host_callback \fIcallback\fP,
|
||||
void *\fIarg\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
+4
-4
@@ -18,10 +18,10 @@
|
||||
ares_gethostbyname_file \- Lookup a name in the system's hosts file
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_gethostbyname_file(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||
.B int \fIfamily\fP, struct hostent **host)
|
||||
#include <ares.h>
|
||||
|
||||
int ares_gethostbyname_file(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||
int \fIfamily\fP, struct hostent **host)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
Vendored
+9
-8
@@ -18,14 +18,15 @@
|
||||
ares_getnameinfo \- Address-to-nodename translation in protocol-independent manner
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B typedef void (*ares_nameinfo_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
.B int \fItimeouts\fP, char *\fInode\fP, char *\fIservice\fP)
|
||||
.PP
|
||||
.B void ares_getnameinfo(ares_channel \fIchannel\fP, const struct sockaddr *\fIsa\fP,
|
||||
.B ares_socklen_t \fIsalen\fP, int \fIflags\fP, ares_nameinfo_callback \fIcallback\fP,
|
||||
.B void *\fIarg\fP)
|
||||
#include <ares.h>
|
||||
|
||||
typedef void (*ares_nameinfo_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
int \fItimeouts\fP, char *\fInode\fP,
|
||||
char *\fIservice\fP)
|
||||
|
||||
void ares_getnameinfo(ares_channel \fIchannel\fP, const struct sockaddr *\fIsa\fP,
|
||||
ares_socklen_t \fIsalen\fP, int \fIflags\fP,
|
||||
ares_nameinfo_callback \fIcallback\fP, void *\fIarg\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
Vendored
+4
-4
@@ -18,10 +18,10 @@
|
||||
ares_getsock \- get socket descriptors to wait on
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_getsock(ares_channel \fIchannel\fP, ares_socket_t *\fIsocks\fP,
|
||||
.B int \fInumsocks\fP);
|
||||
#include <ares.h>
|
||||
|
||||
int ares_getsock(ares_channel \fIchannel\fP, ares_socket_t *\fIsocks\fP,
|
||||
int \fInumsocks\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
Vendored
+4
-4
@@ -18,10 +18,10 @@
|
||||
ares_inet_ntop \- convert a network format address to presentation format
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B const char *
|
||||
.B ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size);
|
||||
#include <ares.h>
|
||||
|
||||
const char *ares_inet_ntop(int \fIaf\fP, const void *\fIsrc\fP, char *\fIdst\fP,
|
||||
ares_socklen_t \fIsize\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
This is a portable version with the identical functionality of the commonly
|
||||
|
||||
Vendored
+3
-3
@@ -18,9 +18,9 @@
|
||||
ares_inet_pton \- convert an IPv4 or IPv6 address from text to binary form
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B const char *ares_inet_pton(int af, const char *src, void *dst);
|
||||
#include <ares.h>
|
||||
|
||||
const char *ares_inet_pton(int \fIaf\fP, const char *\fIsrc\fP, void *\fIdst\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
This is a portable version with the identical functionality of the commonly
|
||||
|
||||
Vendored
+15
-6
@@ -41,6 +41,7 @@ struct ares_options {
|
||||
int nsort;
|
||||
int ednspsz;
|
||||
char *resolvconf_path;
|
||||
char *hosts_path;
|
||||
};
|
||||
|
||||
int ares_init_options(ares_channel *\fIchannelptr\fP,
|
||||
@@ -101,16 +102,14 @@ resolv.conf or the RES_OPTIONS environment variable.
|
||||
.B ARES_OPT_UDP_PORT
|
||||
.B unsigned short \fIudp_port\fP;
|
||||
.br
|
||||
The port to use for queries over UDP, in network byte order.
|
||||
The default value is 53 (in network byte order), the standard name
|
||||
service port.
|
||||
The port to use for queries over UDP, in host byte order.
|
||||
The default value is 53, the standard name service port.
|
||||
.TP 18
|
||||
.B ARES_OPT_TCP_PORT
|
||||
.B unsigned short \fItcp_port\fP;
|
||||
.br
|
||||
The port to use for queries over TCP, in network byte order.
|
||||
The default value is 53 (in network byte order), the standard name
|
||||
service port.
|
||||
The port to use for queries over TCP, in host byte order.
|
||||
The default value is 53, the standard name service port.
|
||||
.TP 18
|
||||
.B ARES_OPT_SERVERS
|
||||
.B struct in_addr *\fIservers\fP;
|
||||
@@ -195,6 +194,16 @@ should be set to a path string, and will be honoured on *nix like systems. The
|
||||
default is
|
||||
.B /etc/resolv.conf
|
||||
.br
|
||||
.TP 18
|
||||
.B ARES_OPT_HOSTS_FILE
|
||||
.B char *\fIhosts_path\fP;
|
||||
.br
|
||||
The path to use for reading the hosts file. The
|
||||
.I hosts_path
|
||||
should be set to a path string, and will be honoured on *nix like systems. The
|
||||
default is
|
||||
.B /etc/hosts
|
||||
.br
|
||||
.PP
|
||||
The \fIoptmask\fP parameter also includes options without a corresponding
|
||||
field in the
|
||||
|
||||
Vendored
+2
-1
@@ -79,7 +79,8 @@ DllMain function. Doing so will produce deadlocks and other problems.
|
||||
Initialize everything possible. This sets all known bits.
|
||||
.TP
|
||||
.B ARES_LIB_INIT_WIN32
|
||||
Initialize Win32/64 specific libraries.
|
||||
Initialize Win32/64 specific libraries. As of c-ares 1.19.0, this is ignored
|
||||
as there are no currently dynamically loaded libraries.
|
||||
.TP
|
||||
.B ARES_LIB_INIT_NONE
|
||||
Initialize nothing extra. This sets no bit.
|
||||
|
||||
Vendored
+5
-5
@@ -18,11 +18,11 @@
|
||||
ares_mkquery \- Compose a single-question DNS query buffer
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_mkquery(const char *\fIname\fP, int \fIdnsclass\fP, int \fItype\fP,
|
||||
.B unsigned short \fIid\fP, int \fIrd\fP, unsigned char **\fIbuf\fP,
|
||||
.B int *\fIbuflen\fP)
|
||||
#include <ares.h>
|
||||
|
||||
int ares_mkquery(const char *\fIname\fP, int \fIdnsclass\fP, int \fItype\fP,
|
||||
unsigned short \fIid\fP, int \fIrd\fP, unsigned char **\fIbuf\fP,
|
||||
int *\fIbuflen\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Deprecated function. See \fIares_create_query(3)\fP instead!
|
||||
|
||||
Vendored
+5
-5
@@ -18,11 +18,11 @@
|
||||
ares_parse_a_reply \- Parse a reply to a DNS query of type A
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_a_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
.B struct hostent **\fIhost\fP,
|
||||
.B struct ares_addrttl *\fIaddrttls\fP, int *\fInaddrttls\fP);
|
||||
#include <ares.h>
|
||||
|
||||
int ares_parse_a_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
struct hostent **\fIhost\fP,
|
||||
struct ares_addrttl *\fIaddrttls\fP, int *\fInaddrttls\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
+5
-5
@@ -18,11 +18,11 @@
|
||||
ares_parse_aaaa_reply \- Parse a reply to a DNS query of type AAAA
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_aaaa_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
.B struct hostent **\fIhost\fP,
|
||||
.B struct ares_addr6ttl *\fIaddrttls\fP, int *\fInaddrttls\fP);
|
||||
#include <ares.h>
|
||||
|
||||
int ares_parse_aaaa_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
struct hostent **\fIhost\fP,
|
||||
struct ares_addr6ttl *\fIaddrttls\fP, int *\fInaddrttls\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
+4
-5
@@ -17,11 +17,10 @@
|
||||
.SH NAME
|
||||
ares_parse_mx_reply \- Parse a reply to a DNS query of type MX
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_mx_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
.B struct ares_mx_reply** \fImx_out\fP);
|
||||
#include <ares.h>
|
||||
|
||||
int ares_parse_mx_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
struct ares_mx_reply** \fImx_out\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
+4
-4
@@ -18,10 +18,10 @@
|
||||
ares_parse_naptr_reply \- Parse a reply to a DNS query of type NAPTR
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_naptr_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
.B struct ares_naptr_reply** \fInaptr_out\fP);
|
||||
#include <ares.h>
|
||||
|
||||
int ares_parse_naptr_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
struct ares_naptr_reply** \fInaptr_out\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
+4
-4
@@ -18,10 +18,10 @@
|
||||
ares_parse_ns_reply \- Parse a reply to a DNS query of type NS into a hostent
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_ns_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
.B struct hostent **\fIhost\fP);
|
||||
#include <ares.h>
|
||||
|
||||
int ares_parse_ns_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
struct hostent **\fIhost\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
+5
-5
@@ -18,11 +18,11 @@
|
||||
ares_parse_ptr_reply \- Parse a reply to a DNS query of type PTR into a hostent
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_ptr_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
.B const void *\fIaddr\fP, int \fIaddrlen\fP, int \fIfamily\fP,
|
||||
.B struct hostent **\fIhost\fP);
|
||||
#include <ares.h>
|
||||
|
||||
int ares_parse_ptr_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
const void *\fIaddr\fP, int \fIaddrlen\fP,
|
||||
int \fIfamily\fP, struct hostent **\fIhost\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
+4
-4
@@ -18,10 +18,10 @@
|
||||
ares_parse_soa_reply \- Parse a reply to a DNS query of type SOA
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_soa_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
.B struct ares_soa_reply** \fIsoa_out\fP);
|
||||
#include <ares.h>
|
||||
|
||||
int ares_parse_soa_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
struct ares_soa_reply** \fIsoa_out\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
+4
-4
@@ -18,10 +18,10 @@
|
||||
ares_parse_srv_reply \- Parse a reply to a DNS query of type SRV
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_srv_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
.B struct ares_srv_reply** \fIsrv_out\fP);
|
||||
#include <ares.h>
|
||||
|
||||
int ares_parse_srv_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
struct ares_srv_reply** \fIsrv_out\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
+7
-7
@@ -18,13 +18,13 @@
|
||||
ares_parse_txt_reply \- Parse a reply to a DNS query of type TXT
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_txt_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
.B struct ares_txt_reply **\fItxt_out\fP);
|
||||
.PP
|
||||
.B int ares_parse_txt_reply_ext(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
.B struct ares_txt_ext **\fItxt_out\fP);
|
||||
#include <ares.h>
|
||||
|
||||
int ares_parse_txt_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
struct ares_txt_reply **\fItxt_out\fP);
|
||||
|
||||
int ares_parse_txt_reply_ext(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
struct ares_txt_ext **\fItxt_out\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
+4
-4
@@ -18,10 +18,10 @@
|
||||
ares_parse_uri_reply \- Parse a reply to a DNS query of type URI
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_uri_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
.B struct ares_uri_reply** \fIuri_out\fP);
|
||||
#include <ares.h>
|
||||
|
||||
int ares_parse_uri_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
struct ares_uri_reply** \fIuri_out\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
Vendored
+1
-1
@@ -44,7 +44,7 @@ if they complete successfully or fail.
|
||||
\fBares_process_fd(3)\fP works the same way but acts and operates only on the
|
||||
specific file descriptors (sockets) you pass in to the function. Use
|
||||
ARES_SOCKET_BAD for "no action". This function is provided to allow users of
|
||||
c-ares to void \fIselect(3)\fP in their applications and within c-ares.
|
||||
c-ares to avoid \fIselect(3)\fP in their applications and within c-ares.
|
||||
|
||||
To only process possible timeout conditions without a socket event occurring,
|
||||
one may pass NULL as the values for both \fIread_fds\fP and \fIwrite_fds\fP for
|
||||
|
||||
Vendored
+9
-8
@@ -18,14 +18,15 @@
|
||||
ares_query \- Initiate a single-question DNS query
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
.B int \fItimeouts\fP, unsigned char *\fIabuf\fP, int \fIalen\fP)
|
||||
.PP
|
||||
.B void ares_query(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||
.B int \fIdnsclass\fP, int \fItype\fP, ares_callback \fIcallback\fP,
|
||||
.B void *\fIarg\fP)
|
||||
#include <ares.h>
|
||||
|
||||
typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
int \fItimeouts\fP, unsigned char *\fIabuf\fP,
|
||||
int \fIalen\fP)
|
||||
|
||||
void ares_query(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||
int \fIdnsclass\fP, int \fItype\fP,
|
||||
ares_callback \fIcallback\fP, void *\fIarg\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
Vendored
+4
-3
@@ -18,9 +18,10 @@
|
||||
ares_save_options \- Save configuration values obtained from initialized ares_channel
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_save_options(ares_channel \fIchannel\fP, struct ares_options *\fIoptions\fP, int *\fIoptmask\fP)
|
||||
#include <ares.h>
|
||||
|
||||
int ares_save_options(ares_channel \fIchannel\fP,
|
||||
struct ares_options *\fIoptions\fP, int *\fIoptmask\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_save_options(3)\fP function saves the channel data identified by
|
||||
|
||||
Vendored
+9
-8
@@ -18,14 +18,15 @@
|
||||
ares_search \- Initiate a DNS query with domain search
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
.B int \fItimeouts\fP, unsigned char *\fIabuf\fP, int \fIalen\fP)
|
||||
.PP
|
||||
.B void ares_search(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||
.B int \fIdnsclass\fP, int \fItype\fP, ares_callback \fIcallback\fP,
|
||||
.B void *\fIarg\fP)
|
||||
#include <ares.h>
|
||||
|
||||
typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
int \fItimeouts\fP, unsigned char *\fIabuf\fP,
|
||||
int \fIalen\fP)
|
||||
|
||||
void ares_search(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||
int \fIdnsclass\fP, int \fItype\fP,
|
||||
ares_callback \fIcallback\fP, void *\fIarg\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
Vendored
+8
-7
@@ -18,13 +18,14 @@
|
||||
ares_send \- Initiate a DNS query
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
.B int \fItimeouts\fP, unsigned char *\fIabuf\fP, int \fIalen\fP)
|
||||
.PP
|
||||
.B void ares_send(ares_channel \fIchannel\fP, const unsigned char *\fIqbuf\fP,
|
||||
.B int \fIqlen\fP, ares_callback \fIcallback\fP, void *\fIarg\fP)
|
||||
#include <ares.h>
|
||||
|
||||
typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP,
|
||||
int \fItimeouts\fP, unsigned char *\fIabuf\fP,
|
||||
int \fIalen\fP)
|
||||
|
||||
void ares_send(ares_channel \fIchannel\fP, const unsigned char *\fIqbuf\fP,
|
||||
int \fIqlen\fP, ares_callback \fIcallback\fP, void *\fIarg\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
Vendored
+3
-3
@@ -18,9 +18,9 @@
|
||||
ares_set_local_dev \- Bind to a specific network device when creating sockets.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B void ares_set_local_dev(ares_channel \fIchannel\fP, const char* \fIlocal_dev_name\fP)
|
||||
#include <ares.h>
|
||||
|
||||
void ares_set_local_dev(ares_channel \fIchannel\fP, const char* \fIlocal_dev_name\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_set_local_dev\fP function causes all future sockets
|
||||
|
||||
Vendored
+3
-3
@@ -18,9 +18,9 @@
|
||||
ares_set_local_ip4 \- Set local IPv4 address outgoing requests.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B void ares_set_local_ip4(ares_channel \fIchannel\fP, unsigned int \fIlocal_ip\fP)
|
||||
#include <ares.h>
|
||||
|
||||
void ares_set_local_ip4(ares_channel \fIchannel\fP, unsigned int \fIlocal_ip\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_set_local_ip4\fP function sets the IP address for outbound
|
||||
|
||||
Vendored
+7
-7
@@ -18,15 +18,15 @@
|
||||
ares_set_local_ip6 \- Set local IPv6 address outgoing requests.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B void ares_set_local_ip6(ares_channel \fIchannel\fP, const unsigned char* \fIlocal_ip6\fP)
|
||||
#include <ares.h>
|
||||
|
||||
void ares_set_local_ip6(ares_channel \fIchannel\fP, const unsigned char* \fIlocal_ip6\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_set_local_ip6\fP function sets the IPv6 address for outbound
|
||||
IPv6 requests. The parameter \fIlocal_ip6\fP is specified in network byte
|
||||
order. This allows users to specify outbound interfaces when used on
|
||||
multi-homed systems. The local_ip6 argument must be 16 bytes in length.
|
||||
The \fBares_set_local_ip6\fP function sets the IPv6 address for outbound IPv6
|
||||
requests. The parameter \fIlocal_ip6\fP is specified in network byte order.
|
||||
This allows users to specify outbound interfaces when used on multi-homed
|
||||
systems. The \fIlocal_ip6\fP argument must be 16 bytes in length.
|
||||
.SH SEE ALSO
|
||||
.BR ares_set_local_ip4 (3)
|
||||
.SH NOTES
|
||||
|
||||
Vendored
+7
-4
@@ -18,10 +18,13 @@
|
||||
ares_set_servers, ares_set_servers_ports \- Initialize an ares_channel name servers configuration
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_set_servers(ares_channel \fIchannel\fP, struct ares_addr_node *\fIservers\fP)
|
||||
.B int ares_set_servers_ports(ares_channel \fIchannel\fP, struct ares_addr_port_node *\fIservers\fP)
|
||||
#include <ares.h>
|
||||
|
||||
int ares_set_servers(ares_channel \fIchannel\fP,
|
||||
struct ares_addr_node *\fIservers\fP)
|
||||
|
||||
int ares_set_servers_ports(ares_channel \fIchannel\fP,
|
||||
struct ares_addr_port_node *\fIservers\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_set_servers(3)\fP function initializes name servers configuration
|
||||
|
||||
+5
-4
@@ -18,10 +18,11 @@
|
||||
ares_set_servers_csv, ares_set_servers_ports_csv \- Set list of DNS servers to be used.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_set_servers_csv(ares_channel \fIchannel\fP, const char* \fIservers\fP)
|
||||
.B int ares_set_servers_ports_csv(ares_channel \fIchannel\fP, const char* \fIservers\fP)
|
||||
#include <ares.h>
|
||||
|
||||
int ares_set_servers_csv(ares_channel \fIchannel\fP, const char* \fIservers\fP)
|
||||
|
||||
int ares_set_servers_ports_csv(ares_channel \fIchannel\fP, const char* \fIservers\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_set_servers_csv\fP and \fBares_set_servers_ports_csv\fPfunctions set
|
||||
|
||||
+7
-7
@@ -4,15 +4,15 @@
|
||||
ares_set_socket_callback \- Set a socket creation callback
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B typedef int (*ares_sock_create_callback)(ares_socket_t \fIsocket_fd\fP,
|
||||
#include <ares.h>
|
||||
|
||||
typedef int (*ares_sock_create_callback)(ares_socket_t \fIsocket_fd\fP,
|
||||
int \fItype\fP,
|
||||
void *\fIuserdata\fP)
|
||||
.PP
|
||||
.B void ares_set_socket_callback(ares_channel \fIchannel\fP,
|
||||
ares_sock_create_callback \fIcallback\fP,
|
||||
void *\fIuserdata\fP)
|
||||
|
||||
void ares_set_socket_callback(ares_channel \fIchannel\fP,
|
||||
ares_sock_create_callback \fIcallback\fP,
|
||||
void *\fIuserdata\fP)
|
||||
.PP
|
||||
.B cc file.c -lcares
|
||||
.fi
|
||||
|
||||
+7
-9
@@ -4,17 +4,15 @@
|
||||
ares_set_socket_configure_callback \- Set a socket configuration callback
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B typedef int (*ares_sock_config_callback)(ares_socket_t \fIsocket_fd\fP,
|
||||
#include <ares.h>
|
||||
|
||||
typedef int (*ares_sock_config_callback)(ares_socket_t \fIsocket_fd\fP,
|
||||
int \fItype\fP,
|
||||
void *\fIuserdata\fP)
|
||||
.PP
|
||||
.B void ares_set_socket_configure_callback(ares_channel \fIchannel\fP,
|
||||
ares_sock_config_callback \fIcallback\fP,
|
||||
void *\fIuserdata\fP)
|
||||
.PP
|
||||
.B cc file.c -lcares
|
||||
|
||||
void ares_set_socket_configure_callback(ares_channel \fIchannel\fP,
|
||||
ares_sock_config_callback \fIcallback\fP,
|
||||
void *\fIuserdata\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
|
||||
+12
-13
@@ -4,21 +4,20 @@
|
||||
ares_set_socket_functions \- Set socket io callbacks
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B struct ares_socket_functions {
|
||||
ares_socket_t(*\fIasocket\fP)(int, int, int, void *);
|
||||
int(*\fIaclose\fP)(ares_socket_t, void *);
|
||||
int(*\fIaconnect\fP)(ares_socket_t, const struct sockaddr *, ares_socklen_t, void *);
|
||||
ares_ssize_t(*\fIarecvfrom\fP)(ares_socket_t, void *, size_t, int, struct sockaddr *, ares_socklen_t *, void *);
|
||||
ares_ssize_t(*\fIasendv\fP)(ares_socket_t, const struct iovec *, int, void *);
|
||||
};
|
||||
#include <ares.h>
|
||||
|
||||
.PP
|
||||
.B void ares_set_socket_functions(ares_channel \fIchannel\fP,
|
||||
const struct ares_socket_functions * \fIfunctions\fP,
|
||||
void *\fIuser_data\fP);
|
||||
struct ares_socket_functions {
|
||||
ares_socket_t (*\fIasocket\fP)(int, int, int, void *);
|
||||
int (*\fIaclose\fP)(ares_socket_t, void *);
|
||||
int (*\fIaconnect\fP)(ares_socket_t, const struct sockaddr *, ares_socklen_t, void *);
|
||||
ares_ssize_t (*\fIarecvfrom\fP)(ares_socket_t, void *, size_t, int,
|
||||
struct sockaddr *, ares_socklen_t *, void *);
|
||||
ares_ssize_t (*\fIasendv\fP)(ares_socket_t, const struct iovec *, int, void *);
|
||||
};
|
||||
|
||||
void ares_set_socket_functions(ares_channel \fIchannel\fP,
|
||||
const struct ares_socket_functions * \fIfunctions\fP,
|
||||
void *\fIuser_data\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
|
||||
Vendored
+3
-3
@@ -16,9 +16,9 @@
|
||||
ares_set_sortlist \- Initialize an ares_channel sortlist configuration
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_set_sortlist(ares_channel \fIchannel\fP, const char *\fIsortstr\fP)
|
||||
#include <ares.h>
|
||||
|
||||
int ares_set_sortlist(ares_channel \fIchannel\fP, const char *\fIsortstr\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_set_sortlist(3)\fP function initializes an address sortlist configuration
|
||||
|
||||
Vendored
+3
-3
@@ -18,9 +18,9 @@
|
||||
ares_strerror \- Get the description of an ares library error code
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B const char *ares_strerror(int \fIcode\fP)
|
||||
#include <ares.h>
|
||||
|
||||
const char *ares_strerror(int \fIcode\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
||||
Vendored
+1
@@ -234,6 +234,7 @@ EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GCOV = @GCOV@
|
||||
GENHTML = @GENHTML@
|
||||
GREP = @GREP@
|
||||
|
||||
Vendored
+9
@@ -63,6 +63,13 @@
|
||||
# include <windows.h>
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
/* To aid with linking against a static c-ares build, lets tell the microsoft
|
||||
* compiler to pull in needed dependencies */
|
||||
# ifdef _MSC_VER
|
||||
# pragma comment(lib, "ws2_32")
|
||||
# pragma comment(lib, "advapi32")
|
||||
# pragma comment(lib, "iphlpapi")
|
||||
# endif
|
||||
#else
|
||||
# include <sys/socket.h>
|
||||
# include <netinet/in.h>
|
||||
@@ -168,6 +175,7 @@ extern "C" {
|
||||
#define ARES_OPT_EDNSPSZ (1 << 15)
|
||||
#define ARES_OPT_NOROTATE (1 << 16)
|
||||
#define ARES_OPT_RESOLVCONF (1 << 17)
|
||||
#define ARES_OPT_HOSTS_FILE (1 << 18)
|
||||
|
||||
/* Nameinfo flag values */
|
||||
#define ARES_NI_NOFQDN (1 << 0)
|
||||
@@ -277,6 +285,7 @@ struct ares_options {
|
||||
int nsort;
|
||||
int ednspsz;
|
||||
char *resolvconf_path;
|
||||
char *hosts_path;
|
||||
};
|
||||
|
||||
struct hostent;
|
||||
|
||||
Vendored
+3
-3
@@ -6,12 +6,12 @@
|
||||
#define ARES_COPYRIGHT "2004 - 2021 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
#define ARES_VERSION_MAJOR 1
|
||||
#define ARES_VERSION_MINOR 18
|
||||
#define ARES_VERSION_PATCH 1
|
||||
#define ARES_VERSION_MINOR 19
|
||||
#define ARES_VERSION_PATCH 0
|
||||
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
||||
(ARES_VERSION_MINOR<<8)|\
|
||||
(ARES_VERSION_PATCH))
|
||||
#define ARES_VERSION_STR "1.18.1"
|
||||
#define ARES_VERSION_STR "1.19.0"
|
||||
|
||||
#if (ARES_VERSION >= 0x010700)
|
||||
# define CARES_HAVE_ARES_LIBRARY_INIT 1
|
||||
|
||||
Vendored
+3
-4
@@ -4,10 +4,9 @@
|
||||
# | (_|_____| (_| | | | __/\__ \
|
||||
# \___| \__,_|_| \___||___/
|
||||
#
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}/@CMAKE_INSTALL_BINDIR@
|
||||
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
|
||||
exec_prefix=@CMAKE_INSTALL_FULL_BINDIR@
|
||||
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||
|
||||
Name: c-ares
|
||||
URL: https://c-ares.org/
|
||||
|
||||
Vendored
+514
-317
File diff suppressed because it is too large.
Load diff
Vendored
+2
-2
@@ -609,12 +609,12 @@ AC_DEFUN([CARES_SET_COMPILER_BASIC_OPTS], [
|
||||
dnl #147: declaration is incompatible with 'previous one'
|
||||
dnl #165: too few arguments in function call
|
||||
dnl #266: function declared implicitly
|
||||
tmp_CPPFLAGS="$tmp_CPPFLAGS -we 140,147,165,266"
|
||||
tmp_CPPFLAGS="$tmp_CPPFLAGS -diag-error 140,147,165,266"
|
||||
dnl Disable some remarks
|
||||
dnl #279: controlling expression is constant
|
||||
dnl #981: operands are evaluated in unspecified order
|
||||
dnl #1469: "cc" clobber ignored
|
||||
tmp_CPPFLAGS="$tmp_CPPFLAGS -wd 279,981,1469"
|
||||
tmp_CPPFLAGS="$tmp_CPPFLAGS -diag-disable 279,981,1469"
|
||||
;;
|
||||
#
|
||||
INTEL_WINDOWS_C)
|
||||
|
||||
Vendored
+131
-98
@@ -1,6 +1,7 @@
|
||||
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
|
||||
# Foundation, Inc.
|
||||
# Written by Gordon Matzigkeit, 1996
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
@@ -31,7 +32,7 @@ m4_define([_LT_COPYING], [dnl
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
])
|
||||
|
||||
# serial 58 LT_INIT
|
||||
# serial 59 LT_INIT
|
||||
|
||||
|
||||
# LT_PREREQ(VERSION)
|
||||
@@ -181,6 +182,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
|
||||
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
|
||||
m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
|
||||
m4_require([_LT_CMD_RELOAD])dnl
|
||||
m4_require([_LT_DECL_FILECMD])dnl
|
||||
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
|
||||
m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
|
||||
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
|
||||
@@ -219,8 +221,8 @@ esac
|
||||
ofile=libtool
|
||||
can_build_shared=yes
|
||||
|
||||
# All known linkers require a '.a' archive for static linking (except MSVC,
|
||||
# which needs '.lib').
|
||||
# All known linkers require a '.a' archive for static linking (except MSVC and
|
||||
# ICC, which need '.lib').
|
||||
libext=a
|
||||
|
||||
with_gnu_ld=$lt_cv_prog_gnu_ld
|
||||
@@ -777,7 +779,7 @@ _LT_EOF
|
||||
# if finds mixed CR/LF and LF-only lines. Since sed operates in
|
||||
# text mode, it properly converts lines to CR/LF. This bash problem
|
||||
# is reportedly fixed, but why not run on old versions too?
|
||||
sed '$q' "$ltmain" >> "$cfgfile" \
|
||||
$SED '$q' "$ltmain" >> "$cfgfile" \
|
||||
|| (rm -f "$cfgfile"; exit 1)
|
||||
|
||||
mv -f "$cfgfile" "$ofile" ||
|
||||
@@ -1041,8 +1043,8 @@ int forced_loaded() { return 2;}
|
||||
_LT_EOF
|
||||
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
|
||||
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
|
||||
echo "$AR cr libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
|
||||
$AR cr libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
|
||||
echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
|
||||
$AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
|
||||
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
|
||||
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
|
||||
cat > conftest.c << _LT_EOF
|
||||
@@ -1066,17 +1068,12 @@ _LT_EOF
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
|
||||
darwin1.*)
|
||||
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
|
||||
darwin*) # darwin 5.x on
|
||||
# if running on 10.5 or later, the deployment target defaults
|
||||
# to the OS version, if on x86, and 10.4, the deployment
|
||||
# target defaults to 10.4. Don't you love it?
|
||||
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
|
||||
10.0,*86*-darwin8*|10.0,*-darwin[[912]]*)
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
|
||||
10.[[012]][[,.]]*)
|
||||
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
|
||||
10.*|11.*)
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
|
||||
darwin*)
|
||||
case $MACOSX_DEPLOYMENT_TARGET,$host in
|
||||
10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
|
||||
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
|
||||
*)
|
||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
@@ -1125,12 +1122,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
|
||||
output_verbose_link_cmd=func_echo_all
|
||||
_LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
|
||||
_LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
|
||||
_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
|
||||
_LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
|
||||
_LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
|
||||
_LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
|
||||
m4_if([$1], [CXX],
|
||||
[ if test yes != "$lt_cv_apple_cc_single_mod"; then
|
||||
_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
|
||||
_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
|
||||
_LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
|
||||
fi
|
||||
],[])
|
||||
else
|
||||
@@ -1244,7 +1241,8 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
|
||||
# _LT_WITH_SYSROOT
|
||||
# ----------------
|
||||
AC_DEFUN([_LT_WITH_SYSROOT],
|
||||
[AC_MSG_CHECKING([for sysroot])
|
||||
[m4_require([_LT_DECL_SED])dnl
|
||||
AC_MSG_CHECKING([for sysroot])
|
||||
AC_ARG_WITH([sysroot],
|
||||
[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
|
||||
[Search for dependent libraries within DIR (or the compiler's sysroot
|
||||
@@ -1261,7 +1259,7 @@ case $with_sysroot in #(
|
||||
fi
|
||||
;; #(
|
||||
/*)
|
||||
lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
|
||||
lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
|
||||
;; #(
|
||||
no|'')
|
||||
;; #(
|
||||
@@ -1291,7 +1289,7 @@ ia64-*-hpux*)
|
||||
# options accordingly.
|
||||
echo 'int i;' > conftest.$ac_ext
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
case `/usr/bin/file conftest.$ac_objext` in
|
||||
case `$FILECMD conftest.$ac_objext` in
|
||||
*ELF-32*)
|
||||
HPUX_IA64_MODE=32
|
||||
;;
|
||||
@@ -1308,7 +1306,7 @@ ia64-*-hpux*)
|
||||
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
if test yes = "$lt_cv_prog_gnu_ld"; then
|
||||
case `/usr/bin/file conftest.$ac_objext` in
|
||||
case `$FILECMD conftest.$ac_objext` in
|
||||
*32-bit*)
|
||||
LD="${LD-ld} -melf32bsmip"
|
||||
;;
|
||||
@@ -1320,7 +1318,7 @@ ia64-*-hpux*)
|
||||
;;
|
||||
esac
|
||||
else
|
||||
case `/usr/bin/file conftest.$ac_objext` in
|
||||
case `$FILECMD conftest.$ac_objext` in
|
||||
*32-bit*)
|
||||
LD="${LD-ld} -32"
|
||||
;;
|
||||
@@ -1342,7 +1340,7 @@ mips64*-*linux*)
|
||||
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
emul=elf
|
||||
case `/usr/bin/file conftest.$ac_objext` in
|
||||
case `$FILECMD conftest.$ac_objext` in
|
||||
*32-bit*)
|
||||
emul="${emul}32"
|
||||
;;
|
||||
@@ -1350,7 +1348,7 @@ mips64*-*linux*)
|
||||
emul="${emul}64"
|
||||
;;
|
||||
esac
|
||||
case `/usr/bin/file conftest.$ac_objext` in
|
||||
case `$FILECMD conftest.$ac_objext` in
|
||||
*MSB*)
|
||||
emul="${emul}btsmip"
|
||||
;;
|
||||
@@ -1358,7 +1356,7 @@ mips64*-*linux*)
|
||||
emul="${emul}ltsmip"
|
||||
;;
|
||||
esac
|
||||
case `/usr/bin/file conftest.$ac_objext` in
|
||||
case `$FILECMD conftest.$ac_objext` in
|
||||
*N32*)
|
||||
emul="${emul}n32"
|
||||
;;
|
||||
@@ -1378,14 +1376,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||
# not appear in the list.
|
||||
echo 'int i;' > conftest.$ac_ext
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
case `/usr/bin/file conftest.o` in
|
||||
case `$FILECMD conftest.o` in
|
||||
*32-bit*)
|
||||
case $host in
|
||||
x86_64-*kfreebsd*-gnu)
|
||||
LD="${LD-ld} -m elf_i386_fbsd"
|
||||
;;
|
||||
x86_64-*linux*)
|
||||
case `/usr/bin/file conftest.o` in
|
||||
case `$FILECMD conftest.o` in
|
||||
*x86-64*)
|
||||
LD="${LD-ld} -m elf32_x86_64"
|
||||
;;
|
||||
@@ -1453,7 +1451,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||
# options accordingly.
|
||||
echo 'int i;' > conftest.$ac_ext
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
case `/usr/bin/file conftest.o` in
|
||||
case `$FILECMD conftest.o` in
|
||||
*64-bit*)
|
||||
case $lt_cv_prog_gnu_ld in
|
||||
yes*)
|
||||
@@ -1492,9 +1490,22 @@ need_locks=$enable_libtool_lock
|
||||
m4_defun([_LT_PROG_AR],
|
||||
[AC_CHECK_TOOLS(AR, [ar], false)
|
||||
: ${AR=ar}
|
||||
: ${AR_FLAGS=cr}
|
||||
_LT_DECL([], [AR], [1], [The archiver])
|
||||
_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
|
||||
|
||||
# Use ARFLAGS variable as AR's operation code to sync the variable naming with
|
||||
# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
|
||||
# higher priority because thats what people were doing historically (setting
|
||||
# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
|
||||
# variable obsoleted/removed.
|
||||
|
||||
test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
|
||||
lt_ar_flags=$AR_FLAGS
|
||||
_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
|
||||
|
||||
# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
|
||||
# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
|
||||
_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
|
||||
[Flags to create an archive])
|
||||
|
||||
AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
|
||||
[lt_cv_ar_at_file=no
|
||||
@@ -1713,7 +1724,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
|
||||
lt_cv_sys_max_cmd_len=8192;
|
||||
;;
|
||||
|
||||
bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
|
||||
bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
|
||||
# This has been around since 386BSD, at least. Likely further.
|
||||
if test -x /sbin/sysctl; then
|
||||
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
|
||||
@@ -1756,7 +1767,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
|
||||
sysv5* | sco5v6* | sysv4.2uw2*)
|
||||
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
|
||||
if test -n "$kargmax"; then
|
||||
lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
|
||||
lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'`
|
||||
else
|
||||
lt_cv_sys_max_cmd_len=32768
|
||||
fi
|
||||
@@ -2206,26 +2217,35 @@ m4_defun([_LT_CMD_STRIPLIB],
|
||||
striplib=
|
||||
old_striplib=
|
||||
AC_MSG_CHECKING([whether stripping libraries is possible])
|
||||
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
|
||||
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
|
||||
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
|
||||
AC_MSG_RESULT([yes])
|
||||
if test -z "$STRIP"; then
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
# FIXME - insert some real tests, host_os isn't really good enough
|
||||
case $host_os in
|
||||
darwin*)
|
||||
if test -n "$STRIP"; then
|
||||
if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
|
||||
old_striplib="$STRIP --strip-debug"
|
||||
striplib="$STRIP --strip-unneeded"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
case $host_os in
|
||||
darwin*)
|
||||
# FIXME - insert some real tests, host_os isn't really good enough
|
||||
striplib="$STRIP -x"
|
||||
old_striplib="$STRIP -S"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
;;
|
||||
freebsd*)
|
||||
if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
|
||||
old_striplib="$STRIP --strip-debug"
|
||||
striplib="$STRIP --strip-unneeded"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
|
||||
_LT_DECL([], [striplib], [1])
|
||||
@@ -2548,7 +2568,7 @@ cygwin* | mingw* | pw32* | cegcc*)
|
||||
case $host_os in
|
||||
cygwin*)
|
||||
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
|
||||
soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
m4_if([$1], [],[
|
||||
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
|
||||
;;
|
||||
@@ -2558,14 +2578,14 @@ m4_if([$1], [],[
|
||||
;;
|
||||
pw32*)
|
||||
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
||||
library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
;;
|
||||
esac
|
||||
dynamic_linker='Win32 ld.exe'
|
||||
;;
|
||||
|
||||
*,cl*)
|
||||
# Native MSVC
|
||||
*,cl* | *,icl*)
|
||||
# Native MSVC or ICC
|
||||
libname_spec='$name'
|
||||
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||
library_names_spec='$libname.dll.lib'
|
||||
@@ -2584,7 +2604,7 @@ m4_if([$1], [],[
|
||||
done
|
||||
IFS=$lt_save_ifs
|
||||
# Convert to MSYS style.
|
||||
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
|
||||
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
|
||||
;;
|
||||
cygwin*)
|
||||
# Convert to unix form, then to dos form, then back to unix form
|
||||
@@ -2621,7 +2641,7 @@ m4_if([$1], [],[
|
||||
;;
|
||||
|
||||
*)
|
||||
# Assume MSVC wrapper
|
||||
# Assume MSVC and ICC wrapper
|
||||
library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
|
||||
dynamic_linker='Win32 ld.exe'
|
||||
;;
|
||||
@@ -2654,7 +2674,7 @@ dgux*)
|
||||
shlibpath_var=LD_LIBRARY_PATH
|
||||
;;
|
||||
|
||||
freebsd* | dragonfly*)
|
||||
freebsd* | dragonfly* | midnightbsd*)
|
||||
# DragonFly does not have aout. When/if they implement a new
|
||||
# versioning mechanism, adjust this.
|
||||
if test -x /usr/bin/objformat; then
|
||||
@@ -3465,7 +3485,7 @@ beos*)
|
||||
|
||||
bsdi[[45]]*)
|
||||
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
|
||||
lt_cv_file_magic_cmd='/usr/bin/file -L'
|
||||
lt_cv_file_magic_cmd='$FILECMD -L'
|
||||
lt_cv_file_magic_test_file=/shlib/libc.so
|
||||
;;
|
||||
|
||||
@@ -3499,14 +3519,14 @@ darwin* | rhapsody*)
|
||||
lt_cv_deplibs_check_method=pass_all
|
||||
;;
|
||||
|
||||
freebsd* | dragonfly*)
|
||||
freebsd* | dragonfly* | midnightbsd*)
|
||||
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
|
||||
case $host_cpu in
|
||||
i*86 )
|
||||
# Not sure whether the presence of OpenBSD here was a mistake.
|
||||
# Let's accept both of them until this is cleared up.
|
||||
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
|
||||
lt_cv_file_magic_cmd=/usr/bin/file
|
||||
lt_cv_file_magic_cmd=$FILECMD
|
||||
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
|
||||
;;
|
||||
esac
|
||||
@@ -3520,7 +3540,7 @@ haiku*)
|
||||
;;
|
||||
|
||||
hpux10.20* | hpux11*)
|
||||
lt_cv_file_magic_cmd=/usr/bin/file
|
||||
lt_cv_file_magic_cmd=$FILECMD
|
||||
case $host_cpu in
|
||||
ia64*)
|
||||
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
|
||||
@@ -3567,7 +3587,7 @@ netbsd* | netbsdelf*-gnu)
|
||||
|
||||
newos6*)
|
||||
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
|
||||
lt_cv_file_magic_cmd=/usr/bin/file
|
||||
lt_cv_file_magic_cmd=$FILECMD
|
||||
lt_cv_file_magic_test_file=/usr/lib/libnls.so
|
||||
;;
|
||||
|
||||
@@ -3694,13 +3714,13 @@ else
|
||||
mingw*) lt_bad_file=conftest.nm/nofile ;;
|
||||
*) lt_bad_file=/dev/null ;;
|
||||
esac
|
||||
case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
|
||||
case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
|
||||
*$lt_bad_file* | *'Invalid file or object type'*)
|
||||
lt_cv_path_NM="$tmp_nm -B"
|
||||
break 2
|
||||
;;
|
||||
*)
|
||||
case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
|
||||
case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
|
||||
*/dev/null*)
|
||||
lt_cv_path_NM="$tmp_nm -p"
|
||||
break 2
|
||||
@@ -3726,7 +3746,7 @@ else
|
||||
# Let the user override the test.
|
||||
else
|
||||
AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
|
||||
case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
|
||||
case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
|
||||
*COFF*)
|
||||
DUMPBIN="$DUMPBIN -symbols -headers"
|
||||
;;
|
||||
@@ -3966,7 +3986,7 @@ esac
|
||||
|
||||
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
|
||||
# Gets list of data symbols to import.
|
||||
lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
|
||||
lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
|
||||
# Adjust the below global symbol transforms to fixup imported variables.
|
||||
lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
|
||||
lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
|
||||
@@ -3984,20 +4004,20 @@ fi
|
||||
# Transform an extracted symbol line into a proper C declaration.
|
||||
# Some systems (esp. on ia64) link data and code symbols differently,
|
||||
# so use this general approach.
|
||||
lt_cv_sys_global_symbol_to_cdecl="sed -n"\
|
||||
lt_cv_sys_global_symbol_to_cdecl="$SED -n"\
|
||||
$lt_cdecl_hook\
|
||||
" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
|
||||
" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
|
||||
|
||||
# Transform an extracted symbol line into symbol name and symbol address
|
||||
lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
|
||||
lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
|
||||
$lt_c_name_hook\
|
||||
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
|
||||
" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
|
||||
|
||||
# Transform an extracted symbol line into symbol name with lib prefix and
|
||||
# symbol address.
|
||||
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
|
||||
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
|
||||
$lt_c_name_lib_hook\
|
||||
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
|
||||
" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
|
||||
@@ -4021,7 +4041,7 @@ for ac_symprfx in "" "_"; do
|
||||
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
|
||||
# Fake it for dumpbin and say T for any non-static function,
|
||||
# D for any global variable and I for any imported variable.
|
||||
# Also find C++ and __fastcall symbols from MSVC++,
|
||||
# Also find C++ and __fastcall symbols from MSVC++ or ICC,
|
||||
# which start with @ or ?.
|
||||
lt_cv_sys_global_symbol_pipe="$AWK ['"\
|
||||
" {last_section=section; section=\$ 3};"\
|
||||
@@ -4039,9 +4059,9 @@ for ac_symprfx in "" "_"; do
|
||||
" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
|
||||
" ' prfx=^$ac_symprfx]"
|
||||
else
|
||||
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
|
||||
lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
|
||||
fi
|
||||
lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
|
||||
lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
|
||||
|
||||
# Check to see that the pipe works correctly.
|
||||
pipe_works=no
|
||||
@@ -4329,7 +4349,7 @@ m4_if([$1], [CXX], [
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
freebsd* | dragonfly* | midnightbsd*)
|
||||
# FreeBSD uses GNU C++
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
@@ -4412,7 +4432,7 @@ m4_if([$1], [CXX], [
|
||||
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
|
||||
;;
|
||||
*)
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
case `$CC -V 2>&1 | $SED 5q` in
|
||||
*Sun\ C*)
|
||||
# Sun C++ 5.9
|
||||
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
|
||||
@@ -4754,7 +4774,7 @@ m4_if([$1], [CXX], [
|
||||
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
|
||||
;;
|
||||
*)
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
case `$CC -V 2>&1 | $SED 5q` in
|
||||
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
|
||||
# Sun Fortran 8.3 passes all unrecognized flags to the linker
|
||||
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
|
||||
@@ -4937,7 +4957,7 @@ m4_if([$1], [CXX], [
|
||||
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
|
||||
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
|
||||
else
|
||||
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
|
||||
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
|
||||
fi
|
||||
;;
|
||||
pw32*)
|
||||
@@ -4945,7 +4965,7 @@ m4_if([$1], [CXX], [
|
||||
;;
|
||||
cygwin* | mingw* | cegcc*)
|
||||
case $cc_basename in
|
||||
cl*)
|
||||
cl* | icl*)
|
||||
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
|
||||
;;
|
||||
*)
|
||||
@@ -5005,15 +5025,15 @@ dnl Note also adjust exclude_expsyms for C++ above.
|
||||
|
||||
case $host_os in
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
# Microsoft Visual C++ or Intel C++ Compiler.
|
||||
if test yes != "$GCC"; then
|
||||
with_gnu_ld=no
|
||||
fi
|
||||
;;
|
||||
interix*)
|
||||
# we just hope/assume this is gcc and not c89 (= MSVC++)
|
||||
# we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
|
||||
with_gnu_ld=yes
|
||||
;;
|
||||
openbsd* | bitrig*)
|
||||
@@ -5068,7 +5088,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
|
||||
_LT_TAGVAR(whole_archive_flag_spec, $1)=
|
||||
fi
|
||||
supports_anon_versioning=no
|
||||
case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
|
||||
case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
|
||||
*GNU\ gold*) supports_anon_versioning=yes ;;
|
||||
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
|
||||
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
|
||||
@@ -5180,6 +5200,7 @@ _LT_EOF
|
||||
emximp -o $lib $output_objdir/$libname.def'
|
||||
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
|
||||
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
||||
_LT_TAGVAR(file_list_spec, $1)='@'
|
||||
;;
|
||||
|
||||
interix[[3-9]]*)
|
||||
@@ -5194,7 +5215,7 @@ _LT_EOF
|
||||
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
|
||||
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
|
||||
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
||||
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
||||
_LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
||||
;;
|
||||
|
||||
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
@@ -5237,7 +5258,7 @@ _LT_EOF
|
||||
_LT_TAGVAR(compiler_needs_object, $1)=yes
|
||||
;;
|
||||
esac
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
case `$CC -V 2>&1 | $SED 5q` in
|
||||
*Sun\ C*) # Sun C 5.9
|
||||
_LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
|
||||
_LT_TAGVAR(compiler_needs_object, $1)=yes
|
||||
@@ -5249,13 +5270,14 @@ _LT_EOF
|
||||
|
||||
if test yes = "$supports_anon_versioning"; then
|
||||
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
|
||||
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
|
||||
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
|
||||
echo "local: *; };" >> $output_objdir/$libname.ver~
|
||||
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
|
||||
fi
|
||||
|
||||
case $cc_basename in
|
||||
tcc*)
|
||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
|
||||
_LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
|
||||
;;
|
||||
xlf* | bgf* | bgxlf* | mpixlf*)
|
||||
@@ -5265,7 +5287,7 @@ _LT_EOF
|
||||
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
|
||||
if test yes = "$supports_anon_versioning"; then
|
||||
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
|
||||
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
|
||||
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
|
||||
echo "local: *; };" >> $output_objdir/$libname.ver~
|
||||
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
|
||||
fi
|
||||
@@ -5397,7 +5419,7 @@ _LT_EOF
|
||||
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
|
||||
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
|
||||
else
|
||||
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
|
||||
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
|
||||
fi
|
||||
aix_use_runtimelinking=no
|
||||
|
||||
@@ -5580,12 +5602,12 @@ _LT_EOF
|
||||
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
# Microsoft Visual C++ or Intel C++ Compiler.
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
case $cc_basename in
|
||||
cl*)
|
||||
# Native MSVC
|
||||
cl* | icl*)
|
||||
# Native MSVC or ICC
|
||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
|
||||
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
|
||||
_LT_TAGVAR(always_export_symbols, $1)=yes
|
||||
@@ -5626,7 +5648,7 @@ _LT_EOF
|
||||
fi'
|
||||
;;
|
||||
*)
|
||||
# Assume MSVC wrapper
|
||||
# Assume MSVC and ICC wrapper
|
||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
|
||||
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
|
||||
# Tell ltmain to make .lib files, not .a files.
|
||||
@@ -5674,7 +5696,7 @@ _LT_EOF
|
||||
;;
|
||||
|
||||
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
|
||||
freebsd* | dragonfly*)
|
||||
freebsd* | dragonfly* | midnightbsd*)
|
||||
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
|
||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
|
||||
_LT_TAGVAR(hardcode_direct, $1)=yes
|
||||
@@ -5815,6 +5837,7 @@ _LT_EOF
|
||||
# Fabrice Bellard et al's Tiny C Compiler
|
||||
_LT_TAGVAR(ld_shlibs, $1)=yes
|
||||
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
|
||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@@ -5886,6 +5909,7 @@ _LT_EOF
|
||||
emximp -o $lib $output_objdir/$libname.def'
|
||||
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
|
||||
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
||||
_LT_TAGVAR(file_list_spec, $1)='@'
|
||||
;;
|
||||
|
||||
osf3*)
|
||||
@@ -6656,8 +6680,8 @@ if test yes != "$_lt_caught_CXX_error"; then
|
||||
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
case $GXX,$cc_basename in
|
||||
,cl* | no,cl*)
|
||||
# Native MSVC
|
||||
,cl* | no,cl* | ,icl* | no,icl*)
|
||||
# Native MSVC or ICC
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
|
||||
@@ -6755,6 +6779,7 @@ if test yes != "$_lt_caught_CXX_error"; then
|
||||
emximp -o $lib $output_objdir/$libname.def'
|
||||
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
|
||||
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
||||
_LT_TAGVAR(file_list_spec, $1)='@'
|
||||
;;
|
||||
|
||||
dgux*)
|
||||
@@ -6785,7 +6810,7 @@ if test yes != "$_lt_caught_CXX_error"; then
|
||||
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
|
||||
;;
|
||||
|
||||
freebsd* | dragonfly*)
|
||||
freebsd* | dragonfly* | midnightbsd*)
|
||||
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
|
||||
# conventions
|
||||
_LT_TAGVAR(ld_shlibs, $1)=yes
|
||||
@@ -6922,7 +6947,7 @@ if test yes != "$_lt_caught_CXX_error"; then
|
||||
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
|
||||
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
|
||||
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
||||
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
||||
_LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
||||
;;
|
||||
irix5* | irix6*)
|
||||
case $cc_basename in
|
||||
@@ -7062,13 +7087,13 @@ if test yes != "$_lt_caught_CXX_error"; then
|
||||
_LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
|
||||
if test yes = "$supports_anon_versioning"; then
|
||||
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
|
||||
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
|
||||
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
|
||||
echo "local: *; };" >> $output_objdir/$libname.ver~
|
||||
$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
case `$CC -V 2>&1 | $SED 5q` in
|
||||
*Sun\ C*)
|
||||
# Sun C++ 5.9
|
||||
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
|
||||
@@ -8214,6 +8239,14 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program])
|
||||
AC_SUBST([DLLTOOL])
|
||||
])
|
||||
|
||||
# _LT_DECL_FILECMD
|
||||
# ----------------
|
||||
# Check for a file(cmd) program that can be used to detect file type and magic
|
||||
m4_defun([_LT_DECL_FILECMD],
|
||||
[AC_CHECK_TOOL([FILECMD], [file], [:])
|
||||
_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
|
||||
])# _LD_DECL_FILECMD
|
||||
|
||||
# _LT_DECL_SED
|
||||
# ------------
|
||||
# Check for a fully-functional sed program, that truncates
|
||||
|
||||
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
|
||||
# Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
|
||||
# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
|
||||
# Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
|
||||
Vendored
+7
-6
@@ -1,6 +1,7 @@
|
||||
# ltversion.m4 -- version numbers -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
|
||||
# Inc.
|
||||
# Written by Scott James Remnant, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
@@ -9,15 +10,15 @@
|
||||
|
||||
# @configure_input@
|
||||
|
||||
# serial 4179 ltversion.m4
|
||||
# serial 4245 ltversion.m4
|
||||
# This file is part of GNU Libtool
|
||||
|
||||
m4_define([LT_PACKAGE_VERSION], [2.4.6])
|
||||
m4_define([LT_PACKAGE_REVISION], [2.4.6])
|
||||
m4_define([LT_PACKAGE_VERSION], [2.4.7])
|
||||
m4_define([LT_PACKAGE_REVISION], [2.4.7])
|
||||
|
||||
AC_DEFUN([LTVERSION_VERSION],
|
||||
[macro_version='2.4.6'
|
||||
macro_revision='2.4.6'
|
||||
[macro_version='2.4.7'
|
||||
macro_revision='2.4.7'
|
||||
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
||||
_LT_DECL(, macro_revision, 0)
|
||||
])
|
||||
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
||||
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
|
||||
# Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
|
||||
Vendored
+1
@@ -245,6 +245,7 @@ EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GCOV = @GCOV@
|
||||
GENHTML = @GENHTML@
|
||||
GREP = @GREP@
|
||||
|
||||
Vendored
+5
@@ -10,6 +10,11 @@ CONFIGURE_FILE (ares_config.h.cmake ${PROJECT_BINARY_DIR}/ares_config.h)
|
||||
IF (CARES_SHARED)
|
||||
ADD_LIBRARY (${PROJECT_NAME} SHARED ${CSOURCES})
|
||||
|
||||
# Include resource file in windows builds for versioned DLLs
|
||||
IF (WIN32)
|
||||
TARGET_SOURCES (${PROJECT_NAME} PRIVATE cares.rc)
|
||||
ENDIF()
|
||||
|
||||
# Convert CARES_LIB_VERSIONINFO libtool version format into VERSION and SOVERSION
|
||||
# Convert from ":" separated into CMake list format using ";"
|
||||
STRING (REPLACE ":" ";" CARES_LIB_VERSIONINFO ${CARES_LIB_VERSIONINFO})
|
||||
|
||||
Vendored
+2
-2
@@ -15,7 +15,7 @@
|
||||
@SET_MAKE@
|
||||
|
||||
# aminclude_static.am generated automatically by Autoconf
|
||||
# from AX_AM_MACROS_STATIC on Wed Oct 27 08:01:08 CEST 2021
|
||||
# from AX_AM_MACROS_STATIC on Sat Jan 28 10:29:54 CET 2023
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
@@ -422,6 +422,7 @@ EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GCOV = @GCOV@
|
||||
GENHTML = @GENHTML@
|
||||
GREP = @GREP@
|
||||
@@ -636,7 +637,6 @@ HHEADERS = ares_android.h \
|
||||
ares_inet_net_pton.h \
|
||||
ares_iphlpapi.h \
|
||||
ares_ipv6.h \
|
||||
ares_library_init.h \
|
||||
ares_llist.h \
|
||||
ares_nowarn.h \
|
||||
ares_platform.h \
|
||||
|
||||
Vendored
-1
@@ -65,7 +65,6 @@ HHEADERS = ares_android.h \
|
||||
ares_inet_net_pton.h \
|
||||
ares_iphlpapi.h \
|
||||
ares_ipv6.h \
|
||||
ares_library_init.h \
|
||||
ares_llist.h \
|
||||
ares_nowarn.h \
|
||||
ares_platform.h \
|
||||
|
||||
+8
-1
@@ -234,12 +234,19 @@ int ares__readaddrinfo(FILE *fp,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* If no results, its a failure */
|
||||
if (!nodes)
|
||||
{
|
||||
status = ARES_ENOTFOUND;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Free line buffer. */
|
||||
ares_free(line);
|
||||
ares__addrinfo_cat_cnames(&ai->cnames, cnames);
|
||||
ares__addrinfo_cat_nodes(&ai->nodes, nodes);
|
||||
|
||||
return nodes ? ARES_SUCCESS : ARES_ENOTFOUND;
|
||||
return ARES_SUCCESS;
|
||||
|
||||
fail:
|
||||
ares_free(line);
|
||||
|
||||
Vendored
+5
@@ -1,3 +1,6 @@
|
||||
#ifndef __ARES_DATA_H
|
||||
#define __ARES_DATA_H
|
||||
|
||||
|
||||
/* Copyright (C) 2009-2013 by Daniel Stenberg
|
||||
*
|
||||
@@ -74,3 +77,5 @@ struct ares_data {
|
||||
|
||||
void *ares_malloc_data(ares_datatype type);
|
||||
|
||||
|
||||
#endif // __ARES_DATA_H
|
||||
Vendored
+5
@@ -38,6 +38,8 @@ void ares_destroy_options(struct ares_options *options)
|
||||
ares_free(options->lookups);
|
||||
if(options->resolvconf_path)
|
||||
ares_free(options->resolvconf_path);
|
||||
if(options->hosts_path)
|
||||
ares_free(options->hosts_path);
|
||||
}
|
||||
|
||||
void ares_destroy(ares_channel channel)
|
||||
@@ -90,6 +92,9 @@ void ares_destroy(ares_channel channel)
|
||||
if (channel->resolvconf_path)
|
||||
ares_free(channel->resolvconf_path);
|
||||
|
||||
if (channel->hosts_path)
|
||||
ares_free(channel->hosts_path);
|
||||
|
||||
ares_free(channel);
|
||||
}
|
||||
|
||||
|
||||
+51
-9
@@ -326,7 +326,7 @@ static int fake_addrinfo(const char *name,
|
||||
}
|
||||
}
|
||||
|
||||
if (family == AF_INET6 || family == AF_UNSPEC)
|
||||
if (!result && (family == AF_INET6 || family == AF_UNSPEC))
|
||||
{
|
||||
struct ares_in6_addr addr6;
|
||||
result = ares_inet_pton(AF_INET6, name, &addr6) < 1 ? 0 : 1;
|
||||
@@ -404,6 +404,27 @@ static void end_hquery(struct host_query *hquery, int status)
|
||||
ares_free(hquery);
|
||||
}
|
||||
|
||||
static int is_localhost(const char *name)
|
||||
{
|
||||
/* RFC6761 6.3 says : The domain "localhost." and any names falling within ".localhost." */
|
||||
size_t len;
|
||||
|
||||
if (name == NULL)
|
||||
return 0;
|
||||
|
||||
if (strcmp(name, "localhost") == 0)
|
||||
return 1;
|
||||
|
||||
len = strlen(name);
|
||||
if (len < 10 /* strlen(".localhost") */)
|
||||
return 0;
|
||||
|
||||
if (strcmp(name + (len - 10 /* strlen(".localhost") */), ".localhost") == 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int file_lookup(struct host_query *hquery)
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -416,6 +437,11 @@ static int file_lookup(struct host_query *hquery)
|
||||
path_hosts = getenv("CARES_HOSTS");
|
||||
}
|
||||
|
||||
if (hquery->channel->hosts_path)
|
||||
{
|
||||
path_hosts = hquery->channel->hosts_path;
|
||||
}
|
||||
|
||||
if (!path_hosts)
|
||||
{
|
||||
#ifdef WIN32
|
||||
@@ -466,21 +492,28 @@ static int file_lookup(struct host_query *hquery)
|
||||
{
|
||||
case ENOENT:
|
||||
case ESRCH:
|
||||
return ARES_ENOTFOUND;
|
||||
status = ARES_ENOTFOUND;
|
||||
break;
|
||||
default:
|
||||
DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", error,
|
||||
strerror(error)));
|
||||
DEBUGF(fprintf(stderr, "Error opening file: %s\n", path_hosts));
|
||||
return ARES_EFILE;
|
||||
status = ARES_EFILE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
status = ares__readaddrinfo(fp, hquery->name, hquery->port, &hquery->hints, hquery->ai);
|
||||
fclose(fp);
|
||||
else
|
||||
{
|
||||
status = ares__readaddrinfo(fp, hquery->name, hquery->port, &hquery->hints, hquery->ai);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
/* RFC6761 section 6.3 #3 states that "Name resolution APIs and libraries
|
||||
* SHOULD recognize localhost names as special and SHOULD always return the
|
||||
* IP loopback address for address queries" */
|
||||
if (status == ARES_ENOTFOUND && strcmp(hquery->name, "localhost") == 0)
|
||||
* IP loopback address for address queries".
|
||||
* We will also ignore ALL errors when trying to resolve localhost, such
|
||||
* as permissions errors reading /etc/hosts or a malformed /etc/hosts */
|
||||
if (status != ARES_SUCCESS && is_localhost(hquery->name))
|
||||
{
|
||||
return ares__addrinfo_localhost(hquery->name, hquery->port,
|
||||
&hquery->hints, hquery->ai);
|
||||
@@ -497,7 +530,7 @@ static void next_lookup(struct host_query *hquery, int status)
|
||||
/* RFC6761 section 6.3 #3 says "Name resolution APIs SHOULD NOT send
|
||||
* queries for localhost names to their configured caching DNS
|
||||
* server(s)." */
|
||||
if (strcmp(hquery->name, "localhost") != 0)
|
||||
if (!is_localhost(hquery->name))
|
||||
{
|
||||
/* DNS lookup */
|
||||
if (next_dns_lookup(hquery))
|
||||
@@ -543,7 +576,16 @@ static void host_callback(void *arg, int status, int timeouts,
|
||||
if (addinfostatus != ARES_SUCCESS && addinfostatus != ARES_ENODATA)
|
||||
{
|
||||
/* error in parsing result e.g. no memory */
|
||||
end_hquery(hquery, addinfostatus);
|
||||
if (addinfostatus == ARES_EBADRESP && hquery->ai->nodes)
|
||||
{
|
||||
/* We got a bad response from server, but at least one query
|
||||
* ended with ARES_SUCCESS */
|
||||
end_hquery(hquery, ARES_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
end_hquery(hquery, addinfostatus);
|
||||
}
|
||||
}
|
||||
else if (hquery->ai->nodes)
|
||||
{
|
||||
|
||||
Vendored
+96
-425
@@ -47,9 +47,12 @@
|
||||
#include <resolv.h>
|
||||
#endif
|
||||
|
||||
#if defined(USE_WINSOCK)
|
||||
# include <iphlpapi.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_inet_net_pton.h"
|
||||
#include "ares_library_init.h"
|
||||
#include "ares_nowarn.h"
|
||||
#include "ares_platform.h"
|
||||
#include "ares_private.h"
|
||||
@@ -58,6 +61,18 @@
|
||||
#undef WIN32 /* Redefined in MingW/MSVC headers */
|
||||
#endif
|
||||
|
||||
/* Define RtlGenRandom = SystemFunction036. This is in advapi32.dll. There is
|
||||
* no need to dynamically load this, other software used widely does not.
|
||||
* http://blogs.msdn.com/michael_howard/archive/2005/01/14/353379.aspx
|
||||
* https://docs.microsoft.com/en-us/windows/win32/api/ntsecapi/nf-ntsecapi-rtlgenrandom
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
BOOLEAN WINAPI SystemFunction036(PVOID RandomBuffer, ULONG RandomBufferLength);
|
||||
# ifndef RtlGenRandom
|
||||
# define RtlGenRandom(a,b) SystemFunction036(a,b)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static int init_by_options(ares_channel channel,
|
||||
const struct ares_options *options,
|
||||
int optmask);
|
||||
@@ -149,6 +164,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
channel->sock_funcs = NULL;
|
||||
channel->sock_func_cb_data = NULL;
|
||||
channel->resolvconf_path = NULL;
|
||||
channel->hosts_path = NULL;
|
||||
|
||||
channel->last_server = 0;
|
||||
channel->last_timeout_processed = (time_t)now.tv_sec;
|
||||
@@ -217,13 +233,15 @@ done:
|
||||
if (channel->servers)
|
||||
ares_free(channel->servers);
|
||||
if (channel->ndomains != -1)
|
||||
ares_strsplit_free(channel->domains, channel->ndomains);
|
||||
ares__strsplit_free(channel->domains, channel->ndomains);
|
||||
if (channel->sortlist)
|
||||
ares_free(channel->sortlist);
|
||||
if(channel->lookups)
|
||||
ares_free(channel->lookups);
|
||||
if(channel->resolvconf_path)
|
||||
ares_free(channel->resolvconf_path);
|
||||
if(channel->hosts_path)
|
||||
ares_free(channel->hosts_path);
|
||||
ares_free(channel);
|
||||
return status;
|
||||
}
|
||||
@@ -335,6 +353,9 @@ int ares_save_options(ares_channel channel, struct ares_options *options,
|
||||
if (channel->resolvconf_path)
|
||||
(*optmask) |= ARES_OPT_RESOLVCONF;
|
||||
|
||||
if (channel->hosts_path)
|
||||
(*optmask) |= ARES_OPT_HOSTS_FILE;
|
||||
|
||||
/* Copy easy stuff */
|
||||
options->flags = channel->flags;
|
||||
|
||||
@@ -414,6 +435,13 @@ int ares_save_options(ares_channel channel, struct ares_options *options,
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
|
||||
/* copy path for hosts file */
|
||||
if (channel->hosts_path) {
|
||||
options->hosts_path = ares_strdup(channel->hosts_path);
|
||||
if (!options->hosts_path)
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -530,6 +558,14 @@ static int init_by_options(ares_channel channel,
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
|
||||
/* Set path for hosts file, if given. */
|
||||
if ((optmask & ARES_OPT_HOSTS_FILE) && !channel->hosts_path)
|
||||
{
|
||||
channel->hosts_path = ares_strdup(options->hosts_path);
|
||||
if (!channel->hosts_path && options->hosts_path)
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
|
||||
channel->optmask = optmask;
|
||||
|
||||
return ARES_SUCCESS;
|
||||
@@ -608,227 +644,6 @@ static int get_REG_SZ(HKEY hKey, const char *leafKeyName, char **outptr)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* get_REG_SZ_9X()
|
||||
*
|
||||
* Functionally identical to get_REG_SZ()
|
||||
*
|
||||
* Supported on Windows 95, 98 and ME.
|
||||
*/
|
||||
static int get_REG_SZ_9X(HKEY hKey, const char *leafKeyName, char **outptr)
|
||||
{
|
||||
DWORD dataType = 0;
|
||||
DWORD size = 0;
|
||||
int res;
|
||||
|
||||
*outptr = NULL;
|
||||
|
||||
/* Find out size of string stored in registry */
|
||||
res = RegQueryValueExA(hKey, leafKeyName, 0, &dataType, NULL, &size);
|
||||
if ((res != ERROR_SUCCESS && res != ERROR_MORE_DATA) || !size)
|
||||
return 0;
|
||||
|
||||
/* Allocate buffer of indicated size plus one given that string
|
||||
might have been stored without null termination */
|
||||
*outptr = ares_malloc(size+1);
|
||||
if (!*outptr)
|
||||
return 0;
|
||||
|
||||
/* Get the value for real */
|
||||
res = RegQueryValueExA(hKey, leafKeyName, 0, &dataType,
|
||||
(unsigned char *)*outptr, &size);
|
||||
if ((res != ERROR_SUCCESS) || (size == 1))
|
||||
{
|
||||
ares_free(*outptr);
|
||||
*outptr = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Null terminate buffer allways */
|
||||
*(*outptr + size) = '\0';
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* get_enum_REG_SZ()
|
||||
*
|
||||
* Given a 'hKeyParent' handle to an open registry key and a 'leafKeyName'
|
||||
* pointer to the name of the registry leaf key to be queried, parent key
|
||||
* is enumerated searching in child keys for given leaf key name and its
|
||||
* associated string value. When located, this returns a pointer in *outptr
|
||||
* to a newly allocated memory area holding it as a null-terminated string.
|
||||
*
|
||||
* Returns 0 and nullifies *outptr upon inability to return a string value.
|
||||
*
|
||||
* Returns 1 and sets *outptr when returning a dynamically allocated string.
|
||||
*
|
||||
* Supported on Windows NT 3.5 and newer.
|
||||
*/
|
||||
static int get_enum_REG_SZ(HKEY hKeyParent, const char *leafKeyName,
|
||||
char **outptr)
|
||||
{
|
||||
char enumKeyName[256];
|
||||
DWORD enumKeyNameBuffSize;
|
||||
DWORD enumKeyIdx = 0;
|
||||
HKEY hKeyEnum;
|
||||
int gotString;
|
||||
int res;
|
||||
|
||||
*outptr = NULL;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
enumKeyNameBuffSize = sizeof(enumKeyName);
|
||||
res = RegEnumKeyExA(hKeyParent, enumKeyIdx++, enumKeyName,
|
||||
&enumKeyNameBuffSize, 0, NULL, NULL, NULL);
|
||||
if (res != ERROR_SUCCESS)
|
||||
break;
|
||||
res = RegOpenKeyExA(hKeyParent, enumKeyName, 0, KEY_QUERY_VALUE,
|
||||
&hKeyEnum);
|
||||
if (res != ERROR_SUCCESS)
|
||||
continue;
|
||||
gotString = get_REG_SZ(hKeyEnum, leafKeyName, outptr);
|
||||
RegCloseKey(hKeyEnum);
|
||||
if (gotString)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!*outptr)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* get_DNS_Registry_9X()
|
||||
*
|
||||
* Functionally identical to get_DNS_Registry()
|
||||
*
|
||||
* Implementation supports Windows 95, 98 and ME.
|
||||
*/
|
||||
static int get_DNS_Registry_9X(char **outptr)
|
||||
{
|
||||
HKEY hKey_VxD_MStcp;
|
||||
int gotString;
|
||||
int res;
|
||||
|
||||
*outptr = NULL;
|
||||
|
||||
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_9X, 0, KEY_READ,
|
||||
&hKey_VxD_MStcp);
|
||||
if (res != ERROR_SUCCESS)
|
||||
return 0;
|
||||
|
||||
gotString = get_REG_SZ_9X(hKey_VxD_MStcp, NAMESERVER, outptr);
|
||||
RegCloseKey(hKey_VxD_MStcp);
|
||||
|
||||
if (!gotString || !*outptr)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* get_DNS_Registry_NT()
|
||||
*
|
||||
* Functionally identical to get_DNS_Registry()
|
||||
*
|
||||
* Refs: Microsoft Knowledge Base articles KB120642 and KB314053.
|
||||
*
|
||||
* Implementation supports Windows NT 3.5 and newer.
|
||||
*/
|
||||
static int get_DNS_Registry_NT(char **outptr)
|
||||
{
|
||||
HKEY hKey_Interfaces = NULL;
|
||||
HKEY hKey_Tcpip_Parameters;
|
||||
int gotString;
|
||||
int res;
|
||||
|
||||
*outptr = NULL;
|
||||
|
||||
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
|
||||
&hKey_Tcpip_Parameters);
|
||||
if (res != ERROR_SUCCESS)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
** Global DNS settings override adapter specific parameters when both
|
||||
** are set. Additionally static DNS settings override DHCP-configured
|
||||
** parameters when both are set.
|
||||
*/
|
||||
|
||||
/* Global DNS static parameters */
|
||||
gotString = get_REG_SZ(hKey_Tcpip_Parameters, NAMESERVER, outptr);
|
||||
if (gotString)
|
||||
goto done;
|
||||
|
||||
/* Global DNS DHCP-configured parameters */
|
||||
gotString = get_REG_SZ(hKey_Tcpip_Parameters, DHCPNAMESERVER, outptr);
|
||||
if (gotString)
|
||||
goto done;
|
||||
|
||||
/* Try adapter specific parameters */
|
||||
res = RegOpenKeyExA(hKey_Tcpip_Parameters, "Interfaces", 0,
|
||||
KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS,
|
||||
&hKey_Interfaces);
|
||||
if (res != ERROR_SUCCESS)
|
||||
{
|
||||
hKey_Interfaces = NULL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Adapter specific DNS static parameters */
|
||||
gotString = get_enum_REG_SZ(hKey_Interfaces, NAMESERVER, outptr);
|
||||
if (gotString)
|
||||
goto done;
|
||||
|
||||
/* Adapter specific DNS DHCP-configured parameters */
|
||||
gotString = get_enum_REG_SZ(hKey_Interfaces, DHCPNAMESERVER, outptr);
|
||||
|
||||
done:
|
||||
if (hKey_Interfaces)
|
||||
RegCloseKey(hKey_Interfaces);
|
||||
|
||||
RegCloseKey(hKey_Tcpip_Parameters);
|
||||
|
||||
if (!gotString || !*outptr)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* get_DNS_Registry()
|
||||
*
|
||||
* Locates DNS info in the registry. When located, this returns a pointer
|
||||
* in *outptr to a newly allocated memory area holding a null-terminated
|
||||
* string with a space or comma seperated list of DNS IP addresses.
|
||||
*
|
||||
* Returns 0 and nullifies *outptr upon inability to return DNSes string.
|
||||
*
|
||||
* Returns 1 and sets *outptr when returning a dynamically allocated string.
|
||||
*/
|
||||
static int get_DNS_Registry(char **outptr)
|
||||
{
|
||||
win_platform platform;
|
||||
int gotString = 0;
|
||||
|
||||
*outptr = NULL;
|
||||
|
||||
platform = ares__getplatform();
|
||||
|
||||
if (platform == WIN_NT)
|
||||
gotString = get_DNS_Registry_NT(outptr);
|
||||
else if (platform == WIN_9X)
|
||||
gotString = get_DNS_Registry_9X(outptr);
|
||||
|
||||
if (!gotString)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void commanjoin(char** dst, const char* const src, const size_t len)
|
||||
{
|
||||
char *newbuf;
|
||||
@@ -857,106 +672,6 @@ static void commajoin(char **dst, const char *src)
|
||||
commanjoin(dst, src, strlen(src));
|
||||
}
|
||||
|
||||
/*
|
||||
* get_DNS_NetworkParams()
|
||||
*
|
||||
* Locates DNS info using GetNetworkParams() function from the Internet
|
||||
* Protocol Helper (IP Helper) API. When located, this returns a pointer
|
||||
* in *outptr to a newly allocated memory area holding a null-terminated
|
||||
* string with a space or comma seperated list of DNS IP addresses.
|
||||
*
|
||||
* Returns 0 and nullifies *outptr upon inability to return DNSes string.
|
||||
*
|
||||
* Returns 1 and sets *outptr when returning a dynamically allocated string.
|
||||
*
|
||||
* Implementation supports Windows 98 and newer.
|
||||
*
|
||||
* Note: Ancient PSDK required in order to build a W98 target.
|
||||
*/
|
||||
static int get_DNS_NetworkParams(char **outptr)
|
||||
{
|
||||
FIXED_INFO *fi, *newfi;
|
||||
struct ares_addr namesrvr;
|
||||
char *txtaddr;
|
||||
IP_ADDR_STRING *ipAddr;
|
||||
int res;
|
||||
DWORD size = sizeof (*fi);
|
||||
|
||||
*outptr = NULL;
|
||||
|
||||
/* Verify run-time availability of GetNetworkParams() */
|
||||
if (ares_fpGetNetworkParams == ZERO_NULL)
|
||||
return 0;
|
||||
|
||||
fi = ares_malloc(size);
|
||||
if (!fi)
|
||||
return 0;
|
||||
|
||||
res = (*ares_fpGetNetworkParams) (fi, &size);
|
||||
if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
|
||||
goto done;
|
||||
|
||||
newfi = ares_realloc(fi, size);
|
||||
if (!newfi)
|
||||
goto done;
|
||||
|
||||
fi = newfi;
|
||||
res = (*ares_fpGetNetworkParams) (fi, &size);
|
||||
if (res != ERROR_SUCCESS)
|
||||
goto done;
|
||||
|
||||
for (ipAddr = &fi->DnsServerList; ipAddr; ipAddr = ipAddr->Next)
|
||||
{
|
||||
txtaddr = &ipAddr->IpAddress.String[0];
|
||||
|
||||
/* Validate converting textual address to binary format. */
|
||||
if (ares_inet_pton(AF_INET, txtaddr, &namesrvr.addrV4) == 1)
|
||||
{
|
||||
if ((namesrvr.addrV4.S_un.S_addr == INADDR_ANY) ||
|
||||
(namesrvr.addrV4.S_un.S_addr == INADDR_NONE))
|
||||
continue;
|
||||
}
|
||||
else if (ares_inet_pton(AF_INET6, txtaddr, &namesrvr.addrV6) == 1)
|
||||
{
|
||||
if (memcmp(&namesrvr.addrV6, &ares_in6addr_any,
|
||||
sizeof(namesrvr.addrV6)) == 0)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
|
||||
commajoin(outptr, txtaddr);
|
||||
|
||||
if (!*outptr)
|
||||
break;
|
||||
}
|
||||
|
||||
done:
|
||||
if (fi)
|
||||
ares_free(fi);
|
||||
|
||||
if (!*outptr)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static BOOL ares_IsWindowsVistaOrGreater(void)
|
||||
{
|
||||
OSVERSIONINFO vinfo;
|
||||
memset(&vinfo, 0, sizeof(vinfo));
|
||||
vinfo.dwOSVersionInfoSize = sizeof(vinfo);
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4996) /* warning C4996: 'GetVersionExW': was declared deprecated */
|
||||
#endif
|
||||
if (!GetVersionEx(&vinfo) || vinfo.dwMajorVersion < 6)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* A structure to hold the string form of IPv4 and IPv6 addresses so we can
|
||||
* sort them by a metric.
|
||||
@@ -1033,21 +748,20 @@ static ULONG getBestRouteMetric(IF_LUID * const luid, /* Can't be const :( */
|
||||
/* On this interface, get the best route to that destination. */
|
||||
MIB_IPFORWARD_ROW2 row;
|
||||
SOCKADDR_INET ignored;
|
||||
if(!ares_fpGetBestRoute2 ||
|
||||
ares_fpGetBestRoute2(/* The interface to use. The index is ignored since we are
|
||||
* passing a LUID.
|
||||
*/
|
||||
luid, 0,
|
||||
/* No specific source address. */
|
||||
NULL,
|
||||
/* Our destination address. */
|
||||
dest,
|
||||
/* No options. */
|
||||
0,
|
||||
/* The route row. */
|
||||
&row,
|
||||
/* The best source address, which we don't need. */
|
||||
&ignored) != NO_ERROR
|
||||
if(GetBestRoute2(/* The interface to use. The index is ignored since we are
|
||||
* passing a LUID.
|
||||
*/
|
||||
luid, 0,
|
||||
/* No specific source address. */
|
||||
NULL,
|
||||
/* Our destination address. */
|
||||
dest,
|
||||
/* No options. */
|
||||
0,
|
||||
/* The route row. */
|
||||
&row,
|
||||
/* The best source address, which we don't need. */
|
||||
&ignored) != NO_ERROR
|
||||
/* If the metric is "unused" (-1) or too large for us to add the two
|
||||
* metrics, use the worst possible, thus sorting this last.
|
||||
*/
|
||||
@@ -1067,7 +781,7 @@ static ULONG getBestRouteMetric(IF_LUID * const luid, /* Can't be const :( */
|
||||
}
|
||||
|
||||
/*
|
||||
* get_DNS_AdaptersAddresses()
|
||||
* get_DNS_Windows()
|
||||
*
|
||||
* Locates DNS info using GetAdaptersAddresses() function from the Internet
|
||||
* Protocol Helper (IP Helper) API. When located, this returns a pointer
|
||||
@@ -1082,7 +796,7 @@ static ULONG getBestRouteMetric(IF_LUID * const luid, /* Can't be const :( */
|
||||
*/
|
||||
#define IPAA_INITIAL_BUF_SZ 15 * 1024
|
||||
#define IPAA_MAX_TRIES 3
|
||||
static int get_DNS_AdaptersAddresses(char **outptr)
|
||||
static int get_DNS_Windows(char **outptr)
|
||||
{
|
||||
IP_ADAPTER_DNS_SERVER_ADDRESS *ipaDNSAddr;
|
||||
IP_ADAPTER_ADDRESSES *ipaa, *newipaa, *ipaaEntry;
|
||||
@@ -1107,10 +821,6 @@ static int get_DNS_AdaptersAddresses(char **outptr)
|
||||
|
||||
*outptr = NULL;
|
||||
|
||||
/* Verify run-time availability of GetAdaptersAddresses() */
|
||||
if (ares_fpGetAdaptersAddresses == ZERO_NULL)
|
||||
return 0;
|
||||
|
||||
ipaa = ares_malloc(Bufsz);
|
||||
if (!ipaa)
|
||||
return 0;
|
||||
@@ -1127,8 +837,7 @@ static int get_DNS_AdaptersAddresses(char **outptr)
|
||||
}
|
||||
|
||||
/* Usually this call suceeds with initial buffer size */
|
||||
res = (*ares_fpGetAdaptersAddresses) (AF_UNSPEC, AddrFlags, NULL,
|
||||
ipaa, &ReqBufsz);
|
||||
res = GetAdaptersAddresses(AF_UNSPEC, AddrFlags, NULL, ipaa, &ReqBufsz);
|
||||
if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
|
||||
goto done;
|
||||
|
||||
@@ -1142,8 +851,7 @@ static int get_DNS_AdaptersAddresses(char **outptr)
|
||||
Bufsz = ReqBufsz;
|
||||
ipaa = newipaa;
|
||||
}
|
||||
res = (*ares_fpGetAdaptersAddresses) (AF_UNSPEC, AddrFlags, NULL,
|
||||
ipaa, &ReqBufsz);
|
||||
res = GetAdaptersAddresses(AF_UNSPEC, AddrFlags, NULL, ipaa, &ReqBufsz);
|
||||
if (res == ERROR_SUCCESS)
|
||||
break;
|
||||
}
|
||||
@@ -1185,26 +893,17 @@ static int get_DNS_AdaptersAddresses(char **outptr)
|
||||
addressesSize = newSize;
|
||||
}
|
||||
|
||||
/* Vista required for Luid or Ipv4Metric */
|
||||
if (ares_IsWindowsVistaOrGreater())
|
||||
{
|
||||
/* Save the address as the next element in addresses. */
|
||||
addresses[addressesIndex].metric =
|
||||
getBestRouteMetric(&ipaaEntry->Luid,
|
||||
(SOCKADDR_INET*)(namesrvr.sa),
|
||||
ipaaEntry->Ipv4Metric);
|
||||
}
|
||||
else
|
||||
{
|
||||
addresses[addressesIndex].metric = (ULONG)-1;
|
||||
}
|
||||
addresses[addressesIndex].metric =
|
||||
getBestRouteMetric(&ipaaEntry->Luid,
|
||||
(SOCKADDR_INET*)(namesrvr.sa),
|
||||
ipaaEntry->Ipv4Metric);
|
||||
|
||||
/* Record insertion index to make qsort stable */
|
||||
addresses[addressesIndex].orig_idx = addressesIndex;
|
||||
|
||||
if (! ares_inet_ntop(AF_INET, &namesrvr.sa4->sin_addr,
|
||||
addresses[addressesIndex].text,
|
||||
sizeof(addresses[0].text))) {
|
||||
if (!ares_inet_ntop(AF_INET, &namesrvr.sa4->sin_addr,
|
||||
addresses[addressesIndex].text,
|
||||
sizeof(addresses[0].text))) {
|
||||
continue;
|
||||
}
|
||||
++addressesIndex;
|
||||
@@ -1227,26 +926,17 @@ static int get_DNS_AdaptersAddresses(char **outptr)
|
||||
addressesSize = newSize;
|
||||
}
|
||||
|
||||
/* Vista required for Luid or Ipv4Metric */
|
||||
if (ares_IsWindowsVistaOrGreater())
|
||||
{
|
||||
/* Save the address as the next element in addresses. */
|
||||
addresses[addressesIndex].metric =
|
||||
getBestRouteMetric(&ipaaEntry->Luid,
|
||||
(SOCKADDR_INET*)(namesrvr.sa),
|
||||
ipaaEntry->Ipv6Metric);
|
||||
}
|
||||
else
|
||||
{
|
||||
addresses[addressesIndex].metric = (ULONG)-1;
|
||||
}
|
||||
addresses[addressesIndex].metric =
|
||||
getBestRouteMetric(&ipaaEntry->Luid,
|
||||
(SOCKADDR_INET*)(namesrvr.sa),
|
||||
ipaaEntry->Ipv6Metric);
|
||||
|
||||
/* Record insertion index to make qsort stable */
|
||||
addresses[addressesIndex].orig_idx = addressesIndex;
|
||||
|
||||
if (! ares_inet_ntop(AF_INET6, &namesrvr.sa6->sin6_addr,
|
||||
addresses[addressesIndex].text,
|
||||
sizeof(addresses[0].text))) {
|
||||
if (!ares_inet_ntop(AF_INET6, &namesrvr.sa6->sin6_addr,
|
||||
addresses[addressesIndex].text,
|
||||
sizeof(addresses[0].text))) {
|
||||
continue;
|
||||
}
|
||||
++addressesIndex;
|
||||
@@ -1294,35 +984,6 @@ done:
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* get_DNS_Windows()
|
||||
*
|
||||
* Locates DNS info from Windows employing most suitable methods available at
|
||||
* run-time no matter which Windows version it is. When located, this returns
|
||||
* a pointer in *outptr to a newly allocated memory area holding a string with
|
||||
* a space or comma seperated list of DNS IP addresses, null-terminated.
|
||||
*
|
||||
* Returns 0 and nullifies *outptr upon inability to return DNSes string.
|
||||
*
|
||||
* Returns 1 and sets *outptr when returning a dynamically allocated string.
|
||||
*
|
||||
* Implementation supports Windows 95 and newer.
|
||||
*/
|
||||
static int get_DNS_Windows(char **outptr)
|
||||
{
|
||||
/* Try using IP helper API GetAdaptersAddresses(). IPv4 + IPv6, also sorts
|
||||
* DNS servers by interface route metrics to try to use the best DNS server. */
|
||||
if (get_DNS_AdaptersAddresses(outptr))
|
||||
return 1;
|
||||
|
||||
/* Try using IP helper API GetNetworkParams(). IPv4 only. */
|
||||
if (get_DNS_NetworkParams(outptr))
|
||||
return 1;
|
||||
|
||||
/* Fall-back to registry information */
|
||||
return get_DNS_Registry(outptr);
|
||||
}
|
||||
|
||||
/*
|
||||
* get_SuffixList_Windows()
|
||||
*
|
||||
@@ -1686,8 +1347,12 @@ static int init_by_resolv_conf(ares_channel channel)
|
||||
channel->tries = res.retry;
|
||||
if (channel->rotate == -1)
|
||||
channel->rotate = res.options & RES_ROTATE;
|
||||
if (channel->timeout == -1)
|
||||
if (channel->timeout == -1) {
|
||||
channel->timeout = res.retrans * 1000;
|
||||
#ifdef __APPLE__
|
||||
channel->timeout /= (res.retry + 1) * (res.nscount > 0 ? res.nscount : 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
res_ndestroy(&res);
|
||||
}
|
||||
@@ -2021,6 +1686,11 @@ static int init_by_defaults(ares_channel channel)
|
||||
ares_free(channel->resolvconf_path);
|
||||
channel->resolvconf_path = NULL;
|
||||
}
|
||||
|
||||
if(channel->hosts_path) {
|
||||
ares_free(channel->hosts_path);
|
||||
channel->hosts_path = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if(hostname)
|
||||
@@ -2243,6 +1913,8 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
|
||||
q = str;
|
||||
while (*q && *q != '/' && *q != ';' && !ISSPACE(*q))
|
||||
q++;
|
||||
if (q-str >= 16)
|
||||
return ARES_EBADSTR;
|
||||
memcpy(ipbuf, str, q-str);
|
||||
ipbuf[q-str] = '\0';
|
||||
/* Find the prefix */
|
||||
@@ -2251,6 +1923,8 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
|
||||
const char *str2 = q+1;
|
||||
while (*q && *q != ';' && !ISSPACE(*q))
|
||||
q++;
|
||||
if (q-str >= 32)
|
||||
return ARES_EBADSTR;
|
||||
memcpy(ipbufpfx, str, q-str);
|
||||
ipbufpfx[q-str] = '\0';
|
||||
str = str2;
|
||||
@@ -2325,12 +1999,12 @@ static int set_search(ares_channel channel, const char *str)
|
||||
if(channel->ndomains != -1) {
|
||||
/* LCOV_EXCL_START: all callers check ndomains == -1 */
|
||||
/* if we already have some domains present, free them first */
|
||||
ares_strsplit_free(channel->domains, channel->ndomains);
|
||||
ares__strsplit_free(channel->domains, channel->ndomains);
|
||||
channel->domains = NULL;
|
||||
channel->ndomains = -1;
|
||||
} /* LCOV_EXCL_STOP */
|
||||
|
||||
channel->domains = ares_strsplit(str, ", ", 1, &cnt);
|
||||
channel->domains = ares__strsplit(str, ", ", &cnt);
|
||||
channel->ndomains = (int)cnt;
|
||||
if (channel->domains == NULL || channel->ndomains == 0) {
|
||||
channel->domains = NULL;
|
||||
@@ -2495,12 +2169,10 @@ static int sortlist_alloc(struct apattern **sortlist, int *nsort,
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* initialize an rc4 key. If possible a cryptographically secure random key
|
||||
is generated using a suitable function (for example win32's RtlGenRandom as
|
||||
described in
|
||||
http://blogs.msdn.com/michael_howard/archive/2005/01/14/353379.aspx
|
||||
otherwise the code defaults to cross-platform albeit less secure mechanism
|
||||
using rand
|
||||
is generated using a suitable function otherwise the code defaults to
|
||||
cross-platform albeit less secure mechanism using rand
|
||||
*/
|
||||
static void randomize_key(unsigned char* key,int key_data_len)
|
||||
{
|
||||
@@ -2508,21 +2180,20 @@ static void randomize_key(unsigned char* key,int key_data_len)
|
||||
int counter=0;
|
||||
#ifdef WIN32
|
||||
BOOLEAN res;
|
||||
if (ares_fpSystemFunction036)
|
||||
{
|
||||
res = (*ares_fpSystemFunction036) (key, key_data_len);
|
||||
if (res)
|
||||
randomized = 1;
|
||||
}
|
||||
|
||||
res = RtlGenRandom(key, key_data_len);
|
||||
if (res)
|
||||
randomized = 1;
|
||||
|
||||
#else /* !WIN32 */
|
||||
#ifdef CARES_RANDOM_FILE
|
||||
# ifdef CARES_RANDOM_FILE
|
||||
FILE *f = fopen(CARES_RANDOM_FILE, "rb");
|
||||
if(f) {
|
||||
setvbuf(f, NULL, _IONBF, 0);
|
||||
counter = aresx_uztosi(fread(key, 1, key_data_len, f));
|
||||
fclose(f);
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
#endif /* WIN32 */
|
||||
|
||||
if (!randomized) {
|
||||
|
||||
+2
-89
@@ -18,18 +18,10 @@
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_library_init.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
/* library-private global and unique instance vars */
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
fpGetNetworkParams_t ares_fpGetNetworkParams = ZERO_NULL;
|
||||
fpSystemFunction036_t ares_fpSystemFunction036 = ZERO_NULL;
|
||||
fpGetAdaptersAddresses_t ares_fpGetAdaptersAddresses = ZERO_NULL;
|
||||
fpGetBestRoute2_t ares_fpGetBestRoute2 = ZERO_NULL;
|
||||
#endif
|
||||
|
||||
#if defined(ANDROID) || defined(__ANDROID__)
|
||||
#include "ares_android.h"
|
||||
#endif
|
||||
@@ -59,81 +51,8 @@ void *(*ares_malloc)(size_t size) = default_malloc;
|
||||
void *(*ares_realloc)(void *ptr, size_t size) = default_realloc;
|
||||
void (*ares_free)(void *ptr) = default_free;
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
static HMODULE hnd_iphlpapi;
|
||||
static HMODULE hnd_advapi32;
|
||||
#endif
|
||||
|
||||
|
||||
static int ares_win32_init(void)
|
||||
{
|
||||
#ifdef USE_WINSOCK
|
||||
|
||||
hnd_iphlpapi = 0;
|
||||
hnd_iphlpapi = LoadLibraryW(L"iphlpapi.dll");
|
||||
if (!hnd_iphlpapi)
|
||||
return ARES_ELOADIPHLPAPI;
|
||||
|
||||
ares_fpGetNetworkParams = (fpGetNetworkParams_t)
|
||||
GetProcAddress(hnd_iphlpapi, "GetNetworkParams");
|
||||
if (!ares_fpGetNetworkParams)
|
||||
{
|
||||
FreeLibrary(hnd_iphlpapi);
|
||||
return ARES_EADDRGETNETWORKPARAMS;
|
||||
}
|
||||
|
||||
ares_fpGetAdaptersAddresses = (fpGetAdaptersAddresses_t)
|
||||
GetProcAddress(hnd_iphlpapi, "GetAdaptersAddresses");
|
||||
if (!ares_fpGetAdaptersAddresses)
|
||||
{
|
||||
/* This can happen on clients before WinXP, I don't
|
||||
think it should be an error, unless we don't want to
|
||||
support Windows 2000 anymore */
|
||||
}
|
||||
|
||||
ares_fpGetBestRoute2 = (fpGetBestRoute2_t)
|
||||
GetProcAddress(hnd_iphlpapi, "GetBestRoute2");
|
||||
if (!ares_fpGetBestRoute2)
|
||||
{
|
||||
/* This can happen on clients before Vista, I don't
|
||||
think it should be an error, unless we don't want to
|
||||
support Windows XP anymore */
|
||||
}
|
||||
|
||||
/*
|
||||
* When advapi32.dll is unavailable or advapi32.dll has no SystemFunction036,
|
||||
* also known as RtlGenRandom, which is the case for Windows versions prior
|
||||
* to WinXP then c-ares uses portable rand() function. Then don't error here.
|
||||
*/
|
||||
|
||||
hnd_advapi32 = 0;
|
||||
hnd_advapi32 = LoadLibraryW(L"advapi32.dll");
|
||||
if (hnd_advapi32)
|
||||
{
|
||||
ares_fpSystemFunction036 = (fpSystemFunction036_t)
|
||||
GetProcAddress(hnd_advapi32, "SystemFunction036");
|
||||
}
|
||||
|
||||
#endif
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static void ares_win32_cleanup(void)
|
||||
{
|
||||
#ifdef USE_WINSOCK
|
||||
if (hnd_advapi32)
|
||||
FreeLibrary(hnd_advapi32);
|
||||
if (hnd_iphlpapi)
|
||||
FreeLibrary(hnd_iphlpapi);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int ares_library_init(int flags)
|
||||
{
|
||||
int res;
|
||||
|
||||
if (ares_initialized)
|
||||
{
|
||||
ares_initialized++;
|
||||
@@ -141,12 +60,7 @@ int ares_library_init(int flags)
|
||||
}
|
||||
ares_initialized++;
|
||||
|
||||
if (flags & ARES_LIB_INIT_WIN32)
|
||||
{
|
||||
res = ares_win32_init();
|
||||
if (res != ARES_SUCCESS)
|
||||
return res; /* LCOV_EXCL_LINE: can't test Win32 init failure */
|
||||
}
|
||||
/* NOTE: ARES_LIB_INIT_WIN32 flag no longer used */
|
||||
|
||||
ares_init_flags = flags;
|
||||
|
||||
@@ -176,8 +90,7 @@ void ares_library_cleanup(void)
|
||||
if (ares_initialized)
|
||||
return;
|
||||
|
||||
if (ares_init_flags & ARES_LIB_INIT_WIN32)
|
||||
ares_win32_cleanup();
|
||||
/* NOTE: ARES_LIB_INIT_WIN32 flag no longer used */
|
||||
|
||||
#if defined(ANDROID) || defined(__ANDROID__)
|
||||
ares_library_cleanup_android();
|
||||
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
#ifndef HEADER_CARES_LIBRARY_INIT_H
|
||||
#define HEADER_CARES_LIBRARY_INIT_H
|
||||
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2004-2011 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
|
||||
#include <iphlpapi.h>
|
||||
#include "ares_iphlpapi.h"
|
||||
|
||||
typedef DWORD (WINAPI *fpGetNetworkParams_t) (FIXED_INFO*, DWORD*);
|
||||
typedef BOOLEAN (APIENTRY *fpSystemFunction036_t) (void*, ULONG);
|
||||
typedef ULONG (WINAPI *fpGetAdaptersAddresses_t) ( ULONG, ULONG, void*, IP_ADAPTER_ADDRESSES*, ULONG* );
|
||||
typedef NETIO_STATUS (WINAPI *fpGetBestRoute2_t) ( NET_LUID *, NET_IFINDEX, const SOCKADDR_INET *, const SOCKADDR_INET *, ULONG, PMIB_IPFORWARD_ROW2, SOCKADDR_INET * );
|
||||
/* Forward-declaration of variables defined in ares_library_init.c */
|
||||
/* that are global and unique instances for whole c-ares library. */
|
||||
|
||||
extern fpGetNetworkParams_t ares_fpGetNetworkParams;
|
||||
extern fpSystemFunction036_t ares_fpSystemFunction036;
|
||||
extern fpGetAdaptersAddresses_t ares_fpGetAdaptersAddresses;
|
||||
extern fpGetBestRoute2_t ares_fpGetBestRoute2;
|
||||
|
||||
#endif /* USE_WINSOCK */
|
||||
|
||||
#endif /* HEADER_CARES_LIBRARY_INIT_H */
|
||||
|
||||
Vendored
+3
@@ -339,6 +339,9 @@ struct ares_channeldata {
|
||||
|
||||
/* Path for resolv.conf file, configurable via ares_options */
|
||||
char *resolvconf_path;
|
||||
|
||||
/* Path for hosts file, configurable via ares_options */
|
||||
char *hosts_path;
|
||||
};
|
||||
|
||||
/* Does the domain end in ".onion" or ".onion."? Case-insensitive. */
|
||||
|
||||
Vendored
+13
@@ -209,6 +209,17 @@ static void write_tcp_data(ares_channel channel,
|
||||
ares_ssize_t scount;
|
||||
ares_ssize_t wcount;
|
||||
size_t n;
|
||||
/* From writev manpage: An implementation can advertise its limit by defining
|
||||
IOV_MAX in <limits.h> or at run time via the return value from
|
||||
sysconf(_SC_IOV_MAX). On modern Linux systems, the limit is 1024. Back in
|
||||
Linux 2.0 days, this limit was 16. */
|
||||
#if defined(IOV_MAX)
|
||||
const size_t maxn = IOV_MAX; /* FreeBSD */
|
||||
#elif defined(_SC_IOV_MAX)
|
||||
const size_t maxn = sysconf(_SC_IOV_MAX); /* Linux */
|
||||
#else
|
||||
const size_t maxn = 16; /* Safe default */
|
||||
#endif
|
||||
|
||||
if(!write_fds && (write_fd == ARES_SOCKET_BAD))
|
||||
/* no possible action */
|
||||
@@ -256,6 +267,8 @@ static void write_tcp_data(ares_channel channel,
|
||||
vec[n].iov_base = (char *) sendreq->data;
|
||||
vec[n].iov_len = sendreq->len;
|
||||
n++;
|
||||
if(n >= maxn)
|
||||
break;
|
||||
}
|
||||
wcount = socket_writev(channel, server->tcp_socket, vec, (int)n);
|
||||
ares_free(vec);
|
||||
|
||||
Vendored
+53
-131
@@ -22,47 +22,7 @@
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
static int list_contains(char * const *list, size_t num_elem, const char *str, int insensitive)
|
||||
{
|
||||
size_t len;
|
||||
size_t i;
|
||||
|
||||
len = strlen(str);
|
||||
for (i=0; i<num_elem; i++)
|
||||
{
|
||||
if (insensitive)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (strnicmp(list[i], str, len) == 0)
|
||||
#else
|
||||
if (strncasecmp(list[i], str, len) == 0)
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strncmp(list[i], str, len) == 0)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int is_delim(char c, const char *delims, size_t num_delims)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i=0; i<num_delims; i++)
|
||||
{
|
||||
if (c == delims[i])
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void ares_strsplit_free(char **elms, size_t num_elm)
|
||||
void ares__strsplit_free(char **elms, size_t num_elm)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
@@ -74,105 +34,67 @@ void ares_strsplit_free(char **elms, size_t num_elm)
|
||||
ares_free(elms);
|
||||
}
|
||||
|
||||
|
||||
char **ares_strsplit(const char *in, const char *delms, int make_set, size_t *num_elm)
|
||||
{
|
||||
char *parsestr;
|
||||
char **temp;
|
||||
char **out;
|
||||
size_t cnt;
|
||||
size_t nelms;
|
||||
size_t in_len;
|
||||
size_t num_delims;
|
||||
size_t i;
|
||||
char **ares__strsplit(const char *in, const char *delms, size_t *num_elm) {
|
||||
const char *p;
|
||||
char **table;
|
||||
void *tmp;
|
||||
size_t i, j, k, count;
|
||||
|
||||
if (in == NULL || delms == NULL || num_elm == NULL)
|
||||
return NULL;
|
||||
|
||||
*num_elm = 0;
|
||||
|
||||
in_len = strlen(in);
|
||||
num_delims = strlen(delms);
|
||||
/* count non-empty delimited substrings */
|
||||
count = 0;
|
||||
p = in;
|
||||
do {
|
||||
i = strcspn(p, delms);
|
||||
if (i != 0) {
|
||||
/* string is non-empty */
|
||||
count++;
|
||||
p += i;
|
||||
}
|
||||
} while(*p++ != 0);
|
||||
|
||||
/* Figure out how many elements. */
|
||||
nelms = 1;
|
||||
for (i=0; i<in_len; i++)
|
||||
{
|
||||
if (is_delim(in[i], delms, num_delims))
|
||||
{
|
||||
nelms++;
|
||||
if (count == 0)
|
||||
return NULL;
|
||||
table = ares_malloc(count * sizeof(*table));
|
||||
if (table == NULL)
|
||||
return NULL;
|
||||
|
||||
j = 0; /* current table entry */
|
||||
/* re-calculate indices and allocate new strings for table */
|
||||
for (p = in; j < count; p += i + 1) {
|
||||
i = strcspn(p, delms);
|
||||
if (i != 0) {
|
||||
for (k = 0; k < j; k++) {
|
||||
#ifdef WIN32
|
||||
if (strnicmp(table[k], p, i) == 0 && table[k][i] == 0)
|
||||
break;
|
||||
#else
|
||||
if (strncasecmp(table[k], p, i) == 0 && table[k][i] == 0)
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
if (k == j) {
|
||||
/* copy unique strings only */
|
||||
table[j] = ares_malloc(i + 1);
|
||||
if (table[j] == NULL) {
|
||||
ares__strsplit_free(table, j);
|
||||
return NULL;
|
||||
}
|
||||
strncpy(table[j], p, i);
|
||||
table[j++][i] = 0;
|
||||
} else
|
||||
count--;
|
||||
}
|
||||
}
|
||||
|
||||
/* Copy of input so we can cut it up. */
|
||||
parsestr = ares_strdup(in);
|
||||
if (parsestr == NULL)
|
||||
return NULL;
|
||||
tmp = ares_realloc(table, count * sizeof (*table));
|
||||
if (tmp != NULL)
|
||||
table = tmp;
|
||||
|
||||
/* Temporary array to store locations of start of each element
|
||||
* within parsestr. */
|
||||
temp = ares_malloc(nelms * sizeof(*temp));
|
||||
if (temp == NULL)
|
||||
{
|
||||
ares_free(parsestr);
|
||||
return NULL;
|
||||
}
|
||||
temp[0] = parsestr;
|
||||
cnt = 1;
|
||||
for (i=0; i<in_len && cnt<nelms; i++)
|
||||
{
|
||||
if (!is_delim(parsestr[i], delms, num_delims))
|
||||
continue;
|
||||
|
||||
/* Replace sep with NULL. */
|
||||
parsestr[i] = '\0';
|
||||
/* Add the pointer to the array of elements */
|
||||
temp[cnt] = parsestr+i+1;
|
||||
cnt++;
|
||||
}
|
||||
|
||||
/* Copy each element to our output array. */
|
||||
out = ares_malloc(nelms * sizeof(*out));
|
||||
if (out == NULL)
|
||||
{
|
||||
ares_free(parsestr);
|
||||
ares_free(temp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nelms = 0;
|
||||
for (i=0; i<cnt; i++)
|
||||
{
|
||||
if (temp[i][0] == '\0')
|
||||
continue;
|
||||
|
||||
if (make_set && list_contains(out, nelms, temp[i], 1))
|
||||
continue;
|
||||
|
||||
out[nelms] = ares_strdup(temp[i]);
|
||||
if (out[nelms] == NULL)
|
||||
{
|
||||
ares_strsplit_free(out, nelms);
|
||||
ares_free(parsestr);
|
||||
ares_free(temp);
|
||||
return NULL;
|
||||
}
|
||||
nelms++;
|
||||
}
|
||||
|
||||
|
||||
/* If there are no elements don't return an empty allocated
|
||||
* array. */
|
||||
if (nelms == 0)
|
||||
{
|
||||
ares_strsplit_free(out, nelms);
|
||||
out = NULL;
|
||||
}
|
||||
|
||||
/* Get the true number of elements (recalculated because of make_set) */
|
||||
*num_elm = nelms;
|
||||
|
||||
ares_free(parsestr);
|
||||
ares_free(temp);
|
||||
return out;
|
||||
*num_elm = count;
|
||||
return table;
|
||||
}
|
||||
Vendored
+9
-10
@@ -18,25 +18,24 @@
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
/* Split a string on delem skipping empty elements.
|
||||
/* Split a string on delms skipping empty or duplicate elements.
|
||||
*
|
||||
* param in String to split.
|
||||
* param delims String of characters to treat as a delimitor.
|
||||
* Each character in the string is a delimitor so
|
||||
* there can be multiple delimitors to split on.
|
||||
* E.g. ", " will split on all comma's and spaces.
|
||||
* param make_set Have the list be a Set where there are no
|
||||
* duplicate entries. 1 for true, 0 or false.
|
||||
* param delms String of characters to treat as a delimitor.
|
||||
* Each character in the string is a delimitor so
|
||||
* there can be multiple delimitors to split on.
|
||||
* E.g. ", " will split on all comma's and spaces.
|
||||
* Duplicate entries are removed.
|
||||
* param num_elm Return parameter of the number of elements
|
||||
* in the result array.
|
||||
*
|
||||
* returns an allocated array of allocated string elements.
|
||||
*
|
||||
*/
|
||||
char **ares_strsplit(const char *in, const char *delms, int make_set, size_t *num_elm);
|
||||
char **ares__strsplit(const char *in, const char *delms, size_t *num_elm);
|
||||
|
||||
/* Frees the result returned from ares_strsplit(). */
|
||||
void ares_strsplit_free(char **elms, size_t num_elm);
|
||||
/* Frees the result returned from ares__strsplit(). */
|
||||
void ares__strsplit_free(char **elms, size_t num_elm);
|
||||
|
||||
|
||||
#endif /* HEADER_CARES_STRSPLIT_H */
|
||||
|
||||
Vendored
+3
-1
@@ -21,7 +21,9 @@ endif
|
||||
|
||||
include Makefile.inc
|
||||
|
||||
LDADD = $(top_builddir)/src/lib/libcares.la
|
||||
# We're not interested in code coverage of the test apps themselves, but need
|
||||
# to link with gcov if building with code coverage enabled
|
||||
LDADD = $(top_builddir)/src/lib/libcares.la $(CODE_COVERAGE_LIBS)
|
||||
|
||||
ahost_SOURCES = ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
|
||||
ahost_CFLAGS = $(AM_CFLAGS)
|
||||
|
||||
Vendored
+12
-4
@@ -134,7 +134,9 @@ am_acountry_OBJECTS = acountry-acountry.$(OBJEXT) $(am__objects_1) \
|
||||
$(am__objects_2)
|
||||
acountry_OBJECTS = $(am_acountry_OBJECTS)
|
||||
acountry_LDADD = $(LDADD)
|
||||
acountry_DEPENDENCIES = $(top_builddir)/src/lib/libcares.la
|
||||
am__DEPENDENCIES_1 =
|
||||
acountry_DEPENDENCIES = $(top_builddir)/src/lib/libcares.la \
|
||||
$(am__DEPENDENCIES_1)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
@@ -149,7 +151,8 @@ am_adig_OBJECTS = adig-adig.$(OBJEXT) $(am__objects_3) \
|
||||
$(am__objects_2)
|
||||
adig_OBJECTS = $(am_adig_OBJECTS)
|
||||
adig_LDADD = $(LDADD)
|
||||
adig_DEPENDENCIES = $(top_builddir)/src/lib/libcares.la
|
||||
adig_DEPENDENCIES = $(top_builddir)/src/lib/libcares.la \
|
||||
$(am__DEPENDENCIES_1)
|
||||
adig_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(adig_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@@ -160,7 +163,8 @@ am_ahost_OBJECTS = ahost-ahost.$(OBJEXT) $(am__objects_4) \
|
||||
$(am__objects_2)
|
||||
ahost_OBJECTS = $(am_ahost_OBJECTS)
|
||||
ahost_LDADD = $(LDADD)
|
||||
ahost_DEPENDENCIES = $(top_builddir)/src/lib/libcares.la
|
||||
ahost_DEPENDENCIES = $(top_builddir)/src/lib/libcares.la \
|
||||
$(am__DEPENDENCIES_1)
|
||||
ahost_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ahost_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@@ -280,6 +284,7 @@ EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GCOV = @GCOV@
|
||||
GENHTML = @GENHTML@
|
||||
GREP = @GREP@
|
||||
@@ -399,7 +404,10 @@ SAMPLEHEADERS = ares_getopt.h \
|
||||
../lib/ares_nowarn.h \
|
||||
../lib/ares_strcasecmp.h
|
||||
|
||||
LDADD = $(top_builddir)/src/lib/libcares.la
|
||||
|
||||
# We're not interested in code coverage of the test apps themselves, but need
|
||||
# to link with gcov if building with code coverage enabled
|
||||
LDADD = $(top_builddir)/src/lib/libcares.la $(CODE_COVERAGE_LIBS)
|
||||
ahost_SOURCES = ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
|
||||
ahost_CFLAGS = $(AM_CFLAGS)
|
||||
ahost_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
|
||||
Vendored
+7
-4
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
|
||||
for ( ; *argv; argv++)
|
||||
{
|
||||
struct in_addr addr;
|
||||
char buf[100];
|
||||
char *buf;
|
||||
|
||||
/* If this fails, assume '*argv' is a host-name that
|
||||
* must be resolved first
|
||||
@@ -171,6 +171,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
buf = malloc(100);
|
||||
sprintf(buf, nerd_fmt,
|
||||
(unsigned int)(addr.s_addr >> 24),
|
||||
(unsigned int)((addr.s_addr >> 16) & 255),
|
||||
@@ -232,6 +233,7 @@ static void callback(void *arg, int status, int timeouts, struct hostent *host)
|
||||
if (!host || status != ARES_SUCCESS)
|
||||
{
|
||||
printf("Failed to lookup %s: %s\n", name, ares_strerror(status));
|
||||
free(arg);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -244,6 +246,7 @@ static void callback(void *arg, int status, int timeouts, struct hostent *host)
|
||||
printf("Failed to get CNAME for %s\n", name);
|
||||
else
|
||||
find_country_from_cname(cname, *(CARES_INADDR_CAST(struct in_addr *, host->h_addr)));
|
||||
free(arg);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -643,10 +646,10 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
|
||||
|
||||
/* Information from the man page. Formatting taken from man -h */
|
||||
static void print_help_info_acountry(void) {
|
||||
printf("acountry, version %s \n\n", ARES_VERSION_STR);
|
||||
printf("usage: acountry [-hdv] {host|addr} ...\n\n"
|
||||
" d : Print some extra debugging output.\n"
|
||||
printf("acountry, version %s\n\n", ARES_VERSION_STR);
|
||||
printf("usage: acountry [-hdv] host|addr ...\n\n"
|
||||
" h : Display this help and exit.\n"
|
||||
" d : Print some extra debugging output.\n"
|
||||
" v : Be more verbose. Print extra information.\n\n");
|
||||
exit(0);
|
||||
}
|
||||
Vendored
+22
-17
@@ -296,6 +296,7 @@ int main(int argc, char **argv)
|
||||
if (!ISDIGIT(*optarg))
|
||||
usage();
|
||||
options.tcp_port = (unsigned short)strtol(optarg, NULL, 0);
|
||||
options.flags |= ARES_FLAG_USEVC;
|
||||
optmask |= ARES_OPT_TCP_PORT;
|
||||
break;
|
||||
|
||||
@@ -959,23 +960,27 @@ static void append_addr_list(struct ares_addr_node **head,
|
||||
|
||||
/* Information from the man page. Formatting taken from man -h */
|
||||
static void print_help_info_adig(void) {
|
||||
printf("adig, version %s \n\n", ARES_VERSION_STR);
|
||||
printf("usage: adig [-h] [-d] [-f flag] [-s server] [-c class] [-t type] [-T|U port] [-x | -xx] name ...\n\n"
|
||||
" d : Print some extra debugging output.\n"
|
||||
" f : Add a flag. Possible values for flag are igntc, noaliases, norecurse, primary, stayopen, usevc.\n"
|
||||
" h : Display this help and exit.\n\n"
|
||||
" T port : Use specified TCP port to connect to DNS server.\n"
|
||||
" U port : Use specified UDP port to connect to DNS server.\n"
|
||||
" c class : Set the query class. Possible values for class are NY, CHAOS, HS, IN (default).\n"
|
||||
" s server : Connect to specified DNS server, instead of the system's default one(s).\n"
|
||||
" t type : Query records of specified type. \n"
|
||||
" Possible values for type are A \n"
|
||||
" (default), AAAA, AFSDB, ANY,\n"
|
||||
" AXFR, CNAME, GPOS, HINFO, ISDN,\n"
|
||||
" KEY, LOC, MAILA, MAILB, MB, MD,\n"
|
||||
" MF, MG, MINFO, MR, MX, NAPTR, NS,\n"
|
||||
" NSAP, NSAP_PTR, NULL, PTR, PX, RP,\n"
|
||||
" RT, SIG, SOA, SRV, TXT, URI, WKS, X25\n\n"
|
||||
printf("adig, version %s\n\n", ARES_VERSION_STR);
|
||||
printf("usage: adig [-h] [-d] [-f flag] [[-s server] ...] [-T|U port] [-c class] [-t type] [-x|-xx] name ...\n\n"
|
||||
" h : Display this help and exit.\n"
|
||||
" d : Print some extra debugging output.\n\n"
|
||||
" f flag : Add a behavior control flag. Possible values are\n"
|
||||
" igntc - ignore to query in TCP to get truncated UDP answer,\n"
|
||||
" noaliases - don't honor the HOSTALIASES environment variable,\n"
|
||||
" norecurse - don't query upstream servers recursively,\n"
|
||||
" primary - use the first server,\n"
|
||||
" stayopen - don't close the communication sockets, and\n"
|
||||
" usevc - use TCP only.\n"
|
||||
" s server : Connect to the specified DNS server, instead of the system's default one(s).\n"
|
||||
" Servers are tried in round-robin, if the previous one failed.\n"
|
||||
" T port : Connect to the specified TCP port of DNS server.\n"
|
||||
" U port : Connect to the specified UDP port of DNS server.\n"
|
||||
" c class : Set the query class. Possible values for class are ANY, CHAOS, HS and IN (default)\n"
|
||||
" t type : Query records of the specified type.\n"
|
||||
" Possible values for type are A (default), AAAA, AFSDB, ANY, AXFR,\n"
|
||||
" CNAME, GPOS, HINFO, ISDN, KEY, LOC, MAILA, MAILB, MB, MD, MF, MG,\n"
|
||||
" MINFO, MR, MX, NAPTR, NS, NSAP, NSAP_PTR, NULL, PTR, PX, RP, RT,\n"
|
||||
" SIG, SOA, SRV, TXT, URI, WKS and X25.\n\n"
|
||||
" -x : For a '-t PTR a.b.c.d' lookup, query for 'd.c.b.a.in-addr.arpa.'\n"
|
||||
" -xx : As above, but for IPv6, compact the format into a bitstring like\n"
|
||||
" '[xabcdef00000000000000000000000000].IP6.ARPA.'\n");
|
||||
|
||||
Vendored
+10
-13
@@ -213,19 +213,16 @@ static void usage(void)
|
||||
|
||||
/* Information from the man page. Formatting taken from man -h */
|
||||
static void print_help_info_ahost(void) {
|
||||
printf("ahost, version %s \n\n", ARES_VERSION_STR);
|
||||
printf("usage: ahost [-h] [-d] [-s {domain}] [-t {a|aaaa|u}] {host|addr} ...\n\n"
|
||||
" d : Print some extra debugging output.\n"
|
||||
" h : Display this help and exit.\n\n"
|
||||
" s domain : Specify the domain to search instead of \n"
|
||||
" using the default values from \n"
|
||||
" /etc/resolv.conf. This option only has an \n"
|
||||
" effect on platforms that use /etc/resolv.conf\n"
|
||||
" for DNS configuration; it has no effect on other\n"
|
||||
" platforms (such as Win32 or Android).\n"
|
||||
printf("ahost, version %s\n\n", ARES_VERSION_STR);
|
||||
printf("usage: ahost [-h] [-d] [[-s domain] ...] [-t a|aaaa|u] host|addr ...\n\n"
|
||||
" h : Display this help and exit.\n"
|
||||
" d : Print some extra debugging output.\n\n"
|
||||
" s domain : Specify the domain to search instead of using the default values\n"
|
||||
" from /etc/resolv.conf. This option only has an effect on\n"
|
||||
" platforms that use /etc/resolv.conf for DNS configuration;\n"
|
||||
" it has no effect on other platforms (such as Win32 or Android).\n\n"
|
||||
" t type : If type is \"a\", print the A record (default).\n"
|
||||
" If type is \"aaaa\", print the AAAA record. If\n"
|
||||
" type is \"u\", look for either AAAA or A record\n"
|
||||
" (in that order).\n\n");
|
||||
" If type is \"aaaa\", print the AAAA record.\n"
|
||||
" If type is \"u\", look for either AAAA or A record (in that order).\n\n");
|
||||
exit(0);
|
||||
}
|
||||
Reference in new issue
Block a user