mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
deps: update c-ares to 1.25.0
PR-URL: https://github.com/nodejs/node/pull/51385 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
This commit is contained in:
1 parent
718e4e6918
commit
0090c10782
301 files changed
+63892
-54082
No files matched your search
Vendored
+1178
-808
File diff suppressed because it is too large.
Load diff
Vendored
+95
-30
@@ -1,6 +1,8 @@
|
||||
# Copyright (C) The c-ares project and its contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
CMAKE_MINIMUM_REQUIRED (VERSION 3.1.0)
|
||||
CMAKE_MINIMUM_REQUIRED (VERSION 3.5.0)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
|
||||
|
||||
INCLUDE (CheckIncludeFiles)
|
||||
INCLUDE (CheckTypeSize)
|
||||
@@ -10,10 +12,10 @@ INCLUDE (CheckCSourceCompiles)
|
||||
INCLUDE (CheckStructHasMember)
|
||||
INCLUDE (CheckLibraryExists)
|
||||
|
||||
PROJECT (c-ares LANGUAGES C VERSION "1.20.1" )
|
||||
PROJECT (c-ares LANGUAGES C VERSION "1.25.0" )
|
||||
|
||||
# Set this version before release
|
||||
SET (CARES_VERSION "1.20.1")
|
||||
SET (CARES_VERSION "1.25.0")
|
||||
|
||||
INCLUDE (GNUInstallDirs) # include this *AFTER* PROJECT(), otherwise paths are wrong.
|
||||
|
||||
@@ -28,26 +30,38 @@ 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 "9:1:7")
|
||||
SET (CARES_LIB_VERSIONINFO "12:1:10")
|
||||
|
||||
|
||||
OPTION (CARES_STATIC "Build as a static library" OFF)
|
||||
OPTION (CARES_SHARED "Build as a shared library" ON)
|
||||
OPTION (CARES_INSTALL "Create installation targets (chain builders may want to disable this)" ON)
|
||||
OPTION (CARES_STATIC_PIC "Build the static library as PIC (position independent)" OFF)
|
||||
OPTION (CARES_BUILD_TESTS "Build and run tests" OFF)
|
||||
OPTION (CARES_STATIC "Build as a static library" OFF)
|
||||
OPTION (CARES_SHARED "Build as a shared library" ON)
|
||||
OPTION (CARES_INSTALL "Create installation targets (chain builders may want to disable this)" ON)
|
||||
OPTION (CARES_STATIC_PIC "Build the static library as PIC (position independent)" OFF)
|
||||
OPTION (CARES_BUILD_TESTS "Build and run tests" OFF)
|
||||
OPTION (CARES_BUILD_CONTAINER_TESTS "Build and run container tests (implies CARES_BUILD_TESTS, Linux only)" OFF)
|
||||
OPTION (CARES_BUILD_TOOLS "Build tools" ON)
|
||||
OPTION (CARES_BUILD_TOOLS "Build tools" ON)
|
||||
OPTION (CARES_SYMBOL_HIDING "Hide private symbols in shared libraries" OFF)
|
||||
OPTION (CARES_THREADS "Build with thread-safety support" ON)
|
||||
SET (CARES_RANDOM_FILE "/dev/urandom" CACHE STRING "Suitable File / Device Path for entropy, such as /dev/urandom")
|
||||
|
||||
|
||||
# Tests require a C++14 compiler
|
||||
IF (CARES_BUILD_TESTS OR CARES_BUILD_CONTAINER_TESTS)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||
set(CMAKE_CXX_EXTENSIONS FALSE)
|
||||
enable_language(CXX)
|
||||
ENDIF ()
|
||||
|
||||
# Tests require static to be enabled on Windows to be able to access otherwise hidden symbols
|
||||
IF (CARES_BUILD_TESTS AND (NOT CARES_STATIC) AND WIN32)
|
||||
IF ((CARES_BUILD_TESTS OR CARES_BUILD_CONTAINER_TESTS) AND (NOT CARES_STATIC) AND WIN32)
|
||||
SET (CARES_STATIC ON)
|
||||
SET (CARES_STATIC_PIC ON)
|
||||
MESSAGE (WARNING "Static building was requested be disabled, but reenabled to support tests")
|
||||
MESSAGE (WARNING "Static building was requested be disabled, but re-enabled to support tests")
|
||||
ENDIF ()
|
||||
|
||||
INCLUDE (EnableWarnings)
|
||||
|
||||
# allow linking against the static runtime library in msvc
|
||||
IF (MSVC)
|
||||
OPTION (CARES_MSVC_STATIC_RUNTIME "Link against the static runtime library" OFF)
|
||||
@@ -70,6 +84,13 @@ IF (MSVC)
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
IF (CARES_SYMBOL_HIDING)
|
||||
IF (CMAKE_VERSION VERSION_LESS 3.12)
|
||||
MESSAGE (FATAL_ERROR "Hiding symbols requires CMake 3.12")
|
||||
ENDIF ()
|
||||
CMAKE_POLICY (SET CMP0063 NEW)
|
||||
ENDIF ()
|
||||
|
||||
# Keep build organized.
|
||||
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
|
||||
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
|
||||
@@ -181,7 +202,12 @@ CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
|
||||
CHECK_INCLUDE_FILES (memory.h HAVE_MEMORY_H)
|
||||
CHECK_INCLUDE_FILES (netdb.h HAVE_NETDB_H)
|
||||
CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H)
|
||||
CHECK_INCLUDE_FILES (net/if.h HAVE_NET_IF_H)
|
||||
# On old MacOS SDK versions, you must include sys/socket.h before net/if.h
|
||||
IF (HAVE_SYS_SOCKET_H)
|
||||
CHECK_INCLUDE_FILES ("sys/socket.h;net/if.h" HAVE_NET_IF_H)
|
||||
ELSE ()
|
||||
CHECK_INCLUDE_FILES (net/if.h HAVE_NET_IF_H)
|
||||
ENDIF ()
|
||||
CHECK_INCLUDE_FILES (signal.h HAVE_SIGNAL_H)
|
||||
CHECK_INCLUDE_FILES (socket.h HAVE_SOCKET_H)
|
||||
CHECK_INCLUDE_FILES (stdbool.h HAVE_STDBOOL_H)
|
||||
@@ -196,10 +222,11 @@ CHECK_INCLUDE_FILES (sys/select.h HAVE_SYS_SELECT_H)
|
||||
CHECK_INCLUDE_FILES (sys/stat.h HAVE_SYS_STAT_H)
|
||||
CHECK_INCLUDE_FILES (sys/time.h HAVE_SYS_TIME_H)
|
||||
CHECK_INCLUDE_FILES (sys/uio.h HAVE_SYS_UIO_H)
|
||||
CHECK_INCLUDE_FILES (sys/random.h HAVE_SYS_RANDOM_H)
|
||||
CHECK_INCLUDE_FILES (ifaddrs.h HAVE_IFADDRS_H)
|
||||
CHECK_INCLUDE_FILES (time.h HAVE_TIME_H)
|
||||
CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H)
|
||||
CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)
|
||||
|
||||
# On OpenBSD, you must include sys/types.h before netinet/tcp.h
|
||||
IF (HAVE_SYS_TYPES_H)
|
||||
CHECK_INCLUDE_FILES ("sys/types.h;netinet/tcp.h" HAVE_NETINET_TCP_H)
|
||||
@@ -213,6 +240,8 @@ ENDIF ()
|
||||
IF (WIN32)
|
||||
CHECK_INCLUDE_FILES ("winsock2.h;windows.h" HAVE_WINSOCK2_H)
|
||||
CHECK_INCLUDE_FILES ("winsock2.h;ws2tcpip.h;windows.h" HAVE_WS2TCPIP_H)
|
||||
CHECK_INCLUDE_FILES ("winsock2.h;iphlpapi.h;windows.h" HAVE_IPHLPAPI_H)
|
||||
CHECK_INCLUDE_FILES ("winsock2.h;netioapi.h;windows.h" HAVE_NETIOAPI_H)
|
||||
CHECK_INCLUDE_FILES ("winsock.h;windows.h" HAVE_WINSOCK_H)
|
||||
CHECK_INCLUDE_FILES (windows.h HAVE_WINDOWS_H)
|
||||
ENDIF ()
|
||||
@@ -221,15 +250,15 @@ ENDIF ()
|
||||
IF (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
LIST (APPEND SYSFLAGS -D_DARWIN_C_SOURCE)
|
||||
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
LIST (APPEND SYSFLAGS -D_GNU_SOURCE -D_POSIX_C_SOURCE=199309L -D_XOPEN_SOURCE=600)
|
||||
LIST (APPEND SYSFLAGS -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700)
|
||||
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||
LIST (APPEND SYSFLAGS -D__EXTENSIONS__ -D_REENTRANT -D_XOPEN_SOURCE=600)
|
||||
LIST (APPEND SYSFLAGS -D__EXTENSIONS__ -D_REENTRANT -D_XOPEN_SOURCE=700)
|
||||
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "AIX")
|
||||
LIST (APPEND SYSFLAGS -D_ALL_SOURCE -D_XOPEN_SOURCE=600 -D_USE_IRS)
|
||||
LIST (APPEND SYSFLAGS -D_ALL_SOURCE -D_XOPEN_SOURCE=700 -D_USE_IRS)
|
||||
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||
# Don't define _XOPEN_SOURCE on FreeBSD, it actually reduces visibility instead of increasing it
|
||||
ELSEIF (WIN32)
|
||||
LIST (APPEND SYSFLAGS -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_WIN32_WINNT=0x0600)
|
||||
LIST (APPEND SYSFLAGS -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_WIN32_WINNT=0x0602)
|
||||
ENDIF ()
|
||||
ADD_DEFINITIONS(${SYSFLAGS})
|
||||
|
||||
@@ -277,6 +306,7 @@ CARES_EXTRAINCLUDE_IFSET (HAVE_ARPA_INET_H arpa/inet.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_ARPA_NAMESER_H arpa/nameser.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_NETDB_H netdb.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_NET_IF_H net/if.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_IFADDRS_H ifaddrs.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_NETINET_IN_H netinet/in.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_NETINET_TCP_H netinet/tcp.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_SIGNAL_H signal.h)
|
||||
@@ -289,12 +319,15 @@ CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_SELECT_H sys/select.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_SOCKET_H sys/socket.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_SOCKIO_H sys/sockio.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_TIME_H sys/time.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_STAT_H sys/stat.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_UIO_H sys/uio.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_RANDOM_H sys/random.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_TIME_H time.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_FCNTL_H fcntl.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_UNISTD_H unistd.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_WINSOCK2_H winsock2.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_WS2TCPIP_H ws2tcpip.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_IPHLPAPI_H iphlpapi.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_WINDOWS_H windows.h)
|
||||
|
||||
# Check Types
|
||||
@@ -323,10 +356,8 @@ ENDMACRO ()
|
||||
|
||||
CARES_TYPE_EXISTS (socklen_t HAVE_SOCKLEN_T)
|
||||
CARES_TYPE_EXISTS (SOCKET HAVE_TYPE_SOCKET)
|
||||
CARES_TYPE_EXISTS (bool HAVE_BOOL_T)
|
||||
CARES_TYPE_EXISTS (ssize_t HAVE_SSIZE_T)
|
||||
CARES_TYPE_EXISTS ("long long" HAVE_LONGLONG)
|
||||
CARES_TYPE_EXISTS (sig_atomic_t HAVE_SIG_ATOMIC_T)
|
||||
CARES_TYPE_EXISTS ("struct addrinfo" HAVE_STRUCT_ADDRINFO)
|
||||
CARES_TYPE_EXISTS ("struct in6_addr" HAVE_STRUCT_IN6_ADDR)
|
||||
CARES_TYPE_EXISTS ("struct sockaddr_in6" HAVE_STRUCT_SOCKADDR_IN6)
|
||||
@@ -351,13 +382,9 @@ IF ((NOT APPLE) OR IOS_V10 OR MACOS_V1012)
|
||||
CHECK_SYMBOL_EXISTS (CLOCK_MONOTONIC "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CLOCK_GETTIME_MONOTONIC)
|
||||
ENDIF ()
|
||||
|
||||
CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6" sin6_scope_id "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID LANGUAGE C)
|
||||
|
||||
# Check for "LL" numeric suffix support
|
||||
CHECK_C_SOURCE_COMPILES ("int main() { int n=1234LL; return 0; }" HAVE_LL)
|
||||
CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6" sin6_scope_id "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID LANGUAGE C)
|
||||
|
||||
|
||||
CHECK_SYMBOL_EXISTS (bitncmp "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_BITNCMP)
|
||||
CHECK_SYMBOL_EXISTS (closesocket "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CLOSESOCKET)
|
||||
CHECK_SYMBOL_EXISTS (CloseSocket "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CLOSESOCKET_CAMEL)
|
||||
CHECK_SYMBOL_EXISTS (connect "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CONNECT)
|
||||
@@ -365,8 +392,6 @@ CHECK_SYMBOL_EXISTS (fcntl "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_FCNTL)
|
||||
CHECK_SYMBOL_EXISTS (freeaddrinfo "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_FREEADDRINFO)
|
||||
CHECK_SYMBOL_EXISTS (getaddrinfo "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETADDRINFO)
|
||||
CHECK_SYMBOL_EXISTS (getenv "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETENV)
|
||||
CHECK_SYMBOL_EXISTS (gethostbyaddr "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETHOSTBYADDR)
|
||||
CHECK_SYMBOL_EXISTS (gethostbyname "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETHOSTBYNAME)
|
||||
CHECK_SYMBOL_EXISTS (gethostname "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETHOSTNAME)
|
||||
CHECK_SYMBOL_EXISTS (getnameinfo "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETNAMEINFO)
|
||||
CHECK_SYMBOL_EXISTS (getrandom "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETRANDOM)
|
||||
@@ -374,6 +399,9 @@ CHECK_SYMBOL_EXISTS (getservbyport_r "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETSERV
|
||||
CHECK_SYMBOL_EXISTS (getservbyname_r "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETSERVBYNAME_R)
|
||||
CHECK_SYMBOL_EXISTS (gettimeofday "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETTIMEOFDAY)
|
||||
CHECK_SYMBOL_EXISTS (if_indextoname "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_IF_INDEXTONAME)
|
||||
CHECK_SYMBOL_EXISTS (if_nametoindex "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_IF_NAMETOINDEX)
|
||||
CHECK_SYMBOL_EXISTS (ConvertInterfaceIndexToLuid "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CONVERTINTERFACEINDEXTOLUID)
|
||||
CHECK_SYMBOL_EXISTS (ConvertInterfaceLuidToNameA "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CONVERTINTERFACELUIDTONAMEA)
|
||||
CHECK_SYMBOL_EXISTS (inet_net_pton "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_INET_NET_PTON)
|
||||
IF (NOT WIN32)
|
||||
# Disabled on Windows, because these functions are only really supported on Windows
|
||||
@@ -399,7 +427,8 @@ CHECK_SYMBOL_EXISTS (strncmpi "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRNCMP
|
||||
CHECK_SYMBOL_EXISTS (strnicmp "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRNICMP)
|
||||
CHECK_SYMBOL_EXISTS (writev "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_WRITEV)
|
||||
CHECK_SYMBOL_EXISTS (arc4random_buf "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_ARC4RANDOM_BUF)
|
||||
|
||||
CHECK_SYMBOL_EXISTS (stat "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STAT)
|
||||
CHECK_SYMBOL_EXISTS (getifaddrs "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETIFADDRS)
|
||||
|
||||
# On Android, the system headers may define __system_property_get(), but excluded
|
||||
# from libc. We need to perform a link test instead of a header/symbol test.
|
||||
@@ -411,6 +440,43 @@ SET (CMAKE_REQUIRED_DEFINITIONS)
|
||||
SET (CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
|
||||
################################################################################
|
||||
# Threading Support
|
||||
#
|
||||
IF (CARES_THREADS)
|
||||
IF (WIN32)
|
||||
# Do nothing, always has threads
|
||||
ELSE ()
|
||||
# Need to prefer pthreads on platforms that may have more threading choices
|
||||
# (e.g. Solaris)
|
||||
SET (CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
FIND_PACKAGE (Threads)
|
||||
|
||||
IF (Threads_FOUND)
|
||||
# Fix solaris9 bug due to libc having pthread_create() stubs that always fail. CMake
|
||||
# doesn't realize that the real pthread functions aren't in libc, so sets the pthread
|
||||
# library CAKE_THREAD_LIBS_INIT variable to blank instead of to the correct "-lpthread".
|
||||
IF (CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND NOT CMAKE_THREAD_LIBS_INIT)
|
||||
SET (CMAKE_THREAD_LIBS_INIT "-lpthread")
|
||||
ENDIF ()
|
||||
|
||||
# PThread functions.
|
||||
CHECK_INCLUDE_FILES (pthread.h HAVE_PTHREAD_H)
|
||||
CHECK_INCLUDE_FILES (pthread_np.h HAVE_PTHREAD_NP_H)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_PTHREAD_H pthread.h)
|
||||
CARES_EXTRAINCLUDE_IFSET (HAVE_PTHREAD_NP_H pthread_np.h)
|
||||
CHECK_SYMBOL_EXISTS (pthread_init "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_PTHREAD_INIT)
|
||||
# Make sure libcares.pc.cmake knows about thread libraries on static builds
|
||||
LIST (APPEND CARES_DEPENDENT_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
||||
ELSE ()
|
||||
MESSAGE (WARNING "Threading support not found, disabling...")
|
||||
SET (CARES_THREADS OFF)
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
# recv, recvfrom, send, getnameinfo, gethostname
|
||||
# ARGUMENTS AND RETURN VALUES
|
||||
@@ -421,7 +487,7 @@ SET (CMAKE_REQUIRED_LIBRARIES)
|
||||
# defaults. This should be much quicker and nearly as accurate ... and even
|
||||
# if not, it probably won't matter in the least.
|
||||
|
||||
IF (HAVE_SSIZE_T AND HAVE_SOCKLEN_T)
|
||||
IF (HAVE_SSIZE_T AND HAVE_SOCKLEN_T AND NOT WIN32)
|
||||
# If we have ssize_t and socklen_t, the API is usually sane and uses ssize_t and size_t for lengths
|
||||
SET (RECVFROM_TYPE_RETV ssize_t)
|
||||
SET (RECVFROM_TYPE_ARG3 size_t)
|
||||
@@ -656,7 +722,6 @@ IF (CARES_INSTALL)
|
||||
|
||||
# pkgconfig support
|
||||
IF (NOT CARES_SHARED)
|
||||
SET (CPPFLAG_CARES_STATICLIB "-DCARES_STATICLIB")
|
||||
FOREACH (LIB ${CARES_DEPENDENT_LIBS})
|
||||
SET (CARES_PRIVATE_LIBS "${CARES_PRIVATE_LIBS} -l${LIB}")
|
||||
ENDFOREACH ()
|
||||
|
||||
Vendored
+16
-11
@@ -32,7 +32,7 @@ the same for both Git and official release tarballs.
|
||||
AutoTools Build
|
||||
===============
|
||||
|
||||
### General Information, works on most Unix Platforms (Linux, FreeBSD, etc)
|
||||
### General Information, works on most Unix Platforms (Linux, FreeBSD, etc.)
|
||||
|
||||
A normal Unix installation is made in three or four steps (after you've
|
||||
unpacked the source archive):
|
||||
@@ -57,7 +57,7 @@ you need to specify that already when running configure:
|
||||
|
||||
If you happen to have write permission in that directory, you can do `make
|
||||
install` without being root. An example of this would be to make a local
|
||||
install in your own home directory:
|
||||
installation in your own home directory:
|
||||
|
||||
./configure --prefix=$HOME
|
||||
make
|
||||
@@ -183,7 +183,7 @@ Method using a configure cross-compile (tested with Android NDK r7b):
|
||||
|
||||
./tools/make-standalone-toolchain.sh
|
||||
|
||||
which creates a usual cross-compile toolchain. Lets assume that you put
|
||||
which creates a usual cross-compile toolchain. Let's assume that you put
|
||||
this toolchain below `/opt` then invoke configure with something
|
||||
like:
|
||||
|
||||
@@ -213,7 +213,7 @@ CMake builds
|
||||
============
|
||||
|
||||
Current releases of c-ares introduce a CMake v3+ build system that has been
|
||||
tested on most platforms including Windows, Linux, FreeBSD, MacOS, AIX and
|
||||
tested on most platforms including Windows, Linux, FreeBSD, macOS, AIX and
|
||||
Solaris.
|
||||
|
||||
In the most basic form, building with CMake might look like:
|
||||
@@ -233,18 +233,23 @@ Options
|
||||
Options to CMake are passed on the command line using "-D${OPTION}=${VALUE}".
|
||||
The values defined are all boolean and take values like On, Off, True, False.
|
||||
|
||||
* CARES_STATIC - Build the static library (off by default)
|
||||
* CARES_SHARED - Build the shared library (on by default)
|
||||
* CARES_INSTALL - Hook in installation, useful to disable if chain building
|
||||
* CARES_STATIC_PIC - Build the static library as position-independent (off by
|
||||
default)
|
||||
|
||||
| Option Name | Description | Default Value |
|
||||
|-----------------------------|-----------------------------------------------------------------------|----------------|
|
||||
| CARES_STATIC | Build the static library | Off |
|
||||
| CARES_SHARED | Build the shared library | On |
|
||||
| CARES_INSTALL | Hook in installation, useful to disable if chain building | On |
|
||||
| CARES_STATIC_PIC | Build the static library as position-independent | Off |
|
||||
| CARES_BUILD_TESTS | Build and run tests | Off |
|
||||
| CARES_BUILD_CONTAINER_TESTS | Build and run container tests (implies CARES_BUILD_TESTS, Linux only) | Off |
|
||||
| CARES_BUILD_TOOLS | Build tools | On |
|
||||
| CARES_SYMBOL_HIDING | Hide private symbols in shared libraries | Off |
|
||||
| CARES_THREADS | Build with thread-safety support | On |
|
||||
|
||||
Ninja
|
||||
-----
|
||||
|
||||
Ninja is the next-generation build system meant for generators like CMake that
|
||||
heavily parallize builds. Its use is very similar to the normal build:
|
||||
heavily parallelize builds. Its use is very similar to the normal build:
|
||||
|
||||
```sh
|
||||
cd /path/to/cmake/source
|
||||
|
||||
Vendored
+4
-4
@@ -41,9 +41,9 @@ MD = mkdir
|
||||
RD = rmdir /q /s 2>NUL
|
||||
CP = copy
|
||||
|
||||
CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -aa &
|
||||
-wcd=201 -bt=nt -d+ -dWIN32 -dCARES_BUILDING_LIBRARY &
|
||||
-dNTDDI_VERSION=0x06000000 -I. -I.\include -I.\src\lib $(SYS_INCL)
|
||||
CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -aa &
|
||||
-wcd=201 -bt=nt -d+ -dWIN32 -dCARES_BUILDING_LIBRARY &
|
||||
-dNTDDI_VERSION=0x06020000 -I. -I.\include -I.\src\lib $(SYS_INCL)
|
||||
|
||||
LFLAGS = option quiet, map, caseexact, eliminate
|
||||
|
||||
@@ -55,7 +55,7 @@ LFLAGS += debug all
|
||||
CFLAGS += -d0
|
||||
!endif
|
||||
|
||||
CFLAGS += -d_WIN32_WINNT=0x0600
|
||||
CFLAGS += -d_WIN32_WINNT=0x0602
|
||||
|
||||
#
|
||||
# Change to suite.
|
||||
|
||||
Vendored
+2
-2
@@ -30,8 +30,8 @@ EXTRA_DIST = AUTHORS CHANGES README.cares $(man_MANS) RELEASE-NOTES \
|
||||
c-ares-config.cmake.in libcares.pc.cmake libcares.pc.in buildconf get_ver.awk \
|
||||
maketgz TODO README.msvc $(MSVCFILES) INSTALL.md README.md LICENSE.md \
|
||||
CMakeLists.txt Makefile.dj Makefile.m32 Makefile.netware Makefile.msvc \
|
||||
Makefile.Watcom AUTHORS CONTRIBUTING.md SECURITY.md TODO
|
||||
|
||||
Makefile.Watcom AUTHORS CONTRIBUTING.md SECURITY.md TODO \
|
||||
cmake/EnableWarnings.cmake
|
||||
|
||||
CLEANFILES = $(PDFPAGES) $(HTMLPAGES)
|
||||
|
||||
|
||||
Vendored
+33
-20
@@ -115,25 +115,24 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_ac_append_to_file.m4 \
|
||||
$(top_srcdir)/m4/ax_ac_print_to_file.m4 \
|
||||
$(top_srcdir)/m4/ax_add_am_macro_static.m4 \
|
||||
$(top_srcdir)/m4/ax_am_macros_static.m4 \
|
||||
$(top_srcdir)/m4/ax_append_compile_flags.m4 \
|
||||
$(top_srcdir)/m4/ax_append_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_append_link_flags.m4 \
|
||||
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_check_gnu_make.m4 \
|
||||
$(top_srcdir)/m4/ax_check_link_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_check_user_namespace.m4 \
|
||||
$(top_srcdir)/m4/ax_check_uts_namespace.m4 \
|
||||
$(top_srcdir)/m4/ax_code_coverage.m4 \
|
||||
$(top_srcdir)/m4/ax_compiler_vendor.m4 \
|
||||
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
|
||||
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \
|
||||
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_14.m4 \
|
||||
$(top_srcdir)/m4/ax_file_escapes.m4 \
|
||||
$(top_srcdir)/m4/ax_pthread.m4 \
|
||||
$(top_srcdir)/m4/ax_require_defined.m4 \
|
||||
$(top_srcdir)/m4/cares-compilers.m4 \
|
||||
$(top_srcdir)/m4/cares-confopts.m4 \
|
||||
$(top_srcdir)/m4/cares-functions.m4 \
|
||||
$(top_srcdir)/m4/cares-reentrant.m4 \
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/xc-am-iface.m4 \
|
||||
$(top_srcdir)/m4/xc-cc-check.m4 \
|
||||
$(top_srcdir)/m4/xc-lt-iface.m4 \
|
||||
$(top_srcdir)/m4/xc-translit.m4 \
|
||||
$(top_srcdir)/m4/xc-val-flgs.m4 \
|
||||
$(top_srcdir)/m4/zz40-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
@@ -228,8 +227,14 @@ am__define_uniq_tagged_files = \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libcares.pc.in \
|
||||
AUTHORS INSTALL.md NEWS README.md TODO compile config.guess \
|
||||
config.sub depcomp install-sh ltmain.sh missing
|
||||
$(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \
|
||||
$(top_srcdir)/config/config.sub \
|
||||
$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
|
||||
$(top_srcdir)/config/missing AUTHORS INSTALL.md NEWS README.md \
|
||||
TODO compile config.guess config.sub config/compile \
|
||||
config/config.guess config/config.sub config/install-sh \
|
||||
config/ltmain.sh config/missing depcomp install-sh ltmain.sh \
|
||||
missing
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
@@ -284,14 +289,13 @@ AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BUILD_SUBDIRS = @BUILD_SUBDIRS@
|
||||
CARES_CFLAG_EXTRAS = @CARES_CFLAG_EXTRAS@
|
||||
CARES_PRIVATE_LIBS = @CARES_PRIVATE_LIBS@
|
||||
CARES_RANDOM_FILE = @CARES_RANDOM_FILE@
|
||||
CARES_SYMBOL_HIDING_CFLAG = @CARES_SYMBOL_HIDING_CFLAG@
|
||||
CARES_VERSION_INFO = @CARES_VERSION_INFO@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAG_CARES_SYMBOL_HIDING = @CFLAG_CARES_SYMBOL_HIDING@
|
||||
CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
|
||||
CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@
|
||||
CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
|
||||
@@ -299,7 +303,6 @@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
|
||||
CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPFLAG_CARES_STATICLIB = @CPPFLAG_CARES_STATICLIB@
|
||||
CSCOPE = @CSCOPE@
|
||||
CTAGS = @CTAGS@
|
||||
CXX = @CXX@
|
||||
@@ -322,8 +325,10 @@ FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GCOV = @GCOV@
|
||||
GENHTML = @GENHTML@
|
||||
GMOCK_CFLAGS = @GMOCK_CFLAGS@
|
||||
GMOCK_LIBS = @GMOCK_LIBS@
|
||||
GREP = @GREP@
|
||||
HAVE_CXX11 = @HAVE_CXX11@
|
||||
HAVE_CXX14 = @HAVE_CXX14@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
@@ -357,6 +362,13 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PTHREAD_CC = @PTHREAD_CC@
|
||||
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
|
||||
PTHREAD_CXX = @PTHREAD_CXX@
|
||||
PTHREAD_LIBS = @PTHREAD_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
@@ -376,6 +388,7 @@ am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
ax_pthread_config = @ax_pthread_config@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
@@ -414,7 +427,6 @@ runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
subdirs = @subdirs@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
@@ -430,7 +442,8 @@ EXTRA_DIST = AUTHORS CHANGES README.cares $(man_MANS) RELEASE-NOTES \
|
||||
c-ares-config.cmake.in libcares.pc.cmake libcares.pc.in buildconf get_ver.awk \
|
||||
maketgz TODO README.msvc $(MSVCFILES) INSTALL.md README.md LICENSE.md \
|
||||
CMakeLists.txt Makefile.dj Makefile.m32 Makefile.netware Makefile.msvc \
|
||||
Makefile.Watcom AUTHORS CONTRIBUTING.md SECURITY.md TODO
|
||||
Makefile.Watcom AUTHORS CONTRIBUTING.md SECURITY.md TODO \
|
||||
cmake/EnableWarnings.cmake
|
||||
|
||||
CLEANFILES = $(PDFPAGES) $(HTMLPAGES)
|
||||
DISTCLEANFILES = include/ares_build.h
|
||||
|
||||
Vendored
+2
-1
@@ -19,7 +19,7 @@ RANLIB = $(CROSSPREFIX)ranlib
|
||||
#RM = rm -f
|
||||
CP = cp -afv
|
||||
|
||||
CFLAGS = $(CARES_CFLAG_EXTRAS) -O2 -Wall -I./include -I./src/lib -D_WIN32_WINNT=0x0600
|
||||
CFLAGS = $(CARES_CFLAG_EXTRAS) -O2 -Wall -I./include -I./src/lib -D_WIN32_WINNT=0x0602
|
||||
CFLAGS += -DCARES_STATICLIB
|
||||
LDFLAGS = $(CARES_LDFLAG_EXTRAS) -s
|
||||
LIBS = -lws2_32 -liphlpapi
|
||||
@@ -63,6 +63,7 @@ install:
|
||||
chmod u-w ${DESTDIR}${libdir}/$(LIB)
|
||||
${INSTALL} -m 444 ${srcdir}/include/ares.h ${DESTDIR}${includedir}
|
||||
${INSTALL} -m 444 ${srcdir}/include/ares_build.h ${DESTDIR}${includedir}
|
||||
${INSTALL} -m 444 ${srcdir}/include/ares_dns_record.h ${DESTDIR}${includedir}
|
||||
${INSTALL} -m 444 ${srcdir}/include/ares_rules.h ${DESTDIR}${includedir}
|
||||
${INSTALL} -m 444 ${srcdir}/include/ares_version.h ${DESTDIR}${includedir}
|
||||
(for man in $(MANPAGES); do \
|
||||
|
||||
Vendored
+2
-1
@@ -180,7 +180,7 @@ CFLAGS = /UWIN32 /DWATT32 /I$(WATT_ROOT)\inc
|
||||
EX_LIBS_REL = $(WATT_ROOT)\lib\wattcpvc_imp.lib
|
||||
EX_LIBS_DBG = $(WATT_ROOT)\lib\wattcpvc_imp_d.lib
|
||||
!ELSE
|
||||
CFLAGS = /DWIN32 /D_WIN32_WINNT=0x0600
|
||||
CFLAGS = /DWIN32 /D_WIN32_WINNT=0x0602
|
||||
EX_LIBS_REL = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib
|
||||
EX_LIBS_DBG = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib
|
||||
!ENDIF
|
||||
@@ -437,6 +437,7 @@ install:
|
||||
@copy /y $(SRCDIR)\include\ares_build.h "$(INSTALL_DIR_INC)" >NUL
|
||||
@copy /y $(SRCDIR)\include\ares_rules.h "$(INSTALL_DIR_INC)" >NUL
|
||||
@copy /y $(SRCDIR)\include\ares_version.h "$(INSTALL_DIR_INC)" >NUL
|
||||
@copy /y $(SRCDIR)\include\ares_dns_record.h "$(INSTALL_DIR_INC)" >NUL
|
||||
@echo Installed c-ares $(CFG)
|
||||
|
||||
!ENDIF
|
||||
|
||||
Vendored
+2
-2
@@ -92,7 +92,7 @@ ifeq ($(LIBARCH),LIBC)
|
||||
CFLAGS += -align 4
|
||||
else
|
||||
# PRELUDE = $(SDK_CLIB)/imports/clibpre.o
|
||||
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
|
||||
# to avoid the __init_* / __deinit_* whose dont use prelude from NDK
|
||||
PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
|
||||
# CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
|
||||
CFLAGS += -align 1
|
||||
@@ -114,7 +114,7 @@ ifeq ($(LIBARCH),LIBC)
|
||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
||||
else
|
||||
# PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
|
||||
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
|
||||
# to avoid the __init_* / __deinit_* whose dont use prelude from NDK
|
||||
# http://www.gknw.net/development/mk_nlm/gcc_pre.zip
|
||||
PRELUDE = $(NDK_ROOT)/pre/prelude.o
|
||||
CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
|
||||
|
||||
Vendored
+4
-2
@@ -6,6 +6,8 @@ c-ares
|
||||
[](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://sonarcloud.io/summary/new_code?id=c-ares_c-ares)
|
||||
[](https://scan.coverity.com/projects/c-ares)
|
||||
|
||||
This is c-ares, an asynchronous resolver library. It is intended for
|
||||
applications which need to perform DNS queries without blocking, or need to
|
||||
@@ -21,7 +23,7 @@ If you find bugs, correct flaws, have questions or have comments in general in
|
||||
regard to c-ares (or by all means the original ares too), get in touch with us
|
||||
on the c-ares mailing list: https://lists.haxx.se/listinfo/c-ares
|
||||
|
||||
c-ares is distributed the MIT license.
|
||||
c-ares is distributed under the MIT license.
|
||||
|
||||
You'll find all c-ares details and news here:
|
||||
https://c-ares.org/
|
||||
@@ -47,7 +49,7 @@ Notes for c-ares hackers
|
||||
|
||||
* If you intend to distribute an already compiled c-ares library you **MUST**
|
||||
also distribute along with it the generated `ares_build.h` which has been
|
||||
used to compile it. Otherwise the library will be of no use for the users of
|
||||
used to compile it. Otherwise, the library will be of no use for the users of
|
||||
the library that you have built. It is **your** responsibility to provide this
|
||||
file. No one at the c-ares project can know how you have built the library.
|
||||
|
||||
|
||||
Vendored
+37
-64
@@ -1,74 +1,47 @@
|
||||
c-ares version 1.20.1
|
||||
c-ares version 1.25.0
|
||||
|
||||
This release resolves a significant issue in the 1.20.0 release.
|
||||
|
||||
Bug fixes:
|
||||
o Resolve use-after-free issue when TCP connection is terminated before a
|
||||
response is returned [17]
|
||||
o Reduce number of queries for a load test case to prevent overloading some
|
||||
build systems
|
||||
o Fix fuzz test build target [18]
|
||||
|
||||
|
||||
c-ares 1.20.0 notes below:
|
||||
|
||||
This is a feature and bugfix release with some significant internal changes.
|
||||
This is a maintenance release.
|
||||
|
||||
Changes:
|
||||
o Update from 1989 MIT license text to modern MIT license text [1]
|
||||
o Remove acountry from built tools as nerd.dk is gone [3]
|
||||
o Add new ARES_OPT_UDP_MAX_QUERIES configuration option to limit the number of
|
||||
queries that can be made from a single ephemeral port [7]
|
||||
o Default per-query timeout has been reduced to 2s with a 3x retry count [8]
|
||||
o Modernization: start implementing some common data structures that are easy
|
||||
to use and hard to misuse. This will make code refactoring easier and remove
|
||||
some varied implementations in use. This change also makes ares_timeout()
|
||||
more efficient [9]
|
||||
o Use SPDX identifiers and a REUSE CI job to verify [12]
|
||||
o rand: add support for getrandom() [14]
|
||||
o AutoTools: rewrite build system to be lighter weight and fix issues in some
|
||||
semi-modern systems. It is likely this has broken building on some less
|
||||
common and legacy OSs, please report issues. [1]
|
||||
o Rewrite ares_strsplit() as a wrapper for ares__buf_split() for memory
|
||||
safety reasons. [4]
|
||||
o The ahost utility now uses ares_getaddrinfo() and returns both IPv4 and
|
||||
IPv6 addresses by default. [6]
|
||||
o OpenBSD: Add SOCK_DNS flag when creating socket. [12]
|
||||
|
||||
Bug fixes:
|
||||
o TCP back to back queries were broken [2]
|
||||
o Ensure queries for ares_getaddrinfo() are not requeued during destruction [4]
|
||||
o ares_getaddrinfo() should not retry other address classes if one address
|
||||
class has already been returned [5]
|
||||
o Avoid production ill-formed result when qualifying a name with the root
|
||||
domain [6]
|
||||
o Fix missing prefix for CMake generated libcares.pc [10]
|
||||
o DNS server ports will now be read from system configuration instead of
|
||||
defaulting to port 53 [11]
|
||||
o Remove some unreachable code [13]
|
||||
o Replace usages of sprintf with snprintf [15]
|
||||
o Fix Watcom instructions and update Windows URLs [16]
|
||||
Bug Fixes:
|
||||
o Tests: Live reverse lookups for Google's public DNS servers no longer
|
||||
return results, replace with CloudFlare pubic DNS servers. [2]
|
||||
o MacOS legacy SDKs require sys/socket.h before net/if.h [3]
|
||||
o Connection failures should increment the server failure count first or a
|
||||
retry might be enqueued to the same server. [5]
|
||||
o On systems that don't implement the ability to enumerate network interfaces
|
||||
the stubs used the wrong prototype. [7]
|
||||
o Fix minor warnings and documentation typos. [8]
|
||||
o Fix support for older GoogleTest versions. [9]
|
||||
o getrandom() may require sys/random.h on some systems. [10]
|
||||
o Fix building tests with symbol hiding enabled. [11]
|
||||
|
||||
Thanks go to these friendly people for their efforts and contributions:
|
||||
Alexey A Tikhonov (@alexey-tikhonov)
|
||||
Ben Noordhuis (@bnoordhuis)
|
||||
Brad House (@bradh352)
|
||||
@Chilledheart
|
||||
Daniel Stenberg (@bagder)
|
||||
Douglas R. Reno (@renodr)
|
||||
Jérôme Duval (@korli)
|
||||
Sam Morris (@yrro)
|
||||
Tim Wojtulewicz (@timwoj)
|
||||
(9 contributors)
|
||||
Gregor Jasny (@gjasny)
|
||||
Martin Chang (@marty1885)
|
||||
(4 contributors)
|
||||
|
||||
References to bug reports and discussions on issues:
|
||||
[1] = https://github.com/c-ares/c-ares/pull/556
|
||||
[2] = https://github.com/c-ares/c-ares/pull/552
|
||||
[3] = https://github.com/c-ares/c-ares/pull/554
|
||||
[4] = https://github.com/c-ares/c-ares/pull/553
|
||||
[5] = https://github.com/c-ares/c-ares/pull/551
|
||||
[6] = https://github.com/c-ares/c-ares/pull/546
|
||||
[7] = https://github.com/c-ares/c-ares/pull/549
|
||||
[8] = https://github.com/c-ares/c-ares/pull/542
|
||||
[9] = https://github.com/c-ares/c-ares/pull/540
|
||||
[10] = https://github.com/c-ares/c-ares/pull/530
|
||||
[11] = https://github.com/c-ares/c-ares/pull/534
|
||||
[12] = https://github.com/c-ares/c-ares/commit/c1b00c41
|
||||
[13] = https://github.com/c-ares/c-ares/pull/527
|
||||
[14] = https://github.com/c-ares/c-ares/pull/526
|
||||
[15] = https://github.com/c-ares/c-ares/pull/525
|
||||
[16] = https://github.com/c-ares/c-ares/pull/524
|
||||
[17] = https://github.com/c-ares/c-ares/pull/562
|
||||
[18] = https://github.com/c-ares/c-ares/pull/559
|
||||
[1] = https://github.com/c-ares/c-ares/pull/674
|
||||
[2] = https://github.com/c-ares/c-ares/commit/1231aa7
|
||||
[3] = https://github.com/c-ares/c-ares/pull/673
|
||||
[4] = https://github.com/c-ares/c-ares/commit/88c444d
|
||||
[5] = https://github.com/c-ares/c-ares/commit/05181a6
|
||||
[6] = https://github.com/c-ares/c-ares/pull/669
|
||||
[7] = https://github.com/c-ares/c-ares/commit/eebfe0c
|
||||
[8] = https://github.com/c-ares/c-ares/pull/666
|
||||
[9] = https://github.com/c-ares/c-ares/commit/d186f11
|
||||
[10] = https://github.com/c-ares/c-ares/issues/665
|
||||
[11] = https://github.com/c-ares/c-ares/issues/664
|
||||
[12] = https://github.com/c-ares/c-ares/pull/659
|
||||
Vendored
+1
-20
@@ -1,23 +1,4 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
ares_reinit()
|
||||
|
||||
- To allow an app to force a re-read of /etc/resolv.conf etc, pretty much
|
||||
like the res_init() resolver function offers
|
||||
|
||||
ares_gethostbyname
|
||||
|
||||
- When built to support IPv6, it needs to also support PF_UNSPEC or similar,
|
||||
so that an application can ask for any protocol and then c-ares would return
|
||||
all known resolves and not just explicitly IPv4 _or_ IPv6 resolves.
|
||||
|
||||
ares_process
|
||||
|
||||
- Upon next ABI breakage ares_process() should be changed to return 'int'
|
||||
and return ARES_ENOTINITIALIZED if ares_library_init() has not been called.
|
||||
|
||||
ares_process_fd
|
||||
|
||||
- Upon next ABI breakage ares_process_fd() should be changed to return
|
||||
'int' and return ARES_ENOTINITIALIZED if library has not been initialized.
|
||||
Please see https://github.com/c-ares/c-ares/issues
|
||||
Vendored
-1916
File diff suppressed because it is too large.
Load diff
Vendored
+48
-12
@@ -108,6 +108,43 @@ AC_DEFUN([AM_AUX_DIR_EXPAND],
|
||||
am_aux_dir=`cd "$ac_aux_dir" && pwd`
|
||||
])
|
||||
|
||||
# AM_COND_IF -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2008-2021 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# _AM_COND_IF
|
||||
# _AM_COND_ELSE
|
||||
# _AM_COND_ENDIF
|
||||
# --------------
|
||||
# These macros are only used for tracing.
|
||||
m4_define([_AM_COND_IF])
|
||||
m4_define([_AM_COND_ELSE])
|
||||
m4_define([_AM_COND_ENDIF])
|
||||
|
||||
# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
|
||||
# ---------------------------------------
|
||||
# If the shell condition COND is true, execute IF-TRUE, otherwise execute
|
||||
# IF-FALSE. Allow automake to learn about conditional instantiating macros
|
||||
# (the AC_CONFIG_FOOS).
|
||||
AC_DEFUN([AM_COND_IF],
|
||||
[m4_ifndef([_AM_COND_VALUE_$1],
|
||||
[m4_fatal([$0: no such condition "$1"])])dnl
|
||||
_AM_COND_IF([$1])dnl
|
||||
if test -z "$$1_TRUE"; then :
|
||||
m4_n([$2])[]dnl
|
||||
m4_ifval([$3],
|
||||
[_AM_COND_ELSE([$1])dnl
|
||||
else
|
||||
$3
|
||||
])dnl
|
||||
_AM_COND_ENDIF([$1])dnl
|
||||
fi[]dnl
|
||||
])
|
||||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997-2021 Free Software Foundation, Inc.
|
||||
@@ -1188,25 +1225,24 @@ m4_include([m4/ax_ac_append_to_file.m4])
|
||||
m4_include([m4/ax_ac_print_to_file.m4])
|
||||
m4_include([m4/ax_add_am_macro_static.m4])
|
||||
m4_include([m4/ax_am_macros_static.m4])
|
||||
m4_include([m4/ax_append_compile_flags.m4])
|
||||
m4_include([m4/ax_append_flag.m4])
|
||||
m4_include([m4/ax_append_link_flags.m4])
|
||||
m4_include([m4/ax_check_compile_flag.m4])
|
||||
m4_include([m4/ax_check_gnu_make.m4])
|
||||
m4_include([m4/ax_check_link_flag.m4])
|
||||
m4_include([m4/ax_check_user_namespace.m4])
|
||||
m4_include([m4/ax_check_uts_namespace.m4])
|
||||
m4_include([m4/ax_code_coverage.m4])
|
||||
m4_include([m4/ax_compiler_vendor.m4])
|
||||
m4_include([m4/ax_cxx_compile_stdcxx.m4])
|
||||
m4_include([m4/ax_cxx_compile_stdcxx_11.m4])
|
||||
m4_include([m4/ax_cxx_compile_stdcxx_14.m4])
|
||||
m4_include([m4/ax_file_escapes.m4])
|
||||
m4_include([m4/ax_pthread.m4])
|
||||
m4_include([m4/ax_require_defined.m4])
|
||||
m4_include([m4/cares-compilers.m4])
|
||||
m4_include([m4/cares-confopts.m4])
|
||||
m4_include([m4/cares-functions.m4])
|
||||
m4_include([m4/cares-reentrant.m4])
|
||||
m4_include([m4/libtool.m4])
|
||||
m4_include([m4/ltoptions.m4])
|
||||
m4_include([m4/ltsugar.m4])
|
||||
m4_include([m4/ltversion.m4])
|
||||
m4_include([m4/lt~obsolete.m4])
|
||||
m4_include([m4/xc-am-iface.m4])
|
||||
m4_include([m4/xc-cc-check.m4])
|
||||
m4_include([m4/xc-lt-iface.m4])
|
||||
m4_include([m4/xc-translit.m4])
|
||||
m4_include([m4/xc-val-flgs.m4])
|
||||
m4_include([m4/zz40-xc-ovr.m4])
|
||||
m4_include([acinclude.m4])
|
||||
m4_include([m4/pkg.m4])
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
|
||||
# aminclude_static.am generated automatically by Autoconf
|
||||
# from AX_AM_MACROS_STATIC on Sun Oct 8 23:23:39 CEST 2023
|
||||
# from AX_AM_MACROS_STATIC on Wed Jan 3 09:44:48 CET 2024
|
||||
|
||||
|
||||
# Code coverage
|
||||
|
||||
Vendored
+28
-14
@@ -3,6 +3,7 @@
|
||||
'cares_sources_common': [
|
||||
'include/ares.h',
|
||||
'include/ares_dns.h',
|
||||
'include/ares_dns_record.h',
|
||||
'include/ares_nameser.h',
|
||||
'include/ares_rules.h',
|
||||
'include/ares_version.h',
|
||||
@@ -11,28 +12,40 @@
|
||||
'src/lib/ares__buf.c',
|
||||
'src/lib/ares__buf.h',
|
||||
'src/lib/ares__close_sockets.c',
|
||||
'src/lib/ares__hosts_file.c',
|
||||
'src/lib/ares__htable.c',
|
||||
'src/lib/ares__htable.h',
|
||||
'src/lib/ares__htable_asvp.c',
|
||||
'src/lib/ares__htable_asvp.h',
|
||||
'src/lib/ares__htable_stvp.c',
|
||||
'src/lib/ares__htable_stvp.h',
|
||||
'src/lib/ares__htable_strvp.c',
|
||||
'src/lib/ares__htable_strvp.h',
|
||||
'src/lib/ares__htable_szvp.c',
|
||||
'src/lib/ares__htable_szvp.h',
|
||||
'src/lib/ares__iface_ips.c',
|
||||
'src/lib/ares__iface_ips.h',
|
||||
'src/lib/ares__llist.c',
|
||||
'src/lib/ares__llist.h',
|
||||
'src/lib/ares__get_hostent.c',
|
||||
'src/lib/ares__parse_into_addrinfo.c',
|
||||
'src/lib/ares__read_line.c',
|
||||
'src/lib/ares__readaddrinfo.c',
|
||||
'src/lib/ares__slist.c',
|
||||
'src/lib/ares__slist.h',
|
||||
'src/lib/ares__socket.c',
|
||||
'src/lib/ares__sortaddrinfo.c',
|
||||
'src/lib/ares__threads.c',
|
||||
'src/lib/ares__timeval.c',
|
||||
'src/lib/ares_android.c',
|
||||
'src/lib/ares_android.h',
|
||||
'src/lib/ares_cancel.c',
|
||||
'src/lib/ares_create_query.c',
|
||||
'src/lib/ares_data.c',
|
||||
'src/lib/ares_data.h',
|
||||
'src/lib/ares_destroy.c',
|
||||
'src/lib/ares_dns_mapping.c',
|
||||
'src/lib/ares_dns_name.c',
|
||||
'src/lib/ares_dns_parse.c',
|
||||
'src/lib/ares_dns_record.c',
|
||||
'src/lib/ares_dns_private.h',
|
||||
'src/lib/ares_dns_write.c',
|
||||
'src/lib/ares_expand_name.c',
|
||||
'src/lib/ares_expand_string.c',
|
||||
'src/lib/ares_fds.c',
|
||||
@@ -40,6 +53,7 @@
|
||||
'src/lib/ares_free_string.c',
|
||||
'src/lib/ares_freeaddrinfo.c',
|
||||
'src/lib/ares_getaddrinfo.c',
|
||||
'src/lib/ares_getenv.c',
|
||||
'src/lib/ares_getenv.h',
|
||||
'src/lib/ares_gethostbyaddr.c',
|
||||
'src/lib/ares_gethostbyname.c',
|
||||
@@ -47,11 +61,10 @@
|
||||
'src/lib/ares_getsock.c',
|
||||
'src/lib/ares_inet_net_pton.h',
|
||||
'src/lib/ares_init.c',
|
||||
'src/lib/ares_ipv6.h',
|
||||
'src/lib/ares_library_init.c',
|
||||
'src/lib/ares_ipv6.h',
|
||||
'src/lib/ares_math.c',
|
||||
'src/lib/ares_mkquery.c',
|
||||
'src/lib/ares_nowarn.c',
|
||||
'src/lib/ares_nowarn.h',
|
||||
'src/lib/ares_options.c',
|
||||
'src/lib/ares_parse_a_reply.c',
|
||||
'src/lib/ares_parse_aaaa_reply.c',
|
||||
@@ -64,9 +77,11 @@
|
||||
'src/lib/ares_parse_srv_reply.c',
|
||||
'src/lib/ares_parse_txt_reply.c',
|
||||
'src/lib/ares_parse_uri_reply.c',
|
||||
'src/lib/ares_platform.c',
|
||||
'src/lib/ares_platform.h',
|
||||
'src/lib/ares_private.h',
|
||||
'src/lib/ares_process.c',
|
||||
'src/lib/ares_qcache.c',
|
||||
'src/lib/ares_query.c',
|
||||
'src/lib/ares_rand.c',
|
||||
'src/lib/ares_search.c',
|
||||
@@ -74,14 +89,16 @@
|
||||
'src/lib/ares_setup.h',
|
||||
'src/lib/ares_strcasecmp.c',
|
||||
'src/lib/ares_strcasecmp.h',
|
||||
'src/lib/ares_strdup.c',
|
||||
'src/lib/ares_strdup.h',
|
||||
'src/lib/ares_str.c',
|
||||
'src/lib/ares_str.h',
|
||||
'src/lib/ares_strerror.c',
|
||||
'src/lib/ares_strsplit.c',
|
||||
'src/lib/ares_strsplit.h',
|
||||
'src/lib/ares_sysconfig.c',
|
||||
'src/lib/ares_sysconfig_files.c',
|
||||
'src/lib/ares_timeout.c',
|
||||
'src/lib/ares_update_servers.c',
|
||||
'src/lib/ares_version.c',
|
||||
'src/lib/bitncmp.c',
|
||||
'src/lib/bitncmp.h',
|
||||
'src/lib/inet_net_pton.c',
|
||||
'src/lib/inet_ntop.c',
|
||||
'src/lib/setup_once.h',
|
||||
@@ -91,9 +108,6 @@
|
||||
'cares_sources_win': [
|
||||
'src/lib/config-win32.h',
|
||||
'src/lib/windows_port.c',
|
||||
'src/lib/ares_getenv.c',
|
||||
'src/lib/ares_iphlpapi.h',
|
||||
'src/lib/ares_platform.c',
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
+399
@@ -0,0 +1,399 @@
|
||||
# Copyright (c) Monetra Technologies LLC
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# EnableWarnings.cmake
|
||||
#
|
||||
# Checks for and turns on a large number of warning C flags.
|
||||
#
|
||||
# Adds the following helper functions:
|
||||
#
|
||||
# remove_warnings(... list of warnings ...)
|
||||
# Turn off given list of individual warnings for all targets and subdirectories added after this.
|
||||
#
|
||||
# remove_all_warnings()
|
||||
# Remove all warning flags, add -w to suppress built-in warnings.
|
||||
#
|
||||
# remove_all_warnings_from_targets(... list of targets ...)
|
||||
# Suppress warnings for the given targets only.
|
||||
#
|
||||
# push_warnings()
|
||||
# Save current warning flags by pushing them onto an internal stack. Note that modifications to the internal
|
||||
# stack are only visible in the current CMakeLists.txt file and its children.
|
||||
#
|
||||
# Note: changing warning flags multiple times in the same directory only affects add_subdirectory() calls.
|
||||
# Targets in the directory will always use the warning flags in effect at the end of the CMakeLists.txt
|
||||
# file - this is due to really weird and annoying legacy behavior of CMAKE_C_FLAGS.
|
||||
#
|
||||
# pop_warnings()
|
||||
# Restore the last set of flags that were saved with push_warnings(). Note that modifications to the internal
|
||||
# stack are only visible in the current CMakeLists.txt file and its children.
|
||||
#
|
||||
|
||||
if (_internal_enable_warnings_already_run)
|
||||
return()
|
||||
endif ()
|
||||
set(_internal_enable_warnings_already_run TRUE)
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
|
||||
# internal helper: _int_enable_warnings_set_flags_ex(langs_var configs_var [warnings flags])
|
||||
function(_int_enable_warnings_set_flags_ex langs_var configs_var)
|
||||
if (NOT ARGN)
|
||||
return()
|
||||
endif ()
|
||||
|
||||
if (NOT ${configs_var})
|
||||
set(${configs_var} "NONE")
|
||||
endif ()
|
||||
string(TOUPPER "${${configs_var}}" ${configs_var})
|
||||
|
||||
foreach(_flag ${ARGN})
|
||||
string(MAKE_C_IDENTIFIER "HAVE_${_flag}" varname)
|
||||
|
||||
if ("C" IN_LIST ${langs_var})
|
||||
check_c_compiler_flag(${_flag} ${varname})
|
||||
if (${varname})
|
||||
foreach (config IN LISTS ${configs_var})
|
||||
if (config STREQUAL "NONE")
|
||||
set(config)
|
||||
else ()
|
||||
set(config "_${config}")
|
||||
endif ()
|
||||
string(APPEND CMAKE_C_FLAGS${config} " ${_flag}")
|
||||
endforeach ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if ("CXX" IN_LIST ${langs_var})
|
||||
string(APPEND varname "_CXX")
|
||||
check_cxx_compiler_flag(${_flag} ${varname})
|
||||
if (${varname})
|
||||
foreach (config IN LISTS ${configs_var})
|
||||
if (config STREQUAL "NONE")
|
||||
set(config)
|
||||
else ()
|
||||
set(config "_${config}")
|
||||
endif ()
|
||||
string(APPEND CMAKE_CXX_FLAGS${config} " ${_flag}")
|
||||
endforeach ()
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach()
|
||||
|
||||
foreach(lang C CXX)
|
||||
foreach (config IN LISTS ${configs_var})
|
||||
string(TOUPPER "${config}" config)
|
||||
if (config STREQUAL "NONE")
|
||||
set(config)
|
||||
else ()
|
||||
set(config "_${config}")
|
||||
endif ()
|
||||
string(STRIP "${CMAKE_${lang}_FLAGS${config}}" CMAKE_${lang}_FLAGS${config})
|
||||
set(CMAKE_${lang}_FLAGS${config} "${CMAKE_${lang}_FLAGS${config}}" PARENT_SCOPE)
|
||||
endforeach ()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# internal helper: _int_enable_warnings_set_flags(langs_var [warnings flags])
|
||||
macro(_int_enable_warnings_set_flags langs_var)
|
||||
set(configs "NONE")
|
||||
_int_enable_warnings_set_flags_ex(${langs_var} configs ${ARGN})
|
||||
endmacro()
|
||||
|
||||
set(_flags_C)
|
||||
set(_flags_CXX)
|
||||
set(_debug_flags_C)
|
||||
set(_debug_flags_CXX)
|
||||
|
||||
if (MSVC)
|
||||
# Visual Studio uses a completely different nomenclature for warnings than gcc/mingw/clang, so none of the
|
||||
# "-W[name]" warnings will work.
|
||||
|
||||
# W4 would be better but it produces unnecessary warnings like:
|
||||
# * warning C4706: assignment within conditional expression
|
||||
# Triggered when doing "while(1)"
|
||||
# * warning C4115: 'timeval' : named type definition in parentheses
|
||||
# * warning C4201: nonstandard extension used : nameless struct/union
|
||||
# Triggered by system includes (commctrl.h, shtypes.h, Shlobj.h)
|
||||
set(_flags
|
||||
/W3
|
||||
/we4013 # Treat "function undefined, assuming extern returning int" warning as an error. https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4013
|
||||
)
|
||||
|
||||
list(APPEND _flags_C ${_flags})
|
||||
list(APPEND _flags_CXX ${_flags})
|
||||
|
||||
elseif (CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||
# Intel's compiler warning flags are more like Visual Studio than GCC, though the numbers aren't the same.
|
||||
set(_flags
|
||||
# Use warning level 3, quite wordy.
|
||||
-w3
|
||||
# Disable warnings we don't care about (add more as they are encountered).
|
||||
-wd383 # Spammy warning about initializing from a temporary object in C++ (which is done all the time ...).
|
||||
-wd11074 # Diagnostic related to inlining.
|
||||
-wd11076 # Diagnostic related to inlining.
|
||||
)
|
||||
|
||||
list(APPEND _flags_C ${_flags})
|
||||
list(APPEND _flags_CXX ${_flags})
|
||||
|
||||
elseif (CMAKE_C_COMPILER_ID MATCHES "XL")
|
||||
set (_flags
|
||||
-qwarn64
|
||||
-qformat=all
|
||||
-qflag=i:i
|
||||
)
|
||||
list(APPEND _flags_C ${_flags})
|
||||
list(APPEND _flags_CXX ${_flags})
|
||||
|
||||
else ()
|
||||
# If we're compiling with GCC / Clang / MinGW (or anything else besides Visual Studio or Intel):
|
||||
# C Flags:
|
||||
list(APPEND _flags_C
|
||||
-Wall
|
||||
-Wextra
|
||||
|
||||
# Enable additional warnings not covered by Wall and Wextra.
|
||||
-Wcast-align
|
||||
-Wconversion
|
||||
-Wdeclaration-after-statement
|
||||
-Wdouble-promotion
|
||||
-Wfloat-equal
|
||||
-Wformat-security
|
||||
-Winit-self
|
||||
-Wjump-misses-init
|
||||
-Wlogical-op
|
||||
-Wmissing-braces
|
||||
-Wmissing-declarations
|
||||
-Wmissing-format-attribute
|
||||
-Wmissing-include-dirs
|
||||
-Wmissing-prototypes
|
||||
-Wnested-externs
|
||||
-Wno-coverage-mismatch
|
||||
-Wold-style-definition
|
||||
-Wpacked
|
||||
-Wpointer-arith
|
||||
-Wredundant-decls
|
||||
-Wshadow
|
||||
-Wsign-conversion
|
||||
-Wstrict-overflow
|
||||
-Wstrict-prototypes
|
||||
-Wtrampolines
|
||||
-Wundef
|
||||
-Wunused
|
||||
-Wvariadic-macros
|
||||
-Wvla
|
||||
-Wwrite-strings
|
||||
|
||||
# On Windows MinGW I think implicit fallthrough enabled by -Wextra must not default to 3
|
||||
-Wimplicit-fallthrough=3
|
||||
|
||||
# Treat implicit variable typing and implicit function declarations as errors.
|
||||
-Werror=implicit-int
|
||||
-Werror=implicit-function-declaration
|
||||
|
||||
# Make MacOSX honor -mmacosx-version-min
|
||||
-Werror=partial-availability
|
||||
|
||||
# Some clang versions might warn if an argument like "-I/path/to/headers" is unused,
|
||||
# silence these.
|
||||
-Qunused-arguments
|
||||
)
|
||||
|
||||
# C++ flags:
|
||||
list(APPEND _flags_CXX
|
||||
-Wall
|
||||
-Wextra
|
||||
|
||||
# Enable additional warnings not covered by Wall and Wextra.
|
||||
-Wcast-align
|
||||
-Wformat-security
|
||||
-Wmissing-declarations
|
||||
-Wmissing-format-attribute
|
||||
-Wpacked-bitfield-compat
|
||||
-Wredundant-decls
|
||||
-Wvla
|
||||
|
||||
# Turn off unused parameter warnings with C++ (they happen often in C++ and Qt).
|
||||
-Wno-unused-parameter
|
||||
|
||||
# Some clang versions might warn if an argument like "-I/path/to/headers" is unused,
|
||||
# silence these.
|
||||
-Qunused-arguments
|
||||
)
|
||||
|
||||
# Note: when cross-compiling to Windows from Cygwin, the Qt Mingw packages have a bunch of
|
||||
# noisy type-conversion warnings in headers. So, only enable those warnings if we're
|
||||
# not building that configuration.
|
||||
if (NOT (WIN32 AND (CMAKE_HOST_SYSTEM_NAME MATCHES "CYGWIN")))
|
||||
list(APPEND _flags_CXX
|
||||
-Wconversion
|
||||
-Wfloat-equal
|
||||
-Wsign-conversion
|
||||
)
|
||||
endif ()
|
||||
|
||||
# Add flags to force colored output even when output is redirected via pipe.
|
||||
if (CMAKE_GENERATOR MATCHES "Ninja")
|
||||
set(color_default TRUE)
|
||||
else ()
|
||||
set(color_default FALSE)
|
||||
endif ()
|
||||
option(FORCE_COLOR "Force compiler to always colorize, even when output is redirected." ${color_default})
|
||||
mark_as_advanced(FORCE FORCE_COLOR)
|
||||
if (FORCE_COLOR)
|
||||
set(_flags
|
||||
-fdiagnostics-color=always # GCC
|
||||
-fcolor-diagnostics # Clang
|
||||
)
|
||||
list(APPEND _flags_C ${_flags})
|
||||
list(APPEND _flags_CXX ${_flags})
|
||||
endif ()
|
||||
|
||||
# Add -fno-omit-frame-pointer (and optionally -fno-inline) to make debugging and stack dumps nicer.
|
||||
set(_flags
|
||||
-fno-omit-frame-pointer
|
||||
)
|
||||
option(M_NO_INLINE "Disable function inlining for RelWithDebInfo and Debug configurations?" FALSE)
|
||||
if (M_NO_INLINE)
|
||||
list(APPEND _flags
|
||||
-fno-inline
|
||||
)
|
||||
endif ()
|
||||
list(APPEND _debug_flags_C ${_flags})
|
||||
list(APPEND _debug_flags_CXX ${_flags})
|
||||
endif ()
|
||||
|
||||
# Check and set compiler flags.
|
||||
set(_debug_configs
|
||||
RelWithDebInfo
|
||||
Debug
|
||||
)
|
||||
foreach(_lang ${languages})
|
||||
_int_enable_warnings_set_flags(_lang ${_flags_${_lang}})
|
||||
_int_enable_warnings_set_flags_ex(_lang _debug_configs ${_debug_flags_${_lang}})
|
||||
|
||||
# Ensure pure Debug builds are NOT optimized (not possible on Visual Studio).
|
||||
# Any optimization of a Debug build will prevent debuggers like lldb from
|
||||
# fully displaying backtraces and stepping.
|
||||
if (NOT MSVC)
|
||||
set(_config Debug)
|
||||
_int_enable_warnings_set_flags_ex(_lang _config -O0)
|
||||
endif ()
|
||||
endforeach()
|
||||
|
||||
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Helper functions
|
||||
|
||||
|
||||
# This function can be called in subdirectories, to prune out warnings that they don't want.
|
||||
# vararg: warning flags to remove from list of enabled warnings. All "no" flags after EXPLICIT_DISABLE
|
||||
# will be added to C flags.
|
||||
#
|
||||
# Ex.: remove_warnings(-Wall -Wdouble-promotion -Wcomment) prunes those warnings flags from the compile command.
|
||||
function(remove_warnings)
|
||||
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
set(langs C)
|
||||
if ("CXX" IN_LIST languages)
|
||||
list(APPEND langs CXX)
|
||||
endif ()
|
||||
|
||||
foreach(lang ${langs})
|
||||
set(toadd)
|
||||
set(in_explicit_disable FALSE)
|
||||
foreach (flag ${ARGN})
|
||||
if (flag STREQUAL "EXPLICIT_DISABLE")
|
||||
set(in_explicit_disable TRUE)
|
||||
elseif (in_explicit_disable)
|
||||
list(APPEND toadd "${flag}")
|
||||
else ()
|
||||
string(REGEX REPLACE "${flag}([ \t]+|$)" "" CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}")
|
||||
endif ()
|
||||
endforeach ()
|
||||
_int_enable_warnings_set_flags(lang ${toadd})
|
||||
string(STRIP "${CMAKE_${lang}_FLAGS}" CMAKE_${lang}_FLAGS)
|
||||
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}" PARENT_SCOPE)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
|
||||
# Explicitly suppress all warnings. As long as this flag is the last warning flag, warnings will be
|
||||
# suppressed even if earlier flags enabled warnings.
|
||||
function(remove_all_warnings)
|
||||
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
set(langs C)
|
||||
if ("CXX" IN_LIST languages)
|
||||
list(APPEND langs CXX)
|
||||
endif ()
|
||||
|
||||
foreach(lang ${langs})
|
||||
string(REGEX REPLACE "[-/][Ww][^ \t]*([ \t]+|$)" "" CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}")
|
||||
if (MSVC)
|
||||
string(APPEND CMAKE_${lang}_FLAGS " /w")
|
||||
else ()
|
||||
string(APPEND CMAKE_${lang}_FLAGS " -w")
|
||||
endif ()
|
||||
string(STRIP "${CMAKE_${lang}_FLAGS}" CMAKE_${lang}_FLAGS)
|
||||
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}" PARENT_SCOPE)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
|
||||
function(remove_all_warnings_from_targets)
|
||||
foreach (target ${ARGN})
|
||||
if (MSVC)
|
||||
target_compile_options(${target} PRIVATE "/w")
|
||||
else ()
|
||||
target_compile_options(${target} PRIVATE "-w")
|
||||
endif ()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
|
||||
# Save the current warning settings to an internal variable.
|
||||
function(push_warnings)
|
||||
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
set(langs C)
|
||||
if ("CXX" IN_LIST languages)
|
||||
list(APPEND langs CXX)
|
||||
endif ()
|
||||
|
||||
foreach(lang ${langs})
|
||||
if (CMAKE_${lang}_FLAGS MATCHES ";")
|
||||
message(AUTHOR_WARNING "Cannot push warnings for ${lang}, CMAKE_${lang}_FLAGS contains semicolons")
|
||||
continue()
|
||||
endif ()
|
||||
# Add current flags to end of internal list.
|
||||
list(APPEND _enable_warnings_internal_${lang}_flags_stack "${CMAKE_${lang}_FLAGS}")
|
||||
# Propagate results up to caller's scope.
|
||||
set(_enable_warnings_internal_${lang}_flags_stack "${_enable_warnings_internal_${lang}_flags_stack}" PARENT_SCOPE)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
|
||||
# Restore the current warning settings from an internal variable.
|
||||
function(pop_warnings)
|
||||
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
set(langs C)
|
||||
if ("CXX" IN_LIST languages)
|
||||
list(APPEND langs CXX)
|
||||
endif ()
|
||||
|
||||
foreach(lang ${langs})
|
||||
if (NOT _enable_warnings_internal_${lang}_flags_stack)
|
||||
continue()
|
||||
endif ()
|
||||
# Pop flags off of end of list, overwrite current flags with whatever we popped off.
|
||||
list(GET _enable_warnings_internal_${lang}_flags_stack -1 CMAKE_${lang}_FLAGS)
|
||||
list(REMOVE_AT _enable_warnings_internal_${lang}_flags_stack -1)
|
||||
# Propagate results up to caller's scope.
|
||||
set(_enable_warnings_internal_${lang}_flags_stack "${_enable_warnings_internal_${lang}_flags_stack}" PARENT_SCOPE)
|
||||
string(STRIP "${CMAKE_${lang}_FLAGS}" CMAKE_${lang}_FLAGS)
|
||||
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}" PARENT_SCOPE)
|
||||
endforeach()
|
||||
endfunction()
|
||||
+6
@@ -124,6 +124,9 @@
|
||||
/* Define to 1 if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define to 1 if you have the getifaddrs function. */
|
||||
#define HAVE_GETIFADDRS 1
|
||||
|
||||
/* Define to 1 if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
@@ -133,6 +136,9 @@
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the <ifaddrs.h> header file. */
|
||||
#define HAVE_IFADDRS_H 1
|
||||
|
||||
/* Define to 1 if you have the `if_indextoname' function. */
|
||||
#define HAVE_IF_INDEXTONAME 1
|
||||
|
||||
|
||||
+348
@@ -0,0 +1,348 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2018-03-07.03; # UTC
|
||||
|
||||
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file lazy
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) LAZY, no conversion will
|
||||
# take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN* | MSYS*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/* | msys/*)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_cl_dashL linkdir
|
||||
# Make cl look for libraries in LINKDIR
|
||||
func_cl_dashL ()
|
||||
{
|
||||
func_file_conv "$1"
|
||||
if test -z "$lib_path"; then
|
||||
lib_path=$file
|
||||
else
|
||||
lib_path="$lib_path;$file"
|
||||
fi
|
||||
linker_opts="$linker_opts -LIBPATH:$file"
|
||||
}
|
||||
|
||||
# func_cl_dashl library
|
||||
# Do a library search-path lookup for cl
|
||||
func_cl_dashl ()
|
||||
{
|
||||
lib=$1
|
||||
found=no
|
||||
save_IFS=$IFS
|
||||
IFS=';'
|
||||
for dir in $lib_path $LIB
|
||||
do
|
||||
IFS=$save_IFS
|
||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.dll.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/$lib.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/lib$lib.a"; then
|
||||
found=yes
|
||||
lib=$dir/lib$lib.a
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
|
||||
if test "$found" != yes; then
|
||||
lib=$lib.lib
|
||||
fi
|
||||
}
|
||||
|
||||
# func_cl_wrapper cl arg...
|
||||
# Adjust compile command to suit cl
|
||||
func_cl_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
lib_path=
|
||||
shared=:
|
||||
linker_opts=
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.[oO][bB][jJ])
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fo"$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fe"$file"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-I*)
|
||||
func_file_conv "${1#-I}" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
eat=1
|
||||
func_cl_dashl "$2"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-l*)
|
||||
func_cl_dashl "${1#-l}"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
eat=1
|
||||
func_cl_dashL "$2"
|
||||
;;
|
||||
-L*)
|
||||
func_cl_dashL "${1#-L}"
|
||||
;;
|
||||
-static)
|
||||
shared=false
|
||||
;;
|
||||
-Wl,*)
|
||||
arg=${1#-Wl,}
|
||||
save_ifs="$IFS"; IFS=','
|
||||
for flag in $arg; do
|
||||
IFS="$save_ifs"
|
||||
linker_opts="$linker_opts $flag"
|
||||
done
|
||||
IFS="$save_ifs"
|
||||
;;
|
||||
-Xlinker)
|
||||
eat=1
|
||||
linker_opts="$linker_opts $2"
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||
func_file_conv "$1"
|
||||
set x "$@" -Tp"$file"
|
||||
shift
|
||||
;;
|
||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||
func_file_conv "$1" mingw
|
||||
set x "$@" "$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if test -n "$linker_opts"; then
|
||||
linker_opts="-link$linker_opts"
|
||||
fi
|
||||
exec "$@" $linker_opts
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand '-c -o'.
|
||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file 'INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
|
||||
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
# So we strip '-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no '-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# '.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+1754
File diff suppressed because it is too large.
Load diff
+1890
File diff suppressed because it is too large.
Load diff
+6
@@ -124,6 +124,9 @@
|
||||
/* Define to 1 if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define to 1 if you have the getifaddrs function. */
|
||||
#define HAVE_GETIFADDRS 1
|
||||
|
||||
/* Define to 1 if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
@@ -133,6 +136,9 @@
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the <ifaddrs.h> header file. */
|
||||
#define HAVE_IFADDRS_H 1
|
||||
|
||||
/* Define to 1 if you have the `if_indextoname' function. */
|
||||
#define HAVE_IF_INDEXTONAME 1
|
||||
|
||||
|
||||
+791
@@ -0,0 +1,791 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2018-03-07.03; # UTC
|
||||
|
||||
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by 'PROGRAMS ARGS'.
|
||||
object Object file output by 'PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputting dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
# Get the directory component of the given path, and save it in the
|
||||
# global variables '$dir'. Note that this directory component will
|
||||
# be either empty or ending with a '/' character. This is deliberate.
|
||||
set_dir_from ()
|
||||
{
|
||||
case $1 in
|
||||
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
|
||||
*) dir=;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Get the suffix-stripped basename of the given path, and save it the
|
||||
# global variable '$base'.
|
||||
set_base_from ()
|
||||
{
|
||||
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
|
||||
}
|
||||
|
||||
# If no dependency file was actually created by the compiler invocation,
|
||||
# we still have to create a dummy depfile, to avoid errors with the
|
||||
# Makefile "include basename.Plo" scheme.
|
||||
make_dummy_depfile ()
|
||||
{
|
||||
echo "#dummy" > "$depfile"
|
||||
}
|
||||
|
||||
# Factor out some common post-processing of the generated depfile.
|
||||
# Requires the auxiliary global variable '$tmpdepfile' to be set.
|
||||
aix_post_process_depfile ()
|
||||
{
|
||||
# If the compiler actually managed to produce a dependency file,
|
||||
# post-process it.
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form 'foo.o: dependency.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# $object: dependency.h
|
||||
# and one to simply output
|
||||
# dependency.h:
|
||||
# which is needed to avoid the deleted-header problem.
|
||||
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
|
||||
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
|
||||
} > "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
}
|
||||
|
||||
# A tabulation character.
|
||||
tab=' '
|
||||
# A newline character.
|
||||
nl='
|
||||
'
|
||||
# Character ranges might be problematic outside the C locale.
|
||||
# These definitions help.
|
||||
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
lower=abcdefghijklmnopqrstuvwxyz
|
||||
digits=0123456789
|
||||
alpha=${upper}${lower}
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Avoid interferences from the environment.
|
||||
gccflag= dashmflag=
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
cygpath_u="cygpath -u -f -"
|
||||
if test "$depmode" = msvcmsys; then
|
||||
# This is just like msvisualcpp but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvisualcpp
|
||||
fi
|
||||
|
||||
if test "$depmode" = msvc7msys; then
|
||||
# This is just like msvc7 but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvc7
|
||||
fi
|
||||
|
||||
if test "$depmode" = xlc; then
|
||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
||||
gccflag=-qmakedep=gcc,-MF
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
|
||||
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
|
||||
## (see the conditional assignment to $gccflag above).
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say). Also, it might not be
|
||||
## supported by the other compilers which use the 'gcc' depmode.
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The second -e expression handles DOS-style file names with drive
|
||||
# letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the "deleted header file" problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
## Some versions of gcc put a space before the ':'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well. hp depmode also adds that space, but also prefixes the VPATH
|
||||
## to the object. Take care to not repeat it in the output.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like '#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
|
||||
| tr "$nl" ' ' >> "$depfile"
|
||||
echo >> "$depfile"
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
xlc)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts '$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$base.u
|
||||
tmpdepfile3=$dir.libs/$base.u
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$dir$base.u
|
||||
tmpdepfile3=$dir$base.u
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
tcc)
|
||||
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
|
||||
# FIXME: That version still under development at the moment of writing.
|
||||
# Make that this statement remains true also for stable, released
|
||||
# versions.
|
||||
# It will wrap lines (doesn't matter whether long or short) with a
|
||||
# trailing '\', as in:
|
||||
#
|
||||
# foo.o : \
|
||||
# foo.c \
|
||||
# foo.h \
|
||||
#
|
||||
# It will put a trailing '\' even on the last line, and will use leading
|
||||
# spaces rather than leading tabs (at least since its commit 0394caf7
|
||||
# "Emit spaces for -MD").
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
|
||||
# We have to change lines of the first kind to '$object: \'.
|
||||
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
|
||||
# And for each line of the second kind, we have to emit a 'dep.h:'
|
||||
# dummy dependency, to avoid the deleted-header problem.
|
||||
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
## The order of this option in the case statement is important, since the
|
||||
## shell code in configure will try each of these formats in the order
|
||||
## listed in this file. A plain '-MD' option would be understood by many
|
||||
## compilers, so we must ensure this comes after the gcc and icc options.
|
||||
pgcc)
|
||||
# Portland's C compiler understands '-MD'.
|
||||
# Will always output deps to 'file.d' where file is the root name of the
|
||||
# source file under compilation, even if file resides in a subdirectory.
|
||||
# The object file name does not affect the name of the '.d' file.
|
||||
# pgcc 10.2 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using '\' :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
set_dir_from "$object"
|
||||
# Use the source, not the object, to determine the base name, since
|
||||
# that's sadly what pgcc will do too.
|
||||
set_base_from "$source"
|
||||
tmpdepfile=$base.d
|
||||
|
||||
# For projects that build the same source file twice into different object
|
||||
# files, the pgcc approach of using the *source* file root name can cause
|
||||
# problems in parallel builds. Use a locking strategy to avoid stomping on
|
||||
# the same $tmpdepfile.
|
||||
lockdir=$base.d-lock
|
||||
trap "
|
||||
echo '$0: caught signal, cleaning up...' >&2
|
||||
rmdir '$lockdir'
|
||||
exit 1
|
||||
" 1 2 13 15
|
||||
numtries=100
|
||||
i=$numtries
|
||||
while test $i -gt 0; do
|
||||
# mkdir is a portable test-and-set.
|
||||
if mkdir "$lockdir" 2>/dev/null; then
|
||||
# This process acquired the lock.
|
||||
"$@" -MD
|
||||
stat=$?
|
||||
# Release the lock.
|
||||
rmdir "$lockdir"
|
||||
break
|
||||
else
|
||||
# If the lock is being held by a different process, wait
|
||||
# until the winning process is done or we timeout.
|
||||
while test -d "$lockdir" && test $i -gt 0; do
|
||||
sleep 1
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
fi
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
trap - 1 2 13 15
|
||||
if test $i -le 0; then
|
||||
echo "$0: failed to acquire lock after $numtries attempts" >&2
|
||||
echo "$0: check lockdir '$lockdir'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add 'dependent.h:' lines.
|
||||
sed -ne '2,${
|
||||
s/^ *//
|
||||
s/ \\*$//
|
||||
s/$/:/
|
||||
p
|
||||
}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in 'foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# Libtool generates 2 separate objects for the 2 libraries. These
|
||||
# two compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
|
||||
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
# Same post-processing that is required for AIX mode.
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
msvc7)
|
||||
if test "$libtool" = yes; then
|
||||
showIncludes=-Wc,-showIncludes
|
||||
else
|
||||
showIncludes=-showIncludes
|
||||
fi
|
||||
"$@" $showIncludes > "$tmpdepfile"
|
||||
stat=$?
|
||||
grep -v '^Note: including file: ' "$tmpdepfile"
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The first sed program below extracts the file names and escapes
|
||||
# backslashes for cygpath. The second sed program outputs the file
|
||||
# name when reading, but also accumulates all include files in the
|
||||
# hold buffer in order to output them again at the end. This only
|
||||
# works with sed implementations that can handle large buffers.
|
||||
sed < "$tmpdepfile" -n '
|
||||
/^Note: including file: *\(.*\)/ {
|
||||
s//\1/
|
||||
s/\\/\\\\/g
|
||||
p
|
||||
}' | $cygpath_u | sort -u | sed -n '
|
||||
s/ /\\ /g
|
||||
s/\(.*\)/'"$tab"'\1 \\/p
|
||||
s/.\(.*\) \\/\1:/
|
||||
H
|
||||
$ {
|
||||
s/.*/'"$tab"'/
|
||||
G
|
||||
p
|
||||
}' >> "$depfile"
|
||||
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvc7msys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for ':'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this sed invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no eat=no
|
||||
for arg
|
||||
do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
if test $eat = yes; then
|
||||
eat=no
|
||||
continue
|
||||
fi
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-arch)
|
||||
eat=yes ;;
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix=`echo "$object" | sed 's/^.*\././'`
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
# makedepend may prepend the VPATH from the source file name to the object.
|
||||
# No need to regex-escape $object, excess matching of '.' is harmless.
|
||||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process the last invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed '1,2d' "$tmpdepfile" \
|
||||
| tr ' ' "$nl" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E \
|
||||
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
| sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E 2>/dev/null |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
|
||||
echo "$tab" >> "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvcmsys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+6
@@ -124,6 +124,9 @@
|
||||
/* Define to 1 if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define to 1 if you have the getifaddrs function. */
|
||||
#define HAVE_GETIFADDRS 1
|
||||
|
||||
/* Define to 1 if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
@@ -133,6 +136,9 @@
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the <ifaddrs.h> header file. */
|
||||
#define HAVE_IFADDRS_H 1
|
||||
|
||||
/* Define to 1 if you have the `if_indextoname' function. */
|
||||
#define HAVE_IF_INDEXTONAME 1
|
||||
|
||||
|
||||
+541
@@ -0,0 +1,541 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2020-11-14.01; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
tab=' '
|
||||
nl='
|
||||
'
|
||||
IFS=" $tab$nl"
|
||||
|
||||
# Set DOITPROG to "echo" to test this script.
|
||||
|
||||
doit=${DOITPROG-}
|
||||
doit_exec=${doit:-exec}
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
# Create dirs (including intermediate dirs) using mode 755.
|
||||
# This is like GNU 'install' as of coreutils 8.32 (2020).
|
||||
mkdir_umask=22
|
||||
|
||||
backupsuffix=
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
stripcmd=
|
||||
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
is_target_a_directory=possibly
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-p pass -p to $cpprog.
|
||||
-s $stripprog installed files.
|
||||
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
|
||||
By default, rm is invoked with -f; when overridden with RMPROG,
|
||||
it's up to you to specify -f if you want it.
|
||||
|
||||
If -S is not specified, no backups are attempted.
|
||||
|
||||
Email bug reports to bug-automake@gnu.org.
|
||||
Automake home page: https://www.gnu.org/software/automake/
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-p) cpprog="$cpprog -p";;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-S) backupsuffix="$2"
|
||||
shift;;
|
||||
|
||||
-t)
|
||||
is_target_a_directory=always
|
||||
dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-T) is_target_a_directory=never;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# We allow the use of options -d and -T together, by making -d
|
||||
# take the precedence; this is for compatibility with GNU install.
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
if test -n "$dst_arg"; then
|
||||
echo "$0: target directory not allowed when installing a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
||||
if test ! -d "$dst_arg"; then
|
||||
echo "$0: $dst_arg: Is not a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
trap "ret=130; $do_exit" 2
|
||||
trap "ret=141; $do_exit" 13
|
||||
trap "ret=143; $do_exit" 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
# Don't chown directories that already exist.
|
||||
if test $dstdir_status = 0; then
|
||||
chowncmd=""
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst_arg
|
||||
|
||||
# If destination is a directory, append the input filename.
|
||||
if test -d "$dst"; then
|
||||
if test "$is_target_a_directory" = never; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dstbase=`basename "$src"`
|
||||
case $dst in
|
||||
*/) dst=$dst$dstbase;;
|
||||
*) dst=$dst/$dstbase;;
|
||||
esac
|
||||
dstdir_status=0
|
||||
else
|
||||
dstdir=`dirname "$dst"`
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
case $dstdir in
|
||||
*/) dstdirslash=$dstdir;;
|
||||
*) dstdirslash=$dstdir/;;
|
||||
esac
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
# The $RANDOM variable is not portable (e.g., dash). Use it
|
||||
# here however when possible just to lower collision chance.
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
|
||||
trap '
|
||||
ret=$?
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
|
||||
exit $ret
|
||||
' 0
|
||||
|
||||
# Because "mkdir -p" follows existing symlinks and we likely work
|
||||
# directly in world-writeable /tmp, make sure that the '$tmpdir'
|
||||
# directory is successfully created first before we actually test
|
||||
# 'mkdir -p'.
|
||||
if (umask $mkdir_umask &&
|
||||
$mkdirprog $mkdir_mode "$tmpdir" &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
test_tmpdir="$tmpdir/a"
|
||||
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=${dstdirslash}_inst.$$_
|
||||
rmtmp=${dstdirslash}_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask &&
|
||||
{ test -z "$stripcmd" || {
|
||||
# Create $dsttmp read-write so that cp doesn't create it read-only,
|
||||
# which would cause strip to fail.
|
||||
if test -z "$doit"; then
|
||||
: >"$dsttmp" # No need to fork-exec 'touch'.
|
||||
else
|
||||
$doit touch "$dsttmp"
|
||||
fi
|
||||
}
|
||||
} &&
|
||||
$doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
set +f &&
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# If $backupsuffix is set, and the file being installed
|
||||
# already exists, attempt a backup. Don't worry if it fails,
|
||||
# e.g., if mv doesn't support -f.
|
||||
if test -n "$backupsuffix" && test -f "$dst"; then
|
||||
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
|
||||
fi
|
||||
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+6
@@ -124,6 +124,9 @@
|
||||
/* Define to 1 if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define to 1 if you have the getifaddrs function. */
|
||||
#define HAVE_GETIFADDRS 1
|
||||
|
||||
/* Define to 1 if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
@@ -133,6 +136,9 @@
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the <ifaddrs.h> header file. */
|
||||
#define HAVE_IFADDRS_H 1
|
||||
|
||||
/* Define to 1 if you have the `if_indextoname' function. */
|
||||
#define HAVE_IF_INDEXTONAME 1
|
||||
|
||||
|
||||
+11436
File diff suppressed because it is too large.
Load diff
+215
@@ -0,0 +1,215 @@
|
||||
#! /bin/sh
|
||||
# Common wrapper for a few potentially missing GNU programs.
|
||||
|
||||
scriptversion=2018-03-07.03; # UTC
|
||||
|
||||
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
|
||||
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
|
||||
--is-lightweight)
|
||||
# Used by our autoconf macros to check whether the available missing
|
||||
# script is modern enough.
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--run)
|
||||
# Back-compat with the calling convention used by older automake.
|
||||
shift
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
|
||||
to PROGRAM being missing or too old.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal autoconf autoheader autom4te automake makeinfo
|
||||
bison yacc flex lex help2man
|
||||
|
||||
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
|
||||
'g' are ignored when checking the name.
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: unknown '$1' option"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Run the given program, remember its exit status.
|
||||
"$@"; st=$?
|
||||
|
||||
# If it succeeded, we are done.
|
||||
test $st -eq 0 && exit 0
|
||||
|
||||
# Also exit now if we it failed (or wasn't found), and '--version' was
|
||||
# passed; such an option is passed most likely to detect whether the
|
||||
# program is present and works.
|
||||
case $2 in --version|--help) exit $st;; esac
|
||||
|
||||
# Exit code 63 means version mismatch. This often happens when the user
|
||||
# tries to use an ancient version of a tool on a file that requires a
|
||||
# minimum version.
|
||||
if test $st -eq 63; then
|
||||
msg="probably too old"
|
||||
elif test $st -eq 127; then
|
||||
# Program was missing.
|
||||
msg="missing on your system"
|
||||
else
|
||||
# Program was found and executed, but failed. Give up.
|
||||
exit $st
|
||||
fi
|
||||
|
||||
perl_URL=https://www.perl.org/
|
||||
flex_URL=https://github.com/westes/flex
|
||||
gnu_software_URL=https://www.gnu.org/software
|
||||
|
||||
program_details ()
|
||||
{
|
||||
case $1 in
|
||||
aclocal|automake)
|
||||
echo "The '$1' program is part of the GNU Automake package:"
|
||||
echo "<$gnu_software_URL/automake>"
|
||||
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/autoconf>"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
autoconf|autom4te|autoheader)
|
||||
echo "The '$1' program is part of the GNU Autoconf package:"
|
||||
echo "<$gnu_software_URL/autoconf/>"
|
||||
echo "It also requires GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
give_advice ()
|
||||
{
|
||||
# Normalize program name to check for.
|
||||
normalized_program=`echo "$1" | sed '
|
||||
s/^gnu-//; t
|
||||
s/^gnu//; t
|
||||
s/^g//; t'`
|
||||
|
||||
printf '%s\n' "'$1' is $msg."
|
||||
|
||||
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
|
||||
case $normalized_program in
|
||||
autoconf*)
|
||||
echo "You should only need it if you modified 'configure.ac',"
|
||||
echo "or m4 files included by it."
|
||||
program_details 'autoconf'
|
||||
;;
|
||||
autoheader*)
|
||||
echo "You should only need it if you modified 'acconfig.h' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'autoheader'
|
||||
;;
|
||||
automake*)
|
||||
echo "You should only need it if you modified 'Makefile.am' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'automake'
|
||||
;;
|
||||
aclocal*)
|
||||
echo "You should only need it if you modified 'acinclude.m4' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'aclocal'
|
||||
;;
|
||||
autom4te*)
|
||||
echo "You might have modified some maintainer files that require"
|
||||
echo "the 'autom4te' program to be rebuilt."
|
||||
program_details 'autom4te'
|
||||
;;
|
||||
bison*|yacc*)
|
||||
echo "You should only need it if you modified a '.y' file."
|
||||
echo "You may want to install the GNU Bison package:"
|
||||
echo "<$gnu_software_URL/bison/>"
|
||||
;;
|
||||
lex*|flex*)
|
||||
echo "You should only need it if you modified a '.l' file."
|
||||
echo "You may want to install the Fast Lexical Analyzer package:"
|
||||
echo "<$flex_URL>"
|
||||
;;
|
||||
help2man*)
|
||||
echo "You should only need it if you modified a dependency" \
|
||||
"of a man page."
|
||||
echo "You may want to install the GNU Help2man package:"
|
||||
echo "<$gnu_software_URL/help2man/>"
|
||||
;;
|
||||
makeinfo*)
|
||||
echo "You should only need it if you modified a '.texi' file, or"
|
||||
echo "any other file indirectly affecting the aspect of the manual."
|
||||
echo "You might want to install the Texinfo package:"
|
||||
echo "<$gnu_software_URL/texinfo/>"
|
||||
echo "The spurious makeinfo call might also be the consequence of"
|
||||
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
|
||||
echo "want to install GNU make:"
|
||||
echo "<$gnu_software_URL/make/>"
|
||||
;;
|
||||
*)
|
||||
echo "You might have modified some files without having the proper"
|
||||
echo "tools for further handling them. Check the 'README' file, it"
|
||||
echo "often tells you about the needed prerequisites for installing"
|
||||
echo "this package. You may also peek at any GNU archive site, in"
|
||||
echo "case some other package contains this missing '$1' program."
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
give_advice "$1" | sed -e '1s/^/WARNING: /' \
|
||||
-e '2,$s/^/ /' >&2
|
||||
|
||||
# Propagate the correct exit status (expected to be 127 for a program
|
||||
# not found, 63 for a program that failed due to version mismatch).
|
||||
exit $st
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+6
@@ -124,6 +124,9 @@
|
||||
/* Define to 1 if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define to 1 if you have the getifaddrs function. */
|
||||
#define HAVE_GETIFADDRS 1
|
||||
|
||||
/* Define to 1 if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
@@ -133,6 +136,9 @@
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the <ifaddrs.h> header file. */
|
||||
#define HAVE_IFADDRS_H 1
|
||||
|
||||
/* Define to 1 if you have the `if_indextoname' function. */
|
||||
#define HAVE_IF_INDEXTONAME 1
|
||||
|
||||
|
||||
+6
@@ -124,6 +124,9 @@
|
||||
/* Define to 1 if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define to 1 if you have the getifaddrs function. */
|
||||
#define HAVE_GETIFADDRS 1
|
||||
|
||||
/* Define to 1 if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
@@ -133,6 +136,9 @@
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the <ifaddrs.h> header file. */
|
||||
#define HAVE_IFADDRS_H 1
|
||||
|
||||
/* Define to 1 if you have the `if_indextoname' function. */
|
||||
#define HAVE_IF_INDEXTONAME 1
|
||||
|
||||
|
||||
+6
@@ -124,6 +124,9 @@
|
||||
/* Define to 1 if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define to 1 if you have the getifaddrs function. */
|
||||
#define HAVE_GETIFADDRS 1
|
||||
|
||||
/* Define to 1 if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
@@ -133,6 +136,9 @@
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the <ifaddrs.h> header file. */
|
||||
#define HAVE_IFADDRS_H 1
|
||||
|
||||
/* Define to 1 if you have the `if_indextoname' function. */
|
||||
#define HAVE_IF_INDEXTONAME 1
|
||||
|
||||
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
#! /bin/sh
|
||||
# test-driver - basic testsuite driver script.
|
||||
|
||||
scriptversion=2018-03-07.03; # UTC
|
||||
|
||||
# Copyright (C) 2011-2021 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
# Make unconditional expansion of undefined variables an error. This
|
||||
# helps a lot in preventing typo-related bugs.
|
||||
set -u
|
||||
|
||||
usage_error ()
|
||||
{
|
||||
echo "$0: $*" >&2
|
||||
print_usage >&2
|
||||
exit 2
|
||||
}
|
||||
|
||||
print_usage ()
|
||||
{
|
||||
cat <<END
|
||||
Usage:
|
||||
test-driver --test-name NAME --log-file PATH --trs-file PATH
|
||||
[--expect-failure {yes|no}] [--color-tests {yes|no}]
|
||||
[--enable-hard-errors {yes|no}] [--]
|
||||
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
|
||||
|
||||
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
|
||||
See the GNU Automake documentation for information.
|
||||
END
|
||||
}
|
||||
|
||||
test_name= # Used for reporting.
|
||||
log_file= # Where to save the output of the test script.
|
||||
trs_file= # Where to save the metadata of the test run.
|
||||
expect_failure=no
|
||||
color_tests=no
|
||||
enable_hard_errors=yes
|
||||
while test $# -gt 0; do
|
||||
case $1 in
|
||||
--help) print_usage; exit $?;;
|
||||
--version) echo "test-driver $scriptversion"; exit $?;;
|
||||
--test-name) test_name=$2; shift;;
|
||||
--log-file) log_file=$2; shift;;
|
||||
--trs-file) trs_file=$2; shift;;
|
||||
--color-tests) color_tests=$2; shift;;
|
||||
--expect-failure) expect_failure=$2; shift;;
|
||||
--enable-hard-errors) enable_hard_errors=$2; shift;;
|
||||
--) shift; break;;
|
||||
-*) usage_error "invalid option: '$1'";;
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
missing_opts=
|
||||
test x"$test_name" = x && missing_opts="$missing_opts --test-name"
|
||||
test x"$log_file" = x && missing_opts="$missing_opts --log-file"
|
||||
test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
|
||||
if test x"$missing_opts" != x; then
|
||||
usage_error "the following mandatory options are missing:$missing_opts"
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
usage_error "missing argument"
|
||||
fi
|
||||
|
||||
if test $color_tests = yes; then
|
||||
# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
|
||||
red='[0;31m' # Red.
|
||||
grn='[0;32m' # Green.
|
||||
lgn='[1;32m' # Light green.
|
||||
blu='[1;34m' # Blue.
|
||||
mgn='[0;35m' # Magenta.
|
||||
std='[m' # No color.
|
||||
else
|
||||
red= grn= lgn= blu= mgn= std=
|
||||
fi
|
||||
|
||||
do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
|
||||
trap "st=129; $do_exit" 1
|
||||
trap "st=130; $do_exit" 2
|
||||
trap "st=141; $do_exit" 13
|
||||
trap "st=143; $do_exit" 15
|
||||
|
||||
# Test script is run here. We create the file first, then append to it,
|
||||
# to ameliorate tests themselves also writing to the log file. Our tests
|
||||
# don't, but others can (automake bug#35762).
|
||||
: >"$log_file"
|
||||
"$@" >>"$log_file" 2>&1
|
||||
estatus=$?
|
||||
|
||||
if test $enable_hard_errors = no && test $estatus -eq 99; then
|
||||
tweaked_estatus=1
|
||||
else
|
||||
tweaked_estatus=$estatus
|
||||
fi
|
||||
|
||||
case $tweaked_estatus:$expect_failure in
|
||||
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
|
||||
0:*) col=$grn res=PASS recheck=no gcopy=no;;
|
||||
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
|
||||
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
|
||||
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
|
||||
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
|
||||
esac
|
||||
|
||||
# Report the test outcome and exit status in the logs, so that one can
|
||||
# know whether the test passed or failed simply by looking at the '.log'
|
||||
# file, without the need of also peaking into the corresponding '.trs'
|
||||
# file (automake bug#11814).
|
||||
echo "$res $test_name (exit status: $estatus)" >>"$log_file"
|
||||
|
||||
# Report outcome to console.
|
||||
echo "${col}${res}${std}: $test_name"
|
||||
|
||||
# Register the test result, and other relevant metadata.
|
||||
echo ":test-result: $res" > $trs_file
|
||||
echo ":global-test-result: $res" >> $trs_file
|
||||
echo ":recheck: $recheck" >> $trs_file
|
||||
echo ":copy-in-global-log: $gcopy" >> $trs_file
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
Vendored
+6674
-16735
File diff suppressed because it is too large.
Load diff
Vendored
+634
-762
File diff suppressed because it is too large.
Load diff
Vendored
+92
-17
@@ -96,25 +96,24 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_ac_append_to_file.m4 \
|
||||
$(top_srcdir)/m4/ax_ac_print_to_file.m4 \
|
||||
$(top_srcdir)/m4/ax_add_am_macro_static.m4 \
|
||||
$(top_srcdir)/m4/ax_am_macros_static.m4 \
|
||||
$(top_srcdir)/m4/ax_append_compile_flags.m4 \
|
||||
$(top_srcdir)/m4/ax_append_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_append_link_flags.m4 \
|
||||
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_check_gnu_make.m4 \
|
||||
$(top_srcdir)/m4/ax_check_link_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_check_user_namespace.m4 \
|
||||
$(top_srcdir)/m4/ax_check_uts_namespace.m4 \
|
||||
$(top_srcdir)/m4/ax_code_coverage.m4 \
|
||||
$(top_srcdir)/m4/ax_compiler_vendor.m4 \
|
||||
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
|
||||
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \
|
||||
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_14.m4 \
|
||||
$(top_srcdir)/m4/ax_file_escapes.m4 \
|
||||
$(top_srcdir)/m4/ax_pthread.m4 \
|
||||
$(top_srcdir)/m4/ax_require_defined.m4 \
|
||||
$(top_srcdir)/m4/cares-compilers.m4 \
|
||||
$(top_srcdir)/m4/cares-confopts.m4 \
|
||||
$(top_srcdir)/m4/cares-functions.m4 \
|
||||
$(top_srcdir)/m4/cares-reentrant.m4 \
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/xc-am-iface.m4 \
|
||||
$(top_srcdir)/m4/xc-cc-check.m4 \
|
||||
$(top_srcdir)/m4/xc-lt-iface.m4 \
|
||||
$(top_srcdir)/m4/xc-translit.m4 \
|
||||
$(top_srcdir)/m4/xc-val-flgs.m4 \
|
||||
$(top_srcdir)/m4/zz40-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
@@ -189,14 +188,13 @@ AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BUILD_SUBDIRS = @BUILD_SUBDIRS@
|
||||
CARES_CFLAG_EXTRAS = @CARES_CFLAG_EXTRAS@
|
||||
CARES_PRIVATE_LIBS = @CARES_PRIVATE_LIBS@
|
||||
CARES_RANDOM_FILE = @CARES_RANDOM_FILE@
|
||||
CARES_SYMBOL_HIDING_CFLAG = @CARES_SYMBOL_HIDING_CFLAG@
|
||||
CARES_VERSION_INFO = @CARES_VERSION_INFO@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAG_CARES_SYMBOL_HIDING = @CFLAG_CARES_SYMBOL_HIDING@
|
||||
CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
|
||||
CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@
|
||||
CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
|
||||
@@ -204,7 +202,6 @@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
|
||||
CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPFLAG_CARES_STATICLIB = @CPPFLAG_CARES_STATICLIB@
|
||||
CSCOPE = @CSCOPE@
|
||||
CTAGS = @CTAGS@
|
||||
CXX = @CXX@
|
||||
@@ -227,8 +224,10 @@ FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GCOV = @GCOV@
|
||||
GENHTML = @GENHTML@
|
||||
GMOCK_CFLAGS = @GMOCK_CFLAGS@
|
||||
GMOCK_LIBS = @GMOCK_LIBS@
|
||||
GREP = @GREP@
|
||||
HAVE_CXX11 = @HAVE_CXX11@
|
||||
HAVE_CXX14 = @HAVE_CXX14@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
@@ -262,6 +261,13 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PTHREAD_CC = @PTHREAD_CC@
|
||||
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
|
||||
PTHREAD_CXX = @PTHREAD_CXX@
|
||||
PTHREAD_LIBS = @PTHREAD_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
@@ -281,6 +287,7 @@ am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
ax_pthread_config = @ax_pthread_config@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
@@ -319,7 +326,6 @@ runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
subdirs = @subdirs@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
@@ -333,6 +339,67 @@ MANPAGES = ares_cancel.3 \
|
||||
ares_create_query.3 \
|
||||
ares_destroy.3 \
|
||||
ares_destroy_options.3 \
|
||||
ares_dns_class_fromstr.3 \
|
||||
ares_dns_class_t.3 \
|
||||
ares_dns_class_tostr.3 \
|
||||
ares_dns_datatype_t.3 \
|
||||
ares_dns_flags_t.3 \
|
||||
ares_dns_mapping.3 \
|
||||
ares_dns_opcode_tostr.3 \
|
||||
ares_dns_opt_datatype_t.3 \
|
||||
ares_dns_opt_get_datatype.3 \
|
||||
ares_dns_opt_get_name.3 \
|
||||
ares_dns_opcode_t.3 \
|
||||
ares_dns_parse.3 \
|
||||
ares_dns_rcode_t.3 \
|
||||
ares_dns_rcode_tostr.3 \
|
||||
ares_dns_record.3 \
|
||||
ares_dns_record_create.3 \
|
||||
ares_dns_record_get_flags.3 \
|
||||
ares_dns_record_get_id.3 \
|
||||
ares_dns_record_get_opcode.3 \
|
||||
ares_dns_record_get_rcode.3 \
|
||||
ares_dns_record_destroy.3 \
|
||||
ares_dns_record_query_add.3 \
|
||||
ares_dns_record_query_cnt.3 \
|
||||
ares_dns_record_query_get.3 \
|
||||
ares_dns_record_rr_add.3 \
|
||||
ares_dns_record_rr_cnt.3 \
|
||||
ares_dns_record_rr_del.3 \
|
||||
ares_dns_record_rr_get.3 \
|
||||
ares_dns_rec_type_fromstr.3 \
|
||||
ares_dns_rec_type_t.3 \
|
||||
ares_dns_rr.3 \
|
||||
ares_dns_rr_get_addr.3 \
|
||||
ares_dns_rr_get_addr6.3 \
|
||||
ares_dns_rr_get_bin.3 \
|
||||
ares_dns_rr_get_class.3 \
|
||||
ares_dns_rr_get_keys.3 \
|
||||
ares_dns_rr_get_name.3 \
|
||||
ares_dns_rr_get_opt.3 \
|
||||
ares_dns_rr_get_opt_byid.3 \
|
||||
ares_dns_rr_get_opt_cnt.3 \
|
||||
ares_dns_rr_get_str.3 \
|
||||
ares_dns_rr_get_type.3 \
|
||||
ares_dns_rr_get_ttl.3 \
|
||||
ares_dns_rr_get_u16.3 \
|
||||
ares_dns_rr_get_u32.3 \
|
||||
ares_dns_rr_get_u8.3 \
|
||||
ares_dns_rr_key_datatype.3 \
|
||||
ares_dns_rr_key_t.3 \
|
||||
ares_dns_rr_key_to_rec_type.3 \
|
||||
ares_dns_rr_key_tostr.3 \
|
||||
ares_dns_rr_set_addr.3 \
|
||||
ares_dns_rr_set_addr6.3 \
|
||||
ares_dns_rr_set_bin.3 \
|
||||
ares_dns_rr_set_opt.3 \
|
||||
ares_dns_rr_set_str.3 \
|
||||
ares_dns_rr_set_u16.3 \
|
||||
ares_dns_rr_set_u32.3 \
|
||||
ares_dns_rr_set_u8.3 \
|
||||
ares_dns_section_t.3 \
|
||||
ares_dns_section_tostr.3 \
|
||||
ares_dns_write.3 \
|
||||
ares_dup.3 \
|
||||
ares_expand_name.3 \
|
||||
ares_expand_string.3 \
|
||||
@@ -342,6 +409,7 @@ MANPAGES = ares_cancel.3 \
|
||||
ares_free_string.3 \
|
||||
ares_freeaddrinfo.3 \
|
||||
ares_get_servers.3 \
|
||||
ares_get_servers_csv.3 \
|
||||
ares_get_servers_ports.3 \
|
||||
ares_getaddrinfo.3 \
|
||||
ares_gethostbyaddr.3 \
|
||||
@@ -358,6 +426,7 @@ MANPAGES = ares_cancel.3 \
|
||||
ares_library_init_android.3 \
|
||||
ares_library_initialized.3 \
|
||||
ares_mkquery.3 \
|
||||
ares_opt_param_t.3 \
|
||||
ares_parse_a_reply.3 \
|
||||
ares_parse_aaaa_reply.3 \
|
||||
ares_parse_caa_reply.3 \
|
||||
@@ -371,6 +440,7 @@ MANPAGES = ares_cancel.3 \
|
||||
ares_parse_uri_reply.3 \
|
||||
ares_process.3 \
|
||||
ares_query.3 \
|
||||
ares_reinit.3 \
|
||||
ares_save_options.3 \
|
||||
ares_search.3 \
|
||||
ares_send.3 \
|
||||
@@ -386,7 +456,12 @@ MANPAGES = ares_cancel.3 \
|
||||
ares_set_socket_functions.3 \
|
||||
ares_set_sortlist.3 \
|
||||
ares_strerror.3 \
|
||||
ares_svcb_param_t.3 \
|
||||
ares_threadsafety.3 \
|
||||
ares_timeout.3 \
|
||||
ares_tlsa_match_t.3 \
|
||||
ares_tlsa_selector_t.3 \
|
||||
ares_tlsa_usage_t.3 \
|
||||
ares_version.3
|
||||
|
||||
man_MANS = $(MANPAGES)
|
||||
|
||||
Vendored
+69
@@ -4,6 +4,67 @@ MANPAGES = ares_cancel.3 \
|
||||
ares_create_query.3 \
|
||||
ares_destroy.3 \
|
||||
ares_destroy_options.3 \
|
||||
ares_dns_class_fromstr.3 \
|
||||
ares_dns_class_t.3 \
|
||||
ares_dns_class_tostr.3 \
|
||||
ares_dns_datatype_t.3 \
|
||||
ares_dns_flags_t.3 \
|
||||
ares_dns_mapping.3 \
|
||||
ares_dns_opcode_tostr.3 \
|
||||
ares_dns_opt_datatype_t.3 \
|
||||
ares_dns_opt_get_datatype.3 \
|
||||
ares_dns_opt_get_name.3 \
|
||||
ares_dns_opcode_t.3 \
|
||||
ares_dns_parse.3 \
|
||||
ares_dns_rcode_t.3 \
|
||||
ares_dns_rcode_tostr.3 \
|
||||
ares_dns_record.3 \
|
||||
ares_dns_record_create.3 \
|
||||
ares_dns_record_get_flags.3 \
|
||||
ares_dns_record_get_id.3 \
|
||||
ares_dns_record_get_opcode.3 \
|
||||
ares_dns_record_get_rcode.3 \
|
||||
ares_dns_record_destroy.3 \
|
||||
ares_dns_record_query_add.3 \
|
||||
ares_dns_record_query_cnt.3 \
|
||||
ares_dns_record_query_get.3 \
|
||||
ares_dns_record_rr_add.3 \
|
||||
ares_dns_record_rr_cnt.3 \
|
||||
ares_dns_record_rr_del.3 \
|
||||
ares_dns_record_rr_get.3 \
|
||||
ares_dns_rec_type_fromstr.3 \
|
||||
ares_dns_rec_type_t.3 \
|
||||
ares_dns_rr.3 \
|
||||
ares_dns_rr_get_addr.3 \
|
||||
ares_dns_rr_get_addr6.3 \
|
||||
ares_dns_rr_get_bin.3 \
|
||||
ares_dns_rr_get_class.3 \
|
||||
ares_dns_rr_get_keys.3 \
|
||||
ares_dns_rr_get_name.3 \
|
||||
ares_dns_rr_get_opt.3 \
|
||||
ares_dns_rr_get_opt_byid.3 \
|
||||
ares_dns_rr_get_opt_cnt.3 \
|
||||
ares_dns_rr_get_str.3 \
|
||||
ares_dns_rr_get_type.3 \
|
||||
ares_dns_rr_get_ttl.3 \
|
||||
ares_dns_rr_get_u16.3 \
|
||||
ares_dns_rr_get_u32.3 \
|
||||
ares_dns_rr_get_u8.3 \
|
||||
ares_dns_rr_key_datatype.3 \
|
||||
ares_dns_rr_key_t.3 \
|
||||
ares_dns_rr_key_to_rec_type.3 \
|
||||
ares_dns_rr_key_tostr.3 \
|
||||
ares_dns_rr_set_addr.3 \
|
||||
ares_dns_rr_set_addr6.3 \
|
||||
ares_dns_rr_set_bin.3 \
|
||||
ares_dns_rr_set_opt.3 \
|
||||
ares_dns_rr_set_str.3 \
|
||||
ares_dns_rr_set_u16.3 \
|
||||
ares_dns_rr_set_u32.3 \
|
||||
ares_dns_rr_set_u8.3 \
|
||||
ares_dns_section_t.3 \
|
||||
ares_dns_section_tostr.3 \
|
||||
ares_dns_write.3 \
|
||||
ares_dup.3 \
|
||||
ares_expand_name.3 \
|
||||
ares_expand_string.3 \
|
||||
@@ -13,6 +74,7 @@ MANPAGES = ares_cancel.3 \
|
||||
ares_free_string.3 \
|
||||
ares_freeaddrinfo.3 \
|
||||
ares_get_servers.3 \
|
||||
ares_get_servers_csv.3 \
|
||||
ares_get_servers_ports.3 \
|
||||
ares_getaddrinfo.3 \
|
||||
ares_gethostbyaddr.3 \
|
||||
@@ -29,6 +91,7 @@ MANPAGES = ares_cancel.3 \
|
||||
ares_library_init_android.3 \
|
||||
ares_library_initialized.3 \
|
||||
ares_mkquery.3 \
|
||||
ares_opt_param_t.3 \
|
||||
ares_parse_a_reply.3 \
|
||||
ares_parse_aaaa_reply.3 \
|
||||
ares_parse_caa_reply.3 \
|
||||
@@ -42,6 +105,7 @@ MANPAGES = ares_cancel.3 \
|
||||
ares_parse_uri_reply.3 \
|
||||
ares_process.3 \
|
||||
ares_query.3 \
|
||||
ares_reinit.3 \
|
||||
ares_save_options.3 \
|
||||
ares_search.3 \
|
||||
ares_send.3 \
|
||||
@@ -57,5 +121,10 @@ MANPAGES = ares_cancel.3 \
|
||||
ares_set_socket_functions.3 \
|
||||
ares_set_sortlist.3 \
|
||||
ares_strerror.3 \
|
||||
ares_svcb_param_t.3 \
|
||||
ares_threadsafety.3 \
|
||||
ares_timeout.3 \
|
||||
ares_tlsa_match_t.3 \
|
||||
ares_tlsa_selector_t.3 \
|
||||
ares_tlsa_usage_t.3 \
|
||||
ares_version.3
|
||||
Vendored
+8
-20
@@ -44,12 +44,13 @@ Print some extra debugging output.
|
||||
\fB\-f\fR flag
|
||||
Add a behavior control flag.
|
||||
Possible values for flag are
|
||||
igntc - ignore to query in TCP to get truncated UDP answer,
|
||||
igntc - ignore query truncation, return answer as-is instead of retrying
|
||||
via tcp.
|
||||
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.
|
||||
primary - use the first server,
|
||||
stayopen - don't close the communication sockets, and
|
||||
usevc - always use TCP.
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-?\fR
|
||||
Display this help and exit.
|
||||
@@ -61,27 +62,14 @@ Servers are tried in round-robin, if the previous one failed.
|
||||
\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 and X25.
|
||||
A (default), AAAA, ANY, AXFR, CNAME, HINFO, MX, NAPTR, NS, PTR, SOA, SRV, TXT,
|
||||
URI, CAA, SVCB, and HTTPS.
|
||||
.TP
|
||||
\fB\-T\fR port
|
||||
Connect to the specified TCP port of DNS server.
|
||||
.TP
|
||||
\fB\-U\fR port
|
||||
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
|
||||
.br
|
||||
\fBd.c.b.a.in-addr.arpa.\fR
|
||||
This more often gives correct names in the \fBANSWER\fR.
|
||||
.br
|
||||
For an IPv6 \fB-t PTR addr\fR lookup, query for \fBa.b.c....z.IP6.ARPA.\fR
|
||||
.TP
|
||||
\fB\-xx\fR
|
||||
As for \fB-x\fR and an IPv6 address, compact \fBa.b.c....z.IP6.ARPA.\fR into a RFC-2673 bit-string.
|
||||
This compacted \fBbit-string\fR form is not supported by many DNS-servers.
|
||||
|
||||
.SH "REPORTING BUGS"
|
||||
Report bugs to the c-ares mailing list:
|
||||
@@ -91,7 +79,7 @@ Report bugs to the c-ares mailing list:
|
||||
.PP
|
||||
acountry(1), ahost(1).
|
||||
.SH COPYRIGHT
|
||||
This utility is based on code/ideas contained in sofware written by Greg Hudson (ares)
|
||||
This utility is based on code/ideas contained in software written by Greg Hudson (ares)
|
||||
carrying the following notice:
|
||||
.br
|
||||
Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
|
||||
Vendored
+7
-4
@@ -39,11 +39,14 @@ Print some extra debugging output.
|
||||
Display this help and exit.
|
||||
.TP
|
||||
\fB\-t\fR type
|
||||
If type is "a", print the A record (default).
|
||||
If type is "a", print the A record.
|
||||
If type is "aaaa", print the AAAA record.
|
||||
If type is "u", look for either AAAA or A record (in that order).
|
||||
If type is "u", look for both AAAA and A records (default).
|
||||
.TP
|
||||
\fB\-s\fR \fIdomain\fP
|
||||
\fB\-s\fR server
|
||||
Set the server list to use for DNS lookups.
|
||||
.TP
|
||||
\fB\-D\fR \fIdomain\fP
|
||||
Specify the \fIdomain\fP to search instead of using the default values from
|
||||
.br
|
||||
/etc/resolv.conf. This option only has an effect on platforms that use
|
||||
@@ -59,7 +62,7 @@ Report bugs to the c-ares mailing list:
|
||||
.PP
|
||||
acountry(1), adig(1).
|
||||
.SH COPYRIGHT
|
||||
This utility is based on code/ideas contained in sofware written by Greg Hudson (ares)
|
||||
This utility is based on code/ideas contained in software written by Greg Hudson (ares)
|
||||
carrying the following notice:
|
||||
.br
|
||||
Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
|
||||
Vendored
+1
-1
@@ -22,7 +22,7 @@ ares_cancel \- Cancel a resolve
|
||||
.nf
|
||||
#include <ares.h>
|
||||
|
||||
void ares_cancel(ares_channel \fIchannel\fP)
|
||||
void ares_cancel(ares_channel_t *\fIchannel\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_cancel(3)\fP function cancels all lookups/requests made on the the
|
||||
|
||||
Vendored
+1
@@ -79,6 +79,7 @@ Memory was exhausted.
|
||||
.SH AVAILABILITY
|
||||
Added in c-ares 1.10.0
|
||||
.SH SEE ALSO
|
||||
.BR ares_dns_record (3),
|
||||
.BR ares_expand_name (3),
|
||||
.BR ares_free_string (3),
|
||||
.BR ares_mkquery (3)
|
||||
|
||||
Vendored
+6
-2
@@ -22,7 +22,7 @@ ares_destroy \- Destroy a resolver channel
|
||||
.nf
|
||||
#include <ares.h>
|
||||
|
||||
void ares_destroy(ares_channel \fIchannel\fP)
|
||||
void ares_destroy(ares_channel_t *\fIchannel\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_destroy(3)\fP function destroys the name service channel
|
||||
@@ -33,9 +33,13 @@ by the channel.
|
||||
channel, passing a status of \fIARES_EDESTRUCTION\fP. These calls give the
|
||||
callbacks a chance to clean up any state which might have been stored in their
|
||||
arguments. A callback must not add new requests to a channel being destroyed.
|
||||
|
||||
There is no ability to make this function thread-safe. No additional calls
|
||||
using this channel may be made once this function is called.
|
||||
.SH SEE ALSO
|
||||
.BR ares_init (3),
|
||||
.BR ares_cancel (3)
|
||||
.BR ares_cancel (3),
|
||||
.BR ares_threadsafety (3)
|
||||
.SH AUTHOR
|
||||
Greg Hudson, MIT Information Systems
|
||||
.br
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
.\"
|
||||
.\" Copyright (C) Daniel Stenberg
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_mapping.3
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
.\"
|
||||
.\" Copyright (C) Daniel Stenberg
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_mapping.3
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
.\"
|
||||
.\" Copyright (C) Daniel Stenberg
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_mapping.3
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
Vendored
+302
@@ -0,0 +1,302 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.\"
|
||||
.TH ARES_DNS_MAPPINGS 3 "12 November 2023"
|
||||
.SH NAME
|
||||
ares_dns_class_fromstr, ares_dns_class_tostr, ares_dns_datatype_t, ares_dns_opcode_tostr,
|
||||
ares_dns_opt_datatype_t, ares_dns_opt_get_datatype, ares_dns_opt_get_name,
|
||||
ares_dns_rcode_tostr, ares_dns_rec_type_fromstr, ares_dns_rr_get_keys,
|
||||
ares_dns_rr_key_datatype, ares_dns_rr_key_to_rec_type, ares_dns_rr_key_tostr,
|
||||
ares_dns_section_tostr, ares_opt_param_t, ares_svcb_param_t \-
|
||||
Helper functions for converting dns record identifiers to and from their
|
||||
respective types, as well identifying datatypes for various records.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <ares.h>
|
||||
|
||||
const char *ares_dns_rec_type_tostr(ares_dns_rec_type_t type);
|
||||
|
||||
const char *ares_dns_class_tostr(ares_dns_class_t qclass);
|
||||
|
||||
const char *ares_dns_opcode_tostr(ares_dns_opcode_t opcode);
|
||||
|
||||
const char *ares_dns_rr_key_tostr(ares_dns_rr_key_t key);
|
||||
|
||||
const char *ares_dns_section_tostr(ares_dns_section_t section);
|
||||
|
||||
const char *ares_dns_rcode_tostr(ares_dns_rcode_t rcode);
|
||||
|
||||
ares_bool_t ares_dns_class_fromstr(ares_dns_class_t *qclass, const char *str);
|
||||
|
||||
ares_bool_t ares_dns_rec_type_fromstr(ares_dns_rec_type_t *qtype,
|
||||
const char *str);
|
||||
|
||||
const ares_dns_rr_key_t *ares_dns_rr_get_keys(ares_dns_rec_type_t type,
|
||||
size_t *cnt);
|
||||
|
||||
ares_dns_datatype_t ares_dns_rr_key_datatype(ares_dns_rr_key_t key);
|
||||
|
||||
ares_dns_rec_type_t ares_dns_rr_key_to_rec_type(ares_dns_rr_key_t key);
|
||||
|
||||
ares_dns_opt_datatype_t ares_dns_opt_get_datatype(ares_dns_rr_key_t key,
|
||||
unsigned short opt);
|
||||
|
||||
const char *ares_dns_opt_get_name(ares_dns_rr_key_t key, unsigned short opt);
|
||||
|
||||
.fi
|
||||
.SH ENUMERATIONS
|
||||
.B ares_dns_datatype_t -
|
||||
Data types associated with \fIares_dns_rr_key_t\fP:
|
||||
.RS 4
|
||||
.B ARES_DATATYPE_INADDR
|
||||
- IPv4 address as \fIstruct in_addr *\fP. Use \fIares_dns_rr_set_addr(3)\fP to
|
||||
set and \fIares_dns_rr_get_addr(3)\fP to get.
|
||||
.br
|
||||
.B ARES_DATATYPE_INADDR6
|
||||
- IPv6 address as \fIstruct ares_in6_addr *\fP. Use \fIares_dns_rr_set_addr6(3)\fP to
|
||||
set and \fIares_dns_rr_get_addr6(3)\fP to get.
|
||||
.br
|
||||
.B ARES_DATATYPE_U8
|
||||
- 8bit unsigned integer. Use \fIares_dns_rr_set_u8(3)\fP to
|
||||
set and \fIares_dns_rr_get_u8(3)\fP to get.
|
||||
.br
|
||||
.B ARES_DATATYPE_U16
|
||||
- 16bit unsigned integer. Use \fIares_dns_rr_set_u16(3)\fP to
|
||||
set and \fIares_dns_rr_get_u16(3)\fP to get.
|
||||
.br
|
||||
.B ARES_DATATYPE_U32
|
||||
- 32bit unsigned integer. Use \fIares_dns_rr_set_u32(3)\fP to
|
||||
set and \fIares_dns_rr_get_u32(3)\fP to get.
|
||||
.br
|
||||
.B ARES_DATATYPE_NAME
|
||||
- Null-terminated string of a domain name (series of labels). Use \fIares_dns_rr_set_str(3)\fP to
|
||||
set and \fIares_dns_rr_get_str(3)\fP to get.
|
||||
.br
|
||||
.B ARES_DATATYPE_STR
|
||||
- Null-terminated string. Use \fIares_dns_rr_set_str(3)\fP to
|
||||
set and \fIares_dns_rr_get_str(3)\fP to get.
|
||||
.br
|
||||
.B ARES_DATATYPE_BIN
|
||||
- Binary Data. Use \fIares_dns_rr_set_bin(3)\fP to
|
||||
set and \fIares_dns_rr_get_bin(3)\fP to get.
|
||||
.br
|
||||
.B ARES_DATATYPE_BINP
|
||||
- Officially defined as binary data, but likely printable. Guaranteed to have
|
||||
a NULL terminator for convenience (not included in length). Use \fIares_dns_rr_set_bin(3)\fP to
|
||||
set and \fIares_dns_rr_get_bin(3)\fP to get.
|
||||
.br
|
||||
.B ARES_DATATYPE_OPT
|
||||
- Array of options. 16bit identifier, Binary data. Use \fIares_dns_rr_set_opt(3)\fP to
|
||||
set and \fIares_dns_rr_get_opt(3)\fP to get.
|
||||
.br
|
||||
.RE
|
||||
|
||||
.B ares_dns_opt_datatype_t -
|
||||
Data types associated with \fIARES_DATATYPE_OPT\fP parameters if known as returned
|
||||
by \fIares_dns_opt_get_datatype(3)\fP:
|
||||
.RS 4
|
||||
.B ARES_OPT_DATATYPE_NONE
|
||||
- No value allowed for this parameter
|
||||
.br
|
||||
.B ARES_OPT_DATATYPE_STR_LIST
|
||||
- List of strings, each prefixed with a single octet representing the length as
|
||||
defined by RFC 1035. Can use \fIares_expand_string(3)\fP until buffer is consumed.
|
||||
.br
|
||||
.B ARES_OPT_DATATYPE_U8_LIST
|
||||
- List of 8bit unsigned integers, concatenated
|
||||
.br
|
||||
.B ARES_OPT_DATATYPE_U16
|
||||
- 16bit unsigned integer in network byte order
|
||||
.br
|
||||
.B ARES_OPT_DATATYPE_U16_LIST
|
||||
- list of 16bit unsigned integers in network byte order, concatenated.
|
||||
.br
|
||||
.B ARES_OPT_DATATYPE_U32
|
||||
- 32bit unsigned integer in network byte order
|
||||
.br
|
||||
.B ARES_OPT_DATATYPE_U32_LIST
|
||||
- list of 16bit unsigned integers in network byte order, concatenated.
|
||||
.br
|
||||
.B ARES_OPT_DATATYPE_INADDR4_LIST
|
||||
- List of ipv4 addresses in network byte order, concatenated
|
||||
.br
|
||||
.B ARES_OPT_DATATYPE_INADDR6_LIST
|
||||
- List of ipv6 addresses in network byte order, concatenated
|
||||
.br
|
||||
.B ARES_OPT_DATATYPE_BIN
|
||||
- Binary Data
|
||||
.br
|
||||
.B ARES_OPT_DATATYPE_NAME
|
||||
- DNS Domain Name binary format as defined in RFC1035, can use \fIares_expand_name(3)\fP
|
||||
.br
|
||||
.RE
|
||||
|
||||
.B ares_svcb_param_t -
|
||||
SVCB (and HTTPS) RR known parameters as returned by \fIares_dns_opt_get_datatype(3)\fP
|
||||
with \fIARES_RR_SVCB_PARAMS\fP or \fIARES_RR_HTTPS_PARAMS\fP:
|
||||
.RS 4
|
||||
.B ARES_SVCB_PARAM_MANDATORY
|
||||
- Mandatory keys in this RR (RFC 9460 Section 8). Datatype: \fIARES_OPT_DATATYPE_U16_LIST\fP
|
||||
.br
|
||||
.B ARES_SVCB_PARAM_ALPN
|
||||
- Additional supported protocols (RFC 9460 Section 7.1). Datatype: \fIARES_OPT_DATATYPE_STR_LIST\fP
|
||||
.br
|
||||
.B ARES_SVCB_PARAM_NO_DEFAULT_ALPN
|
||||
- No support for default protocol (RFC 9460 Section 7.1). Datatype: \fIARES_OPT_DATATYPE_NONE\fP
|
||||
.br
|
||||
.B ARES_SVCB_PARAM_PORT
|
||||
- Port for alternative endpoint (RFC 9460 Section 7.2). Datatype: \fIARES_OPT_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_SVCB_PARAM_IPV4HINT
|
||||
- IPv4 address hints (RFC 9460 Section 7.3). Datatype: \fIARES_OPT_DATATYPE_INADDR4_LIST\fP
|
||||
.br
|
||||
.B ARES_SVCB_PARAM_ECH
|
||||
- RESERVED (held for Encrypted ClientHello)
|
||||
.br
|
||||
.B ARES_SVCB_PARAM_IPV6HINT
|
||||
- IPv6 address hints (RFC 9460 Section 7.3). Datatype: \fIARES_OPT_DATATYPE_INADDR6_LIST\fP
|
||||
.br
|
||||
|
||||
.RE
|
||||
|
||||
.B ares_opt_param_t -
|
||||
OPT RR known parameters as returned by \fIares_dns_opt_get_datatype(3)\fP
|
||||
with \fIARES_RR_OPT_OPTIONS\fB:
|
||||
.RS 4
|
||||
.B ARES_OPT_PARAM_LLQ
|
||||
- RFC 8764. Apple's DNS Long-Lived Queries Protocol. Datatype: \fIARES_OPT_DATATYPE_BIN\fP
|
||||
.br
|
||||
.B ARES_OPT_PARAM_UL
|
||||
- http://files.dns-sd.org/draft-sekar-dns-ul.txt: Update Lease. Datatype: \fIARES_OPT_DATATYPE_U32\fP
|
||||
.br
|
||||
.B ARES_OPT_PARAM_NSID
|
||||
- RFC 5001. Name Server Identification. Datatype: \fIARES_OPT_DATATYPE_BIN\fP
|
||||
.br
|
||||
.B ARES_OPT_PARAM_DAU
|
||||
- RFC 6975. DNSSEC Algorithm Understood. Datatype: \fIARES_OPT_DATATYPE_U8_LIST\fP
|
||||
.br
|
||||
.B ARES_OPT_PARAM_DHU
|
||||
- RFC 6975. DS Hash Understood. Datatype: \fIARES_OPT_DATATYPE_U8_LIST\fP
|
||||
.br
|
||||
.B ARES_OPT_PARAM_N3U
|
||||
- RFC 6975. NSEC3 Hash Understood. Datatype: \fIARES_OPT_DATATYPE_U8_LIST\fP
|
||||
.br
|
||||
.B ARES_OPT_PARAM_EDNS_CLIENT_SUBNET
|
||||
- RFC 7871. Client Subnet. Datatype: \fIARES_OPT_DATATYPE_BIN\fP
|
||||
.br
|
||||
.B ARES_OPT_PARAM_EDNS_EXPIRE
|
||||
- RFC 7314. Expire Timer. Datatype: \fIARES_OPT_DATATYPE_U32\fP
|
||||
.br
|
||||
.B ARES_OPT_PARAM_COOKIE
|
||||
- RFC 7873. Client and Server Cookies. Datatype: \fIARES_OPT_DATATYPE_BIN\fP
|
||||
.br
|
||||
.B ARES_OPT_PARAM_EDNS_TCP_KEEPALIVE
|
||||
- RFC 7828. TCP Keepalive timeout. Datatype: \fIARES_OPT_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_OPT_PARAM_PADDING
|
||||
- RFC 7830. Padding. Datatype: \fIARES_OPT_DATATYPE_BIN\fP
|
||||
.br
|
||||
.B ARES_OPT_PARAM_CHAIN
|
||||
- RFC 7901. Chain query requests. Datatype: \fIARES_OPT_DATATYPE_NAME\fP
|
||||
.br
|
||||
.B ARES_OPT_PARAM_EDNS_KEY_TAG
|
||||
- RFC 8145. Signaling Trust Anchor Knowledge in DNSSEC. Datatype: \fIARES_OPT_DATATYPE_U16_LIST\fP
|
||||
.br
|
||||
.B ARES_OPT_PARAM_EXTENDED_DNS_ERROR
|
||||
- RFC 8914. Extended ERROR code and message. Datatype: \fIARES_OPT_DATATYPE_BIN\fP
|
||||
.br
|
||||
.RE
|
||||
|
||||
.SH DESCRIPTION
|
||||
The \fIares_dns_rec_type_tostr(3)\fP function outputs a human readable DNS record
|
||||
type from its numeric form passed in
|
||||
.IR type .
|
||||
|
||||
The \fIares_dns_class_tostr(3)\fP function outputs a human readable DNS class
|
||||
from its numeric form passed in
|
||||
.IR qclass .
|
||||
|
||||
The \fIares_dns_opcode_tostr(3)\fP function outputs a human readable DNS opcode
|
||||
from its numeric form in
|
||||
.IR opcode .
|
||||
|
||||
The \fIares_dns_rr_key_tostr(3)\fP function outputs a human readable DNS Resource
|
||||
Record parameter name from its numeric form in
|
||||
.IR key .
|
||||
|
||||
The \fIares_dns_section_tostr(3)\fP function outputs a human readable DNS
|
||||
message section from its numeric form in
|
||||
.IR section .
|
||||
|
||||
The \fIares_dns_rcode_tostr(3)\fP function outputs a human readable DNS
|
||||
response code from its numeric form in
|
||||
.IR rcode .
|
||||
|
||||
The \fIares_dns_class_fromstr(3)\fP function outputs the DNS class in numeric
|
||||
from from its string representation in
|
||||
.IR str .
|
||||
The result is stored into the variable pointed to by
|
||||
.IR qclass .
|
||||
|
||||
The \fIares_dns_rec_type_fromstr(3)\fP function outputs the DNS record type in
|
||||
numeric from from its string representation in
|
||||
.IR str .
|
||||
The result is stored into the variable pointed to by
|
||||
.IR qtype .
|
||||
|
||||
The \fIares_dns_rr_get_keys(3)\fP function retrieves a list of parameters that
|
||||
may be set or retrieved for the provided
|
||||
.IR type .
|
||||
The count of returned keys is stored into the variable pointed to by
|
||||
.IR cnt .
|
||||
|
||||
The \fIares_dns_rr_key_datatype(3)\fP function retrieves the associated datatype
|
||||
for an RR parameter specified by
|
||||
.IR key .
|
||||
|
||||
The \fIares_dns_rr_key_to_rec_type(3)\fP function dereferences the provided RR
|
||||
parameter specified by
|
||||
.IR key
|
||||
to the DNS Record Type it belongs.
|
||||
|
||||
The \fIares_dns_opt_get_datatype(3)\fP function is used in association with
|
||||
\fIares_dns_rr_set_opt(3)\fP and \fIares_dns_rr_get_opt(3)\fP to retrieve the
|
||||
datatype of an option record contained within an RR as specified in
|
||||
.IR key
|
||||
if it is known. The raw option record identifier is provided by
|
||||
.IR opt .
|
||||
|
||||
The \fIares_dns_opt_get_name(3)\fP function is used in association with
|
||||
\fIares_dns_rr_set_opt(3)\fP and \fIares_dns_rr_get_opt(3)\fP to retrieve human
|
||||
readable parameter name of an option record contained within an RR as specified
|
||||
in
|
||||
.IR key
|
||||
if it is known. The raw option record identifier is provided by
|
||||
.IR opt .
|
||||
|
||||
.SH RETURN VALUES
|
||||
\fIares_dns_rec_type_tostr(3)\fP, \fIares_dns_class_tostr(3)\fP,
|
||||
\fIares_dns_opcode_tostr(3)\fP, \fIares_dns_rr_key_tostr(3)\fP,
|
||||
\fIares_dns_section_tostr(3)\fP, \fIares_dns_rcode_tostr(3)\fP, and
|
||||
\fIares_dns_opt_get_name(3)\fP all return a human printable ASCII string, or
|
||||
NULL on error.
|
||||
|
||||
\fIares_dns_class_fromstr(3)\fP and \fIares_dns_rec_type_fromstr(3)\fP return
|
||||
.B ARES_TRUE
|
||||
on successful conversion, otherwise
|
||||
.B ARES_FALSE.
|
||||
|
||||
\fIares_dns_rr_get_keys(3)\fP returns an array of keys or NULL on failure.
|
||||
|
||||
\fIares_dns_rr_key_datatype(3)\fP, \fIares_dns_rr_key_to_rec_type(3)\fP, and
|
||||
\fIares_dns_opt_get_datatype(3)\fP return their respective integer values, or
|
||||
0 on failure.
|
||||
|
||||
.SH AVAILABILITY
|
||||
These functions were first introduced in c-ares version 1.22.0.
|
||||
.SH SEE ALSO
|
||||
.BR ares_dns_record (3),
|
||||
.BR ares_dns_rr (3),
|
||||
.BR ares_init (3)
|
||||
.SH AUTHOR
|
||||
Copyright (C) 2023 The c-ares project and its members.
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
.\"
|
||||
.\" Copyright (C) Daniel Stenberg
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_mapping.3
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
.\"
|
||||
.\" Copyright (C) Daniel Stenberg
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_mapping.3
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
.\"
|
||||
.\" Copyright (C) Daniel Stenberg
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_mapping.3
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
.\"
|
||||
.\" Copyright (C) Daniel Stenberg
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_mapping.3
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
.\"
|
||||
.\" Copyright (C) Daniel Stenberg
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_mapping.3
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
.\"
|
||||
.\" Copyright (C) Daniel Stenberg
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_mapping.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
Vendored
+380
@@ -0,0 +1,380 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.\"
|
||||
.TH ARES_DNS_RECORD 3 "12 November 2023"
|
||||
.SH NAME
|
||||
ares_dns_class_t, ares_dns_flags_t, ares_dns_opcode_t, ares_dns_parse,
|
||||
ares_dns_rcode_t, ares_dns_record_create, ares_dns_record_destroy,
|
||||
ares_dns_record_get_flags, ares_dns_record_get_id, ares_dns_record_get_opcode,
|
||||
ares_dns_record_get_rcode, ares_dns_record_query_add, ares_dns_record_query_cnt,
|
||||
ares_dns_record_query_get, ares_dns_rec_type_t, ares_dns_write \-
|
||||
DNS Record parsing, writing, creating and destroying functions.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <ares.h>
|
||||
|
||||
void ares_dns_record_destroy(ares_dns_record_t *dnsrec);
|
||||
|
||||
ares_status_t ares_dns_parse(const unsigned char *buf,
|
||||
size_t buf_len, unsigned int flags,
|
||||
ares_dns_record_t **dnsrec);
|
||||
|
||||
ares_status_t ares_dns_write(ares_dns_record_t *dnsrec,
|
||||
unsigned char **buf, size_t *buf_len);
|
||||
|
||||
ares_status_t ares_dns_record_create(ares_dns_record_t **dnsrec,
|
||||
unsigned short id,
|
||||
unsigned short flags,
|
||||
ares_dns_opcode_t opcode,
|
||||
ares_dns_rcode_t rcode);
|
||||
|
||||
unsigned short ares_dns_record_get_id(const ares_dns_record_t *dnsrec);
|
||||
|
||||
unsigned short ares_dns_record_get_flags(const ares_dns_record_t *dnsrec);
|
||||
|
||||
ares_dns_opcode_t ares_dns_record_get_opcode(const ares_dns_record_t *dnsrec);
|
||||
|
||||
ares_dns_rcode_t ares_dns_record_get_rcode(const ares_dns_record_t *dnsrec);
|
||||
|
||||
ares_status_t ares_dns_record_query_add(ares_dns_record_t *dnsrec,
|
||||
const char *name,
|
||||
ares_dns_rec_type_t qtype,
|
||||
ares_dns_class_t qclass);
|
||||
|
||||
size_t ares_dns_record_query_cnt(const ares_dns_record_t *dnsrec);
|
||||
|
||||
ares_status_t ares_dns_record_query_get(const ares_dns_record_t *dnsrec,
|
||||
size_t idx, const char **name,
|
||||
ares_dns_rec_type_t *qtype,
|
||||
ares_dns_class_t *qclass);
|
||||
|
||||
.fi
|
||||
.SH ENUMERATIONS
|
||||
|
||||
.B ares_dns_rec_type_t -
|
||||
DNS Record types handled by c-ares. Some record types may only be valid
|
||||
on requests, and some may only be valid on responses:
|
||||
.RS 4
|
||||
.B ARES_REC_TYPE_A
|
||||
- Host address
|
||||
.br
|
||||
.B ARES_REC_TYPE_NS
|
||||
- Authoritative server
|
||||
.br
|
||||
.B ARES_REC_TYPE_CNAME
|
||||
- Canonical name
|
||||
.br
|
||||
.B ARES_REC_TYPE_SOA
|
||||
- Start of authority zone
|
||||
.br
|
||||
.B ARES_REC_TYPE_PTR
|
||||
- Domain name pointer
|
||||
.br
|
||||
.B ARES_REC_TYPE_HINFO
|
||||
- Host information
|
||||
.br
|
||||
.B ARES_REC_TYPE_MX
|
||||
- Mail routing information
|
||||
.br
|
||||
.B ARES_REC_TYPE_TXT
|
||||
- Text strings
|
||||
.br
|
||||
.B ARES_REC_TYPE_AAAA
|
||||
- RFC 3596. Ip6 Address
|
||||
.br
|
||||
.B ARES_REC_TYPE_SRV
|
||||
- RFC 2782. Server Selection
|
||||
.br
|
||||
.B ARES_REC_TYPE_NAPTR
|
||||
- RFC 3403. Naming Authority Pointer
|
||||
.br
|
||||
.B ARES_REC_TYPE_OPT
|
||||
- RFC 6891. EDNS0 option (meta-RR). Pseudo Record.
|
||||
.br
|
||||
.B ARES_REC_TYPE_TLSA
|
||||
- RFC 6698. DNS-Based Authentication of Named Entities (DANE) Transport Layer Security (TLS) Protocol: TLSA
|
||||
.br
|
||||
.B ARES_REC_TYPE_SVCB
|
||||
- RFC 9460. General Purpose Service Binding
|
||||
.br
|
||||
.B ARES_REC_TYPE_HTTPS -
|
||||
- RFC 9460. Service Binding type for use with HTTPS
|
||||
.br
|
||||
.B ARES_REC_TYPE_ANY
|
||||
- Wildcard match. Not response RR
|
||||
.br
|
||||
.B ARES_REC_TYPE_URI
|
||||
- RFC 7553. Uniform Resource Identifier
|
||||
.br
|
||||
.B ARES_REC_TYPE_CAA
|
||||
- RFC 6844. Certification Authority Authorization
|
||||
.br
|
||||
.B ARES_REC_TYPE_RAW_RR
|
||||
- Used as an indicator that the RR record is not parsed, but provided in wire
|
||||
format
|
||||
.br
|
||||
.RE
|
||||
|
||||
.B ares_dns_class_t -
|
||||
DNS Classes for requests and responses:
|
||||
.RS 4
|
||||
.B ARES_CLASS_IN
|
||||
- Internet
|
||||
.br
|
||||
.B ARES_CLASS_CHAOS
|
||||
- CHAOS
|
||||
.br
|
||||
.B ARES_CLASS_HESOID
|
||||
- Hesoid [Dyer 87]
|
||||
.br
|
||||
.B ARES_CLASS_NONE
|
||||
- RFC 2136
|
||||
.br
|
||||
.B ARES_CLASS_ANY
|
||||
- Any class (requests only)
|
||||
.br
|
||||
.RE
|
||||
|
||||
.B ares_dns_opcode_t -
|
||||
DNS Header Opcodes:
|
||||
.RS 4
|
||||
.B ARES_OPCODE_QUERY
|
||||
- Standard query
|
||||
.br
|
||||
.B ARES_OPCODE_IQUERY
|
||||
- Inverse query. Obsolete
|
||||
.br
|
||||
.B ARES_OPCODE_STATUS
|
||||
- Name server status query
|
||||
.br
|
||||
.B ARES_OPCODE_NOTIFY
|
||||
- Zone change notification (RFC 1996)
|
||||
.br
|
||||
.B ARES_OPCODE_UPDATE
|
||||
- Zone update message (RFC2136)
|
||||
.br
|
||||
.RE
|
||||
|
||||
.B ares_dns_flags_t -
|
||||
DNS Header Flags:
|
||||
.RS 4
|
||||
.B ARES_FLAG_QR
|
||||
- QR. If set, is a response
|
||||
.br
|
||||
.B ARES_FLAG_AA
|
||||
- Authoritative Answer. If set, is authoritative
|
||||
.br
|
||||
.B ARES_FLAG_TC
|
||||
- Truncation. If set, is truncated response
|
||||
.br
|
||||
.B ARES_FLAG_RD
|
||||
- Recursion Desired. If set, recursion is desired
|
||||
.br
|
||||
.B ARES_FLAG_RA
|
||||
- Recursion Available. If set, server supports recursion
|
||||
.br
|
||||
.B ARES_FLAG_AD
|
||||
- RFC 2065. Authentic Data bit indicates in a response that the data included
|
||||
has been verified by the server providing it
|
||||
.br
|
||||
.B ARES_FLAG_CD
|
||||
- RFC 2065. Checking Disabled bit indicates in a query that non-verified data
|
||||
is acceptable to the resolver sending the query
|
||||
.br
|
||||
.RE
|
||||
|
||||
.B ares_dns_rcode_t -
|
||||
DNS Response codes from server:
|
||||
.RS 4
|
||||
.B ARES_RCODE_NOERROR
|
||||
- Success
|
||||
.br
|
||||
.B ARES_RCODE_FORMERR
|
||||
- Format error. The name server was unable to interpret the query
|
||||
.br
|
||||
.B ARES_RCODE_SERVFAIL
|
||||
- Server Failure. The name server was unable to process this query due to a
|
||||
problem with the nameserver
|
||||
.br
|
||||
.B ARES_RCODE_NXDOMAIN
|
||||
- Name Error. Meaningful only for responses from an authoritative name server,
|
||||
this code signifies that the domain name referenced in the query does not exist.
|
||||
.br
|
||||
.B ARES_RCODE_NOTIMP
|
||||
- Not implemented. The name server does not support the requested kind of query
|
||||
.br
|
||||
.B ARES_RCODE_REFUSED
|
||||
- Refused. The name server refuses to perform the specified operation for policy
|
||||
reasons.
|
||||
.br
|
||||
.B ARES_RCODE_YXDOMAIN
|
||||
- RFC 2136. Some name that ought not to exist, does exist
|
||||
.br
|
||||
.B ARES_RCODE_YXRRSET
|
||||
- RFC 2136. Some RRset that ought to not exist, does exist
|
||||
.br
|
||||
.B ARES_RCODE_NXRRSET
|
||||
- RFC 2136. Some RRset that ought to exist, does not exist
|
||||
.br
|
||||
.B ARES_RCODE_NOTAUTH
|
||||
- RFC 2136. The server is not authoritative for the zone named in the Zone section.
|
||||
.br
|
||||
.B ARES_RCODE_NOTZONE
|
||||
- RFC 2136. A name used in the Prerequisite or Update Section is not within the
|
||||
zone denoted by the Zone Section.
|
||||
.br
|
||||
.B ARES_RCODE_DSOTYPEI
|
||||
- RFC 8409. DSO-TYPE Not implemented
|
||||
.br
|
||||
.B ARES_RCODE_BADSIG
|
||||
- RFC 8945. TSIG Signature Failure
|
||||
.br
|
||||
.B ARES_RCODE_BADKEY
|
||||
- RFC 8945. Key not recognized
|
||||
.br
|
||||
.B ARES_RCODE_BADTIME
|
||||
- RFC 8945. Signature out of time window
|
||||
.br
|
||||
.B ARES_RCODE_BADMODE
|
||||
- RFC 2930. Bad TKEY Mode
|
||||
.br
|
||||
.B ARES_RCODE_BADNAME
|
||||
- RFC 2930. Duplicate Key Name
|
||||
.br
|
||||
.B ARES_RCODE_BADALG
|
||||
- RFC 2930. Algorithm not supported
|
||||
.br
|
||||
.B ARES_RCODE_BADTRUNC
|
||||
- RFC 8945. Bad Truncation
|
||||
.br
|
||||
.B ARES_RCODE_BADCOOKIE
|
||||
- RFC 7973. Bad/missing Server Cookie
|
||||
.br
|
||||
.RE
|
||||
|
||||
|
||||
.SH DESCRIPTION
|
||||
|
||||
The \fIares_dns_record_destroy(3)\fP function destroys the memory associated
|
||||
with the dns record created by either \fIares_dns_record_create(3)\fP or
|
||||
\fIares_dns_parse(3)\fP passed in via
|
||||
.IR dnsrec .
|
||||
|
||||
The \fIares_dns_parse(3)\fP function parses the buffer provided in
|
||||
.IR buf
|
||||
with length provided in
|
||||
.IR buf_len.
|
||||
The
|
||||
.IR flags
|
||||
parameter can be one or more \fIares_dns_parse_flags_t\fP, or zero if no
|
||||
flags are needed. The resulting dns record data structure is stored into the
|
||||
variable pointed to by
|
||||
.IR dnsrec
|
||||
and must be destroyed using \fIares_dns_record_destroy(3)\fP.
|
||||
|
||||
The \fIares_dns_write(3)\fP function takes a populated DNS record structure in
|
||||
.IR dnsrec
|
||||
and writes a wire-format DNS message into the variable pointed to by
|
||||
.IR buf
|
||||
and writes the length of the buffer into the variable pointed to by
|
||||
.IR buf_len.
|
||||
The buffer must be destroyed using \fIares_free_string(3)\fP.
|
||||
|
||||
The \fIares_dns_record_create(3)\fP function creates an empty DNS record structure
|
||||
in the variable pointed to by
|
||||
.IR dnsrec.
|
||||
The
|
||||
.IR id
|
||||
parameter is the DNS message id, however if passing to \fIares_send(3)\fP this
|
||||
identifier will be overwritten, so should typically be 0. The
|
||||
.IR flags
|
||||
parameter is one or more \fIares_dns_flags_t\fP. The opcode is passed in the
|
||||
.IR opcode
|
||||
parameter and should typically be \fIARES_OPCODE_QUERY\fP. The response code
|
||||
is meant mostly for responses and is passed in the
|
||||
.IR rcode
|
||||
parameter and is typically \fPARES_RCODE_NOERROR\fP.
|
||||
|
||||
|
||||
The \fIares_dns_record_get_id(3)\fP function is used to retrieve the DNS
|
||||
message id from the DNS record provided in the
|
||||
.IR dnsrec
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_record_get_flags(3)\fP function is used to retrieve the DNS
|
||||
message flags from the DNS record provided in the
|
||||
.IR dnsrec
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_record_get_opcode(3)\fP function is used to retrieve the DNS
|
||||
message flags from the DNS record provided in the
|
||||
.IR dnsrec
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_record_get_rcode(3)\fP function is used to retrieve the DNS
|
||||
message response code from the DNS record provided in the
|
||||
.IR dnsrec
|
||||
parameter.
|
||||
|
||||
|
||||
The \fIares_dns_record_query_add(3)\fP function is used to add a question to
|
||||
the DNS record provided in the
|
||||
.IR dnsrec
|
||||
parameter. The domain name specified for the question is provided in the
|
||||
.IR name
|
||||
parameter, along with the question type in the
|
||||
.IR qtype
|
||||
parameter and the question class (typically \fIARES_CLASS_IN\fP) in the
|
||||
.IR qclass
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_record_query_cnt(3)\fP function is used to retrieve the number
|
||||
of DNS questions in the DNS record provided in the
|
||||
.IR dnsrec
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_record_query_get(3)\fP function is used to retrieve the details
|
||||
of a single DNS question in the provided
|
||||
.IR dnsrec
|
||||
parameter. The index provided in the
|
||||
.IR idx
|
||||
parameter must be less than the value returned from \fIares_dns_record_query_cnt(3)\fP.
|
||||
The DNS question name will be returned in the variable pointed to by the
|
||||
.IR name
|
||||
parameter, this may be provided as NULL if the name is not needed.
|
||||
The DNS question type will be returned in the variable pointed to by the
|
||||
.IR qtype
|
||||
parameter, this may be provided as NULL if the type is not needed.
|
||||
The DNS question class will be returned in the variable pointed to by the
|
||||
.IR qclass
|
||||
parameter, this may be provided as NULL if the class is not needed.
|
||||
|
||||
|
||||
.SH RETURN VALUES
|
||||
|
||||
\fIares_dns_parse(3)\fP, \fIares_dns_write(3)\fP, \fIares_dns_record_create(3)\fP,
|
||||
\fIares_dns_record_query_add(3)\fP, and \fIares_dns_record_query_get(3)\fP all
|
||||
return an \fIares_status_t\fP error code.
|
||||
.B ARES_SUCCESS
|
||||
is returned on success,
|
||||
.B ARES_ENOMEM
|
||||
is returned on out of memory,
|
||||
.B ARES_EFORMERR
|
||||
is returned on misuse.
|
||||
|
||||
\fIares_dns_record_get_id(3)\fP, \fIares_dns_record_get_flags(3)\fP,
|
||||
\fIares_dns_record_get_opcode(3)\fP, \fIares_dns_record_get_rcode(3)\fP, and
|
||||
\fIares_dns_record_query_cnt(3)\fP all returned their prescribed datatype
|
||||
values and in general can't fail except for misuse cases, in which a 0 may
|
||||
be returned, however 0 can also be a valid return value for most of these
|
||||
functions.
|
||||
|
||||
|
||||
.SH AVAILABILITY
|
||||
These functions were first introduced in c-ares version 1.22.0.
|
||||
.SH SEE ALSO
|
||||
.BR ares_dns_mapping (3),
|
||||
.BR ares_dns_rr (3),
|
||||
.BR ares_free_string (3)
|
||||
.SH AUTHOR
|
||||
Copyright (C) 2023 The c-ares project and its members.
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_record.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
Vendored
+631
@@ -0,0 +1,631 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.\"
|
||||
.TH ARES_DNS_RR 3 "12 November 2023"
|
||||
.SH NAME
|
||||
ares_dns_record_rr_add, ares_dns_record_rr_cnt, ares_dns_record_rr_del,
|
||||
ares_dns_record_rr_get, ares_dns_rr_get_addr, ares_dns_rr_get_addr6,
|
||||
ares_dns_rr_get_bin, ares_dns_rr_get_class, ares_dns_rr_get_name,
|
||||
ares_dns_rr_get_opt, ares_dns_rr_get_opt_byid, ares_dns_rr_get_opt_cnt,
|
||||
ares_dns_rr_get_str, ares_dns_rr_get_ttl, ares_dns_rr_get_type,
|
||||
ares_dns_rr_get_u16, ares_dns_rr_get_u32, ares_dns_rr_get_u8, ares_dns_rr_key_t,
|
||||
ares_dns_rr_set_addr, ares_dns_rr_set_addr6, ares_dns_rr_set_bin,
|
||||
ares_dns_rr_set_opt, ares_dns_rr_set_str, ares_dns_rr_set_u16,
|
||||
ares_dns_rr_set_u32, ares_dns_rr_set_u8, ares_dns_section_t, ares_tlsa_match_t,
|
||||
ares_tlsa_selector_t, ares_tlsa_usage_t \-
|
||||
DNS Resource Record creating, reading, and writing functions.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <ares.h>
|
||||
|
||||
size_t ares_dns_record_rr_cnt(const ares_dns_record_t *dnsrec,
|
||||
ares_dns_section_t sect);
|
||||
|
||||
ares_status_t ares_dns_record_rr_add(ares_dns_rr_t **rr_out,
|
||||
ares_dns_record_t *dnsrec,
|
||||
ares_dns_section_t sect,
|
||||
const char *name,
|
||||
ares_dns_rec_type_t type,
|
||||
ares_dns_class_t rclass,
|
||||
unsigned int ttl);
|
||||
|
||||
ares_dns_rr_t *ares_dns_record_rr_get(ares_dns_record_t *dnsrec,
|
||||
ares_dns_section_t sect,
|
||||
size_t idx);
|
||||
|
||||
ares_status_t ares_dns_record_rr_del(ares_dns_record_t *dnsrec,
|
||||
ares_dns_section_t sect,
|
||||
size_t idx);
|
||||
|
||||
const char *ares_dns_rr_get_name(const ares_dns_rr_t *rr);
|
||||
|
||||
ares_dns_rec_type_t ares_dns_rr_get_type(const ares_dns_rr_t *rr);
|
||||
|
||||
ares_dns_class_t ares_dns_rr_get_class(const ares_dns_rr_t *rr);
|
||||
|
||||
unsigned int ares_dns_rr_get_ttl(const ares_dns_rr_t *rr);
|
||||
|
||||
ares_status_t ares_dns_rr_set_addr(ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key,
|
||||
const struct in_addr *addr);
|
||||
|
||||
ares_status_t ares_dns_rr_set_addr6(ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key,
|
||||
const struct ares_in6_addr *addr);
|
||||
|
||||
ares_status_t ares_dns_rr_set_str(ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key,
|
||||
const char *val);
|
||||
|
||||
ares_status_t ares_dns_rr_set_u8(ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key,
|
||||
unsigned char val);
|
||||
|
||||
ares_status_t ares_dns_rr_set_u16(ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key,
|
||||
unsigned short val);
|
||||
|
||||
ares_status_t ares_dns_rr_set_u32(ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key,
|
||||
unsigned int val);
|
||||
|
||||
ares_status_t ares_dns_rr_set_bin(ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key,
|
||||
const unsigned char *val,
|
||||
size_t len);
|
||||
|
||||
ares_status_t ares_dns_rr_set_opt(ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key,
|
||||
unsigned short opt,
|
||||
const unsigned char *val,
|
||||
size_t val_len);
|
||||
|
||||
const struct in_addr *ares_dns_rr_get_addr(const ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key);
|
||||
|
||||
const struct ares_in6_addr *ares_dns_rr_get_addr6(const ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key);
|
||||
|
||||
const char *ares_dns_rr_get_str(const ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key);
|
||||
|
||||
unsigned char ares_dns_rr_get_u8(const ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key);
|
||||
|
||||
unsigned short ares_dns_rr_get_u16(const ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key);
|
||||
|
||||
unsigned int ares_dns_rr_get_u32(const ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key);
|
||||
|
||||
const unsigned char *ares_dns_rr_get_bin(const ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key,
|
||||
size_t *len);
|
||||
|
||||
size_t ares_dns_rr_get_opt_cnt(const ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key);
|
||||
|
||||
unsigned short ares_dns_rr_get_opt(const ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key,
|
||||
size_t idx,
|
||||
const unsigned char **val,
|
||||
size_t *val_len);
|
||||
|
||||
ares_bool_t ares_dns_rr_get_opt_byid(const ares_dns_rr_t *dns_rr,
|
||||
ares_dns_rr_key_t key,
|
||||
unsigned short opt,
|
||||
const unsigned char **val,
|
||||
size_t *val_len);
|
||||
|
||||
.fi
|
||||
.SH ENUMERATIONS
|
||||
|
||||
.B ares_dns_section_t -
|
||||
DNS RR section types:
|
||||
.RS 4
|
||||
.B ARES_SECTION_ANSWER
|
||||
- Answer section
|
||||
.br
|
||||
.B ARES_SECTION_AUTHORITY
|
||||
- Authority section
|
||||
.br
|
||||
.B ARES_SECTION_ADDITIONAL
|
||||
- Additional Information section
|
||||
.br
|
||||
.RE
|
||||
|
||||
.B ares_dns_rr_key_t -
|
||||
Keys used for handling RR record parameters:
|
||||
.RS 4
|
||||
.B ARES_RR_A_ADDR
|
||||
- A Record. Address. Datatype: \fIARES_DATATYPE_INADDR\fP
|
||||
.br
|
||||
.B ARES_RR_NS_NSDNAME
|
||||
- NS Record. Name. Datatype: \fIARES_DATATYPE_NAME\fP
|
||||
.br
|
||||
.B ARES_RR_CNAME_CNAME
|
||||
- CNAME Record. CName. Datatype: \fIARES_DATATYPE_NAME\fP
|
||||
.br
|
||||
.B ARES_RR_SOA_MNAME
|
||||
- SOA Record. MNAME, Primary Source of Data. Datatype: \fIARES_DATATYPE_NAME\fP
|
||||
.br
|
||||
.B ARES_RR_SOA_RNAME
|
||||
- SOA Record. RNAME, Mailbox of person responsible. Datatype: \fIARES_DATATYPE_NAME\fP
|
||||
.br
|
||||
.B ARES_RR_SOA_SERIAL
|
||||
- SOA Record. Serial, version. Datatype: \fIARES_DATATYPE_U32\fP
|
||||
.br
|
||||
.B ARES_RR_SOA_REFRESH
|
||||
- SOA Record. Refresh, zone refersh interval. Datatype: \fIARES_DATATYPE_U32\fP
|
||||
.br
|
||||
.B ARES_RR_SOA_RETRY
|
||||
- SOA Record. Retry, failed refresh retry interval. Datatype: \fIARES_DATATYPE_U32\fP
|
||||
.br
|
||||
.B ARES_RR_SOA_EXPIRE
|
||||
- SOA Record. Expire, upper limit on authority. Datatype: \fIARES_DATATYPE_U32\fP
|
||||
.br
|
||||
.B ARES_RR_SOA_MINIMUM
|
||||
- SOA Record. Minimum, RR TTL. Datatype: \fIARES_DATATYPE_U32\fP
|
||||
.br
|
||||
.B ARES_RR_PTR_DNAME
|
||||
- PTR Record. DNAME, pointer domain. Datatype: \fIARES_DATATYPE_NAME\fP
|
||||
.br
|
||||
.B ARES_RR_HINFO_CPU
|
||||
- HINFO Record. CPU. Datatype: \fIARES_DATATYPE_STR\fP
|
||||
.br
|
||||
.B ARES_RR_HINFO_OS
|
||||
- HINFO Record. OS. Datatype: \fIARES_DATATYPE_STR\fP
|
||||
.br
|
||||
.B ARES_RR_MX_PREFERENCE
|
||||
- MX Record. Preference. Datatype: \fIARES_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_RR_MX_EXCHANGE
|
||||
- MX Record. Exchange, domain. Datatype: \fIARES_DATATYPE_NAME\fP
|
||||
.br
|
||||
.B ARES_RR_TXT_DATA
|
||||
- TXT Record. Data. Datatype: \fIARES_DATATYPE_BINP\fP
|
||||
.br
|
||||
.B ARES_RR_AAAA_ADDR
|
||||
- AAAA Record. Address. Datatype: \fIARES_DATATYPE_INADDR6\fP
|
||||
.br
|
||||
.B ARES_RR_SRV_PRIORITY
|
||||
- SRV Record. Priority. Datatype: \fIARES_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_RR_SRV_WEIGHT
|
||||
- SRV Record. Weight. Datatype: \fIARES_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_RR_SRV_PORT
|
||||
- SRV Record. Port. Datatype: \fIARES_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_RR_SRV_TARGET
|
||||
- SRV Record. Target domain. Datatype: \fIARES_DATATYPE_NAME\fP
|
||||
.br
|
||||
.B ARES_RR_NAPTR_ORDER
|
||||
- NAPTR Record. Order. Datatype: \fIARES_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_RR_NAPTR_PREFERENCE
|
||||
- NAPTR Record. Preference. Datatype: \fIARES_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_RR_NAPTR_FLAGS
|
||||
- NAPTR Record. Flags. Datatype: \fIARES_DATATYPE_STR\fP
|
||||
.br
|
||||
.B ARES_RR_NAPTR_SERVICES
|
||||
- NAPTR Record. Services. Datatype: \fIARES_DATATYPE_STR\fP
|
||||
.br
|
||||
.B ARES_RR_NAPTR_REGEXP
|
||||
- NAPTR Record. Regexp. Datatype: \fIARES_DATATYPE_STR\fP
|
||||
.br
|
||||
.B ARES_RR_NAPTR_REPLACEMENT
|
||||
- NAPTR Record. Replacement. Datatype: \fIARES_DATATYPE_NAME\fP
|
||||
.br
|
||||
.B ARES_RR_OPT_UDP_SIZE
|
||||
- OPT Record. UDP Size. Datatype: \fIARES_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_RR_OPT_VERSION
|
||||
- OPT Record. Version. Datatype: \fIARES_DATATYPE_U8\fP
|
||||
.br
|
||||
.B ARES_RR_OPT_FLAGS
|
||||
- OPT Record. Flags. Datatype: \fIARES_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_RR_OPT_OPTIONS
|
||||
- OPT Record. Options. See \fIares_opt_param_t\fP. Datatype: \fIARES_DATATYPE_OPT\fP
|
||||
.br
|
||||
.B ARES_RR_TLSA_CERT_USAGE
|
||||
- TLSA Record. Certificate Usage. See \fIares_tlsa_usage_t\fP. Datatype: \fIARES_DATATYPE_U8\fP
|
||||
.br
|
||||
.B ARES_RR_TLSA_SELECTOR
|
||||
- TLSA Record. Selector. See \fIares_tlsa_selector_t\fP. Datatype: \fIARES_DATATYPE_U8\fP
|
||||
.br
|
||||
.B ARES_RR_TLSA_MATCH
|
||||
- TLSA Record. Matching Type. See \fIares_tlsa_match_t\fP. Datatype: \fIARES_DATATYPE_U8\fP
|
||||
.br
|
||||
.B ARES_RR_TLSA_DATA
|
||||
- TLSA Record. Certificate Association Data. Datatype: \fIARES_DATATYPE_BIN\fP
|
||||
.br
|
||||
.B ARES_RR_SVCB_PRIORITY
|
||||
- SVCB Record. SvcPriority. Datatype: \fIARES_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_RR_SVCB_TARGET
|
||||
- SVCB Record. TargetName. Datatype: \fIARES_DATATYPE_NAME\fP
|
||||
.br
|
||||
.B ARES_RR_SVCB_PARAMS
|
||||
- SVCB Record. SvcParams. See \fIares_svcb_param_t\fP. Datatype: \fIARES_DATATYPE_OPT\fP
|
||||
.br
|
||||
.B ARES_RR_HTTPS_PRIORITY
|
||||
- HTTPS Record. SvcPriority. Datatype: \fIARES_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_RR_HTTPS_TARGET
|
||||
- HTTPS Record. TargetName. Datatype: \fIARES_DATATYPE_NAME\fP
|
||||
.br
|
||||
.B ARES_RR_HTTPS_PARAMS
|
||||
- HTTPS Record. SvcParams. See \fIares_svcb_param_t\fP. Datatype: \fIARES_DATATYPE_OPT\fP
|
||||
.br
|
||||
.B ARES_RR_URI_PRIORITY
|
||||
- URI Record. Priority. Datatype: \fIARES_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_RR_URI_WEIGHT
|
||||
- URI Record. Weight. Datatype: \fIARES_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_RR_URI_TARGET
|
||||
- URI Record. Target domain. Datatype: \fIARES_DATATYPE_NAME\fP
|
||||
.br
|
||||
.B ARES_RR_CAA_CRITICAL
|
||||
- CAA Record. Critical flag. Datatype: \fIARES_DATATYPE_U8\fP
|
||||
.br
|
||||
.B ARES_RR_CAA_TAG
|
||||
- CAA Record. Tag/Property. Datatype: \fIARES_DATATYPE_STR\fP
|
||||
.br
|
||||
.B ARES_RR_CAA_VALUE
|
||||
- CAA Record. Value. Datatype: \fIARES_DATATYPE_BINP\fP
|
||||
.br
|
||||
.B ARES_RR_RAW_RR_TYPE
|
||||
- RAW Record. RR Type. Datatype: \fIARES_DATATYPE_U16\fP
|
||||
.br
|
||||
.B ARES_RR_RAW_RR_DATA
|
||||
- RAW Record. RR Data. Datatype: \fIARES_DATATYPE_BIN\fP
|
||||
.br
|
||||
.RE
|
||||
|
||||
.B ares_tlsa_usage_t -
|
||||
TLSA Record \fIARES_RR_TLSA_CERT_USAGE\fP known values
|
||||
.RS 4
|
||||
.B ARES_TLSA_USAGE_CA
|
||||
- Certificate Usage 0. CA Constraint
|
||||
.br
|
||||
.B ARES_TLSA_USAGE_SERVICE
|
||||
- Certificate Usage 1. Service Certificate Constraint
|
||||
.br
|
||||
.B ARES_TLSA_USAGE_TRUSTANCHOR
|
||||
- Certificate Usage 2. Trust Anchor Assertion
|
||||
.br
|
||||
.B ARES_TLSA_USAGE_DOMAIN
|
||||
- Certificate Usage 3. Domain-issued certificate
|
||||
.br
|
||||
.RE
|
||||
|
||||
.B ares_tlsa_selector_t -
|
||||
TLSA Record \fIARES_RR_TLSA_SELECTOR\fP known values:
|
||||
.RS 4
|
||||
.B ARES_TLSA_SELECTOR_FULL
|
||||
- Full Certificate
|
||||
.br
|
||||
.B ARES_TLSA_SELECTOR_SUBJPUBKEYINFO
|
||||
- DER-encoded SubjectPublicKeyInfo
|
||||
.br
|
||||
.RE
|
||||
|
||||
.B ares_tlsa_match_t -
|
||||
TLSA Record \fIARES_RR_TLSA_MATCH\fP known values:
|
||||
.RS 4
|
||||
.B ARES_TLSA_MATCH_EXACT
|
||||
- Exact match
|
||||
.br
|
||||
.B ARES_TLSA_MATCH_SHA256
|
||||
- Sha256 match
|
||||
.br
|
||||
.B ARES_TLSA_MATCH_SHA512
|
||||
- Sha512 match
|
||||
.br
|
||||
.RE
|
||||
|
||||
|
||||
.SH DESCRIPTION
|
||||
|
||||
The \fIares_dns_record_rr_cnt(3)\fP function returns the number of resource
|
||||
records in the DNS record provided by the
|
||||
.IR dnsrec
|
||||
parameter for the section provided in the
|
||||
.IR sect
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_record_rr_add(3)\fP function adds a new resource record entry
|
||||
the the DNS record provided by the
|
||||
.IR dnsrec
|
||||
parameter. The resulting resource record is stored into the variable pointed to by
|
||||
.IR rr_out.
|
||||
The DNS section the resource record belongs to is specified by the
|
||||
.IR sect
|
||||
parameter. The domain name associated with the resource record is specified by the
|
||||
.IR name
|
||||
parameter, which can not be NULL but may be an empty string, or ".". The resource
|
||||
record type is specified in the
|
||||
.IR type
|
||||
parameter, along with the DNS record class in the
|
||||
.IR rclass
|
||||
parameter, and the Time To Live (TTL) in the
|
||||
.IR ttl
|
||||
parameter.
|
||||
|
||||
|
||||
The \fIares_dns_record_rr_get(3)\fP function is used to retrieve the resource
|
||||
record pointer from the DNS record provided in the
|
||||
.IR dnsrec
|
||||
parameter, for the resource record section provided in the
|
||||
.IR sect
|
||||
parameter, for the specified index in the
|
||||
.IR idx
|
||||
parameter. The index must be less than \fIares_dns_record_rr_cnt(3)\fP.
|
||||
|
||||
|
||||
The \fIares_dns_record_rr_del(3)\fP is used to delete a resource record from
|
||||
the DNS record specified in the
|
||||
.IR dnsrec
|
||||
parameter. Its primary use is to remove a \fIARES_REC_TYPE_OPT\fP record when
|
||||
needing to retry a query without EDNS support. The DNS RR section is specified
|
||||
via the
|
||||
.IR sect
|
||||
parameter, and the index to remove is specified in the
|
||||
.IR idx
|
||||
parameter. The index must be less than \fIares_dns_record_rr_cnt(3)\fP.
|
||||
|
||||
|
||||
The \fIares_dns_rr_get_name(3)\fP function is used to retrieve the resource
|
||||
record domain name from the Resource Record pointer provided in the
|
||||
.IR rr
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_get_type(3)\fP function is used to retrieve the resource
|
||||
record type from the Resource Record pointer provided in the
|
||||
.IR rr
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_get_class(3)\fP function is used to retrieve the resource
|
||||
record class from the Resource Record pointer provided in the
|
||||
.IR rr
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_get_ttl(3)\fP function is used to retrieve the resource
|
||||
record class Time to Live (TTL) from the Resource Record pointer provided in the
|
||||
.IR rr
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_set_addr(3)\fP function is used to set an IPv4 address for the
|
||||
associated resource record key/parameter when the datatype is \fIARES_DATATYPE_INADDR\fP.
|
||||
The resource record to be modified is provided in the
|
||||
.IR dns_rr
|
||||
parameter, the key/parameter is provided in the
|
||||
.IR key
|
||||
parameter, and the value is provided in the
|
||||
.IR addr
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_set_addr6(3)\fP function is used to set an IPv6 address for the
|
||||
associated resource record key/parameter when the datatype is \fIARES_DATATYPE_INADDR6\fP.
|
||||
The resource record to be modified is provided in the
|
||||
.IR dns_rr
|
||||
parameter, the key/parameter is provided in the
|
||||
.IR key
|
||||
parameter, and the value is provided in the
|
||||
.IR addr
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_set_str(3)\fP function is used to set a string for the
|
||||
associated resource record key/parameter when the datatype is \fIARES_DATATYPE_STR\fP
|
||||
or \fIARES_DATATYPE_NAME\fP. Most strings are limited to 255 bytes,
|
||||
however some records, such as a TXT record may allow longer as they are output
|
||||
as multiple strings. The resource record to be modified is
|
||||
provided in the
|
||||
.IR dns_rr
|
||||
parameter, the key/parameter is provided in the
|
||||
.IR key
|
||||
parameter, and the value is provided in the
|
||||
.IR val
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_set_u8(3)\fP function is used to set an 8bit unsigned value for the
|
||||
associated resource record key/parameter when the datatype is \fIARES_DATATYPE_U8\fP.
|
||||
The resource record to be modified is provided in the
|
||||
.IR dns_rr
|
||||
parameter, the key/parameter is provided in the
|
||||
.IR key
|
||||
parameter, and the value is provided in the
|
||||
.IR val
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_set_u16(3)\fP function is used to set an 16bit unsigned value for the
|
||||
associated resource record key/parameter when the datatype is \fIARES_DATATYPE_U16\fP.
|
||||
The resource record to be modified is provided in the
|
||||
.IR dns_rr
|
||||
parameter, the key/parameter is provided in the
|
||||
.IR key
|
||||
parameter, and the value is provided in the
|
||||
.IR val
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_set_u32(3)\fP function is used to set an 32bit unsigned value for the
|
||||
associated resource record key/parameter when the datatype is \fIARES_DATATYPE_U32\fP.
|
||||
The resource record to be modified is provided in the
|
||||
.IR dns_rr
|
||||
parameter, the key/parameter is provided in the
|
||||
.IR key
|
||||
parameter, and the value is provided in the
|
||||
.IR val
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_set_bin(3)\fP function is used to set an binary value for the
|
||||
associated resource record key/parameter when the datatype is \fIARES_DATATYPE_BIN\fP
|
||||
or \fIARES_DATATYPE_BINP\fP.
|
||||
The resource record to be modified is provided in the
|
||||
.IR dns_rr
|
||||
parameter, the key/parameter is provided in the
|
||||
.IR key
|
||||
parameter, and the value is provided in the
|
||||
.IR val
|
||||
parameter. And the associated value length is provided in the
|
||||
.IR len
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_set_opt(3)\fP function is used to set option/parameter keys and
|
||||
values for the resource record when the datatype if \fIARES_DATATYPE_OPT\fP. The
|
||||
resource record to be modified is provided in the
|
||||
.IR dns_rr
|
||||
parameter. They key/parameter is provided in the
|
||||
.IR key
|
||||
parameter. The option/parameter value specific to the resource record is provided
|
||||
in the
|
||||
.IR opt
|
||||
parameter, and this is left to the user to determine the appropriate value to
|
||||
use. Some known values may be provided by \fIares_svcb_param_t\fP and \fIares_opt_param_t\fP
|
||||
enumerations. The value for the option is always provided in binary form in
|
||||
.IR val
|
||||
with length provided in
|
||||
.IR val_len.
|
||||
|
||||
The \fIares_dns_rr_get_addr(3)\fP function is used to retrieve the IPv4 address
|
||||
from the resource record when the datatype is \fIARES_DATATYPE_INADDR\fP. The
|
||||
resource record is provided in the
|
||||
.IR dns_rr
|
||||
parameter and the key/parameter to retrieve is provided in the
|
||||
.IR key
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_get_addr6(3)\fP function is used to retrieve the IPv6 address
|
||||
from the resource record when the datatype is \fIARES_DATATYPE_INADDR6\fP. The
|
||||
resource record is provided in the
|
||||
.IR dns_rr
|
||||
parameter and the key/parameter to retrieve is provided in the
|
||||
.IR key
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_get_str(3)\fP function is used to retrieve a string
|
||||
from the resource record when the datatype is \fIARES_DATATYPE_STR\fP or
|
||||
\fIARES_DATATYPE_NAME\fP. The resource record is provided in the
|
||||
.IR dns_rr
|
||||
parameter and the key/parameter to retrieve is provided in the
|
||||
.IR key
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_get_u8(3)\fP function is used to retrieve an 8bit integer
|
||||
from the resource record when the datatype is \fIARES_DATATYPE_U8\fP.
|
||||
The resource record is provided in the
|
||||
.IR dns_rr
|
||||
parameter and the key/parameter to retrieve is provided in the
|
||||
.IR key
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_get_u16(3)\fP function is used to retrieve a 16bit integer
|
||||
from the resource record when the datatype is \fIARES_DATATYPE_U16\fP.
|
||||
The resource record is provided in the
|
||||
.IR dns_rr
|
||||
parameter and the key/parameter to retrieve is provided in the
|
||||
.IR key
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_get_u32(3)\fP function is used to retrieve a 32bit integer
|
||||
from the resource record when the datatype is \fIARES_DATATYPE_U32\fP.
|
||||
The resource record is provided in the
|
||||
.IR dns_rr
|
||||
parameter and the key/parameter to retrieve is provided in the
|
||||
.IR key
|
||||
parameter.
|
||||
|
||||
The \fIares_dns_rr_get_bin(3)\fP function is used to retrieve binary data
|
||||
from the resource record when the datatype is \fIARES_DATATYPE_BIN\fP or
|
||||
\fIARES_DATATYPE_BINP\fP.
|
||||
The resource record is provided in the
|
||||
.IR dns_rr
|
||||
parameter and the key/parameter to retrieve is provided in the
|
||||
.IR key
|
||||
parameter, and length is stored into the variable pointed to by
|
||||
.IR len.
|
||||
|
||||
The \fIares_dns_rr_get_opt_cnt(3)\fP function is used to retrieve the count
|
||||
of options/parameters associated with the resource record when the datatype
|
||||
is \fIARES_DATATYPE_OPT\fP.
|
||||
The resource record is provided in the
|
||||
.IR dns_rr
|
||||
parameter and the key/parameter to retrieve is provided in the
|
||||
.IR key.
|
||||
|
||||
The \fIares_dns_rr_get_opt(3)\fP function is used to retrieve binary option data
|
||||
from the resource record when the datatype is \fIARES_DATATYPE_OPT\fP for the
|
||||
specified index.
|
||||
The resource record is provided in the
|
||||
.IR dns_rr
|
||||
parameter and the key/parameter to retrieve is provided in the
|
||||
.IR key
|
||||
parameter, the index to retrieve the option data from is provided in the
|
||||
.IR idx
|
||||
parameter. The value is stored into the variable pointed to by
|
||||
.IR val
|
||||
and length is stored into the variable pointed to by
|
||||
.IR val_len.
|
||||
|
||||
The \fIares_dns_rr_get_opt_byid(3)\fP function is used to retrieve binary option data
|
||||
from the resource record when the datatype is \fIARES_DATATYPE_OPT\fP for the
|
||||
specified option identifier, if it exists.
|
||||
The resource record is provided in the
|
||||
.IR dns_rr
|
||||
parameter and the key/parameter to retrieve is provided in the
|
||||
.IR key
|
||||
parameter, the identifier to retrieve the option data from is provided in the
|
||||
.IR opt
|
||||
parameter. The value is stored into the variable pointed to by
|
||||
.IR val
|
||||
and length is stored into the variable pointed to by
|
||||
.IR val_len.
|
||||
|
||||
|
||||
.SH RETURN VALUES
|
||||
|
||||
\fIares_dns_record_rr_cnt(3)\fP and \fIares_dns_rr_get_opt_cnt(3)\fP return the
|
||||
respective counts.
|
||||
|
||||
\fIares_dns_record_rr_add(3)\fP, \fIares_dns_record_rr_del(3)\fP,
|
||||
\fIares_dns_rr_set_addr(3)\fP, \fIares_dns_rr_set_addr6(3)\fP,
|
||||
\fIares_dns_rr_set_str(3)\fP, \fIares_dns_rr_set_u8(3)\fP,
|
||||
\fIares_dns_rr_set_u16(3)\fP, \fIares_dns_rr_set_u32(3)\fP,
|
||||
\fIares_dns_rr_set_bin(3)\fP, and \fIares_dns_rr_set_opt(3)\fP all
|
||||
return an \fIares_status_t\fP error code.
|
||||
.B ARES_SUCCESS
|
||||
is returned on success,
|
||||
.B ARES_ENOMEM
|
||||
is returned on out of memory,
|
||||
.B ARES_EFORMERR
|
||||
is returned on misuse.
|
||||
|
||||
|
||||
\fIares_dns_rr_get_name(3)\fP, \fIares_dns_rr_get_type(3)\fP,
|
||||
\fIares_dns_rr_get_class(3)\fP, \fIares_dns_rr_get_ttl(3)\fP,
|
||||
\fIares_dns_rr_get_addr(3)\fP, \fIares_dns_rr_get_addr6(3)\fP,
|
||||
\fIares_dns_rr_get_str(3)\fP, \fIares_dns_rr_get_u8(3)\fP,
|
||||
\fIares_dns_rr_get_u16(3)\fP, \fIares_dns_rr_get_u32(3)\fP,
|
||||
\fIares_dns_rr_get_bin(3)\fP, \fIares_dns_rr_get_opt(3)\fP all return their
|
||||
prescribed datatype values and in general can't fail except for misuse cases,
|
||||
in which a 0 (or NULL) may be returned, however 0 can also be a valid return
|
||||
value for most of these functions.
|
||||
|
||||
\fIares_dns_record_rr_get(3)\fP will return the requested resource record
|
||||
pointer or NULL on failure (misuse).
|
||||
|
||||
\fIares_dns_rr_get_opt_byid(3)\fP will return ARES_TRUE if the option was
|
||||
found, otherwise ARES_FALSE if not found (or misuse).
|
||||
|
||||
.SH AVAILABILITY
|
||||
These functions were first introduced in c-ares version 1.22.0.
|
||||
.SH SEE ALSO
|
||||
.BR ares_dns_mapping (3),
|
||||
.BR ares_dns_record (3),
|
||||
.BR ares_free_string (3)
|
||||
.SH AUTHOR
|
||||
Copyright (C) 2023 The c-ares project and its members.
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_mapping.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
.\"
|
||||
.\" Copyright (C) Daniel Stenberg
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_mapping.3
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
@@ -0,0 +1,4 @@
|
||||
.\"
|
||||
.\" Copyright (C) Daniel Stenberg
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_mapping.3
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
.\"
|
||||
.\" Copyright (C) Daniel Stenberg
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_mapping.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
.\" Copyright (C) 2023 The c-ares project and its contributors.
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.so man3/ares_dns_rr.3
|
||||
Loaded 100 of 301 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user