diff --git a/deps/cares/CMakeLists.txt b/deps/cares/CMakeLists.txt index 9862406495f4fa..39963f1e8c3cb4 100644 --- a/deps/cares/CMakeLists.txt +++ b/deps/cares/CMakeLists.txt @@ -12,7 +12,7 @@ INCLUDE (CheckCSourceCompiles) INCLUDE (CheckStructHasMember) INCLUDE (CheckLibraryExists) -PROJECT (c-ares LANGUAGES C VERSION "1.33.1" ) +PROJECT (c-ares LANGUAGES C VERSION "1.34.1" ) # Set this version before release SET (CARES_VERSION "${PROJECT_VERSION}") @@ -30,7 +30,7 @@ INCLUDE (GNUInstallDirs) # include this *AFTER* PROJECT(), otherwise paths are w # For example, a version of 4:0:2 would generate output such as: # libname.so -> libname.so.2 # libname.so.2 -> libname.so.2.2.0 -SET (CARES_LIB_VERSIONINFO "20:1:18") +SET (CARES_LIB_VERSIONINFO "21:1:19") OPTION (CARES_STATIC "Build as a static library" OFF) @@ -406,7 +406,7 @@ ENDIF () 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 (memmem "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_MEMMEM) 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) @@ -443,6 +443,7 @@ CHECK_SYMBOL_EXISTS (IoctlSocket "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_IOCTLSO CHECK_SYMBOL_EXISTS (recv "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_RECV) CHECK_SYMBOL_EXISTS (recvfrom "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_RECVFROM) CHECK_SYMBOL_EXISTS (send "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SEND) +CHECK_SYMBOL_EXISTS (sendto "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SENDTO) CHECK_SYMBOL_EXISTS (setsockopt "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SETSOCKOPT) CHECK_SYMBOL_EXISTS (socket "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SOCKET) CHECK_SYMBOL_EXISTS (strcasecmp "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRCASECMP) @@ -500,7 +501,10 @@ IF (CARES_THREADS) 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}) + # The variable set by FIND_PACKAGE(Threads) has a -l prefix on it, we need + # to strip that first since CARES_DEPENDENT_LIBS doesn't expect that. + STRING (REPLACE "-l" "" CARES_THREAD_LIBRARY "${CMAKE_THREAD_LIBS_INIT}") + LIST (APPEND CARES_DEPENDENT_LIBS ${CARES_THREAD_LIBRARY}) ELSE () MESSAGE (WARNING "Threading support not found, disabling...") SET (CARES_THREADS OFF) @@ -688,7 +692,6 @@ IF (HAVE_ARPA_NAMESER_COMPAT_H) SET (CARES_HAVE_ARPA_NAMESER_COMPAT_H 1) ENDIF() - # Coverage IF (CARES_COVERAGE) # set compiler flags @@ -755,9 +758,6 @@ IF (CARES_BUILD_TESTS OR CARES_BUILD_CONTAINER_TESTS) ADD_SUBDIRECTORY (test) ENDIF () - - - # Export targets IF (CARES_INSTALL) SET (CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") @@ -781,7 +781,6 @@ IF (CARES_INSTALL) INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libcares.pc" COMPONENT Devel DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") ENDIF () - # Legacy chain-building variables (provided for compatibility with old code). # Don't use these, external code should be updated to refer to the aliases directly (e.g., Cares::cares). SET (CARES_FOUND 1 CACHE INTERNAL "CARES LIBRARY FOUND") diff --git a/deps/cares/Makefile.Watcom b/deps/cares/Makefile.Watcom index 96ffedb1eb3301..1e445f287a54cc 100644 --- a/deps/cares/Makefile.Watcom +++ b/deps/cares/Makefile.Watcom @@ -43,7 +43,8 @@ CP = copy CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -aa & -wcd=201 -bt=nt -d+ -dCARES_BUILDING_LIBRARY & - -dNTDDI_VERSION=0x06020000 -I. -I.\include -I.\src\lib $(SYS_INCL) + -dNTDDI_VERSION=0x06020000 -I. -I.\include -I.\src\lib -I.\src\lib\include & + $(SYS_INCL) LFLAGS = option quiet, map, caseexact, eliminate @@ -124,7 +125,7 @@ $(LIBNAME).lib: $(OBJS_STAT) $(LIB_ARG) $(OBJ_BASE)\tools\ares_getopt.obj: $(CC) $(CFLAGS) -DCARES_STATICLIB .\src\tools\ares_getopt.c -fo=$^@ -adig.exe: $(OBJ_BASE)\tools\ares_getopt.obj $(LIBNAME).lib +adig.exe: $(LIBNAME).lib $(CC) $(CFLAGS) src\tools\adig.c -fo=$(OBJ_BASE)\tools\adig.obj $(LD) name $^@ system nt $(LFLAGS) file { $(OBJ_BASE)\tools\adig.obj $[@ } library $]@, ws2_32.lib, iphlpapi.lib diff --git a/deps/cares/Makefile.dj b/deps/cares/Makefile.dj index 69b3ca31851b32..8dca20cb42b4c3 100644 --- a/deps/cares/Makefile.dj +++ b/deps/cares/Makefile.dj @@ -23,7 +23,7 @@ VPATH = src/lib src/tools WATT32_ROOT = $(realpath $(WATT_ROOT)) WATT32_LIB = $(WATT32_ROOT)/lib/libwatt.a -CFLAGS = -g -O2 -I./include -I./src/lib \ +CFLAGS = -g -O2 -I./include -I./src/lib -I./src/lib/include \ -I$(WATT32_ROOT)/inc \ -Wall \ -Wextra \ diff --git a/deps/cares/Makefile.m32 b/deps/cares/Makefile.m32 index 36ae674c635194..7bd85165978208 100644 --- a/deps/cares/Makefile.m32 +++ b/deps/cares/Makefile.m32 @@ -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=0x0602 +CFLAGS = $(CARES_CFLAG_EXTRAS) -O2 -Wall -I./include -I./src/lib -I./src/lib/include -D_WIN32_WINNT=0x0602 CFLAGS += -DCARES_STATICLIB LDFLAGS = $(CARES_LDFLAG_EXTRAS) -s LIBS = -lws2_32 -liphlpapi diff --git a/deps/cares/Makefile.msvc b/deps/cares/Makefile.msvc index 619c2d39274521..8395d1a7d67728 100644 --- a/deps/cares/Makefile.msvc +++ b/deps/cares/Makefile.msvc @@ -192,7 +192,7 @@ EX_LIBS_DBG = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib CC_CMD_REL = cl.exe /nologo $(RTLIB) /DNDEBUG /O2 CC_CMD_DBG = cl.exe /nologo $(RTLIBD) /D_DEBUG /Od /Zi /RTCsu -CC_CFLAGS = $(CFLAGS) /D_REENTRANT /I.\src\lib /I.\include /W3 /EHsc /FD +CC_CFLAGS = $(CFLAGS) /D_REENTRANT /I.\src\lib /I.\include /I.\src\lib\include /W3 /EHsc /FD RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG" RC_CMD_DBG = rc.exe /l 0x409 /d "_DEBUG" @@ -344,15 +344,6 @@ PROG3_OBJS = $(PROG3_OBJS) $(PROG3_OBJDIR)\ahost.obj {$(SRCDIR)\src\tools}.c{$(PROG3_OBJDIR)}.obj: $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(PROG3_OBJDIR)\ /c $< -# Hack Alert! we reference ../lib/str files in the Makefile.inc for tools as they -# share some files with the library itself. We need to hack around that here. - -{$(SRCDIR)\src\lib\str}.c{$(PROG2_OBJDIR)\..\lib\str}.obj: - $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$(PROG2_OBJDIR)\str\$(@F) /Fd$(PROG2_OBJDIR)\str\ /c $< - -{$(SRCDIR)\src\lib\str}.c{$(PROG3_OBJDIR)\..\lib\str}.obj: - $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$(PROG3_OBJDIR)\str\$(@F) /Fd$(PROG3_OBJDIR)\str\ /c $< - # ------------------------------------------------------------- # # ------------------------------------------------------------- # # Default target when no CFG library type has been specified, # diff --git a/deps/cares/README.md b/deps/cares/README.md index c32d0677c83419..6566c9fe6aa18e 100644 --- a/deps/cares/README.md +++ b/deps/cares/README.md @@ -82,7 +82,7 @@ to sign releases): ```bash gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2 # Daniel Stenberg -gpg --keyserver hkps://keys.openpgp.org --recv-keys DA7D64E4C82C6294CB73A20E22E3D13B5411B7CA # Brad House +gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys DA7D64E4C82C6294CB73A20E22E3D13B5411B7CA # Brad House ``` ### Verifying signatures @@ -109,8 +109,11 @@ gpg: binary signature, digest algorithm SHA512, key algorithm rsa2048 ``` ## Features + +See [Features](FEATURES.md) + ### Supported RFCs and Proposals -- [RFC1035](https://datatracker.ietf.org/doc/html/rfc7873). +- [RFC1035](https://datatracker.ietf.org/doc/html/rfc1035). Initial/Base DNS RFC - [RFC2671](https://datatracker.ietf.org/doc/html/rfc2671), [RFC6891](https://datatracker.ietf.org/doc/html/rfc6891). @@ -151,3 +154,5 @@ gpg: binary signature, digest algorithm SHA512, key algorithm rsa2048 IPv6 address sorting as used by `ares_getaddrinfo()`. - [RFC7413](https://datatracker.ietf.org/doc/html/rfc7413). TCP FastOpen (TFO) for 0-RTT TCP Connection Resumption. +- [RFC3986](https://datatracker.ietf.org/doc/html/rfc3986). + Uniform Resource Identifier (URI). Used for server configuration. diff --git a/deps/cares/RELEASE-NOTES.md b/deps/cares/RELEASE-NOTES.md index e9c04953dc6022..fa1db666083365 100644 --- a/deps/cares/RELEASE-NOTES.md +++ b/deps/cares/RELEASE-NOTES.md @@ -1,65 +1,60 @@ -## c-ares version 1.33.1 - August 23 2024 +## c-ares version 1.34.1 - Octover 9 2024 -This is a bugfix release. +This release fixes a packaging issue. -Bugfixes: -* Work around systemd-resolved quirk that returns unexpected codes for single - label names. Also adds test cases to validate the work around works and - will continue to work in future releases. - [PR #863](https://github.com/c-ares/c-ares/pull/863), - See Also https://github.com/systemd/systemd/issues/34101 -* Fix sysconfig ndots default value, also adds containerized test case to - prevent future regressions. - [PR #862](https://github.com/c-ares/c-ares/pull/862) -* Fix blank DNS name returning error code rather than valid record for - commands like: `adig -t SOA .`. Also adds test case to prevent future - regressions. - [9e574af](https://github.com/c-ares/c-ares/commit/9e574af) -* Fix calculation of query times > 1s. - [2b2eae7](https://github.com/c-ares/c-ares/commit/2b2eae7) -* Fix building on old Linux releases that don't have `TCP_FASTOPEN_CONNECT`. - [b7a89b9](https://github.com/c-ares/c-ares/commit/b7a89b9) -* Fix minor Android build warnings. - [PR #848](https://github.com/c-ares/c-ares/pull/848) - -Thanks go to these friendly people for their efforts and contributions for this -release: -* Brad House (@bradh352) -* Erik Lax (@eriklax) -* Hans-Christian Egtvedt (@egtvedt) -* Mikael Lindemann (@mikaellindemann) -* Nodar Chkuaselidze (@nodech) -## c-ares version 1.33.0 - August 2 2024 +## c-ares version 1.34.0 - October 9 2024 This is a feature and bugfix release. Features: -* Add DNS cookie support (RFC7873 + RFC9018) to help prevent off-path cache - poisoning attacks. [PR #833](https://github.com/c-ares/c-ares/pull/833) -* Implement TCP FastOpen (TFO) RFC7413, which will make TCP reconnects 0-RTT - on supported systems. [PR #840](https://github.com/c-ares/c-ares/pull/840) +* adig: read arguments from adigrc. + [PR #856](https://github.com/c-ares/c-ares/pull/856) +* Add new pending write callback optimization via `ares_set_pending_write_cb`. + [PR #857](https://github.com/c-ares/c-ares/pull/857) +* New function `ares_process_fds()`. + [PR #875](https://github.com/c-ares/c-ares/pull/875) +* Failed servers should be probed rather than redirecting queries which could + cause unexpected latency. + [PR #877](https://github.com/c-ares/c-ares/pull/877) +* adig: rework command line arguments to mimic dig from bind. + [PR #890](https://github.com/c-ares/c-ares/pull/890) +* Add new method for overriding network functions + `ares_set_socket_function_ex()` to properly support all new functionality. + [PR #894](https://github.com/c-ares/c-ares/pull/894) +* Fix regression with custom socket callbacks due to DNS cookie support. + [PR #895](https://github.com/c-ares/c-ares/pull/895) +* ares_socket: set IP_BIND_ADDRESS_NO_PORT on ares_set_local_ip* tcp sockets + [PR #887](https://github.com/c-ares/c-ares/pull/887) +* URI parser/writer for ares_set_servers_csv()/ares_get_servers_csv(). + [PR #882](https://github.com/c-ares/c-ares/pull/882) Changes: -* Reorganize source tree. [PR #822](https://github.com/c-ares/c-ares/pull/822) -* Refactoring of connection handling to prevent code duplication. - [PR #839](https://github.com/c-ares/c-ares/pull/839) -* New dynamic array data structure to prevent simple logic flaws in array - handling in various code paths. - [PR #841](https://github.com/c-ares/c-ares/pull/841) +* Connection handling modularization. + [PR #857](https://github.com/c-ares/c-ares/pull/857), + [PR #876](https://github.com/c-ares/c-ares/pull/876) +* Expose library/utility functions to tools. + [PR #860](https://github.com/c-ares/c-ares/pull/860) +* Remove `ares__` prefix, just use `ares_` for internal functions. + [PR #872](https://github.com/c-ares/c-ares/pull/872) + Bugfixes: -* `ares_destroy()` race condition during shutdown due to missing lock. - [PR #831](https://github.com/c-ares/c-ares/pull/831) -* Android: Preserve thread name after attaching it to JVM. - [PR #838](https://github.com/c-ares/c-ares/pull/838) -* Windows UWP (Store) support fix. - [PR #845](https://github.com/c-ares/c-ares/pull/845) +* fix: potential WIN32_LEAN_AND_MEAN redefinition. + [PR #869](https://github.com/c-ares/c-ares/pull/869) +* Fix googletest v1.15 compatibility. + [PR #874](https://github.com/c-ares/c-ares/pull/874) +* Fix pkgconfig thread dependencies. + [PR #884](https://github.com/c-ares/c-ares/pull/884) Thanks go to these friendly people for their efforts and contributions for this release: * Brad House (@bradh352) -* Yauheni Khnykin (@Hsilgos) +* Cristian Rodríguez (@crrodriguez) +* Georg (@tacerus) +* @lifenjoiner +* Shelley Vohr (@codebytere) +* 前进,前进,进 (@leleliu008) diff --git a/deps/cares/aminclude_static.am b/deps/cares/aminclude_static.am index 538a810c9eb0ee..7cc94c822cf773 100644 --- a/deps/cares/aminclude_static.am +++ b/deps/cares/aminclude_static.am @@ -1,6 +1,6 @@ # aminclude_static.am generated automatically by Autoconf -# from AX_AM_MACROS_STATIC on Fri Aug 23 09:37:25 EDT 2024 +# from AX_AM_MACROS_STATIC on Wed Oct 9 20:58:25 EDT 2024 # Code coverage diff --git a/deps/cares/cares.gyp b/deps/cares/cares.gyp index 6b6d520f9ee872..87898f5610d56c 100644 --- a/deps/cares/cares.gyp +++ b/deps/cares/cares.gyp @@ -6,16 +6,14 @@ 'include/ares_dns_record.h', 'include/ares_nameser.h', 'include/ares_version.h', - 'src/lib/ares__addrinfo2hostent.c', - 'src/lib/ares__addrinfo_localhost.c', - 'src/lib/ares__close_sockets.c', - 'src/lib/ares__hosts_file.c', - 'src/lib/ares__parse_into_addrinfo.c', - 'src/lib/ares__socket.c', - 'src/lib/ares__sortaddrinfo.c', + 'src/lib/ares_addrinfo2hostent.c', + 'src/lib/ares_addrinfo_localhost.c', 'src/lib/ares_android.c', 'src/lib/ares_android.h', 'src/lib/ares_cancel.c', + 'src/lib/ares_close_sockets.c', + 'src/lib/ares_conn.c', + 'src/lib/ares_conn.h', 'src/lib/ares_cookie.c', 'src/lib/ares_data.c', 'src/lib/ares_data.h', @@ -29,43 +27,43 @@ 'src/lib/ares_gethostbyaddr.c', 'src/lib/ares_gethostbyname.c', 'src/lib/ares_getnameinfo.c', + 'src/lib/ares_hosts_file.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_metrics.c', 'src/lib/ares_options.c', - 'src/lib/ares_platform.c', - 'src/lib/ares_platform.h', + 'src/lib/ares_parse_into_addrinfo.c', 'src/lib/ares_private.h', 'src/lib/ares_process.c', 'src/lib/ares_qcache.c', 'src/lib/ares_query.c', 'src/lib/ares_search.c', 'src/lib/ares_send.c', + 'src/lib/ares_set_socket_functions.c', 'src/lib/ares_setup.h', + 'src/lib/ares_socket.c', + 'src/lib/ares_socket.h', + 'src/lib/ares_sortaddrinfo.c', 'src/lib/ares_strerror.c', '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/dsa/ares__array.c', - 'src/lib/dsa/ares__array.h', - 'src/lib/dsa/ares__htable.c', - 'src/lib/dsa/ares__htable.h', - 'src/lib/dsa/ares__htable_asvp.c', - 'src/lib/dsa/ares__htable_asvp.h', - 'src/lib/dsa/ares__htable_strvp.c', - 'src/lib/dsa/ares__htable_strvp.h', - 'src/lib/dsa/ares__htable_szvp.c', - 'src/lib/dsa/ares__htable_szvp.h', - 'src/lib/dsa/ares__htable_vpvp.c', - 'src/lib/dsa/ares__htable_vpvp.h', - 'src/lib/dsa/ares__llist.c', - 'src/lib/dsa/ares__llist.h', - 'src/lib/dsa/ares__slist.c', - 'src/lib/dsa/ares__slist.h', + 'src/lib/dsa/ares_array.c', + 'src/lib/dsa/ares_htable.c', + 'src/lib/dsa/ares_htable.h', + 'src/lib/dsa/ares_htable_asvp.c', + 'src/lib/dsa/ares_htable_dict.c', + 'src/lib/dsa/ares_htable_strvp.c', + 'src/lib/dsa/ares_htable_szvp.c', + 'src/lib/dsa/ares_htable_vpstr.c', + 'src/lib/dsa/ares_htable_vpvp.c', + 'src/lib/dsa/ares_llist.c', + 'src/lib/dsa/ares_slist.c', + 'src/lib/dsa/ares_slist.h', 'src/lib/event/ares_event.h', 'src/lib/event/ares_event_configchg.c', 'src/lib/event/ares_event_epoll.c', @@ -76,6 +74,17 @@ 'src/lib/event/ares_event_wake_pipe.c', 'src/lib/event/ares_event_win32.c', 'src/lib/event/ares_event_win32.h', + 'src/lib/include/ares_array.h', + 'src/lib/include/ares_buf.h', + 'src/lib/include/ares_htable_asvp.h', + 'src/lib/include/ares_htable_dict.h', + 'src/lib/include/ares_htable_strvp.h', + 'src/lib/include/ares_htable_szvp.h', + 'src/lib/include/ares_htable_vpstr.h', + 'src/lib/include/ares_htable_vpvp.h', + 'src/lib/include/ares_llist.h', + 'src/lib/include/ares_mem.h', + 'src/lib/include/ares_str.h', 'src/lib/inet_net_pton.c', 'src/lib/inet_ntop.c', 'src/lib/legacy/ares_create_query.c', @@ -102,21 +111,23 @@ 'src/lib/record/ares_dns_private.h', 'src/lib/record/ares_dns_record.c', 'src/lib/record/ares_dns_write.c', - 'src/lib/str/ares__buf.c', 'src/lib/str/ares__buf.h', + 'src/lib/str/ares_buf.c', 'src/lib/str/ares_str.c', - 'src/lib/str/ares_str.h', - 'src/lib/str/ares_strcasecmp.c', - 'src/lib/str/ares_strcasecmp.h', 'src/lib/str/ares_strsplit.c', 'src/lib/str/ares_strsplit.h', - 'src/lib/util/ares__iface_ips.c', - 'src/lib/util/ares__iface_ips.h', - 'src/lib/util/ares__threads.c', - 'src/lib/util/ares__threads.h', - 'src/lib/util/ares__timeval.c', + 'src/lib/util/ares_iface_ips.c', + 'src/lib/util/ares_iface_ips.h', 'src/lib/util/ares_math.c', + 'src/lib/util/ares_math.h', 'src/lib/util/ares_rand.c', + 'src/lib/util/ares_rand.h', + 'src/lib/util/ares_threads.c', + 'src/lib/util/ares_threads.h', + 'src/lib/util/ares_time.h', + 'src/lib/util/ares_timeval.c', + 'src/lib/util/ares_uri.c', + 'src/lib/util/ares_uri.h', 'src/tools/ares_getopt.c', 'src/tools/ares_getopt.h', ], @@ -163,7 +174,7 @@ { 'target_name': 'cares', 'type': '<(library)', - 'include_dirs': [ 'include', 'src/lib' ], + 'include_dirs': [ 'include', 'src/lib', 'src/lib/include' ], 'direct_dependent_settings': { 'include_dirs': [ 'include' ], 'cflags': [ '-Wno-error=deprecated-declarations' ], diff --git a/deps/cares/configure b/deps/cares/configure index 74e9741fe6ee7a..635872c9f18e1a 100755 --- a/deps/cares/configure +++ b/deps/cares/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for c-ares 1.33.1. +# Generated by GNU Autoconf 2.72 for c-ares 1.34.1. # # Report bugs to . # @@ -614,8 +614,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='c-ares' PACKAGE_TARNAME='c-ares' -PACKAGE_VERSION='1.33.1' -PACKAGE_STRING='c-ares 1.33.1' +PACKAGE_VERSION='1.34.1' +PACKAGE_STRING='c-ares 1.34.1' PACKAGE_BUGREPORT='c-ares mailing list: http://lists.haxx.se/listinfo/c-ares' PACKAGE_URL='' @@ -834,8 +834,10 @@ enable_dependency_tracking enable_silent_rules enable_shared enable_static +enable_pic with_pic enable_fast_install +enable_aix_soname with_aix_soname with_gnu_ld with_sysroot @@ -1421,7 +1423,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -'configure' configures c-ares 1.33.1 to adapt to many kinds of systems. +'configure' configures c-ares 1.34.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1492,7 +1494,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of c-ares 1.33.1:";; + short | recursive ) echo "Configuration of c-ares 1.34.1:";; esac cat <<\_ACEOF @@ -1508,8 +1510,13 @@ Optional Features: --disable-silent-rules verbose build output (undo: "make V=0") --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] + --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] + --enable-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. --disable-libtool-lock avoid locking (might break parallel builds) --disable-warnings Disable strict compiler warnings --disable-symbol-hiding Disable symbol hiding. Enabled by default if the @@ -1528,11 +1535,6 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use - both] - --with-aix-soname=aix|svr4|both - shared library versioning (aka "SONAME") variant to - provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). @@ -1633,7 +1635,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -c-ares configure 1.33.1 +c-ares configure 1.34.1 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. @@ -2277,7 +2279,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by c-ares $as_me 1.33.1, which was +It was created by c-ares $as_me 1.34.1, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -3269,7 +3271,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -CARES_VERSION_INFO="20:1:18" +CARES_VERSION_INFO="21:1:19" @@ -6190,7 +6192,7 @@ fi # Define the identity of the package. PACKAGE='c-ares' - VERSION='1.33.1' + VERSION='1.34.1' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -6523,8 +6525,8 @@ esac -macro_version='2.4.7' -macro_revision='2.4.7' +macro_version='2.5.3' +macro_revision='2.5.3' @@ -7035,7 +7037,7 @@ if test yes = "$GCC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in - *-*-mingw*) + *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) @@ -7164,7 +7166,7 @@ else # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; + mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in @@ -7397,7 +7399,7 @@ else case e in #( lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -7419,7 +7421,7 @@ else case e in #( lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) + darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -7562,7 +7564,7 @@ else case e in #( e) case $host in *-*-mingw* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) @@ -7575,7 +7577,7 @@ else case e in #( ;; *-*-cygwin* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) @@ -7611,9 +7613,9 @@ else case e in #( e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in - *-*-mingw* ) + *-*-mingw* | *-*-windows* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac @@ -7649,7 +7651,7 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi @@ -7671,9 +7673,8 @@ esac -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. -set dummy ${ac_tool_prefix}file; ac_word=$2 +# Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FILECMD+y} @@ -7694,7 +7695,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_FILECMD="${ac_tool_prefix}file" + ac_cv_prog_FILECMD="file" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7702,6 +7703,7 @@ done done IFS=$as_save_IFS + test -z "$ac_cv_prog_FILECMD" && ac_cv_prog_FILECMD=":" fi ;; esac fi @@ -7715,66 +7717,6 @@ printf "%s\n" "no" >&6; } fi -fi -if test -z "$ac_cv_prog_FILECMD"; then - ac_ct_FILECMD=$FILECMD - # Extract the first word of "file", so it can be a program name with args. -set dummy file; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_FILECMD+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_FILECMD"; then - ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_FILECMD="file" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD -if test -n "$ac_ct_FILECMD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 -printf "%s\n" "$ac_ct_FILECMD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_FILECMD" = x; then - FILECMD=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - FILECMD=$ac_ct_FILECMD - fi -else - FILECMD="$ac_cv_prog_FILECMD" -fi - @@ -7906,7 +7848,6 @@ lt_cv_deplibs_check_method='unknown' # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure @@ -7933,7 +7874,7 @@ cygwin*) lt_cv_file_magic_cmd='func_win32_libid' ;; -mingw* | pw32*) +mingw* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. @@ -7942,7 +7883,7 @@ mingw* | pw32*) lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; @@ -8033,7 +7974,7 @@ newos6*) lt_cv_deplibs_check_method=pass_all ;; -openbsd* | bitrig*) +openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else @@ -8101,7 +8042,7 @@ file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in - mingw* | pw32*) + mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else @@ -8257,7 +8198,7 @@ else case e in #( e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in @@ -8288,6 +8229,110 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + if test -n "$ac_tool_prefix"; then for ac_prog in ar do @@ -8409,7 +8454,7 @@ fi # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have -# higher priority because thats what people were doing historically (setting +# higher priority because that's what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. @@ -8601,109 +8646,6 @@ test -z "$STRIP" && STRIP=: -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_RANLIB+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -printf "%s\n" "$RANLIB" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_RANLIB+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -printf "%s\n" "$ac_ct_RANLIB" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi test -z "$RANLIB" && RANLIB=: @@ -8718,15 +8660,8 @@ old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -8806,7 +8741,7 @@ case $host_os in aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -8821,7 +8756,7 @@ osf*) symcode='[BCDEGQRST]' ;; solaris*) - symcode='[BDRT]' + symcode='[BCDRT]' ;; sco3.2v5*) symcode='[DT]' @@ -8885,7 +8820,7 @@ $lt_c_name_lib_hook\ # Handle CRLF in mingw tool chain opt_cr= case $build_os in -mingw*) +mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac @@ -8936,7 +8871,7 @@ void nm_test_func(void){} #ifdef __cplusplus } #endif -int main(){nm_test_var='a';nm_test_func();return(0);} +int main(void){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -9121,7 +9056,9 @@ lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` + # Trim trailing / since we'll always append absolute paths and we want + # to avoid //, if only for less confusing output for the user. + lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` fi ;; #( /*) @@ -9338,7 +9275,7 @@ mips64*-*linux*) ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) +s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when @@ -9357,7 +9294,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; - x86_64-*linux*) + x86_64-*linux*|x86_64-gnu*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" @@ -9386,7 +9323,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; - x86_64-*linux*) + x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) @@ -9607,23 +9544,23 @@ fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if test ${lt_cv_path_mainfest_tool+y} +if test ${lt_cv_path_manifest_tool+y} then : printf %s "(cached) " >&6 else case e in #( - e) lt_cv_path_mainfest_tool=no + e) lt_cv_path_manifest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes + lt_cv_path_manifest_tool=yes fi rm -f conftest* ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } -if test yes != "$lt_cv_path_mainfest_tool"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_manifest_tool" >&5 +printf "%s\n" "$lt_cv_path_manifest_tool" >&6; } +if test yes != "$lt_cv_path_manifest_tool"; then MANIFEST_TOOL=: fi @@ -10218,6 +10155,45 @@ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } + # Feature test to disable chained fixups since it is not + # compatible with '-undefined dynamic_lookup' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5 +printf %s "checking for -no_fixup_chains linker flag... " >&6; } +if test ${lt_cv_support_no_fixup_chains+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_support_no_fixup_chains=yes +else case e in #( + e) lt_cv_support_no_fixup_chains=no + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5 +printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} @@ -10272,7 +10248,7 @@ _LT_EOF echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF -int main() { return 0;} +int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err @@ -10301,7 +10277,11 @@ printf "%s\n" "$lt_cv_ld_force_load" >&6; } 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' + if test yes = "$lt_cv_support_no_fixup_chains"; then + as_fn_append _lt_dar_allow_undefined ' $wl-no_fixup_chains' + fi + ;; esac ;; esac @@ -10382,7 +10362,7 @@ func_stripname_cnf () enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 @@ -10788,31 +10768,54 @@ fi - -# Check whether --with-pic was given. + # Check whether --enable-pic was given. +if test ${enable_pic+y} +then : + enableval=$enable_pic; lt_p=${PACKAGE-default} + case $enableval in + yes|no) pic_mode=$enableval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else case e in #( + e) # Check whether --with-pic was given. if test ${with_pic+y} then : withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for lt_pkg in $withval; do - IFS=$lt_save_ifs - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS=$lt_save_ifs - ;; - esac + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac else case e in #( e) pic_mode=default ;; esac fi + ;; +esac +fi + @@ -10857,18 +10860,29 @@ case $host,$enable_shared in power*-*-aix[5-9]*,yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 printf %s "checking which variant of shared library versioning to provide... " >&6; } - -# Check whether --with-aix-soname was given. + # Check whether --enable-aix-soname was given. +if test ${enable_aix_soname+y} +then : + enableval=$enable_aix_soname; case $enableval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --enable-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$enable_aix_soname +else case e in #( + e) # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in - aix|svr4|both) - ;; - *) - as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 - ;; - esac - lt_cv_with_aix_soname=$with_aix_soname + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname else case e in #( e) if test ${lt_cv_with_aix_soname+y} then : @@ -10876,12 +10890,16 @@ then : else case e in #( e) lt_cv_with_aix_soname=aix ;; esac +fi + ;; +esac fi - with_aix_soname=$lt_cv_with_aix_soname ;; + enable_aix_soname=$lt_cv_with_aix_soname ;; esac fi + with_aix_soname=$enable_aix_soname { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then @@ -11197,7 +11215,7 @@ objext=$objext lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' +lt_simple_link_test_code='int main(void){return(0);}' @@ -11339,7 +11357,7 @@ lt_prog_compiler_static= # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -11442,7 +11460,7 @@ lt_prog_compiler_static= esac ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -11483,6 +11501,12 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; + *flang* | ftn) + # Flang compiler. + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -11954,7 +11978,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. @@ -11966,7 +11990,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; - openbsd* | bitrig*) + openbsd*) with_gnu_ld=no ;; esac @@ -12069,7 +12093,7 @@ _LT_EOF fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -12125,7 +12149,7 @@ _LT_EOF cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; @@ -12616,7 +12640,7 @@ fi export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -12633,14 +12657,14 @@ fi # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_cmds='$CC -Fe $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + $CC -Fe $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' @@ -12949,7 +12973,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } *nto* | *qnx*) ;; - openbsd* | bitrig*) + openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no @@ -12992,7 +13016,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; @@ -13434,7 +13458,7 @@ if test yes = "$GCC"; then *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` @@ -13492,7 +13516,7 @@ BEGIN {RS = " "; FS = "/|\n";} { # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` @@ -13566,7 +13590,7 @@ aix[4-9]*) # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the @@ -13660,7 +13684,7 @@ bsdi[45]*) # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no @@ -13671,6 +13695,19 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds + # If user builds GCC with mulitlibs enabled, + # it should just install on $(libdir) + # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. + if test yes = $multilib; then + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + $install_prog $dir/$dlname $destdir/$dlname~ + chmod a+x $destdir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib $destdir/$dlname'\'' || exit \$?; + fi' + else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ @@ -13680,6 +13717,7 @@ cygwin* | mingw* | pw32* | cegcc*) if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' + fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' @@ -13692,7 +13730,7 @@ cygwin* | mingw* | pw32* | cegcc*) sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; - mingw* | cegcc*) + mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; @@ -13711,7 +13749,7 @@ cygwin* | mingw* | pw32* | cegcc*) library_names_spec='$libname.dll.lib' case $build_os in - mingw*) + mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' @@ -13818,7 +13856,28 @@ freebsd* | dragonfly* | midnightbsd*) need_version=yes ;; esac + case $host_cpu in + powerpc64) + # On FreeBSD bi-arch platforms, a different variable is used for 32-bit + # binaries. See . + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int test_pointer_size[sizeof (void *) - 5]; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : shlibpath_var=LD_LIBRARY_PATH +else case e in #( + e) shlibpath_var=LD_32_LIBRARY_PATH ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + *) + shlibpath_var=LD_LIBRARY_PATH + ;; + esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes @@ -13959,7 +14018,7 @@ linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext' + library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH @@ -13971,8 +14030,9 @@ linux*android*) hardcode_into_libs=yes dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec='-L$libdir' + # -rpath works at least for libraries that are not overridden by + # libraries installed in system locations. + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. @@ -14029,7 +14089,7 @@ fi # before this can be enabled. hardcode_into_libs=yes - # Ideally, we could use ldconfig to report *all* directores which are + # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, @@ -14086,7 +14146,7 @@ newsos6) dynamic_linker='ldqnx.so' ;; -openbsd* | bitrig*) +openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no @@ -14427,7 +14487,7 @@ else lt_cv_dlopen_self=yes ;; - mingw* | pw32* | cegcc*) + mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; @@ -14800,11 +14860,11 @@ else /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); +int fnord (void) __attribute__((visibility("default"))); #endif -int fnord () { return 42; } -int main () +int fnord (void) { return 42; } +int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; @@ -14908,11 +14968,11 @@ else /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); +int fnord (void) __attribute__((visibility("default"))); #endif -int fnord () { return 42; } -int main () +int fnord (void) { return 42; } +int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; @@ -15373,7 +15433,7 @@ if test yes = "$GCC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in - *-*-mingw*) + *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) @@ -15488,8 +15548,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= @@ -15509,7 +15568,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' else GXX=no @@ -15809,7 +15868,7 @@ fi esac ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC @@ -15940,7 +15999,7 @@ fi cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + old_archive_from_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes file_list_spec_CXX='@' ;; @@ -16008,7 +16067,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -16073,7 +16132,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "[-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -16321,7 +16380,7 @@ fi ld_shlibs_CXX=yes ;; - openbsd* | bitrig*) + openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no @@ -16412,7 +16471,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' else # FIXME: insert proper C++ library support @@ -16496,7 +16555,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. @@ -16507,7 +16566,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' @@ -16650,10 +16709,11 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 case $prev$p in -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. + # Some compilers place space between "-{L,R,l}" and the path. # Remove the space. - if test x-L = "$p" || - test x-R = "$p"; then + if test x-L = x"$p" || + test x-R = x"$p" || + test x-l = x"$p"; then prev=$p continue fi @@ -16820,7 +16880,7 @@ lt_prog_compiler_static_CXX= beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -16895,7 +16955,7 @@ lt_prog_compiler_static_CXX= ;; esac ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' @@ -17394,7 +17454,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) case $cc_basename in cl* | icl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' @@ -17623,7 +17683,7 @@ aix[4-9]*) # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the @@ -17717,7 +17777,7 @@ bsdi[45]*) # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no @@ -17728,6 +17788,19 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds + # If user builds GCC with mulitlibs enabled, + # it should just install on $(libdir) + # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. + if test yes = $multilib; then + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + $install_prog $dir/$dlname $destdir/$dlname~ + chmod a+x $destdir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib $destdir/$dlname'\'' || exit \$?; + fi' + else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ @@ -17737,6 +17810,7 @@ cygwin* | mingw* | pw32* | cegcc*) if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' + fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' @@ -17748,7 +17822,7 @@ cygwin* | mingw* | pw32* | cegcc*) soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; - mingw* | cegcc*) + mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; @@ -17767,7 +17841,7 @@ cygwin* | mingw* | pw32* | cegcc*) library_names_spec='$libname.dll.lib' case $build_os in - mingw*) + mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' @@ -17873,7 +17947,28 @@ freebsd* | dragonfly* | midnightbsd*) need_version=yes ;; esac + case $host_cpu in + powerpc64) + # On FreeBSD bi-arch platforms, a different variable is used for 32-bit + # binaries. See . + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int test_pointer_size[sizeof (void *) - 5]; + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : shlibpath_var=LD_LIBRARY_PATH +else case e in #( + e) shlibpath_var=LD_32_LIBRARY_PATH ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + *) + shlibpath_var=LD_LIBRARY_PATH + ;; + esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes @@ -18014,7 +18109,7 @@ linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext' + library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH @@ -18026,8 +18121,9 @@ linux*android*) hardcode_into_libs=yes dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec_CXX='-L$libdir' + # -rpath works at least for libraries that are not overridden by + # libraries installed in system locations. + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. @@ -18084,7 +18180,7 @@ fi # before this can be enabled. hardcode_into_libs=yes - # Ideally, we could use ldconfig to report *all* directores which are + # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, @@ -18141,7 +18237,7 @@ newsos6) dynamic_linker='ldqnx.so' ;; -openbsd* | bitrig*) +openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no @@ -22653,6 +22749,14 @@ fi +ac_fn_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_memmem" = xyes +then : + +printf "%s\n" "#define HAVE_MEMMEM 1" >>confdefs.h + +fi ac_fn_check_decl "$LINENO" "recv" "ac_cv_have_decl_recv" "$cares_all_includes " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_recv" = xyes @@ -22676,6 +22780,14 @@ then : printf "%s\n" "#define HAVE_SEND 1" >>confdefs.h +fi +ac_fn_check_decl "$LINENO" "sendto" "ac_cv_have_decl_sendto" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_sendto" = xyes +then : + +printf "%s\n" "#define HAVE_SENDTO 1" >>confdefs.h + fi ac_fn_check_decl "$LINENO" "getnameinfo" "ac_cv_have_decl_getnameinfo" "$cares_all_includes " "$ac_c_undeclared_builtin_options" "CFLAGS" @@ -26711,7 +26823,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by c-ares $as_me 1.33.1, which was +This file was extended by c-ares $as_me 1.34.1, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26779,7 +26891,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -c-ares config.status 1.33.1 +c-ares config.status 1.34.1 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" @@ -28011,19 +28123,18 @@ See 'config.log' for more details" "$LINENO" 5; } cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 -# Copyright (C) 2014 Free Software Foundation, Inc. +# Copyright (C) 2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of of the License, or +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you @@ -28407,7 +28518,7 @@ hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute @@ -28650,7 +28761,7 @@ hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX diff --git a/deps/cares/configure.ac b/deps/cares/configure.ac index 59fd975b64f873..cc52c2c6c5de0a 100644 --- a/deps/cares/configure.ac +++ b/deps/cares/configure.ac @@ -2,10 +2,10 @@ dnl Copyright (C) The c-ares project and its contributors dnl SPDX-License-Identifier: MIT AC_PREREQ([2.69]) -AC_INIT([c-ares], [1.33.1], +AC_INIT([c-ares], [1.34.1], [c-ares mailing list: http://lists.haxx.se/listinfo/c-ares]) -CARES_VERSION_INFO="20:1:18" +CARES_VERSION_INFO="21:1:19" dnl This flag accepts an argument of the form current[:revision[:age]]. So, dnl passing -version-info 3:12:1 sets current to 3, revision to 12, and age to dnl 1. @@ -540,9 +540,11 @@ dnl https://mailman.videolan.org/pipermail/vlc-devel/2015-March/101802.html dnl which would require we check each individually and provide function arguments dnl for the test. +AC_CHECK_DECL(memmem, [AC_DEFINE([HAVE_MEMMEM], 1, [Define to 1 if you have `memmem`] )], [], $cares_all_includes) AC_CHECK_DECL(recv, [AC_DEFINE([HAVE_RECV], 1, [Define to 1 if you have `recv`] )], [], $cares_all_includes) AC_CHECK_DECL(recvfrom, [AC_DEFINE([HAVE_RECVFROM], 1, [Define to 1 if you have `recvfrom`] )], [], $cares_all_includes) AC_CHECK_DECL(send, [AC_DEFINE([HAVE_SEND], 1, [Define to 1 if you have `send`] )], [], $cares_all_includes) +AC_CHECK_DECL(sendto, [AC_DEFINE([HAVE_SENDTO], 1, [Define to 1 if you have `sendto`] )], [], $cares_all_includes) AC_CHECK_DECL(getnameinfo, [AC_DEFINE([HAVE_GETNAMEINFO], 1, [Define to 1 if you have `getnameinfo`] )], [], $cares_all_includes) AC_CHECK_DECL(gethostname, [AC_DEFINE([HAVE_GETHOSTNAME], 1, [Define to 1 if you have `gethostname`] )], [], $cares_all_includes) AC_CHECK_DECL(connect, [AC_DEFINE([HAVE_CONNECT], 1, [Define to 1 if you have `connect`] )], [], $cares_all_includes) diff --git a/deps/cares/docs/Makefile.in b/deps/cares/docs/Makefile.in index a57cd0abc18846..75b3f3d942bbd6 100644 --- a/deps/cares/docs/Makefile.in +++ b/deps/cares/docs/Makefile.in @@ -457,6 +457,9 @@ MANPAGES = ares_cancel.3 \ ares_parse_txt_reply.3 \ ares_parse_uri_reply.3 \ ares_process.3 \ + ares_process_fd.3 \ + ares_process_fds.3 \ + ares_process_pending_write.3 \ ares_query.3 \ ares_query_dnsrec.3 \ ares_queue.3 \ @@ -471,6 +474,7 @@ MANPAGES = ares_cancel.3 \ ares_set_local_dev.3 \ ares_set_local_ip4.3 \ ares_set_local_ip6.3 \ + ares_set_pending_write_cb.3 \ ares_set_server_state_callback.3 \ ares_set_servers.3 \ ares_set_servers_csv.3 \ diff --git a/deps/cares/docs/Makefile.inc b/deps/cares/docs/Makefile.inc index 46e30346cfb86a..d6ad73246b3f99 100644 --- a/deps/cares/docs/Makefile.inc +++ b/deps/cares/docs/Makefile.inc @@ -114,6 +114,9 @@ MANPAGES = ares_cancel.3 \ ares_parse_txt_reply.3 \ ares_parse_uri_reply.3 \ ares_process.3 \ + ares_process_fd.3 \ + ares_process_fds.3 \ + ares_process_pending_write.3 \ ares_query.3 \ ares_query_dnsrec.3 \ ares_queue.3 \ @@ -128,6 +131,7 @@ MANPAGES = ares_cancel.3 \ ares_set_local_dev.3 \ ares_set_local_ip4.3 \ ares_set_local_ip6.3 \ + ares_set_pending_write_cb.3 \ ares_set_server_state_callback.3 \ ares_set_servers.3 \ ares_set_servers_csv.3 \ diff --git a/deps/cares/docs/adig.1 b/deps/cares/docs/adig.1 index 59923790587ddd..e0b81c91e3f9fa 100644 --- a/deps/cares/docs/adig.1 +++ b/deps/cares/docs/adig.1 @@ -3,65 +3,177 @@ .\" Copyright (C) Daniel Stenberg .\" SPDX-License-Identifier: MIT .\" -.TH ADIG "1" "April 2011" "c-ares utilities" +.TH ADIG "1" "Sept 2024" "c-ares utilities" .SH NAME adig \- print information collected from Domain Name System (DNS) servers .SH SYNOPSIS -.B adig -[\fIOPTION\fR]... \fINAME\fR... +\fBadig\fP [\fI@server\fR] [\fI-c class\fR] [\fI-p port#\fR] [\fI-q name\fR] +[\fI-t type\fR] [\fI-x addr\fR] [\fIname\fR] [\fItype\fR] [\fIclass\fR] +[\fIqueryopt\fR...] + .SH DESCRIPTION .PP -.\" Add any additional description here -.PP -Send queries to DNS servers about \fINAME\fR and print received -information, where \fINAME\fR is a valid DNS name (e.g. www.example.com, +Send queries to DNS servers about \fUname\fR and print received +information, where \fIname\fR is a valid DNS name (e.g. www.example.com, 1.2.3.10.in-addr.arpa). .PP This utility comes with the \fBc\-ares\fR asynchronous resolver library. -.SH OPTIONS +.PP +It is possible to specify default arguments for \fBadig\fR via \fB${XDG_CONFIG_HOME}/adigrc\fR. +.SH ARGS +.TP +\fB@server\fR +Server ip address. May specify multiple in comma delimited format. May be +specified in URI format. +.TP +\fBname\fR +Name of the resource record that is to be looked up +.TP +\fBtype\fR +What type of query is required. e.g. - A, AAAA, MX, TXT, etc. If not +specified, A will be used. +.TP +\fBclass\fR +Sets the query class, defaults to IN. May also be HS or CH. + +.SH FLAGS .TP \fB\-c\fR class -Set the query class. -Possible values for class are -ANY, CHAOS, HS and IN (default). -.TP -\fB\-d\fR -Print some extra debugging output. -.TP -\fB\-f\fR flag -Add a behavior control flag. -Possible values for flag are - 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. -.TP -\fB\-h\fR, \fB\-?\fR -Display this help and exit. -.TP -\fB\-s\fR server -Connect to specified DNS server, instead of the system's default one(s). -Servers are tried in round-robin, if the previous one failed. +Sets the query class, defaults to IN. May also be HS or CH. +.TP +\fB\-h\fR +Prints the help. +.TP +\fB\-p\fR port +Sends query to a port other than 53. Often recommended to set the port using +\fI@server\fR instead. +.TP +\fB\-q\fR name +Specifies the domain name to query. Useful to distinguish name from other +arguments +.TP +\fB\-r\fR +Skip adigrc processing +.TP +\fB\-s\fR +Server (alias for @server syntax), compatibility with old cmdline .TP \fB\-t\fR type -Query records of specified type. -Possible values for type are -A (default), AAAA, ANY, AXFR, CNAME, HINFO, MX, NAPTR, NS, PTR, SOA, SRV, TXT, -URI, CAA, SVCB, and HTTPS. +Indicates resource record type to query. Useful to distinguish type from other +arguments +.TP +\fB\-x\fR addr +Simplified reverse lookups. Sets the type to PTR and forms a valid in-arpa +query string + +.SH QUERY OPTIONS +.TP +\fB+[no]aaonly\fR +Sets the aa flag in the query. Default is off. +.TP +\fB+[no]aaflag\fR +Alias for +[no]aaonly +.TP +\fB+[no]additional\fR +Toggles printing the additional section. On by default. +.TP +\fB+[no]adflag\fR +Sets the ad (authentic data) bit in the query. Default is off. +.TP +\fB+[no]aliases\fR +Whether or not to honor the HOSTALIASES file. Default is on. +.TP +\fB+[no]all\fR +Toggles all of +[no]cmd, +[no]stats, +[no]question, +[no]answer, ++[no]authority, +[no]additional, +[no]comments +.TP +\fB+[no]answer\fR +Toggles printing the answer. On by default. +.TP +\fB+[no]authority\fR +Toggles printing the authority. On by default. .TP -\fB\-T\fR port -Connect to the specified TCP port of DNS server. +\fB+bufsize=\fR# +UDP EDNS 0 packet size allowed. Defaults to 1232. .TP -\fB\-U\fR port -Connect to the specified UDP port of DNS server. +\fB+[no]cdflag\fR +Sets the CD (checking disabled) bit in the query. Default is off. +.TP +\fB+[no]class\fR +Display the class when printing the record. On by default. +.TP +\fB+[no]cmd\fR +Toggles printing the command requested. On by default. +.TP +\fB+[no]comments\fR +Toggles printing the comments. On by default +.TP +\fB+[no]defname\fR +Alias for +[no]search +.TP +\fB+domain=somename\fR +Sets the search list to a single domain. +.TP +\fB+[no]dns0x20\fR +Whether or not to use DNS 0x20 case randomization when sending queries. +Default is off. +.TP +\fB+[no]edns\fR[=#] +Enable or disable EDNS. Only allows a value of 0 if specified. Default is to +enable EDNS. +.TP +\fB+[no]ignore\fR +Ignore truncation on UDP, by default retried on TCP. +.TP +\fB+[no]keepopen\fR +Whether or not the server connection should be persistent. Default is off. +.TP +\fB+ndots\fR=# +Sets the number of dots that must appear before being considered absolute. +Defaults to 1. +.TP +\fB+[no]primary\fR +Whether or not to only use a single server if more than one server is available. +Defaults to using all servers. +.TP +\fB+[no]qr\fR +Toggles printing the request query. Off by default. +.TP +\fB+[no]question\fR +Toggles printing the question. On by default. +.TP +\fB+[no]recurse\fR +Toggles the RD (Recursion Desired) bit. On by default. +.TP +\fB+retry\fR=# +Same as +tries but does not include the initial attempt. +.TP +\fB+[no]search\fR +To use or not use the search list. Search list is not used by default. +.TP +\fB+[no]stats\fR +Toggles printing the statistics. On by default. +.TP +\fB+[no]tcp\fR +Whether to use TCP when querying name servers. Default is UDP. +.TP +\fB+tries\fR=# +Number of query tries. Defaults to 3. +.TP +\fB+[no]ttlid\fR +Display the TTL when printing the record. On by default. +.TP +\fB+[no]vc\fR +Alias for +[no]tcp + +.SH FILES + +${XDG_CONFIG_HOME}/adigrc .SH "REPORTING BUGS" -Report bugs to the c-ares mailing list: +Report bugs to the c-ares github issues tracker .br -\fBhttps://lists.haxx.se/listinfo/c-ares\fR +\fBhttps://github.com/c-ares/c-ares/issues\fR .SH "SEE ALSO" .PP ahost(1). diff --git a/deps/cares/docs/ares_inet_pton.3 b/deps/cares/docs/ares_inet_pton.3 index 5b7b8010d22a3a..34b2df063c6820 100644 --- a/deps/cares/docs/ares_inet_pton.3 +++ b/deps/cares/docs/ares_inet_pton.3 @@ -9,7 +9,7 @@ ares_inet_pton \- convert an IPv4 or IPv6 address from text to binary form .nf #include -const char *ares_inet_pton(int \fIaf\fP, const char *\fIsrc\fP, void *\fIdst\fP); +int ares_inet_pton(int \fIaf\fP, const char *\fIsrc\fP, void *\fIdst\fP); .fi .SH DESCRIPTION This is a portable version with the identical functionality of the commonly @@ -22,6 +22,11 @@ shall be supported. The \fBsrc\fP argument points to the string being passed in. The \fBdst\fP argument points to a buffer into which the function stores the numeric address; this shall be large enough to hold the numeric address (32 bits for AF_INET, 128 bits for AF_INET6). + +It returns 1 if the address was valid for the specified address family, or 0 +if the address was not parseable in the specified address family, or -1 if +some system error occurred (in which case errno will have been set). + .SH SEE ALSO .BR ares_init (3), .BR ares_inet_ntop (3) diff --git a/deps/cares/docs/ares_init_options.3 b/deps/cares/docs/ares_init_options.3 index 694beb5ed28d13..9b3b4815355659 100644 --- a/deps/cares/docs/ares_init_options.3 +++ b/deps/cares/docs/ares_init_options.3 @@ -345,7 +345,8 @@ Configure server failover retry behavior. When a DNS server fails to respond to a query, c-ares will deprioritize the server. On subsequent queries, servers with fewer consecutive failures will be selected in preference. However, in order to detect when such a server has recovered, -c-ares will occasionally retry failed servers. The +c-ares will occasionally retry failed servers by probing with a copy of +the query, without affecting the latency of the actual requested query. The \fIares_server_failover_options\fP structure contains options to control this behavior. The \fIretry_chance\fP field gives the probability (1/N) of retrying a @@ -367,7 +368,9 @@ for each resolution. .TP 23 .B ARES_OPT_NOROTATE Do not perform round-robin nameserver selection; always use the list of -nameservers in the same order. +nameservers in the same order. The default is not to rotate servers, however +the system configuration can specify the desire to rotate and this +configuration value can negate such a system configuration. .PP .SH RETURN VALUES diff --git a/deps/cares/docs/ares_process.3 b/deps/cares/docs/ares_process.3 index d45d92a6259682..ce45a60d6c07d4 100644 --- a/deps/cares/docs/ares_process.3 +++ b/deps/cares/docs/ares_process.3 @@ -4,61 +4,106 @@ .\" .TH ARES_PROCESS 3 "25 July 1998" .SH NAME -ares_process \- Process events for name resolution +ares_process_fds, ares_process_fd, ares_process \- Process events for name resolution .SH SYNOPSIS .nf #include -void ares_process(ares_channel_t *\fIchannel\fP, - fd_set *\fIread_fds\fP, - fd_set *\fIwrite_fds\fP) +/*! Events used by ares_fd_events_t */ +typedef enum { + ARES_FD_EVENT_NONE = 0, /*!< No events */ + ARES_FD_EVENT_READ = 1 << 0, /*!< Read event (including disconnect/error) */ + ARES_FD_EVENT_WRITE = 1 << 1 /*!< Write event */ +} ares_fd_eventflag_t; + +/*! Type holding a file descriptor and mask of events, used by + * ares_process_fds() */ +typedef struct { + ares_socket_t fd; /*!< File descriptor */ + unsigned int events; /*!< Mask of ares_fd_event_t */ +} ares_fd_events_t; + +typedef enum { + ARES_PROCESS_FLAG_NONE = 0, + ARES_PROCESS_FLAG_SKIP_NON_FD = 1 << 0 +} ares_process_flag_t; + + +ares_status_t ares_process_fds(ares_channel_t *\fIchannel\fP, + const ares_fd_events_t *\fIevents\fP, + size_t \fInevents\fP, + unsigned int \fIflags\fP) void ares_process_fd(ares_channel_t *\fIchannel\fP, ares_socket_t \fIread_fd\fP, ares_socket_t \fIwrite_fd\fP) + +void ares_process(ares_channel_t *\fIchannel\fP, + fd_set *\fIread_fds\fP, + fd_set *\fIwrite_fds\fP) + .fi .SH DESCRIPTION -The \fBares_process(3)\fP function handles input/output events and timeouts -associated with queries pending on the name service channel identified by -.IR channel . -The file descriptor sets pointed to by \fIread_fds\fP and \fIwrite_fds\fP -should have file descriptors set in them according to whether the file -descriptors specified by \fIares_fds(3)\fP are ready for reading and writing. -(The easiest way to determine this information is to invoke \fBselect(3)\fP -with a timeout no greater than the timeout given by \fIares_timeout(3)\fP). - -The \fBares_process(3)\fP function will invoke callbacks for pending queries -if they complete successfully or fail. - -\fBares_process_fd(3)\fP works the same way but acts and operates only on the -specific file descriptors (sockets) you pass in to the function. Use -ARES_SOCKET_BAD for "no action". This function is provided to allow users of -c-ares to avoid \fIselect(3)\fP in their applications and within c-ares. - -To only process possible timeout conditions without a socket event occurring, -one may pass NULL as the values for both \fIread_fds\fP and \fIwrite_fds\fP for -\fBares_process(3)\fP, or ARES_SOCKET_BAD for both \fIread_fd\fP and -\fIwrite_fd\fP for \fBares_process_fd(3)\fP. -.SH EXAMPLE -The following code fragment waits for all pending queries on a channel -to complete: +These functions must be used by integrators choosing not to use the +EventThread enabled via \fBARES_OPT_EVENT_THREAD\fP passed to +\fBares_init_options\fP. This assumes integrators already have their own +event loop handling event notifications for various file descriptors and +wish to do the same with their integration with c-ares. + +The \fBares_process_fds(3)\fP function handles input/output events on file +descriptors and timeouts associated with queries pending on the channel +identified by \fIchannel\fP. The file descriptors to be processed are passed +in an array of \fIares_fd_events_t\fP data structures in the \fIfd\fP member, +and events are a bitwise mask of \fIares_fd_eventflag_t\fP in the \fIevent\fP +member. This function can also be used to process timeouts by passing NULL +to the \fIevents\fP member with \fInevents\fP value of 0. Flags may also be +specified in the \fIflags\fP field and are defined in \fBares_process_flag_t\fP. + +\fBARES_PROCESS_FLAG_SKIP_NON_FD\fP can be specified to specifically skip any +processing unrelated to the file descriptor events passed in, examples include +timeout processing and cleanup handling. This is useful if an integrator +knows they will be sending multiple \fIares_process_fds(3)\fP requests and +wants to skip that extra processing. However, the integrator must send the +final request with the flag so that timeout and other processing gets performed +before their event loop waits on additional events. + +It is allowable to use an \fIares_fd_events_t\fP with \fIevents\fP member of +value \fIARES_FD_EVENT_NONE\fP (0) if there are no events for a given file +descriptor if an integrator wishes to simply maintain an array with all +possible file descriptors and update readiness via the \fIevent\fP member. + +This function will return \fIARES_ENOMEM\fP in out of memory conditions, +otherwise will return \fIARES_SUCCESS\fP. + +This function is recommended over \fBares_process_fd(3)\fP since it can +handle processing of multiple file descriptors at once, thus skipping repeating +additional logic such as timeout processing which would be required if calling +\fBares_process_fd(3)\fP for multiple file descriptors notified at the same +time. + +This function is typically used with the \fIARES_OPT_SOCK_STATE_CB\fP option. + +\fBares_timeout(3)\fP should be used to retrieve the desired timeout, and when +the timeout expires, the integrator must call \fBares_process_fds(3)\fP with +a NULL \fIevents\fP array. (or \fBares_process_fd(3)\fP with both sockets set +to \fIARES_SOCKET_BAD\fP). There is no need to do this if events are also +delivered for any file descriptors as timeout processing will automatically be +handled by any call to \fBares_process_fds(3)\fP or \fBares_process_fd(3)\fP. + +The \fBares_process_fd(3)\fP function is the same as \fBares_process_fds(3)\fP +except can only process a single read and write file descriptor at a time. +New integrators should use \fBares_process_fds(3)\fP if possible. + +The \fBares_process(3)\fP function works in the same manner, except it works +on \fIfd_sets\fP as is used by \fBselect(3)\fP and retrieved by +\fBares_fds(3)\fP. This method is deprecated and should not be used in modern +applications due to known limitations to the \fBselect(3)\fP implementation. + +.SH AVAILABILITY +\fBares_process_fds(3)\fP was introduced in c-ares 1.34.0. -.nf -int nfds, count; -fd_set readers, writers; -struct timeval tv, *tvp; - -while (1) { - FD_ZERO(&readers); - FD_ZERO(&writers); - nfds = ares_fds(channel, &readers, &writers); - if (nfds == 0) - break; - tvp = ares_timeout(channel, NULL, &tv); - count = select(nfds, &readers, &writers, NULL, tvp); - ares_process(channel, &readers, &writers); -} -.fi .SH SEE ALSO .BR ares_fds (3), -.BR ares_timeout (3) +.BR ares_timeout (3), +.BR ares_init_options (3) +with \fIARES_OPT_EVENT_THREAD\fP or \fIARES_OPT_SOCK_STATE_CB\fP diff --git a/deps/cares/docs/ares_process_fd.3 b/deps/cares/docs/ares_process_fd.3 new file mode 100644 index 00000000000000..94e50f41a91717 --- /dev/null +++ b/deps/cares/docs/ares_process_fd.3 @@ -0,0 +1,3 @@ +.\" Copyright (C) 2023 The c-ares project and its contributors. +.\" SPDX-License-Identifier: MIT +.so man3/ares_process.3 diff --git a/deps/cares/docs/ares_process_fds.3 b/deps/cares/docs/ares_process_fds.3 new file mode 100644 index 00000000000000..94e50f41a91717 --- /dev/null +++ b/deps/cares/docs/ares_process_fds.3 @@ -0,0 +1,3 @@ +.\" Copyright (C) 2023 The c-ares project and its contributors. +.\" SPDX-License-Identifier: MIT +.so man3/ares_process.3 diff --git a/deps/cares/docs/ares_process_pending_write.3 b/deps/cares/docs/ares_process_pending_write.3 new file mode 100644 index 00000000000000..90843341950bbb --- /dev/null +++ b/deps/cares/docs/ares_process_pending_write.3 @@ -0,0 +1,3 @@ +.\" Copyright (C) 2023 The c-ares project and its contributors. +.\" SPDX-License-Identifier: MIT +.so man3/ares_set_pending_write_cb.3 diff --git a/deps/cares/docs/ares_set_local_dev.3 b/deps/cares/docs/ares_set_local_dev.3 index 2e2028f616ae3e..621cf35184fe10 100644 --- a/deps/cares/docs/ares_set_local_dev.3 +++ b/deps/cares/docs/ares_set_local_dev.3 @@ -2,7 +2,7 @@ .\" Copyright 2010 by Ben Greear .\" SPDX-License-Identifier: MIT .\" -.TH ARES_SET_LOCAL_DEV 3 "30 June 2010" +.TH ARES_SET_LOCAL_DEV 3 "23 September 2024" .SH NAME ares_set_local_dev \- Bind to a specific network device when creating sockets. .SH SYNOPSIS @@ -15,12 +15,14 @@ void ares_set_local_dev(ares_channel_t *\fIchannel\fP, const char* \fIlocal_dev_ The \fBares_set_local_dev\fP function causes all future sockets to be bound to this device with SO_BINDTODEVICE. This forces communications to go over a certain interface, which can be useful on multi-homed machines. -This option is only supported on Linux, and root privileges are required -for the option to work. If SO_BINDTODEVICE is not supported or the -setsocktop call fails (probably because of permissions), the error is +This option is only supported on Linux, the interface must not be already bound to the +socket or the current effective user must have CAP_NET_RAW capability in the current +network namespace for the option to work. If SO_BINDTODEVICE is not supported or the +setsockopt call fails (probably because of permissions), the error is silently ignored. .SH SEE ALSO .BR ares_set_local_ip4 (3) .BR ares_set_local_ip6 (3) +.BR network_namespaces (7) .SH NOTES This function was added in c-ares 1.7.4 diff --git a/deps/cares/docs/ares_set_pending_write_cb.3 b/deps/cares/docs/ares_set_pending_write_cb.3 new file mode 100644 index 00000000000000..3c7712a69d96e4 --- /dev/null +++ b/deps/cares/docs/ares_set_pending_write_cb.3 @@ -0,0 +1,62 @@ +.\" +.\" Copyright 2024 by the c-ares project and its contributors +.\" SPDX-License-Identifier: MIT +.\" +.TH ARES_SET_NOTIFY_PENDING_WRITE_CALLBACK 3 "13 Aug 2024" +.SH NAME +ares_set_pending_write_cb, ares_process_pending_write \- Function +for setting a callback which is triggered when there is potential pending data +which needs to be written. +.SH SYNOPSIS +.nf +#include + +typedef void (*ares_pending_write_cb)(void *\fIdata\fP); + +void ares_set_pending_write_cb( + ares_channel_t *\fIchannel\fP, + ares_pending_write_cb \fIcallback\fP, + void *\fIuser_data\fP); + +void ares_process_pending_write(ares_channel_t *\fIchannel\fP); + +.fi + +.SH DESCRIPTION +The \fBares_set_pending_write_cb(3)\fP function sets a callback +function \fIcallback\fP in the given ares channel handle \fIchannel\fP that +is invoked whenever there is new pending TCP data to be written. Since TCP +is stream based, if there are multiple queries being enqueued back to back they +can be sent as one large buffer. Normally a \fBsend(2)\fP syscall operation +would be triggered for each query. + +When setting this callback, an event will be triggered when data is buffered, +but not written. This event is used to wake the caller's event loop which +should call \fBares_process_pending_write(3)\fP using the channel associated +with the callback. Each time the callback is triggered must result in a call +to \fBares_process_pending_write(3)\fP from the caller's event loop otherwise +stalls and timeouts may occur. The callback \fBmust not\fP call +\fBares_process_pending_write(3)\fP directly as otherwise it would invalidate +any advantage of this use-case. + +This is considered an optimization, especially when using TLS-based connections +which add additional overhead to the data stream. Due to the asyncronous nature +of c-ares, there is no way to identify when a caller may be finished enqueuing +queries via any of the possible public API calls such as +\fBares_getaddrinfo(3)\fP or \fBares_search_dnsrec(3)\fP, so this is an +enhancement to try to group query send operations together and will rely on the +singaling latency involved in waking the user's event loop. + +If no callback is set, data will be written immediately to the socket, thus +bypassing this optimization. + +This option cannot be used with \fIARES_OPT_EVENT_THREAD\fP passed to +\fBares_init_options(3)\fP since the user has no event loop. This optimization +is automatically enabled when using the Event Thread as it sets the callback +for its own internal signaling. + +.SH AVAILABILITY +This function was first introduced in c-ares version 1.34.0. + +.SH SEE ALSO +.BR ares_init_options (3) diff --git a/deps/cares/docs/ares_set_servers_csv.3 b/deps/cares/docs/ares_set_servers_csv.3 index 875a156bfb1014..f1435143f567a4 100644 --- a/deps/cares/docs/ares_set_servers_csv.3 +++ b/deps/cares/docs/ares_set_servers_csv.3 @@ -29,11 +29,18 @@ simulation but unlikely to be useful in production. The \fBares_get_servers_csv\fP retrieves the list of servers in comma delimited format. -The input and output format is a comma separated list of servers. Each server -entry may contain these forms: +The input and output format is a comma separated list of servers. Two formats +are available, the typical \fBresolv.conf(5)\fP \fInameserver\fP format, as +well as a \fIURI\fP format. Both formats can be used at the same time in the +provided CSV string. + +The \fInameserver\fP format is: +.nf ip[:port][%iface] +.fi +.RS 4 The \fBip\fP may be encapsulated in square brackets ([ ]), and must be if using ipv6 and also specifying a port. @@ -42,16 +49,88 @@ The \fBport\fP is optional, and will default to 53 or the value specified in The \fBiface\fP is specific to IPv6 link-local servers (fe80::/10) and should not otherwise be used. +.RE + +\fInameserver\fP format examples: +.nf + +192.168.1.100 +192.168.1.101:53 +[1:2:3::4]:53 +[fe80::1]:53%eth0 + +.fi +.PP + +The \fIURI\fP format is is made up of these defined schemes: +.RS 4 +\fIdns://\fP - Normal DNS server (UDP + TCP). We need to be careful not to +conflict with query params defined in RFC4501 since we'd technically be +extending this URI scheme. Port defaults to 53. + +\fIdns+tls://\fP - DNS over TLS. Port defaults to 853. + +\fIdns+https://\fP - DNS over HTTPS. Port defaults to 443. +.RE + +.PP +Query parameters are defined as below. Additional parameters may be defined +in the future. + +.RS 4 +\fItcpport\fP - TCP port to use, only for \fIdns://\fP scheme. The port +specified as part of the authority component of the URI will be used for both +UDP and TCP by default, this option will override the TCP port. + +\fIipaddr\fP - Only for \fIdns+tls://\fP and \fIdns+https://\fP. If the +authority component of the URI contains a hostname, this is used to specify the +ip address of the hostname. If not specified, will need to use a non-secure +server to perform a DNS lookup to retrieve this information. It is always +recommended to have both the ip address and fully qualified domain name +specified. + +\fIhostname\fP - Only for \fIdns+tls://\fP and \fIdns+https://\fP. If the +authority component of the URI contains an ip address, this is used to specify +the fully qualified domain name of the server. If not specified, will need to +use a non-secure server to perform a DNS reverse lookup to retrieve this +information. It is always recommended to have both the ip address and fully +qualified domain name specified. + +\fIdomain\fP - If specified, this server is a domain-specific server. Any +queries for this domain will be routed to this server. Multiple servers may be +tagged with the same domain. +.RE + +\fIURI\fP format Examples: +.nf -For example: +dns://8.8.8.8 +dns://[2001:4860:4860::8888] +dns://[fe80::b542:84df:1719:65e3%en0] +dns://192.168.1.1:55 +dns://192.168.1.1?tcpport=1153 +dns://10.0.1.1?domain=myvpn.com +dns+tls://8.8.8.8?hostname=dns.google +dns+tls://one.one.one.one?ipaddr=1.1.1.1 + +.fi + +\fBNOTE\fP: While we are defining the scheme for things like domain-specific +servers, DNS over TLS and DNS over HTTPS, the underlying implementations for +those features do not yet exist and therefore will result in errors if they are +attempted to be used. -192.168.1.100,192.168.1.101:53,[1:2:3::4]:53,[fe80::1]:53%eth0 .PP As of c-ares 1.24.0, \fBares_set_servers_csv\fP and \fBares_set_servers_ports_csv\fP are identical. Prior versions would simply omit ports in \fBares_set_servers_csv\fP but due to the addition of link local interface support, this difference was removed. +.SH EXAMPLE +.nf +192.168.1.100,[fe80::1]:53%eth0,dns://192.168.1.1?tcpport=1153 +.fi + .SH RETURN VALUES .B ares_set_servers_csv(3) and @@ -81,3 +160,4 @@ returns a string representing the servers configured which must be freed with \fBares_set_servers_csv\fP was added in c-ares 1.7.2 \fBares_set_servers_ports_csv\fP was added in c-ares 1.11.0. \fBares_get_servers_csv\fP was added in c-ares 1.24.0. +\fIURI\fP support was added in c-ares 1.34.0. diff --git a/deps/cares/docs/ares_set_socket_functions.3 b/deps/cares/docs/ares_set_socket_functions.3 index ab945ed18de86b..8a903dc6521607 100644 --- a/deps/cares/docs/ares_set_socket_functions.3 +++ b/deps/cares/docs/ares_set_socket_functions.3 @@ -1,12 +1,63 @@ .\" Copyright (C) Daniel Stenberg .\" SPDX-License-Identifier: MIT -.TH ARES_SET_SOCKET_FUNCTIONS 3 "13 Dec 2016" +.TH ARES_SET_SOCKET_FUNCTIONS 3 "8 Oct 2024" .SH NAME -ares_set_socket_functions \- Set socket io callbacks +ares_set_socket_functions, ares_set_socket_functions_ex \- Set socket io callbacks .SH SYNOPSIS .nf #include +typedef enum { + ARES_SOCKFUNC_FLAG_NONBLOCKING = 1 << 0 +} ares_sockfunc_flags_t; + +typedef enum { + ARES_SOCKET_OPT_SENDBUF_SIZE, + ARES_SOCKET_OPT_RECVBUF_SIZE, + ARES_SOCKET_OPT_BIND_DEVICE, + ARES_SOCKET_OPT_TCP_FASTOPEN +} ares_socket_opt_t; + +typedef enum { + ARES_SOCKET_CONN_TCP_FASTOPEN = 1 << 0 +} ares_socket_connect_flags_t; + +typedef enum { + ARES_SOCKET_BIND_TCP = 1 << 0, + ARES_SOCKET_BIND_CLIENT = 1 << 1 +} ares_socket_bind_flags_t; + +struct ares_socket_functions_ex { + unsigned int version; /* ABI Version: must be "1" */ + unsigned int flags; + + ares_socket_t (*asocket)(int domain, int type, int protocol, void *user_data); + int (*aclose)(ares_socket_t sock, void *user_data); + int (*asetsockopt)(ares_socket_t sock, ares_socket_opt_t opt, const void *val, + ares_socklen_t val_size, void *user_data); + int (*aconnect)(ares_socket_t sock, const struct sockaddr *address, + ares_socklen_t address_len, unsigned int flags, + void *user_data); + ares_ssize_t (*arecvfrom)(ares_socket_t sock, void *buffer, size_t length, + int flags, struct sockaddr *address, + ares_socklen_t *address_len, void *user_data); + ares_ssize_t (*asendto)(ares_socket_t sock, const void *buffer, size_t length, + int flags, const struct sockaddr *address, + ares_socklen_t address_len, void *user_data); + int (*agetsockname)(ares_socket_t sock, struct sockaddr *address, + ares_socklen_t *address_len, void *user_data); + int (*abind)(ares_socket_t sock, unsigned int flags, + const struct sockaddr *address, socklen_t address_len, + void *user_data); + unsigned int (*aif_nametoindex)(const char *ifname, void *user_data); + const char *(*aif_indextoname)(unsigned int ifindex, char *ifname_buf, + size_t ifname_buf_len, void *user_data); +}; + +ares_status_t ares_set_socket_functions_ex(ares_channel_t *channel, + const struct ares_socket_functions_ex *funcs, void *user_data); + + struct ares_socket_functions { ares_socket_t (*\fIasocket\fP)(int, int, int, void *); int (*\fIaclose\fP)(ares_socket_t, void *); @@ -22,80 +73,262 @@ void ares_set_socket_functions(ares_channel_t *\fIchannel\fP, .fi .SH DESCRIPTION .PP -This function sets a set of callback \fIfunctions\fP in the given ares channel handle. -Cannot be used when \fBARES_OPT_EVENT_THREAD\fP is passed to \fIares_init_options(3)\fP. - -These callback functions will be invoked to create/destroy socket objects and perform -io, instead of the normal system calls. A client application can override normal network -operation fully through this functionality, and provide its own transport layer. You -can choose to only implement some of the socket functions, and provide NULL to any -others and c-ares will use its built-in system functions in that case. + +\fBares_set_socket_functions_ex(3)\fP sets a set of callback \fIfunctions\fP in +the given ares channel handle. Cannot be used when \fBARES_OPT_EVENT_THREAD\fP +is passed to \fIares_init_options(3)\fP. This function replaces the now +deprecated \fBares_set_socket_functions(3)\fP call. + +These callback functions will be invoked to create/destroy socket objects and +perform io, instead of the normal system calls. A client application can +override normal network operation fully through this functionality, and provide +its own transport layer. + +Some callbacks may be optional and are documented as such below, but failing +to implement such callbacks will disable certain features within c-ares. It +is strongly recommended to implement all callbacks. + +All callback functions are expected to operate like their system equivalents, +and to set \fBerrno(2)\fP or \fBWSASetLastError(2)\fP to an appropriate error +code on failure. It is strongly recommended that io callbacks are implemented +to be asynchronous and indicated as such in the \fIflags\fP member. The io +callbacks can return error codes of \fBEAGAIN\fP, \fBEWOULDBLOCK\fP, or +\fBWSAEWOULDBLOCK\fP when they would otherwise block. + +The \fIuser_data\fP value is provided to each callback function invocation to +serve as context. + +The \fBares_set_socket_functions_ex(3)\fP must provide the following structure +members and callbacks (which are different from the +\fBares_set_socket_functions(3)\fP members and callbacks): + +.RS 4 +.TP 8 +.B unsigned int \fIversion\fP +.br +ABI Version of structure. Must be set to a value of "1". + +.TP 8 +.B unsigned int \fIflags\fP +.br +Flags available are specified in \fIares_sockfunc_flags_t\fP. + +.TP 8 +.B ares_socket_t (*\fIasocket\fP)(int \fIdomain\fP, int \fItype\fP, int \fIprotocol\fP, void * \fIuser_data\fP) +.br +\fIREQUIRED\fP. Creates an endpoint for communication and returns a descriptor. \fIdomain\fP, +\fItype\fP, and \fIprotocol\fP each correspond to the parameters of +\fBsocket(2)\fP. Returns a handle to the newly created socket, or +\fBARES_SOCKET_BAD\fP on error. + +.TP 8 +.B int (*\fIaclose\fP)(ares_socket_t \fIfd\fP, void * \fIuser_data\fP) +.br +\fIREQUIRED\fP. Closes the socket endpoint indicated by \fIfd\fP. See \fBclose(2)\fP. + +.TP 8 +.B int (*\fIasetsockopt\fP)(ares_socket_t \fIfd\fP, ares_socket_opt_t \fIopt\fP, const void * \fIval\fP, ares_socklen_t \fIval_size\fP, void * \fIuser_data\fP) +.br +\fIREQUIRED\fP. Set socket option. This shares a similar syntax to the BSD \fIsetsockopt(2)\fP +call, however c-ares uses different options for portability. The value is +a pointer to the desired value, and each option has its own data type listed +in the options below defined in \fIares_socket_opt_t\fP. + +.TP 8 +.B int (*\fIaconnect\fP)(ares_socket_t \fIfd\fP, const struct sockaddr * \fIaddr\fP, ares_socklen_t \fIaddr_len\fP, unsigned int \fIflags\fP, void * \fIuser_data\fP) +.br +\fIREQUIRED\fP. Initiate a connection to the address indicated by \fIaddr\fP on +a socket. Additional flags controlling behavior are in +\fIares_socket_connect_flags_t\fP. See \fBconnect(2)\fP. + +.TP 8 +.B ares_ssize_t (*\fIarecvfrom\fP)(ares_socket_t \fIfd\fP, void * \fIbuffer\fP, size_t \fIbuf_size\fP, int \fIflags\fP, struct sockaddr * \fIaddr\fP, ares_socklen_t * \fIaddr_len\fP, void * \fIuser_data\fP) +.br +\fIREQUIRED\fP. Receives data from remote socket endpoint, if available. If the +\fIaddr\fP parameter is not NULL and the connection protocol provides the source +address, the callback should fill this in. The \fIflags\fP parameter is +currently unused. See \fBrecvfrom(2)\fP. + +.TP 8 +.B ares_ssize_t (*\fIasendto\fP)(ares_socket_t \fIfd\fP, const void * \fIbuffer\fP, size_t \fIlength\fP, int \fIflags\fP, const struct sockaddr * \fIaddress\fP, ares_socklen_t \fIaddress_len\fP, void * \fIuser_data\fP) +.br +\fIREQUIRED\fP. Send data, as provided by the \fIbuffer\fP, to the socket +endpoint. The \fIflags\fP member may be used on systems that have +\fBMSG_NOSIGNAL\fP defined but is otherwise unused. An \fIaddress\fP is +provided primarily to support TCP FastOpen scenarios, which will be NULL in +other circumstances. See \fBsendto(2)\fP. + +.TP 8 +.B int (*\fIagetsockname\fP)(ares_socket_t \fIfd\fP, struct sockaddr * \fIaddress\fP, ares_socklen_t * \fIaddress_len\fP, void * \fIuser_data\fP) +.br +\fIOptional\fP. Retrieve the local address of a socket and store it into the provided +\fIaddress\fP buffer. May impact DNS Cookies if not provided. See +\fBgetsockname(2)\fP. + +.TP 8 +.B int (*\fIabind\fP)(ares_socket_t \fIfd\fP, unsigned int \fIflags\fP, const struct sockaddr * \fIaddress\fP, ares_socklen_t \fIaddress_len\fP, void * \fIuser_data\fP) +.br +\fIOptional\fP. Bind the socket to an address. This can be used for client +connections to bind the source address for packets before connect, or +for server connections to bind to an address and port before listening. +Currently c-ares only supports client connections. \fIflags\fP from +\fIares_socket_bind_flags_t\fP can be specified. See \fBbind(2)\fP. + +.TP 8 +.B unsigned int (*\fIaif_nametoindex\fP)(const char * \fIifname\fP, void * \fIuser_data\fP) +.br +\fIOptional\fP. Convert an interface name into the interface index. If this +callback is not specified, then IPv6 Link-Local DNS servers cannot be used. +See \fBif_nametoindex(2)\fP. + +.TP 8 +.B const char * (*\fIaif_indextoname\fP)(unsigned int \fIifindex\fP, char * \fIifname_buf\fP, size_t \fIifname_buf_len\fP, void * \fIuser_data\fP) +.br +\fIOptional\fP. Convert an interface index into the interface name. If this +callback is not specified, then IPv6 Link-Local DNS servers cannot be used. +\fIifname_buf\fP must be at least \fBIF_NAMESIZE\fP or \fBIFNAMSIZ\fP in size. +See \fBif_indextoname(2)\fP. +.RE + +.PP +\fBares_sockfunc_flags_t\fP values: + +.RS 4 +.TP 8 +.B \fIARES_SOCKFUNC_FLAG_NONBLOCKING\fP +.br +Used to indicate the implementation of the io functions are asynchronous. +.RE + +.PP +\fBares_socket_opt_t\fP values: + +.RS 4 +.TP 8 +.B \fIARES_SOCKET_OPT_SENDBUF_SIZE\fP +.br +Set the Send Buffer size. Value is a pointer to an int. (SO_SNDBUF). + +.TP 8 +.B \fIARES_SOCKET_OPT_RECVBUF_SIZE\fP +.br +Set the Receive Buffer size. Value is a pointer to an int. (SO_RCVBUF). + +.TP 8 +.B \fIARES_SOCKET_OPT_BIND_DEVICE\fP +.br +Set the network interface to use as the source for communication. Value is a C +string. (SO_BINDTODEVICE) + +.TP 8 +.B \fIARES_SOCKET_OPT_TCP_FASTOPEN\fP +.br +Enable TCP Fast Open. Value is a pointer to an \fIares_bool_t\fP. On some +systems this could be a no-op if it is known it is on by default and +return success. Other systems may be a no-op if known the system does +not support the feature and returns failure with errno set to \fBENOSYS\fP or +\fBWSASetLastError(WSAEOPNOTSUPP);\fP. +.RE + +.PP +\fBares_socket_connect_flags_t\fP values: +.RS 4 +.TP 8 +.B \fIARES_SOCKET_CONN_TCP_FASTOPEN\fP +.br +Connect using TCP Fast Open. +.RE + +.PP +\fBares_socket_bind_flags_t\fP values: + +.RS 4 +.TP 8 +.B \fIARES_SOCKET_BIND_TCP\fP +.br +Bind is for a TCP connection. + +.TP 19 +.B \fIARES_SOCKET_BIND_CLIENT\fP +.br +Bind is for a client connection, not server. +.RE + +.PP + +\fBares_set_socket_functions(3)\fP sets a set of callback \fIfunctions\fP in the +given ares channel handle. Cannot be used when \fBARES_OPT_EVENT_THREAD\fP is +passed to \fIares_init_options(3)\fP. This function is deprecated as of +c-ares 1.34.0 in favor of \fIares_set_socket_functions_ex(3)\fP. + +\fBares_set_socket_functions(3)\fP allows you to choose to only implement +some of the socket functions, and provide NULL to any others and c-ares will use +its built-in system functions in that case. + .PP -All callback functions are expected to operate like their system equivalents, and to -set -.BR errno(3) -to an appropriate error code on failure. C-ares also expects all io functions to behave -asynchronously, i.e. as if the socket object has been set to non-blocking mode. Thus -read/write calls (for TCP connections) are expected to often generate -.BR EAGAIN -or -.BR EWOULDBLOCK. +All callback functions are expected to operate like their system equivalents, +and to set \fBerrno(2)\fP or \fBWSASetLastError(2)\fP to an appropriate error +code on failure. It is strongly recommended all io functions behave +asynchronously and return error codes of \fBEAGAIN\fP, \fBEWOULDBLOCK\fP, or +\fBWSAEWOULDBLOCK\fP when they would otherwise block. .PP -The \fIuser_data\fP value is provided to each callback function invocation to serve as -context. +The \fIuser_data\fP value is provided to each callback function invocation to +serve as context. .PP -The -.B ares_socket_functions -must provide the following callbacks: -.TP 18 -.B \fIasocket\fP -.B ares_socket_t(*)(int \fIdomain\fP, int \fItype\fP, int \fIprotocol\fP, void * \fIuser_data\fP) +The \fBares_set_socket_functions(3)\fP must provide the following callbacks (which +are different from the \fBares_set_socket_functions_ex(3)\fP callbacks): + +.RS 4 +.TP 8 +.B ares_socket_t (*\fIasocket\fP)(int \fIdomain\fP, int \fItype\fP, int \fIprotocol\fP, void * \fIuser_data\fP) .br Creates an endpoint for communication and returns a descriptor. \fIdomain\fP, \fItype\fP, and \fIprotocol\fP -each correspond to the parameters of -.BR socket(2). -Returns ahandle to the newly created socket, or -1 on error. -.TP 18 -.B \fIaclose\fP -.B int(*)(ares_socket_t \fIfd\fP, void * \fIuser_data\fP) -.br -Closes the socket endpoint indicated by \fIfd\fP. See -.BR close(2) -.TP 18 -.B \fIaconnect\fP -.B int(*)(ares_socket_t \fIfd\fP, const struct sockaddr * \fIaddr\fP, ares_socklen_t \fIaddr_len\fP, void * \fIuser_data\fP) +each correspond to the parameters of \fBsocket(2)\fP. Returns ahandle to the +newly created socket, or ARES_SOCKET_BAD on error. + +.TP 8 +.B int (*\fIaclose\fP)(ares_socket_t \fIfd\fP, void * \fIuser_data\fP) +.br +Closes the socket endpoint indicated by \fIfd\fP. See \fBclose(2)\fP. + +.TP 8 +.B int (*\fIaconnect\fP)(ares_socket_t \fIfd\fP, const struct sockaddr * \fIaddr\fP, ares_socklen_t \fIaddr_len\fP, void * \fIuser_data\fP) .br Initiate a connection to the address indicated by \fIaddr\fP on a socket. See -.BR connect(2) +\fBconnect(2)\fP -.TP 18 -.B \fIarecvfrom\fP -.B ares_ssize_t(*)(ares_socket_t \fIfd\fP, void * \fIbuffer\fP, size_t \fIbuf_size\fP, int \fIflags\fP, struct sockaddr * \fIaddr\fP, ares_socklen_t * \fIaddr_len\fP, void * \fIuser_data\fP) +.TP 8 +.B ares_ssize_t (*\fIarecvfrom\fP)(ares_socket_t \fIfd\fP, void * \fIbuffer\fP, size_t \fIbuf_size\fP, int \fIflags\fP, struct sockaddr * \fIaddr\fP, ares_socklen_t * \fIaddr_len\fP, void * \fIuser_data\fP) .br -Receives data from remote socket endpoint, if available. If the \fIaddr\fP parameter is not NULL and the connection protocol provides the source address, the callback should fill this in. See -.BR recvfrom(2) +Receives data from remote socket endpoint, if available. If the \fIaddr\fP +parameter is not NULL and the connection protocol provides the source address, +the callback should fill this in. See \fBrecvfrom(2)\fP -.TP 18 -.B \fIasendv\fP -.B ares_ssize_t(*)(ares_socket_t \fIfd\fP, const struct iovec * \fIdata\fP, int \fIlen\fP, void * \fIuser_data\fP) +.TP 8 +.B ares_ssize_t (*\fIasendv\fP)(ares_socket_t \fIfd\fP, const struct iovec * \fIdata\fP, int \fIlen\fP, void * \fIuser_data\fP) .br -Send data, as provided by the iovec array \fIdata\fP, to the socket endpoint. See -.BR writev(2), +Send data, as provided by the iovec array \fIdata\fP, to the socket endpoint. +See \fBwritev(2)\fP +.RE .PP -The -.B ares_socket_functions -struct provided is not copied but directly referenced, -and must thus remain valid through out the channels and any created socket's lifetime. +The \fBares_set_socket_functions(3)\fP struct provided is not copied but directly +referenced, and must thus remain valid through out the channels and any created +socket's lifetime. However, the \fBares_set_socket_functions_ex(3)\fP struct is +duplicated and does not need to survive past the call to the function. + .SH AVAILABILITY -Added in c-ares 1.13.0 +ares_socket_functions added in c-ares 1.13.0, ares_socket_functions_ex added in +c-ares 1.34.0 .SH SEE ALSO .BR ares_init_options (3), .BR socket (2), .BR close (2), .BR connect (2), -.BR recv (2), .BR recvfrom (2), -.BR send (2), +.BR sendto (2), +.BR bind (2), +.BR getsockname (2), +.BR setsockopt (2), .BR writev (2) diff --git a/deps/cares/include/ares.h b/deps/cares/include/ares.h index 95fc2440a1f662..139c6d66ee90df 100644 --- a/deps/cares/include/ares.h +++ b/deps/cares/include/ares.h @@ -460,6 +460,8 @@ typedef void (*ares_server_state_callback)(const char *server_string, ares_bool_t success, int flags, void *data); +typedef void (*ares_pending_write_cb)(void *data); + CARES_EXTERN int ares_library_init(int flags); CARES_EXTERN int ares_library_init_mem(int flags, void *(*amalloc)(size_t size), @@ -473,6 +475,9 @@ CARES_EXTERN int ares_library_init_android(jobject connectivity_manager); CARES_EXTERN int ares_library_android_initialized(void); #endif +#define CARES_HAVE_ARES_LIBRARY_INIT 1 +#define CARES_HAVE_ARES_LIBRARY_CLEANUP 1 + CARES_EXTERN int ares_library_initialized(void); CARES_EXTERN void ares_library_cleanup(void); @@ -526,6 +531,12 @@ CARES_EXTERN void ares_server_state_callback callback, void *user_data); +CARES_EXTERN void ares_set_pending_write_cb(ares_channel_t *channel, + ares_pending_write_cb callback, + void *user_data); + +CARES_EXTERN void ares_process_pending_write(ares_channel_t *channel); + CARES_EXTERN int ares_set_sortlist(ares_channel_t *channel, const char *sortstr); @@ -556,10 +567,251 @@ struct ares_socket_functions { ares_ssize_t (*asendv)(ares_socket_t, const struct iovec *, int, void *); }; -CARES_EXTERN void - ares_set_socket_functions(ares_channel_t *channel, - const struct ares_socket_functions *funcs, - void *user_data); +CARES_EXTERN CARES_DEPRECATED_FOR( + ares_set_socket_functions_ex) void ares_set_socket_functions(ares_channel_t + *channel, + const struct + ares_socket_functions + *funcs, + void *user_data); + +/*! Flags defining behavior of socket functions */ +typedef enum { + /*! Strongly recommended to create sockets as non-blocking and set this + * flag */ + ARES_SOCKFUNC_FLAG_NONBLOCKING = 1 << 0 +} ares_sockfunc_flags_t; + +/*! Socket options in request to asetsockopt() in struct + * ares_socket_functions_ex */ +typedef enum { + /*! Set the send buffer size. Value is a pointer to an int. (SO_SNDBUF) */ + ARES_SOCKET_OPT_SENDBUF_SIZE, + /*! Set the recv buffer size. Value is a pointer to an int. (SO_RCVBUF) */ + ARES_SOCKET_OPT_RECVBUF_SIZE, + /*! Set the network interface to use as the source for communication. + * Value is a C string. (SO_BINDTODEVICE) */ + ARES_SOCKET_OPT_BIND_DEVICE, + /*! Enable TCP Fast Open. Value is a pointer to an ares_bool_t. On some + * systems this could be a no-op if it is known it is on by default and + * return success. Other systems may be a no-op if known the system does + * not support the feature and returns failure with errno set to ENOSYS or + * WSASetLastError(WSAEOPNOTSUPP). + */ + ARES_SOCKET_OPT_TCP_FASTOPEN +} ares_socket_opt_t; + +/*! Flags for behavior during connect */ +typedef enum { + /*! Connect using TCP Fast Open */ + ARES_SOCKET_CONN_TCP_FASTOPEN = 1 << 0 +} ares_socket_connect_flags_t; + +/*! Flags for behavior during bind */ +typedef enum { + /*! Bind is for a TCP connection */ + ARES_SOCKET_BIND_TCP = 1 << 0, + /*! Bind is for a client connection, not server */ + ARES_SOCKET_BIND_CLIENT = 1 << 1 +} ares_socket_bind_flags_t; + +/*! Socket functions to call rather than using OS-native functions */ +struct ares_socket_functions_ex { + /*! ABI Version: must be "1" */ + unsigned int version; + + /*! Flags indicating behavior of the subsystem. One or more + * ares_sockfunc_flags_t */ + unsigned int flags; + + /*! REQUIRED. Create a new socket file descriptor. The file descriptor must + * be opened in non-blocking mode (so that reads and writes never block). + * Recommended other options would be to disable signals on write errors + * (SO_NOSIGPIPE), Disable the Nagle algorithm on SOCK_STREAM (TCP_NODELAY), + * and to automatically close file descriptors on exec (FD_CLOEXEC). + * + * \param[in] domain Socket domain. Valid values are AF_INET, AF_INET6. + * \param[in] type Socket type. Valid values are SOCK_STREAM (tcp) and + * SOCK_DGRAM (udp). + * \param[in] protocol In general this should be ignored, may be passed as + * 0 (use as default for type), or may be IPPROTO_UDP + * or IPPROTO_TCP. + * \param[in] user_data Pointer provided to ares_set_socket_functions_ex(). + * \return ARES_SOCKET_BAD on error, or socket file descriptor on success. + * On error, it is expected to set errno (or WSASetLastError()) to an + * appropriate reason code such as EAFNOSUPPORT / WSAAFNOSUPPORT. */ + ares_socket_t (*asocket)(int domain, int type, int protocol, void *user_data); + + /*! REQUIRED. Close a socket file descriptor. + * \param[in] sock Socket file descriptor returned from asocket. + * \param[in] user_data Pointer provided to ares_set_socket_functions_ex(). + * \return 0 on success. On failure, should set errno (or WSASetLastError) + * to an appropriate code such as EBADF / WSAEBADF */ + int (*aclose)(ares_socket_t sock, void *user_data); + + + /*! REQUIRED. Set socket option. This shares a similar syntax to the BSD + * setsockopt() call, however we use our own options. The value is typically + * a pointer to the desired value and each option has its own data type it + * will express in the documentation. + * + * \param[in] sock Socket file descriptor returned from asocket. + * \param[in] opt Option to set. + * \param[in] val Pointer to value for option. + * \param[in] val_size Size of value. + * \param[in] user_data Pointer provided to + * ares_set_socket_functions_ex(). + * \return Return 0 on success, otherwise -1 should be returned with an + * appropriate errno (or WSASetLastError()) set. If error is ENOSYS / + * WSAEOPNOTSUPP an error will not be propagated as it will take it + * to mean it is an intentional decision to not support the feature. + */ + int (*asetsockopt)(ares_socket_t sock, ares_socket_opt_t opt, const void *val, + ares_socklen_t val_size, void *user_data); + + /*! REQUIRED. Connect to the remote using the supplied address. For UDP + * sockets this will bind the file descriptor to only send and receive packets + * from the remote address provided. + * + * \param[in] sock Socket file descriptor returned from asocket. + * \param[in] address Address to connect to + * \param[in] address_len Size of address structure passed + * \param[in] flags One or more ares_socket_connect_flags_t + * \param[in] user_data Pointer provided to + * ares_set_socket_functions_ex(). + * \return Return 0 upon successful establishement, otherwise -1 should be + * returned with an appropriate errno (or WSASetLastError()) set. It + * is generally expected that most TCP connections (not using TCP Fast Open) + * will return -1 with an error of EINPROGRESS / WSAEINPROGRESS due to the + * non-blocking nature of the connection. It is then the responsibility of + * the implementation to notify of writability on the socket to indicate the + * connection has succeeded (or readability on failure to retrieve the + * appropriate error). + */ + int (*aconnect)(ares_socket_t sock, const struct sockaddr *address, + ares_socklen_t address_len, unsigned int flags, + void *user_data); + + /*! REQUIRED. Attempt to read data from the remote. + * + * \param[in] sock Socket file descriptor returned from asocket. + * \param[in,out] buffer Allocated buffer to place data read from + * socket. + * \param[in] length Size of buffer + * \param[in] flags Unused, always 0. + * \param[in,out] address Buffer to hold address data was received from. + * May be NULL if address not desired. + * \param[in,out] address_len Input size of address buffer, output actual + * written size. Must be NULL if address is NULL. + * \param[in] user_data Pointer provided to + * ares_set_socket_functions_ex(). + * \return -1 on error with appropriate errno (or WSASetLastError()) set, + * such as EWOULDBLOCK / EAGAIN / WSAEWOULDBLOCK, or ECONNRESET / + * WSAECONNRESET. + */ + ares_ssize_t (*arecvfrom)(ares_socket_t sock, void *buffer, size_t length, + int flags, struct sockaddr *address, + ares_socklen_t *address_len, void *user_data); + + /*! REQUIRED. Attempt to send data to the remote. Optional address may be + * specified which may be useful on unbound UDP sockets (though currently not + * used), and TCP FastOpen where the connection is delayed until first write. + * + * \param[in] sock Socket file descriptor returned from asocket. + * \param[in] buffer Containing data to place onto wire. + * \param[in] length Size of buffer + * \param[in] flags Flags for writing. Currently only used flag is + * MSG_NOSIGNAL if the host OS has such a flag. In + * general flags can be ignored. + * \param[in] address Buffer containing address to send data to. May + * be NULL. + * \param[in,out] address_len Size of address buffer. Must be 0 if address + * is NULL. + * \param[in] user_data Pointer provided to + * ares_set_socket_functions_ex(). + * \return Number of bytes written. -1 on error with appropriate errno (or + * WSASetLastError()) set. + */ + ares_ssize_t (*asendto)(ares_socket_t sock, const void *buffer, size_t length, + int flags, const struct sockaddr *address, + ares_socklen_t address_len, void *user_data); + + /*! Optional. Retrieve the local address of the socket. + * + * \param[in] sock Socket file descriptor returned from asocket + * \param[in,out] address Buffer to hold address + * \param[in,out] address_len Size of address buffer on input, written size + * on output. + * \param[in] user_data Pointer provided to + * ares_set_socket_functions_ex(). + * \return 0 on success. -1 on error with an appropriate errno (or + * WSASetLastError()) set. + */ + int (*agetsockname)(ares_socket_t sock, struct sockaddr *address, + ares_socklen_t *address_len, void *user_data); + + /*! Optional. Bind the socket to an address. This can be used for client + * connections to bind the source address for packets before connect, or + * for server connections to bind to an address and port before listening. + * Currently c-ares only supports client connections. + * + * \param[in] sock Socket file descriptor returned from asocket + * \param[in] flags ares_socket_bind_flags_t flags. + * \param[in] address Buffer containing address. + * \param[in] address_len Size of address buffer. + * \param[in] user_data Pointer provided to + * ares_set_socket_functions_ex(). + * \return 0 on success. -1 on error with an appropriate errno (or + * WSASetLastError()) set. + */ + int (*abind)(ares_socket_t sock, unsigned int flags, + const struct sockaddr *address, socklen_t address_len, + void *user_data); + + /* Optional. Convert an interface name into the interface index. If this + * callback is not specified, then IPv6 Link-Local DNS servers cannot be used. + * + * \param[in] ifname Interface Name as NULL-terminated string. + * \param[in] user_data Pointer provided to + * ares_set_socket_functions_ex(). + * \return 0 on failure, otherwise interface index. + */ + unsigned int (*aif_nametoindex)(const char *ifname, void *user_data); + + /* Optional. Convert an interface index into the interface name. If this + * callback is not specified, then IPv6 Link-Local DNS servers cannot be used. + * + * \param[in] ifindex Interface index, must be > 0 + * \param[in] ifname_buf Buffer to hold interface name. Must be at least + * IFNAMSIZ in length or 32 bytes if IFNAMSIZ isn't + * defined. + * \param[in] ifname_buf_len Size of ifname_buf for verification. + * \param[in] user_data Pointer provided to + * ares_set_socket_functions_ex(). + * \return NULL on failure, otherwise pointer to provided ifname_buf + */ + const char *(*aif_indextoname)(unsigned int ifindex, char *ifname_buf, + size_t ifname_buf_len, void *user_data); +}; + +/*! Override the native socket functions for the OS with the provided set. + * An optional user data thunk may be specified which will be passed to + * each registered callback. Replaces ares_set_socket_functions(). + * + * \param[in] channel An initialized c-ares channel. + * \param[in] funcs Structure registering the implementations for the + * various functions. See the structure definition. + * This will be duplicated and does not need to exist + * past the life of this call. + * \param[in] user_data User data thunk which will be passed to each call of + * the registered callbacks. + * \return ARES_SUCCESS on success, or another error code such as ARES_EFORMERR + * on misuse. + */ +CARES_EXTERN ares_status_t ares_set_socket_functions_ex( + ares_channel_t *channel, const struct ares_socket_functions_ex *funcs, + void *user_data); + CARES_EXTERN CARES_DEPRECATED_FOR(ares_send_dnsrec) void ares_send( ares_channel_t *channel, const unsigned char *qbuf, int qlen, @@ -655,12 +907,52 @@ CARES_EXTERN struct timeval *ares_timeout(const ares_channel_t *channel, struct timeval *maxtv, struct timeval *tv); -CARES_EXTERN CARES_DEPRECATED_FOR(ares_process_fd) void ares_process( +CARES_EXTERN CARES_DEPRECATED_FOR(ares_process_fds) void ares_process( ares_channel_t *channel, fd_set *read_fds, fd_set *write_fds); -CARES_EXTERN void ares_process_fd(ares_channel_t *channel, - ares_socket_t read_fd, - ares_socket_t write_fd); +/*! Events used by ares_fd_events_t */ +typedef enum { + ARES_FD_EVENT_NONE = 0, /*!< No events */ + ARES_FD_EVENT_READ = 1 << 0, /*!< Read event (including disconnect/error) */ + ARES_FD_EVENT_WRITE = 1 << 1 /*!< Write event */ +} ares_fd_eventflag_t; + +/*! Type holding a file descriptor and mask of events, used by + * ares_process_fds() */ +typedef struct { + ares_socket_t fd; /*!< File descriptor */ + unsigned int events; /*!< Mask of ares_fd_eventflag_t */ +} ares_fd_events_t; + +/*! Flags used by ares_process_fds() */ +typedef enum { + ARES_PROCESS_FLAG_NONE = 0, /*!< No flag value */ + ARES_PROCESS_FLAG_SKIP_NON_FD = 1 << 0 /*!< skip any processing unrelated to + * the file descriptor events passed + * in */ +} ares_process_flag_t; + +/*! Process events on multiple file descriptors based on the event mask + * associated with each file descriptor. Recommended over calling + * ares_process_fd() multiple times since it would trigger additional logic + * such as timeout processing on each call. + * + * \param[in] channel Initialized ares channel + * \param[in] events Array of file descriptors with events. May be NULL if + * no events, but may have timeouts to process. + * \param[in] nevents Number of elements in the events array. May be 0 if + * no events, but may have timeouts to process. + * \param[in] flags Flags to alter behavior of the process command. + * \return ARES_ENOMEM on out of memory, ARES_EFORMERR on misuse, + * otherwise ARES_SUCCESS + */ +CARES_EXTERN ares_status_t ares_process_fds(ares_channel_t *channel, + const ares_fd_events_t *events, + size_t nevents, unsigned int flags); + +CARES_EXTERN void ares_process_fd(ares_channel_t *channel, + ares_socket_t read_fd, + ares_socket_t write_fd); CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_record_create) int ares_create_query( const char *name, int dnsclass, int type, unsigned short id, int rd, diff --git a/deps/cares/include/ares_build.h b/deps/cares/include/ares_build.h index 18a92606a81714..aca66bebcd9b5c 100644 --- a/deps/cares/include/ares_build.h +++ b/deps/cares/include/ares_build.h @@ -165,7 +165,6 @@ # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(_WIN32) -# define WIN32_LEAN_AND_MEAN # define CARES_TYPEOF_ARES_SOCKLEN_T int # define CARES_HAVE_WINDOWS_H 1 # define CARES_HAVE_SYS_TYPES_H 1 diff --git a/deps/cares/include/ares_version.h b/deps/cares/include/ares_version.h index c910d79209a3fb..ba98e6949d53c8 100644 --- a/deps/cares/include/ares_version.h +++ b/deps/cares/include/ares_version.h @@ -31,14 +31,21 @@ #define ARES_COPYRIGHT "2004 - 2024 Daniel Stenberg, ." #define ARES_VERSION_MAJOR 1 -#define ARES_VERSION_MINOR 33 +#define ARES_VERSION_MINOR 34 #define ARES_VERSION_PATCH 1 + #define ARES_VERSION \ ((ARES_VERSION_MAJOR << 16) | (ARES_VERSION_MINOR << 8) | \ (ARES_VERSION_PATCH)) -#define ARES_VERSION_STR "1.33.1" -#define CARES_HAVE_ARES_LIBRARY_INIT 1 -#define CARES_HAVE_ARES_LIBRARY_CLEANUP 1 + +/* Need a level of indirection due to argument prescan to stringify a macro + * value. */ +#define ARES_STRINGIFY_PRE(s) #s +#define ARES_STRINGIFY(s) ARES_STRINGIFY_PRE(s) + +#define ARES_VERSION_STR \ + ARES_STRINGIFY(ARES_VERSION_MAJOR) \ + "." ARES_STRINGIFY(ARES_VERSION_MINOR) "." ARES_STRINGIFY(ARES_VERSION_PATCH) #endif diff --git a/deps/cares/m4/libtool.m4 b/deps/cares/m4/libtool.m4 index 79a2451ef520f2..e5ddacee99c5cd 100644 --- a/deps/cares/m4/libtool.m4 +++ b/deps/cares/m4/libtool.m4 @@ -1,6 +1,6 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Copyright (C) 1996-2001, 2003-2019, 2021-2024 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # @@ -9,13 +9,13 @@ # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl -# Copyright (C) 2014 Free Software Foundation, Inc. +# Copyright (C) 2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of of the License, or +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you @@ -32,7 +32,7 @@ m4_define([_LT_COPYING], [dnl # along with this program. If not, see . ]) -# serial 59 LT_INIT +# serial 62 LT_INIT # LT_PREREQ(VERSION) @@ -60,7 +60,7 @@ esac # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], -[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK +[AC_PREREQ([2.64])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl @@ -616,7 +616,7 @@ m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation +# AC_OUTPUT is called), in case it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} @@ -651,9 +651,9 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2011 Free Software Foundation, Inc. +Copyright (C) 2024 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." +gives unlimited permission to copy, distribute and modify it." while test 0 != $[#] do @@ -730,7 +730,6 @@ _LT_CONFIG_SAVE_COMMANDS([ cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. @@ -975,6 +974,7 @@ _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE + # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ @@ -1025,6 +1025,21 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ rm -f conftest.* fi]) + # Feature test to disable chained fixups since it is not + # compatible with '-undefined dynamic_lookup' + AC_CACHE_CHECK([for -no_fixup_chains linker flag], + [lt_cv_support_no_fixup_chains], + [ save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([],[])], + lt_cv_support_no_fixup_chains=yes, + lt_cv_support_no_fixup_chains=no + ) + LDFLAGS=$save_LDFLAGS + ] + ) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -1049,7 +1064,7 @@ _LT_EOF echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF -int main() { return 0;} +int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err @@ -1074,7 +1089,11 @@ _LT_EOF 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' + if test yes = "$lt_cv_support_no_fixup_chains"; then + AS_VAR_APPEND([_lt_dar_allow_undefined], [' $wl-no_fixup_chains']) + fi + ;; esac ;; esac @@ -1256,7 +1275,9 @@ lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` + # Trim trailing / since we'll always append absolute paths and we want + # to avoid //, if only for less confusing output for the user. + lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` fi ;; #( /*) @@ -1368,7 +1389,7 @@ mips64*-*linux*) ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) +s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when @@ -1383,7 +1404,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; - x86_64-*linux*) + x86_64-*linux*|x86_64-gnu*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" @@ -1412,7 +1433,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; - x86_64-*linux*) + x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) @@ -1495,7 +1516,7 @@ _LT_DECL([], [AR], [1], [The archiver]) # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have -# higher priority because thats what people were doing historically (setting +# higher priority because that's what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. @@ -1545,7 +1566,7 @@ AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) -AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_REQUIRE([AC_PROG_RANLIB]) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) @@ -1556,15 +1577,8 @@ old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -1703,7 +1717,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -1725,7 +1739,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) + darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1885,11 +1899,11 @@ else /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); +int fnord (void) __attribute__((visibility("default"))); #endif -int fnord () { return 42; } -int main () +int fnord (void) { return 42; } +int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; @@ -1946,7 +1960,7 @@ else lt_cv_dlopen_self=yes ;; - mingw* | pw32* | cegcc*) + mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; @@ -2314,7 +2328,7 @@ if test yes = "$GCC"; then *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; + mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` @@ -2372,7 +2386,7 @@ BEGIN {RS = " "; FS = "/|\n";} { # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` @@ -2447,7 +2461,7 @@ aix[[4-9]]*) # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the @@ -2541,7 +2555,7 @@ bsdi[[45]]*) # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no @@ -2552,6 +2566,19 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds + # If user builds GCC with mulitlibs enabled, + # it should just install on $(libdir) + # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. + if test yes = $multilib; then + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + $install_prog $dir/$dlname $destdir/$dlname~ + chmod a+x $destdir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib $destdir/$dlname'\'' || exit \$?; + fi' + else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ @@ -2561,6 +2588,7 @@ cygwin* | mingw* | pw32* | cegcc*) if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' + fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' @@ -2573,7 +2601,7 @@ cygwin* | mingw* | pw32* | cegcc*) m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; - mingw* | cegcc*) + mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; @@ -2592,7 +2620,7 @@ m4_if([$1], [],[ library_names_spec='$libname.dll.lib' case $build_os in - mingw*) + mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' @@ -2699,7 +2727,21 @@ freebsd* | dragonfly* | midnightbsd*) need_version=yes ;; esac - shlibpath_var=LD_LIBRARY_PATH + case $host_cpu in + powerpc64) + # On FreeBSD bi-arch platforms, a different variable is used for 32-bit + # binaries. See . + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[int test_pointer_size[sizeof (void *) - 5]; + ]])], + [shlibpath_var=LD_LIBRARY_PATH], + [shlibpath_var=LD_32_LIBRARY_PATH]) + ;; + *) + shlibpath_var=LD_LIBRARY_PATH + ;; + esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes @@ -2840,7 +2882,7 @@ linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext' + library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH @@ -2852,8 +2894,9 @@ linux*android*) hardcode_into_libs=yes dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + # -rpath works at least for libraries that are not overridden by + # libraries installed in system locations. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. @@ -2887,7 +2930,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) # before this can be enabled. hardcode_into_libs=yes - # Ideally, we could use ldconfig to report *all* directores which are + # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, @@ -2944,7 +2987,7 @@ newsos6) dynamic_linker='ldqnx.so' ;; -openbsd* | bitrig*) +openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no @@ -3276,7 +3319,7 @@ if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in - *-*-mingw*) + *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) @@ -3385,7 +3428,7 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi @@ -3457,7 +3500,6 @@ lt_cv_deplibs_check_method='unknown' # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure @@ -3484,7 +3526,7 @@ cygwin*) lt_cv_file_magic_cmd='func_win32_libid' ;; -mingw* | pw32*) +mingw* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. @@ -3493,7 +3535,7 @@ mingw* | pw32*) lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; @@ -3584,7 +3626,7 @@ newos6*) lt_cv_deplibs_check_method=pass_all ;; -openbsd* | bitrig*) +openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else @@ -3648,7 +3690,7 @@ file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in - mingw* | pw32*) + mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else @@ -3700,7 +3742,7 @@ else # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; + mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in @@ -3791,7 +3833,7 @@ lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in @@ -3823,16 +3865,16 @@ _LT_DECL([], [sharedlib_from_linklib_cmd], [1], m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], - [lt_cv_path_mainfest_tool=no +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_manifest_tool], + [lt_cv_path_manifest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes + lt_cv_path_manifest_tool=yes fi rm -f conftest*]) -if test yes != "$lt_cv_path_mainfest_tool"; then +if test yes != "$lt_cv_path_manifest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl @@ -3861,7 +3903,7 @@ AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-mingw* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -3936,7 +3978,7 @@ case $host_os in aix*) symcode='[[BCDT]]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) @@ -3951,7 +3993,7 @@ osf*) symcode='[[BCDEGQRST]]' ;; solaris*) - symcode='[[BDRT]]' + symcode='[[BCDRT]]' ;; sco3.2v5*) symcode='[[DT]]' @@ -4015,7 +4057,7 @@ $lt_c_name_lib_hook\ # Handle CRLF in mingw tool chain opt_cr= case $build_os in -mingw*) +mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac @@ -4066,7 +4108,7 @@ void nm_test_func(void){} #ifdef __cplusplus } #endif -int main(){nm_test_var='a';nm_test_func();return(0);} +int main(void){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then @@ -4242,7 +4284,7 @@ m4_if([$1], [CXX], [ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -4318,7 +4360,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], @@ -4566,7 +4608,7 @@ m4_if([$1], [CXX], [ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -4670,7 +4712,7 @@ m4_if([$1], [CXX], [ esac ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], @@ -4712,6 +4754,12 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; + *flang* | ftn) + # Flang compiler. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -4945,7 +4993,7 @@ m4_if([$1], [CXX], [ pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) case $cc_basename in cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' @@ -5003,7 +5051,7 @@ dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. @@ -5015,7 +5063,7 @@ dnl Note also adjust exclude_expsyms for C++ above. # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; - openbsd* | bitrig*) + openbsd*) with_gnu_ld=no ;; esac @@ -5118,7 +5166,7 @@ _LT_EOF fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' @@ -5174,7 +5222,7 @@ _LT_EOF cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; @@ -5575,7 +5623,7 @@ _LT_EOF _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -5592,14 +5640,14 @@ _LT_EOF # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -Fe $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + $CC -Fe $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' @@ -5837,7 +5885,7 @@ _LT_EOF *nto* | *qnx*) ;; - openbsd* | bitrig*) + openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -5880,7 +5928,7 @@ _LT_EOF cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; @@ -6174,7 +6222,7 @@ _LT_TAGDECL([], [hardcode_direct], [0], _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting $shlibpath_var if the + "absolute", i.e. impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR @@ -6232,7 +6280,7 @@ _LT_TAGVAR(objext, $1)=$objext lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' +lt_simple_link_test_code='int main(void){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other @@ -6421,8 +6469,7 @@ if test yes != "$_lt_caught_CXX_error"; then wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= @@ -6442,7 +6489,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' else GXX=no @@ -6651,7 +6698,7 @@ if test yes != "$_lt_caught_CXX_error"; then esac ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC @@ -6750,7 +6797,7 @@ if test yes != "$_lt_caught_CXX_error"; then cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; @@ -6818,7 +6865,7 @@ if test yes != "$_lt_caught_CXX_error"; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -6883,7 +6930,7 @@ if test yes != "$_lt_caught_CXX_error"; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -7131,7 +7178,7 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(ld_shlibs, $1)=yes ;; - openbsd* | bitrig*) + openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -7222,7 +7269,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' else # FIXME: insert proper C++ library support @@ -7306,7 +7353,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. @@ -7317,7 +7364,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' @@ -7555,10 +7602,11 @@ if AC_TRY_EVAL(ac_compile); then case $prev$p in -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. + # Some compilers place space between "-{L,R,l}" and the path. # Remove the space. - if test x-L = "$p" || - test x-R = "$p"; then + if test x-L = x"$p" || + test x-R = x"$p" || + test x-l = x"$p"; then prev=$p continue fi @@ -8216,7 +8264,7 @@ AC_SUBST([DLLTOOL]) # ---------------- # Check for a file(cmd) program that can be used to detect file type and magic m4_defun([_LT_DECL_FILECMD], -[AC_CHECK_TOOL([FILECMD], [file], [:]) +[AC_CHECK_PROG([FILECMD], [file], [file], [:]) _LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) ])# _LD_DECL_FILECMD @@ -8232,73 +8280,6 @@ _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED - -m4_ifndef([AC_PROG_SED], [ -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ - -m4_defun([AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f "$lt_ac_sed" && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test 10 -lt "$lt_ac_count" && break - lt_ac_count=`expr $lt_ac_count + 1` - if test "$lt_ac_count" -gt "$lt_ac_max"; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_SUBST([SED]) -AC_MSG_RESULT([$SED]) -])#AC_PROG_SED -])#m4_ifndef - -# Old name: -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) @@ -8345,7 +8326,7 @@ AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) @@ -8358,7 +8339,7 @@ AC_CACHE_VAL(lt_cv_to_host_file_cmd, ;; *-*-cygwin* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) @@ -8384,9 +8365,9 @@ AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in - *-*-mingw* ) + *-*-mingw* | *-*-windows* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac diff --git a/deps/cares/m4/ltoptions.m4 b/deps/cares/m4/ltoptions.m4 index b0b5e9c2126062..25caa890298a4e 100644 --- a/deps/cares/m4/ltoptions.m4 +++ b/deps/cares/m4/ltoptions.m4 @@ -1,6 +1,6 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2024 Free # Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # @@ -8,7 +8,7 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 8 ltoptions.m4 +# serial 10 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -128,7 +128,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) @@ -323,29 +323,39 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- -# implement the --with-aix-soname flag, and support the `aix-soname=aix' -# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT -# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +# implement the --enable-aix-soname configure option, and support the +# `aix-soname=aix' and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. +# DEFAULT is either `aix', `both', or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) - AC_ARG_WITH([aix-soname], - [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + AC_ARG_ENABLE([aix-soname], + [AS_HELP_STRING([--enable-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], - [case $withval in - aix|svr4|both) - ;; - *) - AC_MSG_ERROR([Unknown argument to --with-aix-soname]) - ;; - esac - lt_cv_with_aix_soname=$with_aix_soname], - [AC_CACHE_VAL([lt_cv_with_aix_soname], - [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) - with_aix_soname=$lt_cv_with_aix_soname]) + [case $enableval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --enable-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$enable_aix_soname], + [_AC_ENABLE_IF([with], [aix-soname], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)]) + enable_aix_soname=$lt_cv_with_aix_soname]) + with_aix_soname=$enable_aix_soname AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member @@ -376,30 +386,50 @@ LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- -# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' +# implement the --enable-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], -[AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], +[AC_ARG_ENABLE([pic], + [AS_HELP_STRING([--enable-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for lt_pkg in $withval; do - IFS=$lt_save_ifs - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [pic_mode=m4_default([$1], [default])]) + case $enableval in + yes|no) pic_mode=$enableval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [dnl Continue to support --with-pic and --without-pic, for backward + dnl compatibility. + _AC_ENABLE_IF([with], [pic], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [pic_mode=m4_default([$1], [default])])] + ) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC diff --git a/deps/cares/m4/ltsugar.m4 b/deps/cares/m4/ltsugar.m4 index 902508bd93aec6..5b5c80a3ad78a1 100644 --- a/deps/cares/m4/ltsugar.m4 +++ b/deps/cares/m4/ltsugar.m4 @@ -1,6 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2024 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # diff --git a/deps/cares/m4/ltversion.m4 b/deps/cares/m4/ltversion.m4 index b155d0aceca376..149c9719fa5983 100644 --- a/deps/cares/m4/ltversion.m4 +++ b/deps/cares/m4/ltversion.m4 @@ -1,6 +1,6 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Copyright (C) 2004, 2011-2019, 2021-2024 Free Software Foundation, # Inc. # Written by Scott James Remnant, 2004 # @@ -10,15 +10,15 @@ # @configure_input@ -# serial 4245 ltversion.m4 +# serial 4392 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.7]) -m4_define([LT_PACKAGE_REVISION], [2.4.7]) +m4_define([LT_PACKAGE_VERSION], [2.5.3]) +m4_define([LT_PACKAGE_REVISION], [2.5.3]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.7' -macro_revision='2.4.7' +[macro_version='2.5.3' +macro_revision='2.5.3' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/deps/cares/m4/lt~obsolete.m4 b/deps/cares/m4/lt~obsolete.m4 index 0f7a8759da8d46..22b5346973571a 100644 --- a/deps/cares/m4/lt~obsolete.m4 +++ b/deps/cares/m4/lt~obsolete.m4 @@ -1,6 +1,6 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free +# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2024 Free # Software Foundation, Inc. # Written by Scott James Remnant, 2004. # diff --git a/deps/cares/src/lib/CMakeLists.txt b/deps/cares/src/lib/CMakeLists.txt index ef0acf371ff091..9956fd625b2ad6 100644 --- a/deps/cares/src/lib/CMakeLists.txt +++ b/deps/cares/src/lib/CMakeLists.txt @@ -53,6 +53,7 @@ IF (CARES_SHARED) "$" "$" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/include" ) TARGET_COMPILE_DEFINITIONS (${PROJECT_NAME} PRIVATE HAVE_CONFIG_H=1 CARES_BUILDING_LIBRARY) @@ -110,6 +111,7 @@ IF (CARES_STATIC) "$" "$" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/include" ) TARGET_COMPILE_DEFINITIONS (${LIBNAME} PRIVATE HAVE_CONFIG_H=1 CARES_BUILDING_LIBRARY) diff --git a/deps/cares/src/lib/Makefile.am b/deps/cares/src/lib/Makefile.am index 44e04bd35ccf7d..db4f2640f2bd40 100644 --- a/deps/cares/src/lib/Makefile.am +++ b/deps/cares/src/lib/Makefile.am @@ -11,7 +11,8 @@ ACLOCAL_AMFLAGS = -I m4 --install AM_CPPFLAGS += -I$(top_builddir)/include \ -I$(top_builddir)/src/lib \ -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/lib + -I$(top_srcdir)/src/lib \ + -I$(top_srcdir)/src/lib/include lib_LTLIBRARIES = libcares.la diff --git a/deps/cares/src/lib/Makefile.in b/deps/cares/src/lib/Makefile.in index 30d33843d5d2d8..6fdb27835828af 100644 --- a/deps/cares/src/lib/Makefile.in +++ b/deps/cares/src/lib/Makefile.in @@ -15,7 +15,7 @@ @SET_MAKE@ # aminclude_static.am generated automatically by Autoconf -# from AX_AM_MACROS_STATIC on Fri Aug 23 09:37:25 EDT 2024 +# from AX_AM_MACROS_STATIC on Wed Oct 9 20:58:25 EDT 2024 # Copyright (C) The c-ares project and its contributors # SPDX-License-Identifier: MIT @@ -162,13 +162,10 @@ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libcares_la_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp -am__objects_1 = libcares_la-ares__addrinfo2hostent.lo \ - libcares_la-ares__addrinfo_localhost.lo \ - libcares_la-ares__close_sockets.lo \ - libcares_la-ares__hosts_file.lo \ - libcares_la-ares__parse_into_addrinfo.lo \ - libcares_la-ares__socket.lo libcares_la-ares__sortaddrinfo.lo \ +am__objects_1 = libcares_la-ares_addrinfo2hostent.lo \ + libcares_la-ares_addrinfo_localhost.lo \ libcares_la-ares_android.lo libcares_la-ares_cancel.lo \ + libcares_la-ares_close_sockets.lo libcares_la-ares_conn.lo \ libcares_la-ares_cookie.lo libcares_la-ares_data.lo \ libcares_la-ares_destroy.lo libcares_la-ares_free_hostent.lo \ libcares_la-ares_free_string.lo \ @@ -176,25 +173,30 @@ am__objects_1 = libcares_la-ares__addrinfo2hostent.lo \ libcares_la-ares_getaddrinfo.lo libcares_la-ares_getenv.lo \ libcares_la-ares_gethostbyaddr.lo \ libcares_la-ares_gethostbyname.lo \ - libcares_la-ares_getnameinfo.lo libcares_la-ares_init.lo \ - libcares_la-ares_library_init.lo libcares_la-ares_metrics.lo \ - libcares_la-ares_options.lo libcares_la-ares_platform.lo \ + libcares_la-ares_getnameinfo.lo libcares_la-ares_hosts_file.lo \ + libcares_la-ares_init.lo libcares_la-ares_library_init.lo \ + libcares_la-ares_metrics.lo libcares_la-ares_options.lo \ + libcares_la-ares_parse_into_addrinfo.lo \ libcares_la-ares_process.lo libcares_la-ares_qcache.lo \ libcares_la-ares_query.lo libcares_la-ares_search.lo \ - libcares_la-ares_send.lo libcares_la-ares_strerror.lo \ - libcares_la-ares_sysconfig.lo \ + libcares_la-ares_send.lo \ + libcares_la-ares_set_socket_functions.lo \ + libcares_la-ares_socket.lo libcares_la-ares_sortaddrinfo.lo \ + libcares_la-ares_strerror.lo libcares_la-ares_sysconfig.lo \ libcares_la-ares_sysconfig_files.lo \ libcares_la-ares_sysconfig_mac.lo \ libcares_la-ares_sysconfig_win.lo libcares_la-ares_timeout.lo \ libcares_la-ares_update_servers.lo libcares_la-ares_version.lo \ libcares_la-inet_net_pton.lo libcares_la-inet_ntop.lo \ - libcares_la-windows_port.lo dsa/libcares_la-ares__array.lo \ - dsa/libcares_la-ares__htable.lo \ - dsa/libcares_la-ares__htable_asvp.lo \ - dsa/libcares_la-ares__htable_strvp.lo \ - dsa/libcares_la-ares__htable_szvp.lo \ - dsa/libcares_la-ares__htable_vpvp.lo \ - dsa/libcares_la-ares__llist.lo dsa/libcares_la-ares__slist.lo \ + libcares_la-windows_port.lo dsa/libcares_la-ares_array.lo \ + dsa/libcares_la-ares_htable.lo \ + dsa/libcares_la-ares_htable_asvp.lo \ + dsa/libcares_la-ares_htable_dict.lo \ + dsa/libcares_la-ares_htable_strvp.lo \ + dsa/libcares_la-ares_htable_szvp.lo \ + dsa/libcares_la-ares_htable_vpstr.lo \ + dsa/libcares_la-ares_htable_vpvp.lo \ + dsa/libcares_la-ares_llist.lo dsa/libcares_la-ares_slist.lo \ event/libcares_la-ares_event_configchg.lo \ event/libcares_la-ares_event_epoll.lo \ event/libcares_la-ares_event_kqueue.lo \ @@ -225,13 +227,12 @@ am__objects_1 = libcares_la-ares__addrinfo2hostent.lo \ record/libcares_la-ares_dns_parse.lo \ record/libcares_la-ares_dns_record.lo \ record/libcares_la-ares_dns_write.lo \ - str/libcares_la-ares__buf.lo \ - str/libcares_la-ares_strcasecmp.lo str/libcares_la-ares_str.lo \ + str/libcares_la-ares_buf.lo str/libcares_la-ares_str.lo \ str/libcares_la-ares_strsplit.lo \ - util/libcares_la-ares__iface_ips.lo \ - util/libcares_la-ares__threads.lo \ - util/libcares_la-ares__timeval.lo \ - util/libcares_la-ares_math.lo util/libcares_la-ares_rand.lo + util/libcares_la-ares_iface_ips.lo \ + util/libcares_la-ares_threads.lo \ + util/libcares_la-ares_timeval.lo util/libcares_la-ares_math.lo \ + util/libcares_la-ares_rand.lo util/libcares_la-ares_uri.lo am__objects_2 = am_libcares_la_OBJECTS = $(am__objects_1) $(am__objects_2) libcares_la_OBJECTS = $(am_libcares_la_OBJECTS) @@ -258,15 +259,12 @@ DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = \ - ./$(DEPDIR)/libcares_la-ares__addrinfo2hostent.Plo \ - ./$(DEPDIR)/libcares_la-ares__addrinfo_localhost.Plo \ - ./$(DEPDIR)/libcares_la-ares__close_sockets.Plo \ - ./$(DEPDIR)/libcares_la-ares__hosts_file.Plo \ - ./$(DEPDIR)/libcares_la-ares__parse_into_addrinfo.Plo \ - ./$(DEPDIR)/libcares_la-ares__socket.Plo \ - ./$(DEPDIR)/libcares_la-ares__sortaddrinfo.Plo \ + ./$(DEPDIR)/libcares_la-ares_addrinfo2hostent.Plo \ + ./$(DEPDIR)/libcares_la-ares_addrinfo_localhost.Plo \ ./$(DEPDIR)/libcares_la-ares_android.Plo \ ./$(DEPDIR)/libcares_la-ares_cancel.Plo \ + ./$(DEPDIR)/libcares_la-ares_close_sockets.Plo \ + ./$(DEPDIR)/libcares_la-ares_conn.Plo \ ./$(DEPDIR)/libcares_la-ares_cookie.Plo \ ./$(DEPDIR)/libcares_la-ares_data.Plo \ ./$(DEPDIR)/libcares_la-ares_destroy.Plo \ @@ -278,16 +276,20 @@ am__depfiles_remade = \ ./$(DEPDIR)/libcares_la-ares_gethostbyaddr.Plo \ ./$(DEPDIR)/libcares_la-ares_gethostbyname.Plo \ ./$(DEPDIR)/libcares_la-ares_getnameinfo.Plo \ + ./$(DEPDIR)/libcares_la-ares_hosts_file.Plo \ ./$(DEPDIR)/libcares_la-ares_init.Plo \ ./$(DEPDIR)/libcares_la-ares_library_init.Plo \ ./$(DEPDIR)/libcares_la-ares_metrics.Plo \ ./$(DEPDIR)/libcares_la-ares_options.Plo \ - ./$(DEPDIR)/libcares_la-ares_platform.Plo \ + ./$(DEPDIR)/libcares_la-ares_parse_into_addrinfo.Plo \ ./$(DEPDIR)/libcares_la-ares_process.Plo \ ./$(DEPDIR)/libcares_la-ares_qcache.Plo \ ./$(DEPDIR)/libcares_la-ares_query.Plo \ ./$(DEPDIR)/libcares_la-ares_search.Plo \ ./$(DEPDIR)/libcares_la-ares_send.Plo \ + ./$(DEPDIR)/libcares_la-ares_set_socket_functions.Plo \ + ./$(DEPDIR)/libcares_la-ares_socket.Plo \ + ./$(DEPDIR)/libcares_la-ares_sortaddrinfo.Plo \ ./$(DEPDIR)/libcares_la-ares_strerror.Plo \ ./$(DEPDIR)/libcares_la-ares_sysconfig.Plo \ ./$(DEPDIR)/libcares_la-ares_sysconfig_files.Plo \ @@ -299,14 +301,16 @@ am__depfiles_remade = \ ./$(DEPDIR)/libcares_la-inet_net_pton.Plo \ ./$(DEPDIR)/libcares_la-inet_ntop.Plo \ ./$(DEPDIR)/libcares_la-windows_port.Plo \ - dsa/$(DEPDIR)/libcares_la-ares__array.Plo \ - dsa/$(DEPDIR)/libcares_la-ares__htable.Plo \ - dsa/$(DEPDIR)/libcares_la-ares__htable_asvp.Plo \ - dsa/$(DEPDIR)/libcares_la-ares__htable_strvp.Plo \ - dsa/$(DEPDIR)/libcares_la-ares__htable_szvp.Plo \ - dsa/$(DEPDIR)/libcares_la-ares__htable_vpvp.Plo \ - dsa/$(DEPDIR)/libcares_la-ares__llist.Plo \ - dsa/$(DEPDIR)/libcares_la-ares__slist.Plo \ + dsa/$(DEPDIR)/libcares_la-ares_array.Plo \ + dsa/$(DEPDIR)/libcares_la-ares_htable.Plo \ + dsa/$(DEPDIR)/libcares_la-ares_htable_asvp.Plo \ + dsa/$(DEPDIR)/libcares_la-ares_htable_dict.Plo \ + dsa/$(DEPDIR)/libcares_la-ares_htable_strvp.Plo \ + dsa/$(DEPDIR)/libcares_la-ares_htable_szvp.Plo \ + dsa/$(DEPDIR)/libcares_la-ares_htable_vpstr.Plo \ + dsa/$(DEPDIR)/libcares_la-ares_htable_vpvp.Plo \ + dsa/$(DEPDIR)/libcares_la-ares_llist.Plo \ + dsa/$(DEPDIR)/libcares_la-ares_slist.Plo \ event/$(DEPDIR)/libcares_la-ares_event_configchg.Plo \ event/$(DEPDIR)/libcares_la-ares_event_epoll.Plo \ event/$(DEPDIR)/libcares_la-ares_event_kqueue.Plo \ @@ -337,15 +341,15 @@ am__depfiles_remade = \ record/$(DEPDIR)/libcares_la-ares_dns_parse.Plo \ record/$(DEPDIR)/libcares_la-ares_dns_record.Plo \ record/$(DEPDIR)/libcares_la-ares_dns_write.Plo \ - str/$(DEPDIR)/libcares_la-ares__buf.Plo \ + str/$(DEPDIR)/libcares_la-ares_buf.Plo \ str/$(DEPDIR)/libcares_la-ares_str.Plo \ - str/$(DEPDIR)/libcares_la-ares_strcasecmp.Plo \ str/$(DEPDIR)/libcares_la-ares_strsplit.Plo \ - util/$(DEPDIR)/libcares_la-ares__iface_ips.Plo \ - util/$(DEPDIR)/libcares_la-ares__threads.Plo \ - util/$(DEPDIR)/libcares_la-ares__timeval.Plo \ + util/$(DEPDIR)/libcares_la-ares_iface_ips.Plo \ util/$(DEPDIR)/libcares_la-ares_math.Plo \ - util/$(DEPDIR)/libcares_la-ares_rand.Plo + util/$(DEPDIR)/libcares_la-ares_rand.Plo \ + util/$(DEPDIR)/libcares_la-ares_threads.Plo \ + util/$(DEPDIR)/libcares_la-ares_timeval.Plo \ + util/$(DEPDIR)/libcares_la-ares_uri.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -445,7 +449,7 @@ AM_CFLAGS = @AM_CFLAGS@ # might possibly already be installed in the system. AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_builddir)/include \ -I$(top_builddir)/src/lib -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/lib + -I$(top_srcdir)/src/lib -I$(top_srcdir)/src/lib/include AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ @@ -643,15 +647,12 @@ libcares_la_CPPFLAGS_EXTRA = -DCARES_BUILDING_LIBRARY $(am__append_3) \ libcares_la_LIBS = $(CODE_COVERAGE_LIBS) libcares_la_CFLAGS = $(AM_CFLAGS) $(libcares_la_CFLAGS_EXTRA) libcares_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcares_la_CPPFLAGS_EXTRA) -CSOURCES = ares__addrinfo2hostent.c \ - ares__addrinfo_localhost.c \ - ares__close_sockets.c \ - ares__hosts_file.c \ - ares__parse_into_addrinfo.c \ - ares__socket.c \ - ares__sortaddrinfo.c \ +CSOURCES = ares_addrinfo2hostent.c \ + ares_addrinfo_localhost.c \ ares_android.c \ ares_cancel.c \ + ares_close_sockets.c \ + ares_conn.c \ ares_cookie.c \ ares_data.c \ ares_destroy.c \ @@ -663,16 +664,20 @@ CSOURCES = ares__addrinfo2hostent.c \ ares_gethostbyaddr.c \ ares_gethostbyname.c \ ares_getnameinfo.c \ + ares_hosts_file.c \ ares_init.c \ ares_library_init.c \ ares_metrics.c \ ares_options.c \ - ares_platform.c \ + ares_parse_into_addrinfo.c \ ares_process.c \ ares_qcache.c \ ares_query.c \ ares_search.c \ ares_send.c \ + ares_set_socket_functions.c \ + ares_socket.c \ + ares_sortaddrinfo.c \ ares_strerror.c \ ares_sysconfig.c \ ares_sysconfig_files.c \ @@ -684,14 +689,16 @@ CSOURCES = ares__addrinfo2hostent.c \ inet_net_pton.c \ inet_ntop.c \ windows_port.c \ - dsa/ares__array.c \ - dsa/ares__htable.c \ - dsa/ares__htable_asvp.c \ - dsa/ares__htable_strvp.c \ - dsa/ares__htable_szvp.c \ - dsa/ares__htable_vpvp.c \ - dsa/ares__llist.c \ - dsa/ares__slist.c \ + dsa/ares_array.c \ + dsa/ares_htable.c \ + dsa/ares_htable_asvp.c \ + dsa/ares_htable_dict.c \ + dsa/ares_htable_strvp.c \ + dsa/ares_htable_szvp.c \ + dsa/ares_htable_vpstr.c \ + dsa/ares_htable_vpvp.c \ + dsa/ares_llist.c \ + dsa/ares_slist.c \ event/ares_event_configchg.c \ event/ares_event_epoll.c \ event/ares_event_kqueue.c \ @@ -722,42 +729,49 @@ CSOURCES = ares__addrinfo2hostent.c \ record/ares_dns_parse.c \ record/ares_dns_record.c \ record/ares_dns_write.c \ - str/ares__buf.c \ - str/ares_strcasecmp.c \ + str/ares_buf.c \ str/ares_str.c \ str/ares_strsplit.c \ - util/ares__iface_ips.c \ - util/ares__threads.c \ - util/ares__timeval.c \ + util/ares_iface_ips.c \ + util/ares_threads.c \ + util/ares_timeval.c \ util/ares_math.c \ - util/ares_rand.c + util/ares_rand.c \ + util/ares_uri.c HHEADERS = ares_android.h \ + ares_conn.h \ ares_data.h \ ares_getenv.h \ ares_inet_net_pton.h \ ares_ipv6.h \ - ares_platform.h \ ares_private.h \ ares_setup.h \ - dsa/ares__array.h \ - dsa/ares__htable.h \ - dsa/ares__htable_asvp.h \ - dsa/ares__htable_strvp.h \ - dsa/ares__htable_szvp.h \ - dsa/ares__htable_vpvp.h \ - dsa/ares__llist.h \ - dsa/ares__slist.h \ + ares_socket.h \ + dsa/ares_htable.h \ + dsa/ares_slist.h \ event/ares_event.h \ event/ares_event_win32.h \ + include/ares_array.h \ + include/ares_buf.h \ + include/ares_htable_asvp.h \ + include/ares_htable_dict.h \ + include/ares_htable_strvp.h \ + include/ares_htable_szvp.h \ + include/ares_htable_vpstr.h \ + include/ares_htable_vpvp.h \ + include/ares_llist.h \ + include/ares_mem.h \ + include/ares_str.h \ record/ares_dns_multistring.h \ record/ares_dns_private.h \ - str/ares__buf.h \ - str/ares_strcasecmp.h \ - str/ares_str.h \ str/ares_strsplit.h \ - util/ares__iface_ips.h \ - util/ares__threads.h \ + util/ares_iface_ips.h \ + util/ares_math.h \ + util/ares_rand.h \ + util/ares_time.h \ + util/ares_threads.h \ + util/ares_uri.h \ thirdparty/apple/dnsinfo.h @@ -852,21 +866,25 @@ dsa/$(am__dirstamp): dsa/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) dsa/$(DEPDIR) @: >>dsa/$(DEPDIR)/$(am__dirstamp) -dsa/libcares_la-ares__array.lo: dsa/$(am__dirstamp) \ +dsa/libcares_la-ares_array.lo: dsa/$(am__dirstamp) \ dsa/$(DEPDIR)/$(am__dirstamp) -dsa/libcares_la-ares__htable.lo: dsa/$(am__dirstamp) \ +dsa/libcares_la-ares_htable.lo: dsa/$(am__dirstamp) \ dsa/$(DEPDIR)/$(am__dirstamp) -dsa/libcares_la-ares__htable_asvp.lo: dsa/$(am__dirstamp) \ +dsa/libcares_la-ares_htable_asvp.lo: dsa/$(am__dirstamp) \ dsa/$(DEPDIR)/$(am__dirstamp) -dsa/libcares_la-ares__htable_strvp.lo: dsa/$(am__dirstamp) \ +dsa/libcares_la-ares_htable_dict.lo: dsa/$(am__dirstamp) \ dsa/$(DEPDIR)/$(am__dirstamp) -dsa/libcares_la-ares__htable_szvp.lo: dsa/$(am__dirstamp) \ +dsa/libcares_la-ares_htable_strvp.lo: dsa/$(am__dirstamp) \ dsa/$(DEPDIR)/$(am__dirstamp) -dsa/libcares_la-ares__htable_vpvp.lo: dsa/$(am__dirstamp) \ +dsa/libcares_la-ares_htable_szvp.lo: dsa/$(am__dirstamp) \ dsa/$(DEPDIR)/$(am__dirstamp) -dsa/libcares_la-ares__llist.lo: dsa/$(am__dirstamp) \ +dsa/libcares_la-ares_htable_vpstr.lo: dsa/$(am__dirstamp) \ dsa/$(DEPDIR)/$(am__dirstamp) -dsa/libcares_la-ares__slist.lo: dsa/$(am__dirstamp) \ +dsa/libcares_la-ares_htable_vpvp.lo: dsa/$(am__dirstamp) \ + dsa/$(DEPDIR)/$(am__dirstamp) +dsa/libcares_la-ares_llist.lo: dsa/$(am__dirstamp) \ + dsa/$(DEPDIR)/$(am__dirstamp) +dsa/libcares_la-ares_slist.lo: dsa/$(am__dirstamp) \ dsa/$(DEPDIR)/$(am__dirstamp) event/$(am__dirstamp): @$(MKDIR_P) event @@ -952,9 +970,7 @@ str/$(am__dirstamp): str/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) str/$(DEPDIR) @: >>str/$(DEPDIR)/$(am__dirstamp) -str/libcares_la-ares__buf.lo: str/$(am__dirstamp) \ - str/$(DEPDIR)/$(am__dirstamp) -str/libcares_la-ares_strcasecmp.lo: str/$(am__dirstamp) \ +str/libcares_la-ares_buf.lo: str/$(am__dirstamp) \ str/$(DEPDIR)/$(am__dirstamp) str/libcares_la-ares_str.lo: str/$(am__dirstamp) \ str/$(DEPDIR)/$(am__dirstamp) @@ -966,16 +982,18 @@ util/$(am__dirstamp): util/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) util/$(DEPDIR) @: >>util/$(DEPDIR)/$(am__dirstamp) -util/libcares_la-ares__iface_ips.lo: util/$(am__dirstamp) \ +util/libcares_la-ares_iface_ips.lo: util/$(am__dirstamp) \ util/$(DEPDIR)/$(am__dirstamp) -util/libcares_la-ares__threads.lo: util/$(am__dirstamp) \ +util/libcares_la-ares_threads.lo: util/$(am__dirstamp) \ util/$(DEPDIR)/$(am__dirstamp) -util/libcares_la-ares__timeval.lo: util/$(am__dirstamp) \ +util/libcares_la-ares_timeval.lo: util/$(am__dirstamp) \ util/$(DEPDIR)/$(am__dirstamp) util/libcares_la-ares_math.lo: util/$(am__dirstamp) \ util/$(DEPDIR)/$(am__dirstamp) util/libcares_la-ares_rand.lo: util/$(am__dirstamp) \ util/$(DEPDIR)/$(am__dirstamp) +util/libcares_la-ares_uri.lo: util/$(am__dirstamp) \ + util/$(DEPDIR)/$(am__dirstamp) libcares.la: $(libcares_la_OBJECTS) $(libcares_la_DEPENDENCIES) $(EXTRA_libcares_la_DEPENDENCIES) $(AM_V_CCLD)$(libcares_la_LINK) -rpath $(libdir) $(libcares_la_OBJECTS) $(libcares_la_LIBADD) $(LIBS) @@ -998,15 +1016,12 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares__addrinfo2hostent.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares__addrinfo_localhost.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares__close_sockets.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares__hosts_file.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares__parse_into_addrinfo.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares__socket.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares__sortaddrinfo.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_addrinfo2hostent.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_addrinfo_localhost.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_android.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_cancel.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_close_sockets.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_cookie.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_data.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_destroy.Plo@am__quote@ # am--include-marker @@ -1018,16 +1033,20 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_gethostbyaddr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_gethostbyname.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_getnameinfo.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_hosts_file.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_init.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_library_init.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_metrics.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_options.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_platform.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_parse_into_addrinfo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_process.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_qcache.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_query.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_search.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_send.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_set_socket_functions.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_socket.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_sortaddrinfo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_strerror.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_sysconfig.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-ares_sysconfig_files.Plo@am__quote@ # am--include-marker @@ -1039,14 +1058,16 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-inet_net_pton.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-inet_ntop.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcares_la-windows_port.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares__array.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares__htable.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares__htable_asvp.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares__htable_strvp.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares__htable_szvp.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares__htable_vpvp.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares__llist.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares__slist.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares_array.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares_htable.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares_htable_asvp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares_htable_dict.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares_htable_strvp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares_htable_szvp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares_htable_vpstr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares_htable_vpvp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares_llist.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcares_la-ares_slist.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@event/$(DEPDIR)/libcares_la-ares_event_configchg.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@event/$(DEPDIR)/libcares_la-ares_event_epoll.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@event/$(DEPDIR)/libcares_la-ares_event_kqueue.Plo@am__quote@ # am--include-marker @@ -1077,15 +1098,15 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@record/$(DEPDIR)/libcares_la-ares_dns_parse.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@record/$(DEPDIR)/libcares_la-ares_dns_record.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@record/$(DEPDIR)/libcares_la-ares_dns_write.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@str/$(DEPDIR)/libcares_la-ares__buf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@str/$(DEPDIR)/libcares_la-ares_buf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@str/$(DEPDIR)/libcares_la-ares_str.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@str/$(DEPDIR)/libcares_la-ares_strcasecmp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@str/$(DEPDIR)/libcares_la-ares_strsplit.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/libcares_la-ares__iface_ips.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/libcares_la-ares__threads.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/libcares_la-ares__timeval.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/libcares_la-ares_iface_ips.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/libcares_la-ares_math.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/libcares_la-ares_rand.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/libcares_la-ares_threads.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/libcares_la-ares_timeval.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/libcares_la-ares_uri.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @@ -1117,54 +1138,19 @@ am--depfiles: $(am__depfiles_remade) @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -libcares_la-ares__addrinfo2hostent.lo: ares__addrinfo2hostent.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares__addrinfo2hostent.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares__addrinfo2hostent.Tpo -c -o libcares_la-ares__addrinfo2hostent.lo `test -f 'ares__addrinfo2hostent.c' || echo '$(srcdir)/'`ares__addrinfo2hostent.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares__addrinfo2hostent.Tpo $(DEPDIR)/libcares_la-ares__addrinfo2hostent.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares__addrinfo2hostent.c' object='libcares_la-ares__addrinfo2hostent.lo' libtool=yes @AMDEPBACKSLASH@ +libcares_la-ares_addrinfo2hostent.lo: ares_addrinfo2hostent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_addrinfo2hostent.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_addrinfo2hostent.Tpo -c -o libcares_la-ares_addrinfo2hostent.lo `test -f 'ares_addrinfo2hostent.c' || echo '$(srcdir)/'`ares_addrinfo2hostent.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares_addrinfo2hostent.Tpo $(DEPDIR)/libcares_la-ares_addrinfo2hostent.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares_addrinfo2hostent.c' object='libcares_la-ares_addrinfo2hostent.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares__addrinfo2hostent.lo `test -f 'ares__addrinfo2hostent.c' || echo '$(srcdir)/'`ares__addrinfo2hostent.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_addrinfo2hostent.lo `test -f 'ares_addrinfo2hostent.c' || echo '$(srcdir)/'`ares_addrinfo2hostent.c -libcares_la-ares__addrinfo_localhost.lo: ares__addrinfo_localhost.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares__addrinfo_localhost.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares__addrinfo_localhost.Tpo -c -o libcares_la-ares__addrinfo_localhost.lo `test -f 'ares__addrinfo_localhost.c' || echo '$(srcdir)/'`ares__addrinfo_localhost.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares__addrinfo_localhost.Tpo $(DEPDIR)/libcares_la-ares__addrinfo_localhost.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares__addrinfo_localhost.c' object='libcares_la-ares__addrinfo_localhost.lo' libtool=yes @AMDEPBACKSLASH@ +libcares_la-ares_addrinfo_localhost.lo: ares_addrinfo_localhost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_addrinfo_localhost.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_addrinfo_localhost.Tpo -c -o libcares_la-ares_addrinfo_localhost.lo `test -f 'ares_addrinfo_localhost.c' || echo '$(srcdir)/'`ares_addrinfo_localhost.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares_addrinfo_localhost.Tpo $(DEPDIR)/libcares_la-ares_addrinfo_localhost.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares_addrinfo_localhost.c' object='libcares_la-ares_addrinfo_localhost.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares__addrinfo_localhost.lo `test -f 'ares__addrinfo_localhost.c' || echo '$(srcdir)/'`ares__addrinfo_localhost.c - -libcares_la-ares__close_sockets.lo: ares__close_sockets.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares__close_sockets.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares__close_sockets.Tpo -c -o libcares_la-ares__close_sockets.lo `test -f 'ares__close_sockets.c' || echo '$(srcdir)/'`ares__close_sockets.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares__close_sockets.Tpo $(DEPDIR)/libcares_la-ares__close_sockets.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares__close_sockets.c' object='libcares_la-ares__close_sockets.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares__close_sockets.lo `test -f 'ares__close_sockets.c' || echo '$(srcdir)/'`ares__close_sockets.c - -libcares_la-ares__hosts_file.lo: ares__hosts_file.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares__hosts_file.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares__hosts_file.Tpo -c -o libcares_la-ares__hosts_file.lo `test -f 'ares__hosts_file.c' || echo '$(srcdir)/'`ares__hosts_file.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares__hosts_file.Tpo $(DEPDIR)/libcares_la-ares__hosts_file.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares__hosts_file.c' object='libcares_la-ares__hosts_file.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares__hosts_file.lo `test -f 'ares__hosts_file.c' || echo '$(srcdir)/'`ares__hosts_file.c - -libcares_la-ares__parse_into_addrinfo.lo: ares__parse_into_addrinfo.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares__parse_into_addrinfo.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares__parse_into_addrinfo.Tpo -c -o libcares_la-ares__parse_into_addrinfo.lo `test -f 'ares__parse_into_addrinfo.c' || echo '$(srcdir)/'`ares__parse_into_addrinfo.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares__parse_into_addrinfo.Tpo $(DEPDIR)/libcares_la-ares__parse_into_addrinfo.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares__parse_into_addrinfo.c' object='libcares_la-ares__parse_into_addrinfo.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares__parse_into_addrinfo.lo `test -f 'ares__parse_into_addrinfo.c' || echo '$(srcdir)/'`ares__parse_into_addrinfo.c - -libcares_la-ares__socket.lo: ares__socket.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares__socket.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares__socket.Tpo -c -o libcares_la-ares__socket.lo `test -f 'ares__socket.c' || echo '$(srcdir)/'`ares__socket.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares__socket.Tpo $(DEPDIR)/libcares_la-ares__socket.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares__socket.c' object='libcares_la-ares__socket.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares__socket.lo `test -f 'ares__socket.c' || echo '$(srcdir)/'`ares__socket.c - -libcares_la-ares__sortaddrinfo.lo: ares__sortaddrinfo.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares__sortaddrinfo.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares__sortaddrinfo.Tpo -c -o libcares_la-ares__sortaddrinfo.lo `test -f 'ares__sortaddrinfo.c' || echo '$(srcdir)/'`ares__sortaddrinfo.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares__sortaddrinfo.Tpo $(DEPDIR)/libcares_la-ares__sortaddrinfo.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares__sortaddrinfo.c' object='libcares_la-ares__sortaddrinfo.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares__sortaddrinfo.lo `test -f 'ares__sortaddrinfo.c' || echo '$(srcdir)/'`ares__sortaddrinfo.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_addrinfo_localhost.lo `test -f 'ares_addrinfo_localhost.c' || echo '$(srcdir)/'`ares_addrinfo_localhost.c libcares_la-ares_android.lo: ares_android.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_android.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_android.Tpo -c -o libcares_la-ares_android.lo `test -f 'ares_android.c' || echo '$(srcdir)/'`ares_android.c @@ -1180,6 +1166,20 @@ libcares_la-ares_cancel.lo: ares_cancel.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_cancel.lo `test -f 'ares_cancel.c' || echo '$(srcdir)/'`ares_cancel.c +libcares_la-ares_close_sockets.lo: ares_close_sockets.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_close_sockets.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_close_sockets.Tpo -c -o libcares_la-ares_close_sockets.lo `test -f 'ares_close_sockets.c' || echo '$(srcdir)/'`ares_close_sockets.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares_close_sockets.Tpo $(DEPDIR)/libcares_la-ares_close_sockets.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares_close_sockets.c' object='libcares_la-ares_close_sockets.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_close_sockets.lo `test -f 'ares_close_sockets.c' || echo '$(srcdir)/'`ares_close_sockets.c + +libcares_la-ares_conn.lo: ares_conn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_conn.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_conn.Tpo -c -o libcares_la-ares_conn.lo `test -f 'ares_conn.c' || echo '$(srcdir)/'`ares_conn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares_conn.Tpo $(DEPDIR)/libcares_la-ares_conn.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares_conn.c' object='libcares_la-ares_conn.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_conn.lo `test -f 'ares_conn.c' || echo '$(srcdir)/'`ares_conn.c + libcares_la-ares_cookie.lo: ares_cookie.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_cookie.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_cookie.Tpo -c -o libcares_la-ares_cookie.lo `test -f 'ares_cookie.c' || echo '$(srcdir)/'`ares_cookie.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares_cookie.Tpo $(DEPDIR)/libcares_la-ares_cookie.Plo @@ -1257,6 +1257,13 @@ libcares_la-ares_getnameinfo.lo: ares_getnameinfo.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_getnameinfo.lo `test -f 'ares_getnameinfo.c' || echo '$(srcdir)/'`ares_getnameinfo.c +libcares_la-ares_hosts_file.lo: ares_hosts_file.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_hosts_file.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_hosts_file.Tpo -c -o libcares_la-ares_hosts_file.lo `test -f 'ares_hosts_file.c' || echo '$(srcdir)/'`ares_hosts_file.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares_hosts_file.Tpo $(DEPDIR)/libcares_la-ares_hosts_file.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares_hosts_file.c' object='libcares_la-ares_hosts_file.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_hosts_file.lo `test -f 'ares_hosts_file.c' || echo '$(srcdir)/'`ares_hosts_file.c + libcares_la-ares_init.lo: ares_init.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_init.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_init.Tpo -c -o libcares_la-ares_init.lo `test -f 'ares_init.c' || echo '$(srcdir)/'`ares_init.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares_init.Tpo $(DEPDIR)/libcares_la-ares_init.Plo @@ -1285,12 +1292,12 @@ libcares_la-ares_options.lo: ares_options.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_options.lo `test -f 'ares_options.c' || echo '$(srcdir)/'`ares_options.c -libcares_la-ares_platform.lo: ares_platform.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_platform.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_platform.Tpo -c -o libcares_la-ares_platform.lo `test -f 'ares_platform.c' || echo '$(srcdir)/'`ares_platform.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares_platform.Tpo $(DEPDIR)/libcares_la-ares_platform.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares_platform.c' object='libcares_la-ares_platform.lo' libtool=yes @AMDEPBACKSLASH@ +libcares_la-ares_parse_into_addrinfo.lo: ares_parse_into_addrinfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_parse_into_addrinfo.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_parse_into_addrinfo.Tpo -c -o libcares_la-ares_parse_into_addrinfo.lo `test -f 'ares_parse_into_addrinfo.c' || echo '$(srcdir)/'`ares_parse_into_addrinfo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares_parse_into_addrinfo.Tpo $(DEPDIR)/libcares_la-ares_parse_into_addrinfo.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares_parse_into_addrinfo.c' object='libcares_la-ares_parse_into_addrinfo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_platform.lo `test -f 'ares_platform.c' || echo '$(srcdir)/'`ares_platform.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_parse_into_addrinfo.lo `test -f 'ares_parse_into_addrinfo.c' || echo '$(srcdir)/'`ares_parse_into_addrinfo.c libcares_la-ares_process.lo: ares_process.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_process.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_process.Tpo -c -o libcares_la-ares_process.lo `test -f 'ares_process.c' || echo '$(srcdir)/'`ares_process.c @@ -1327,6 +1334,27 @@ libcares_la-ares_send.lo: ares_send.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_send.lo `test -f 'ares_send.c' || echo '$(srcdir)/'`ares_send.c +libcares_la-ares_set_socket_functions.lo: ares_set_socket_functions.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_set_socket_functions.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_set_socket_functions.Tpo -c -o libcares_la-ares_set_socket_functions.lo `test -f 'ares_set_socket_functions.c' || echo '$(srcdir)/'`ares_set_socket_functions.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares_set_socket_functions.Tpo $(DEPDIR)/libcares_la-ares_set_socket_functions.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares_set_socket_functions.c' object='libcares_la-ares_set_socket_functions.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_set_socket_functions.lo `test -f 'ares_set_socket_functions.c' || echo '$(srcdir)/'`ares_set_socket_functions.c + +libcares_la-ares_socket.lo: ares_socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_socket.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_socket.Tpo -c -o libcares_la-ares_socket.lo `test -f 'ares_socket.c' || echo '$(srcdir)/'`ares_socket.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares_socket.Tpo $(DEPDIR)/libcares_la-ares_socket.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares_socket.c' object='libcares_la-ares_socket.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_socket.lo `test -f 'ares_socket.c' || echo '$(srcdir)/'`ares_socket.c + +libcares_la-ares_sortaddrinfo.lo: ares_sortaddrinfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_sortaddrinfo.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_sortaddrinfo.Tpo -c -o libcares_la-ares_sortaddrinfo.lo `test -f 'ares_sortaddrinfo.c' || echo '$(srcdir)/'`ares_sortaddrinfo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares_sortaddrinfo.Tpo $(DEPDIR)/libcares_la-ares_sortaddrinfo.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares_sortaddrinfo.c' object='libcares_la-ares_sortaddrinfo.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-ares_sortaddrinfo.lo `test -f 'ares_sortaddrinfo.c' || echo '$(srcdir)/'`ares_sortaddrinfo.c + libcares_la-ares_strerror.lo: ares_strerror.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT libcares_la-ares_strerror.lo -MD -MP -MF $(DEPDIR)/libcares_la-ares_strerror.Tpo -c -o libcares_la-ares_strerror.lo `test -f 'ares_strerror.c' || echo '$(srcdir)/'`ares_strerror.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcares_la-ares_strerror.Tpo $(DEPDIR)/libcares_la-ares_strerror.Plo @@ -1404,61 +1432,75 @@ libcares_la-windows_port.lo: windows_port.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o libcares_la-windows_port.lo `test -f 'windows_port.c' || echo '$(srcdir)/'`windows_port.c -dsa/libcares_la-ares__array.lo: dsa/ares__array.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares__array.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares__array.Tpo -c -o dsa/libcares_la-ares__array.lo `test -f 'dsa/ares__array.c' || echo '$(srcdir)/'`dsa/ares__array.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares__array.Tpo dsa/$(DEPDIR)/libcares_la-ares__array.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares__array.c' object='dsa/libcares_la-ares__array.lo' libtool=yes @AMDEPBACKSLASH@ +dsa/libcares_la-ares_array.lo: dsa/ares_array.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares_array.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares_array.Tpo -c -o dsa/libcares_la-ares_array.lo `test -f 'dsa/ares_array.c' || echo '$(srcdir)/'`dsa/ares_array.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares_array.Tpo dsa/$(DEPDIR)/libcares_la-ares_array.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares_array.c' object='dsa/libcares_la-ares_array.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares__array.lo `test -f 'dsa/ares__array.c' || echo '$(srcdir)/'`dsa/ares__array.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares_array.lo `test -f 'dsa/ares_array.c' || echo '$(srcdir)/'`dsa/ares_array.c -dsa/libcares_la-ares__htable.lo: dsa/ares__htable.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares__htable.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares__htable.Tpo -c -o dsa/libcares_la-ares__htable.lo `test -f 'dsa/ares__htable.c' || echo '$(srcdir)/'`dsa/ares__htable.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares__htable.Tpo dsa/$(DEPDIR)/libcares_la-ares__htable.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares__htable.c' object='dsa/libcares_la-ares__htable.lo' libtool=yes @AMDEPBACKSLASH@ +dsa/libcares_la-ares_htable.lo: dsa/ares_htable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares_htable.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares_htable.Tpo -c -o dsa/libcares_la-ares_htable.lo `test -f 'dsa/ares_htable.c' || echo '$(srcdir)/'`dsa/ares_htable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares_htable.Tpo dsa/$(DEPDIR)/libcares_la-ares_htable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares_htable.c' object='dsa/libcares_la-ares_htable.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares__htable.lo `test -f 'dsa/ares__htable.c' || echo '$(srcdir)/'`dsa/ares__htable.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares_htable.lo `test -f 'dsa/ares_htable.c' || echo '$(srcdir)/'`dsa/ares_htable.c -dsa/libcares_la-ares__htable_asvp.lo: dsa/ares__htable_asvp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares__htable_asvp.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares__htable_asvp.Tpo -c -o dsa/libcares_la-ares__htable_asvp.lo `test -f 'dsa/ares__htable_asvp.c' || echo '$(srcdir)/'`dsa/ares__htable_asvp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares__htable_asvp.Tpo dsa/$(DEPDIR)/libcares_la-ares__htable_asvp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares__htable_asvp.c' object='dsa/libcares_la-ares__htable_asvp.lo' libtool=yes @AMDEPBACKSLASH@ +dsa/libcares_la-ares_htable_asvp.lo: dsa/ares_htable_asvp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares_htable_asvp.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares_htable_asvp.Tpo -c -o dsa/libcares_la-ares_htable_asvp.lo `test -f 'dsa/ares_htable_asvp.c' || echo '$(srcdir)/'`dsa/ares_htable_asvp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares_htable_asvp.Tpo dsa/$(DEPDIR)/libcares_la-ares_htable_asvp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares_htable_asvp.c' object='dsa/libcares_la-ares_htable_asvp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares__htable_asvp.lo `test -f 'dsa/ares__htable_asvp.c' || echo '$(srcdir)/'`dsa/ares__htable_asvp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares_htable_asvp.lo `test -f 'dsa/ares_htable_asvp.c' || echo '$(srcdir)/'`dsa/ares_htable_asvp.c -dsa/libcares_la-ares__htable_strvp.lo: dsa/ares__htable_strvp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares__htable_strvp.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares__htable_strvp.Tpo -c -o dsa/libcares_la-ares__htable_strvp.lo `test -f 'dsa/ares__htable_strvp.c' || echo '$(srcdir)/'`dsa/ares__htable_strvp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares__htable_strvp.Tpo dsa/$(DEPDIR)/libcares_la-ares__htable_strvp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares__htable_strvp.c' object='dsa/libcares_la-ares__htable_strvp.lo' libtool=yes @AMDEPBACKSLASH@ +dsa/libcares_la-ares_htable_dict.lo: dsa/ares_htable_dict.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares_htable_dict.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares_htable_dict.Tpo -c -o dsa/libcares_la-ares_htable_dict.lo `test -f 'dsa/ares_htable_dict.c' || echo '$(srcdir)/'`dsa/ares_htable_dict.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares_htable_dict.Tpo dsa/$(DEPDIR)/libcares_la-ares_htable_dict.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares_htable_dict.c' object='dsa/libcares_la-ares_htable_dict.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares__htable_strvp.lo `test -f 'dsa/ares__htable_strvp.c' || echo '$(srcdir)/'`dsa/ares__htable_strvp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares_htable_dict.lo `test -f 'dsa/ares_htable_dict.c' || echo '$(srcdir)/'`dsa/ares_htable_dict.c -dsa/libcares_la-ares__htable_szvp.lo: dsa/ares__htable_szvp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares__htable_szvp.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares__htable_szvp.Tpo -c -o dsa/libcares_la-ares__htable_szvp.lo `test -f 'dsa/ares__htable_szvp.c' || echo '$(srcdir)/'`dsa/ares__htable_szvp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares__htable_szvp.Tpo dsa/$(DEPDIR)/libcares_la-ares__htable_szvp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares__htable_szvp.c' object='dsa/libcares_la-ares__htable_szvp.lo' libtool=yes @AMDEPBACKSLASH@ +dsa/libcares_la-ares_htable_strvp.lo: dsa/ares_htable_strvp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares_htable_strvp.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares_htable_strvp.Tpo -c -o dsa/libcares_la-ares_htable_strvp.lo `test -f 'dsa/ares_htable_strvp.c' || echo '$(srcdir)/'`dsa/ares_htable_strvp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares_htable_strvp.Tpo dsa/$(DEPDIR)/libcares_la-ares_htable_strvp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares_htable_strvp.c' object='dsa/libcares_la-ares_htable_strvp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares__htable_szvp.lo `test -f 'dsa/ares__htable_szvp.c' || echo '$(srcdir)/'`dsa/ares__htable_szvp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares_htable_strvp.lo `test -f 'dsa/ares_htable_strvp.c' || echo '$(srcdir)/'`dsa/ares_htable_strvp.c -dsa/libcares_la-ares__htable_vpvp.lo: dsa/ares__htable_vpvp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares__htable_vpvp.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares__htable_vpvp.Tpo -c -o dsa/libcares_la-ares__htable_vpvp.lo `test -f 'dsa/ares__htable_vpvp.c' || echo '$(srcdir)/'`dsa/ares__htable_vpvp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares__htable_vpvp.Tpo dsa/$(DEPDIR)/libcares_la-ares__htable_vpvp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares__htable_vpvp.c' object='dsa/libcares_la-ares__htable_vpvp.lo' libtool=yes @AMDEPBACKSLASH@ +dsa/libcares_la-ares_htable_szvp.lo: dsa/ares_htable_szvp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares_htable_szvp.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares_htable_szvp.Tpo -c -o dsa/libcares_la-ares_htable_szvp.lo `test -f 'dsa/ares_htable_szvp.c' || echo '$(srcdir)/'`dsa/ares_htable_szvp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares_htable_szvp.Tpo dsa/$(DEPDIR)/libcares_la-ares_htable_szvp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares_htable_szvp.c' object='dsa/libcares_la-ares_htable_szvp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares__htable_vpvp.lo `test -f 'dsa/ares__htable_vpvp.c' || echo '$(srcdir)/'`dsa/ares__htable_vpvp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares_htable_szvp.lo `test -f 'dsa/ares_htable_szvp.c' || echo '$(srcdir)/'`dsa/ares_htable_szvp.c -dsa/libcares_la-ares__llist.lo: dsa/ares__llist.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares__llist.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares__llist.Tpo -c -o dsa/libcares_la-ares__llist.lo `test -f 'dsa/ares__llist.c' || echo '$(srcdir)/'`dsa/ares__llist.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares__llist.Tpo dsa/$(DEPDIR)/libcares_la-ares__llist.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares__llist.c' object='dsa/libcares_la-ares__llist.lo' libtool=yes @AMDEPBACKSLASH@ +dsa/libcares_la-ares_htable_vpstr.lo: dsa/ares_htable_vpstr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares_htable_vpstr.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares_htable_vpstr.Tpo -c -o dsa/libcares_la-ares_htable_vpstr.lo `test -f 'dsa/ares_htable_vpstr.c' || echo '$(srcdir)/'`dsa/ares_htable_vpstr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares_htable_vpstr.Tpo dsa/$(DEPDIR)/libcares_la-ares_htable_vpstr.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares_htable_vpstr.c' object='dsa/libcares_la-ares_htable_vpstr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares__llist.lo `test -f 'dsa/ares__llist.c' || echo '$(srcdir)/'`dsa/ares__llist.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares_htable_vpstr.lo `test -f 'dsa/ares_htable_vpstr.c' || echo '$(srcdir)/'`dsa/ares_htable_vpstr.c -dsa/libcares_la-ares__slist.lo: dsa/ares__slist.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares__slist.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares__slist.Tpo -c -o dsa/libcares_la-ares__slist.lo `test -f 'dsa/ares__slist.c' || echo '$(srcdir)/'`dsa/ares__slist.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares__slist.Tpo dsa/$(DEPDIR)/libcares_la-ares__slist.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares__slist.c' object='dsa/libcares_la-ares__slist.lo' libtool=yes @AMDEPBACKSLASH@ +dsa/libcares_la-ares_htable_vpvp.lo: dsa/ares_htable_vpvp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares_htable_vpvp.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares_htable_vpvp.Tpo -c -o dsa/libcares_la-ares_htable_vpvp.lo `test -f 'dsa/ares_htable_vpvp.c' || echo '$(srcdir)/'`dsa/ares_htable_vpvp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares_htable_vpvp.Tpo dsa/$(DEPDIR)/libcares_la-ares_htable_vpvp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares_htable_vpvp.c' object='dsa/libcares_la-ares_htable_vpvp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares__slist.lo `test -f 'dsa/ares__slist.c' || echo '$(srcdir)/'`dsa/ares__slist.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares_htable_vpvp.lo `test -f 'dsa/ares_htable_vpvp.c' || echo '$(srcdir)/'`dsa/ares_htable_vpvp.c + +dsa/libcares_la-ares_llist.lo: dsa/ares_llist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares_llist.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares_llist.Tpo -c -o dsa/libcares_la-ares_llist.lo `test -f 'dsa/ares_llist.c' || echo '$(srcdir)/'`dsa/ares_llist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares_llist.Tpo dsa/$(DEPDIR)/libcares_la-ares_llist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares_llist.c' object='dsa/libcares_la-ares_llist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares_llist.lo `test -f 'dsa/ares_llist.c' || echo '$(srcdir)/'`dsa/ares_llist.c + +dsa/libcares_la-ares_slist.lo: dsa/ares_slist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT dsa/libcares_la-ares_slist.lo -MD -MP -MF dsa/$(DEPDIR)/libcares_la-ares_slist.Tpo -c -o dsa/libcares_la-ares_slist.lo `test -f 'dsa/ares_slist.c' || echo '$(srcdir)/'`dsa/ares_slist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcares_la-ares_slist.Tpo dsa/$(DEPDIR)/libcares_la-ares_slist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/ares_slist.c' object='dsa/libcares_la-ares_slist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o dsa/libcares_la-ares_slist.lo `test -f 'dsa/ares_slist.c' || echo '$(srcdir)/'`dsa/ares_slist.c event/libcares_la-ares_event_configchg.lo: event/ares_event_configchg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT event/libcares_la-ares_event_configchg.lo -MD -MP -MF event/$(DEPDIR)/libcares_la-ares_event_configchg.Tpo -c -o event/libcares_la-ares_event_configchg.lo `test -f 'event/ares_event_configchg.c' || echo '$(srcdir)/'`event/ares_event_configchg.c @@ -1670,19 +1712,12 @@ record/libcares_la-ares_dns_write.lo: record/ares_dns_write.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o record/libcares_la-ares_dns_write.lo `test -f 'record/ares_dns_write.c' || echo '$(srcdir)/'`record/ares_dns_write.c -str/libcares_la-ares__buf.lo: str/ares__buf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT str/libcares_la-ares__buf.lo -MD -MP -MF str/$(DEPDIR)/libcares_la-ares__buf.Tpo -c -o str/libcares_la-ares__buf.lo `test -f 'str/ares__buf.c' || echo '$(srcdir)/'`str/ares__buf.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) str/$(DEPDIR)/libcares_la-ares__buf.Tpo str/$(DEPDIR)/libcares_la-ares__buf.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='str/ares__buf.c' object='str/libcares_la-ares__buf.lo' libtool=yes @AMDEPBACKSLASH@ +str/libcares_la-ares_buf.lo: str/ares_buf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT str/libcares_la-ares_buf.lo -MD -MP -MF str/$(DEPDIR)/libcares_la-ares_buf.Tpo -c -o str/libcares_la-ares_buf.lo `test -f 'str/ares_buf.c' || echo '$(srcdir)/'`str/ares_buf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) str/$(DEPDIR)/libcares_la-ares_buf.Tpo str/$(DEPDIR)/libcares_la-ares_buf.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='str/ares_buf.c' object='str/libcares_la-ares_buf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o str/libcares_la-ares__buf.lo `test -f 'str/ares__buf.c' || echo '$(srcdir)/'`str/ares__buf.c - -str/libcares_la-ares_strcasecmp.lo: str/ares_strcasecmp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT str/libcares_la-ares_strcasecmp.lo -MD -MP -MF str/$(DEPDIR)/libcares_la-ares_strcasecmp.Tpo -c -o str/libcares_la-ares_strcasecmp.lo `test -f 'str/ares_strcasecmp.c' || echo '$(srcdir)/'`str/ares_strcasecmp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) str/$(DEPDIR)/libcares_la-ares_strcasecmp.Tpo str/$(DEPDIR)/libcares_la-ares_strcasecmp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='str/ares_strcasecmp.c' object='str/libcares_la-ares_strcasecmp.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o str/libcares_la-ares_strcasecmp.lo `test -f 'str/ares_strcasecmp.c' || echo '$(srcdir)/'`str/ares_strcasecmp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o str/libcares_la-ares_buf.lo `test -f 'str/ares_buf.c' || echo '$(srcdir)/'`str/ares_buf.c str/libcares_la-ares_str.lo: str/ares_str.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT str/libcares_la-ares_str.lo -MD -MP -MF str/$(DEPDIR)/libcares_la-ares_str.Tpo -c -o str/libcares_la-ares_str.lo `test -f 'str/ares_str.c' || echo '$(srcdir)/'`str/ares_str.c @@ -1698,26 +1733,26 @@ str/libcares_la-ares_strsplit.lo: str/ares_strsplit.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o str/libcares_la-ares_strsplit.lo `test -f 'str/ares_strsplit.c' || echo '$(srcdir)/'`str/ares_strsplit.c -util/libcares_la-ares__iface_ips.lo: util/ares__iface_ips.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT util/libcares_la-ares__iface_ips.lo -MD -MP -MF util/$(DEPDIR)/libcares_la-ares__iface_ips.Tpo -c -o util/libcares_la-ares__iface_ips.lo `test -f 'util/ares__iface_ips.c' || echo '$(srcdir)/'`util/ares__iface_ips.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/libcares_la-ares__iface_ips.Tpo util/$(DEPDIR)/libcares_la-ares__iface_ips.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/ares__iface_ips.c' object='util/libcares_la-ares__iface_ips.lo' libtool=yes @AMDEPBACKSLASH@ +util/libcares_la-ares_iface_ips.lo: util/ares_iface_ips.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT util/libcares_la-ares_iface_ips.lo -MD -MP -MF util/$(DEPDIR)/libcares_la-ares_iface_ips.Tpo -c -o util/libcares_la-ares_iface_ips.lo `test -f 'util/ares_iface_ips.c' || echo '$(srcdir)/'`util/ares_iface_ips.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/libcares_la-ares_iface_ips.Tpo util/$(DEPDIR)/libcares_la-ares_iface_ips.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/ares_iface_ips.c' object='util/libcares_la-ares_iface_ips.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o util/libcares_la-ares__iface_ips.lo `test -f 'util/ares__iface_ips.c' || echo '$(srcdir)/'`util/ares__iface_ips.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o util/libcares_la-ares_iface_ips.lo `test -f 'util/ares_iface_ips.c' || echo '$(srcdir)/'`util/ares_iface_ips.c -util/libcares_la-ares__threads.lo: util/ares__threads.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT util/libcares_la-ares__threads.lo -MD -MP -MF util/$(DEPDIR)/libcares_la-ares__threads.Tpo -c -o util/libcares_la-ares__threads.lo `test -f 'util/ares__threads.c' || echo '$(srcdir)/'`util/ares__threads.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/libcares_la-ares__threads.Tpo util/$(DEPDIR)/libcares_la-ares__threads.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/ares__threads.c' object='util/libcares_la-ares__threads.lo' libtool=yes @AMDEPBACKSLASH@ +util/libcares_la-ares_threads.lo: util/ares_threads.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT util/libcares_la-ares_threads.lo -MD -MP -MF util/$(DEPDIR)/libcares_la-ares_threads.Tpo -c -o util/libcares_la-ares_threads.lo `test -f 'util/ares_threads.c' || echo '$(srcdir)/'`util/ares_threads.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/libcares_la-ares_threads.Tpo util/$(DEPDIR)/libcares_la-ares_threads.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/ares_threads.c' object='util/libcares_la-ares_threads.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o util/libcares_la-ares__threads.lo `test -f 'util/ares__threads.c' || echo '$(srcdir)/'`util/ares__threads.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o util/libcares_la-ares_threads.lo `test -f 'util/ares_threads.c' || echo '$(srcdir)/'`util/ares_threads.c -util/libcares_la-ares__timeval.lo: util/ares__timeval.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT util/libcares_la-ares__timeval.lo -MD -MP -MF util/$(DEPDIR)/libcares_la-ares__timeval.Tpo -c -o util/libcares_la-ares__timeval.lo `test -f 'util/ares__timeval.c' || echo '$(srcdir)/'`util/ares__timeval.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/libcares_la-ares__timeval.Tpo util/$(DEPDIR)/libcares_la-ares__timeval.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/ares__timeval.c' object='util/libcares_la-ares__timeval.lo' libtool=yes @AMDEPBACKSLASH@ +util/libcares_la-ares_timeval.lo: util/ares_timeval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT util/libcares_la-ares_timeval.lo -MD -MP -MF util/$(DEPDIR)/libcares_la-ares_timeval.Tpo -c -o util/libcares_la-ares_timeval.lo `test -f 'util/ares_timeval.c' || echo '$(srcdir)/'`util/ares_timeval.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/libcares_la-ares_timeval.Tpo util/$(DEPDIR)/libcares_la-ares_timeval.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/ares_timeval.c' object='util/libcares_la-ares_timeval.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o util/libcares_la-ares__timeval.lo `test -f 'util/ares__timeval.c' || echo '$(srcdir)/'`util/ares__timeval.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o util/libcares_la-ares_timeval.lo `test -f 'util/ares_timeval.c' || echo '$(srcdir)/'`util/ares_timeval.c util/libcares_la-ares_math.lo: util/ares_math.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT util/libcares_la-ares_math.lo -MD -MP -MF util/$(DEPDIR)/libcares_la-ares_math.Tpo -c -o util/libcares_la-ares_math.lo `test -f 'util/ares_math.c' || echo '$(srcdir)/'`util/ares_math.c @@ -1733,6 +1768,13 @@ util/libcares_la-ares_rand.lo: util/ares_rand.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o util/libcares_la-ares_rand.lo `test -f 'util/ares_rand.c' || echo '$(srcdir)/'`util/ares_rand.c +util/libcares_la-ares_uri.lo: util/ares_uri.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -MT util/libcares_la-ares_uri.lo -MD -MP -MF util/$(DEPDIR)/libcares_la-ares_uri.Tpo -c -o util/libcares_la-ares_uri.lo `test -f 'util/ares_uri.c' || echo '$(srcdir)/'`util/ares_uri.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/libcares_la-ares_uri.Tpo util/$(DEPDIR)/libcares_la-ares_uri.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/ares_uri.c' object='util/libcares_la-ares_uri.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcares_la_CPPFLAGS) $(CPPFLAGS) $(libcares_la_CFLAGS) $(CFLAGS) -c -o util/libcares_la-ares_uri.lo `test -f 'util/ares_uri.c' || echo '$(srcdir)/'`util/ares_uri.c + mostlyclean-libtool: -rm -f *.lo @@ -1958,15 +2000,12 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-recursive - -rm -f ./$(DEPDIR)/libcares_la-ares__addrinfo2hostent.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares__addrinfo_localhost.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares__close_sockets.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares__hosts_file.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares__parse_into_addrinfo.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares__socket.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares__sortaddrinfo.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_addrinfo2hostent.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_addrinfo_localhost.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_android.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_cancel.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_close_sockets.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_conn.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_cookie.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_data.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_destroy.Plo @@ -1978,16 +2017,20 @@ distclean: distclean-recursive -rm -f ./$(DEPDIR)/libcares_la-ares_gethostbyaddr.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_gethostbyname.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_getnameinfo.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_hosts_file.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_init.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_library_init.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_metrics.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_options.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares_platform.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_parse_into_addrinfo.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_process.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_qcache.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_query.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_search.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_send.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_set_socket_functions.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_socket.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_sortaddrinfo.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_strerror.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_sysconfig.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_sysconfig_files.Plo @@ -1999,14 +2042,16 @@ distclean: distclean-recursive -rm -f ./$(DEPDIR)/libcares_la-inet_net_pton.Plo -rm -f ./$(DEPDIR)/libcares_la-inet_ntop.Plo -rm -f ./$(DEPDIR)/libcares_la-windows_port.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__array.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__htable.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__htable_asvp.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__htable_strvp.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__htable_szvp.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__htable_vpvp.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__llist.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__slist.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_array.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable_asvp.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable_dict.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable_strvp.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable_szvp.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable_vpstr.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable_vpvp.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_llist.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_slist.Plo -rm -f event/$(DEPDIR)/libcares_la-ares_event_configchg.Plo -rm -f event/$(DEPDIR)/libcares_la-ares_event_epoll.Plo -rm -f event/$(DEPDIR)/libcares_la-ares_event_kqueue.Plo @@ -2037,15 +2082,15 @@ distclean: distclean-recursive -rm -f record/$(DEPDIR)/libcares_la-ares_dns_parse.Plo -rm -f record/$(DEPDIR)/libcares_la-ares_dns_record.Plo -rm -f record/$(DEPDIR)/libcares_la-ares_dns_write.Plo - -rm -f str/$(DEPDIR)/libcares_la-ares__buf.Plo + -rm -f str/$(DEPDIR)/libcares_la-ares_buf.Plo -rm -f str/$(DEPDIR)/libcares_la-ares_str.Plo - -rm -f str/$(DEPDIR)/libcares_la-ares_strcasecmp.Plo -rm -f str/$(DEPDIR)/libcares_la-ares_strsplit.Plo - -rm -f util/$(DEPDIR)/libcares_la-ares__iface_ips.Plo - -rm -f util/$(DEPDIR)/libcares_la-ares__threads.Plo - -rm -f util/$(DEPDIR)/libcares_la-ares__timeval.Plo + -rm -f util/$(DEPDIR)/libcares_la-ares_iface_ips.Plo -rm -f util/$(DEPDIR)/libcares_la-ares_math.Plo -rm -f util/$(DEPDIR)/libcares_la-ares_rand.Plo + -rm -f util/$(DEPDIR)/libcares_la-ares_threads.Plo + -rm -f util/$(DEPDIR)/libcares_la-ares_timeval.Plo + -rm -f util/$(DEPDIR)/libcares_la-ares_uri.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags @@ -2091,15 +2136,12 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -f ./$(DEPDIR)/libcares_la-ares__addrinfo2hostent.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares__addrinfo_localhost.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares__close_sockets.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares__hosts_file.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares__parse_into_addrinfo.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares__socket.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares__sortaddrinfo.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_addrinfo2hostent.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_addrinfo_localhost.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_android.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_cancel.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_close_sockets.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_conn.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_cookie.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_data.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_destroy.Plo @@ -2111,16 +2153,20 @@ maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/libcares_la-ares_gethostbyaddr.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_gethostbyname.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_getnameinfo.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_hosts_file.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_init.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_library_init.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_metrics.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_options.Plo - -rm -f ./$(DEPDIR)/libcares_la-ares_platform.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_parse_into_addrinfo.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_process.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_qcache.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_query.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_search.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_send.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_set_socket_functions.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_socket.Plo + -rm -f ./$(DEPDIR)/libcares_la-ares_sortaddrinfo.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_strerror.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_sysconfig.Plo -rm -f ./$(DEPDIR)/libcares_la-ares_sysconfig_files.Plo @@ -2132,14 +2178,16 @@ maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/libcares_la-inet_net_pton.Plo -rm -f ./$(DEPDIR)/libcares_la-inet_ntop.Plo -rm -f ./$(DEPDIR)/libcares_la-windows_port.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__array.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__htable.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__htable_asvp.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__htable_strvp.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__htable_szvp.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__htable_vpvp.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__llist.Plo - -rm -f dsa/$(DEPDIR)/libcares_la-ares__slist.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_array.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable_asvp.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable_dict.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable_strvp.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable_szvp.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable_vpstr.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_htable_vpvp.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_llist.Plo + -rm -f dsa/$(DEPDIR)/libcares_la-ares_slist.Plo -rm -f event/$(DEPDIR)/libcares_la-ares_event_configchg.Plo -rm -f event/$(DEPDIR)/libcares_la-ares_event_epoll.Plo -rm -f event/$(DEPDIR)/libcares_la-ares_event_kqueue.Plo @@ -2170,15 +2218,15 @@ maintainer-clean: maintainer-clean-recursive -rm -f record/$(DEPDIR)/libcares_la-ares_dns_parse.Plo -rm -f record/$(DEPDIR)/libcares_la-ares_dns_record.Plo -rm -f record/$(DEPDIR)/libcares_la-ares_dns_write.Plo - -rm -f str/$(DEPDIR)/libcares_la-ares__buf.Plo + -rm -f str/$(DEPDIR)/libcares_la-ares_buf.Plo -rm -f str/$(DEPDIR)/libcares_la-ares_str.Plo - -rm -f str/$(DEPDIR)/libcares_la-ares_strcasecmp.Plo -rm -f str/$(DEPDIR)/libcares_la-ares_strsplit.Plo - -rm -f util/$(DEPDIR)/libcares_la-ares__iface_ips.Plo - -rm -f util/$(DEPDIR)/libcares_la-ares__threads.Plo - -rm -f util/$(DEPDIR)/libcares_la-ares__timeval.Plo + -rm -f util/$(DEPDIR)/libcares_la-ares_iface_ips.Plo -rm -f util/$(DEPDIR)/libcares_la-ares_math.Plo -rm -f util/$(DEPDIR)/libcares_la-ares_rand.Plo + -rm -f util/$(DEPDIR)/libcares_la-ares_threads.Plo + -rm -f util/$(DEPDIR)/libcares_la-ares_timeval.Plo + -rm -f util/$(DEPDIR)/libcares_la-ares_uri.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/deps/cares/src/lib/Makefile.inc b/deps/cares/src/lib/Makefile.inc index 8fa434c3e2c860..10e4edf5c761a0 100644 --- a/deps/cares/src/lib/Makefile.inc +++ b/deps/cares/src/lib/Makefile.inc @@ -1,15 +1,12 @@ # Copyright (C) The c-ares project and its contributors # SPDX-License-Identifier: MIT -CSOURCES = ares__addrinfo2hostent.c \ - ares__addrinfo_localhost.c \ - ares__close_sockets.c \ - ares__hosts_file.c \ - ares__parse_into_addrinfo.c \ - ares__socket.c \ - ares__sortaddrinfo.c \ +CSOURCES = ares_addrinfo2hostent.c \ + ares_addrinfo_localhost.c \ ares_android.c \ ares_cancel.c \ + ares_close_sockets.c \ + ares_conn.c \ ares_cookie.c \ ares_data.c \ ares_destroy.c \ @@ -21,16 +18,20 @@ CSOURCES = ares__addrinfo2hostent.c \ ares_gethostbyaddr.c \ ares_gethostbyname.c \ ares_getnameinfo.c \ + ares_hosts_file.c \ ares_init.c \ ares_library_init.c \ ares_metrics.c \ ares_options.c \ - ares_platform.c \ + ares_parse_into_addrinfo.c \ ares_process.c \ ares_qcache.c \ ares_query.c \ ares_search.c \ ares_send.c \ + ares_set_socket_functions.c \ + ares_socket.c \ + ares_sortaddrinfo.c \ ares_strerror.c \ ares_sysconfig.c \ ares_sysconfig_files.c \ @@ -42,14 +43,16 @@ CSOURCES = ares__addrinfo2hostent.c \ inet_net_pton.c \ inet_ntop.c \ windows_port.c \ - dsa/ares__array.c \ - dsa/ares__htable.c \ - dsa/ares__htable_asvp.c \ - dsa/ares__htable_strvp.c \ - dsa/ares__htable_szvp.c \ - dsa/ares__htable_vpvp.c \ - dsa/ares__llist.c \ - dsa/ares__slist.c \ + dsa/ares_array.c \ + dsa/ares_htable.c \ + dsa/ares_htable_asvp.c \ + dsa/ares_htable_dict.c \ + dsa/ares_htable_strvp.c \ + dsa/ares_htable_szvp.c \ + dsa/ares_htable_vpstr.c \ + dsa/ares_htable_vpvp.c \ + dsa/ares_llist.c \ + dsa/ares_slist.c \ event/ares_event_configchg.c \ event/ares_event_epoll.c \ event/ares_event_kqueue.c \ @@ -80,41 +83,47 @@ CSOURCES = ares__addrinfo2hostent.c \ record/ares_dns_parse.c \ record/ares_dns_record.c \ record/ares_dns_write.c \ - str/ares__buf.c \ - str/ares_strcasecmp.c \ + str/ares_buf.c \ str/ares_str.c \ str/ares_strsplit.c \ - util/ares__iface_ips.c \ - util/ares__threads.c \ - util/ares__timeval.c \ + util/ares_iface_ips.c \ + util/ares_threads.c \ + util/ares_timeval.c \ util/ares_math.c \ - util/ares_rand.c + util/ares_rand.c \ + util/ares_uri.c HHEADERS = ares_android.h \ + ares_conn.h \ ares_data.h \ ares_getenv.h \ ares_inet_net_pton.h \ ares_ipv6.h \ - ares_platform.h \ ares_private.h \ ares_setup.h \ - dsa/ares__array.h \ - dsa/ares__htable.h \ - dsa/ares__htable_asvp.h \ - dsa/ares__htable_strvp.h \ - dsa/ares__htable_szvp.h \ - dsa/ares__htable_vpvp.h \ - dsa/ares__llist.h \ - dsa/ares__slist.h \ + ares_socket.h \ + dsa/ares_htable.h \ + dsa/ares_slist.h \ event/ares_event.h \ event/ares_event_win32.h \ + include/ares_array.h \ + include/ares_buf.h \ + include/ares_htable_asvp.h \ + include/ares_htable_dict.h \ + include/ares_htable_strvp.h \ + include/ares_htable_szvp.h \ + include/ares_htable_vpstr.h \ + include/ares_htable_vpvp.h \ + include/ares_llist.h \ + include/ares_mem.h \ + include/ares_str.h \ record/ares_dns_multistring.h \ record/ares_dns_private.h \ - str/ares__buf.h \ - str/ares_strcasecmp.h \ - str/ares_str.h \ str/ares_strsplit.h \ - util/ares__iface_ips.h \ - util/ares__threads.h \ + util/ares_iface_ips.h \ + util/ares_math.h \ + util/ares_rand.h \ + util/ares_time.h \ + util/ares_threads.h \ + util/ares_uri.h \ thirdparty/apple/dnsinfo.h - diff --git a/deps/cares/src/lib/ares__socket.c b/deps/cares/src/lib/ares__socket.c deleted file mode 100644 index 86e281fcddadd4..00000000000000 --- a/deps/cares/src/lib/ares__socket.c +++ /dev/null @@ -1,764 +0,0 @@ -/* MIT License - * - * Copyright (c) Massachusetts Institute of Technology - * Copyright (c) The c-ares project and its contributors - * - * 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 (including the next - * paragraph) 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 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * SPDX-License-Identifier: MIT - */ -#include "ares_private.h" - -#ifdef HAVE_SYS_UIO_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#ifdef HAVE_NETINET_TCP_H -# include -#endif -#ifdef HAVE_NETDB_H -# include -#endif -#ifdef HAVE_ARPA_INET_H -# include -#endif - -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_SYS_IOCTL_H -# include -#endif -#ifdef NETWARE -# include -#endif - -#include -#include -#include - -#if defined(__linux__) && defined(TCP_FASTOPEN_CONNECT) -# define TFO_SUPPORTED 1 -# define TFO_SKIP_CONNECT 0 -# define TFO_USE_SENDTO 0 -# define TFO_USE_CONNECTX 0 -# define TFO_CLIENT_SOCKOPT TCP_FASTOPEN_CONNECT -#elif defined(__FreeBSD__) && defined(TCP_FASTOPEN) -# define TFO_SUPPORTED 1 -# define TFO_SKIP_CONNECT 1 -# define TFO_USE_SENDTO 1 -# define TFO_USE_CONNECTX 0 -# define TFO_CLIENT_SOCKOPT TCP_FASTOPEN -#elif defined(__APPLE__) && defined(HAVE_CONNECTX) -# define TFO_SUPPORTED 1 -# define TFO_SKIP_CONNECT 0 -# define TFO_USE_SENDTO 0 -# define TFO_USE_CONNECTX 1 -# undef TFO_CLIENT_SOCKOPT -#else -# define TFO_SUPPORTED 0 -#endif - - -#ifndef HAVE_WRITEV -/* Structure for scatter/gather I/O. */ -struct iovec { - void *iov_base; /* Pointer to data. */ - size_t iov_len; /* Length of data. */ -}; -#endif - - -/* Return 1 if the specified error number describes a readiness error, or 0 - * otherwise. This is mostly for HP-UX, which could return EAGAIN or - * EWOULDBLOCK. See this man page - * - * http://devrsrc1.external.hp.com/STKS/cgi-bin/man2html? - * manpage=/usr/share/man/man2.Z/send.2 - */ -ares_bool_t ares__socket_try_again(int errnum) -{ -#if !defined EWOULDBLOCK && !defined EAGAIN -# error "Neither EWOULDBLOCK nor EAGAIN defined" -#endif - -#ifdef EWOULDBLOCK - if (errnum == EWOULDBLOCK) { - return ARES_TRUE; - } -#endif - -#if defined EAGAIN && EAGAIN != EWOULDBLOCK - if (errnum == EAGAIN) { - return ARES_TRUE; - } -#endif - - return ARES_FALSE; -} - -ares_ssize_t ares__socket_recv(ares_channel_t *channel, ares_socket_t s, - void *data, size_t data_len) -{ - if (channel->sock_funcs && channel->sock_funcs->arecvfrom) { - return channel->sock_funcs->arecvfrom(s, data, data_len, 0, 0, 0, - channel->sock_func_cb_data); - } - - return (ares_ssize_t)recv((RECV_TYPE_ARG1)s, (RECV_TYPE_ARG2)data, - (RECV_TYPE_ARG3)data_len, (RECV_TYPE_ARG4)(0)); -} - -ares_ssize_t ares__socket_recvfrom(ares_channel_t *channel, ares_socket_t s, - void *data, size_t data_len, int flags, - struct sockaddr *from, - ares_socklen_t *from_len) -{ - if (channel->sock_funcs && channel->sock_funcs->arecvfrom) { - return channel->sock_funcs->arecvfrom(s, data, data_len, flags, from, - from_len, channel->sock_func_cb_data); - } - -#ifdef HAVE_RECVFROM - return (ares_ssize_t)recvfrom(s, data, (RECVFROM_TYPE_ARG3)data_len, flags, - from, from_len); -#else - return ares__socket_recv(channel, s, data, data_len); -#endif -} - -/* Use like: - * struct sockaddr_storage sa_storage; - * ares_socklen_t salen = sizeof(sa_storage); - * struct sockaddr *sa = (struct sockaddr *)&sa_storage; - * ares__conn_set_sockaddr(conn, sa, &salen); - */ -static ares_status_t ares__conn_set_sockaddr(const ares_conn_t *conn, - struct sockaddr *sa, - ares_socklen_t *salen) -{ - const ares_server_t *server = conn->server; - unsigned short port = - conn->flags & ARES_CONN_FLAG_TCP ? server->tcp_port : server->udp_port; - struct sockaddr_in *sin; - struct sockaddr_in6 *sin6; - - switch (server->addr.family) { - case AF_INET: - sin = (struct sockaddr_in *)(void *)sa; - if (*salen < (ares_socklen_t)sizeof(*sin)) { - return ARES_EFORMERR; - } - *salen = sizeof(*sin); - memset(sin, 0, sizeof(*sin)); - sin->sin_family = AF_INET; - sin->sin_port = htons(port); - memcpy(&sin->sin_addr, &server->addr.addr.addr4, sizeof(sin->sin_addr)); - return ARES_SUCCESS; - case AF_INET6: - sin6 = (struct sockaddr_in6 *)(void *)sa; - if (*salen < (ares_socklen_t)sizeof(*sin6)) { - return ARES_EFORMERR; - } - *salen = sizeof(*sin6); - memset(sin6, 0, sizeof(*sin6)); - sin6->sin6_family = AF_INET6; - sin6->sin6_port = htons(port); - memcpy(&sin6->sin6_addr, &server->addr.addr.addr6, - sizeof(sin6->sin6_addr)); -#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID - sin6->sin6_scope_id = server->ll_scope; -#endif - return ARES_SUCCESS; - default: - break; - } - - return ARES_EBADFAMILY; -} - -static ares_status_t ares_conn_set_self_ip(ares_conn_t *conn, ares_bool_t early) -{ - struct sockaddr_storage sa_storage; - int rv; - ares_socklen_t len = sizeof(sa_storage); - - /* We call this twice on TFO, if we already have the IP we can go ahead and - * skip processing */ - if (!early && conn->self_ip.family != AF_UNSPEC) { - return ARES_SUCCESS; - } - - memset(&sa_storage, 0, sizeof(sa_storage)); - - rv = getsockname(conn->fd, (struct sockaddr *)(void *)&sa_storage, &len); - if (rv != 0) { - /* During TCP FastOpen, we can't get the IP this early since connect() - * may not be called. That's ok, we'll try again later */ - if (early && conn->flags & ARES_CONN_FLAG_TCP && - conn->flags & ARES_CONN_FLAG_TFO) { - memset(&conn->self_ip, 0, sizeof(conn->self_ip)); - return ARES_SUCCESS; - } - return ARES_ECONNREFUSED; - } - - if (!ares_sockaddr_to_ares_addr(&conn->self_ip, NULL, - (struct sockaddr *)(void *)&sa_storage)) { - return ARES_ECONNREFUSED; - } - - return ARES_SUCCESS; -} - -ares_ssize_t ares__conn_write(ares_conn_t *conn, const void *data, size_t len) -{ - ares_channel_t *channel = conn->server->channel; - int flags = 0; - -#ifdef HAVE_MSG_NOSIGNAL - flags |= MSG_NOSIGNAL; -#endif - - if (channel->sock_funcs && channel->sock_funcs->asendv) { - struct iovec vec; - vec.iov_base = (void *)((size_t)data); /* Cast off const */ - vec.iov_len = len; - return channel->sock_funcs->asendv(conn->fd, &vec, 1, - channel->sock_func_cb_data); - } - - if (conn->flags & ARES_CONN_FLAG_TFO_INITIAL) { - conn->flags &= ~((unsigned int)ARES_CONN_FLAG_TFO_INITIAL); - -#if defined(TFO_USE_SENDTO) && TFO_USE_SENDTO - { - struct sockaddr_storage sa_storage; - ares_socklen_t salen = sizeof(sa_storage); - struct sockaddr *sa = (struct sockaddr *)&sa_storage; - ares_status_t status; - ares_ssize_t rv; - - status = ares__conn_set_sockaddr(conn, sa, &salen); - if (status != ARES_SUCCESS) { - return status; - } - - rv = (ares_ssize_t)sendto((SEND_TYPE_ARG1)conn->fd, (SEND_TYPE_ARG2)data, - (SEND_TYPE_ARG3)len, (SEND_TYPE_ARG4)flags, sa, - salen); - - /* If using TFO, we might not have been able to get an IP earlier, since - * we hadn't informed the OS of the destination. When using sendto() - * now we have so we should be able to fetch it */ - ares_conn_set_self_ip(conn, ARES_TRUE); - return rv; - } -#endif - } - - return (ares_ssize_t)send((SEND_TYPE_ARG1)conn->fd, (SEND_TYPE_ARG2)data, - (SEND_TYPE_ARG3)len, (SEND_TYPE_ARG4)flags); -} - -/* - * setsocknonblock sets the given socket to either blocking or non-blocking - * mode based on the 'nonblock' boolean argument. This function is highly - * portable. - */ -static int setsocknonblock(ares_socket_t sockfd, /* operate on this */ - int nonblock /* TRUE or FALSE */) -{ -#if defined(USE_BLOCKING_SOCKETS) - - return 0; /* returns success */ - -#elif defined(HAVE_FCNTL_O_NONBLOCK) - - /* most recent unix versions */ - int flags; - flags = fcntl(sockfd, F_GETFL, 0); - if (nonblock) { - return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK); - } else { - return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK)); /* LCOV_EXCL_LINE */ - } - -#elif defined(HAVE_IOCTL_FIONBIO) - - /* older unix versions */ - int flags = nonblock ? 1 : 0; - return ioctl(sockfd, FIONBIO, &flags); - -#elif defined(HAVE_IOCTLSOCKET_FIONBIO) - -# ifdef WATT32 - char flags = nonblock ? 1 : 0; -# else - /* Windows */ - unsigned long flags = nonblock ? 1UL : 0UL; -# endif - return ioctlsocket(sockfd, (long)FIONBIO, &flags); - -#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO) - - /* Amiga */ - long flags = nonblock ? 1L : 0L; - return IoctlSocket(sockfd, FIONBIO, flags); - -#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK) - - /* BeOS */ - long b = nonblock ? 1L : 0L; - return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); - -#else -# error "no non-blocking method was found/used/set" -#endif -} - -#if defined(IPV6_V6ONLY) && defined(USE_WINSOCK) -/* It makes support for IPv4-mapped IPv6 addresses. - * Linux kernel, NetBSD, FreeBSD and Darwin: default is off; - * Windows Vista and later: default is on; - * DragonFly BSD: acts like off, and dummy setting; - * OpenBSD and earlier Windows: unsupported. - * Linux: controlled by /proc/sys/net/ipv6/bindv6only. - */ -static void set_ipv6_v6only(ares_socket_t sockfd, int on) -{ - (void)setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&on, sizeof(on)); -} -#else -# define set_ipv6_v6only(s, v) -#endif - -static ares_status_t configure_socket(ares_conn_t *conn) -{ - union { - struct sockaddr sa; - struct sockaddr_in sa4; - struct sockaddr_in6 sa6; - } local; - - ares_socklen_t bindlen = 0; - ares_server_t *server = conn->server; - ares_channel_t *channel = server->channel; - - /* do not set options for user-managed sockets */ - if (channel->sock_funcs && channel->sock_funcs->asocket) { - return ARES_SUCCESS; - } - - (void)setsocknonblock(conn->fd, 1); - -#if defined(FD_CLOEXEC) && !defined(MSDOS) - /* Configure the socket fd as close-on-exec. */ - if (fcntl(conn->fd, F_SETFD, FD_CLOEXEC) != 0) { - return ARES_ECONNREFUSED; /* LCOV_EXCL_LINE */ - } -#endif - - /* No need to emit SIGPIPE on socket errors */ -#if defined(SO_NOSIGPIPE) - { - int opt = 1; - (void)setsockopt(conn->fd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&opt, - sizeof(opt)); - } -#endif - - /* Set the socket's send and receive buffer sizes. */ - if (channel->socket_send_buffer_size > 0 && - setsockopt(conn->fd, SOL_SOCKET, SO_SNDBUF, - (void *)&channel->socket_send_buffer_size, - sizeof(channel->socket_send_buffer_size)) != 0) { - return ARES_ECONNREFUSED; /* LCOV_EXCL_LINE: UntestablePath */ - } - - if (channel->socket_receive_buffer_size > 0 && - setsockopt(conn->fd, SOL_SOCKET, SO_RCVBUF, - (void *)&channel->socket_receive_buffer_size, - sizeof(channel->socket_receive_buffer_size)) != 0) { - return ARES_ECONNREFUSED; /* LCOV_EXCL_LINE: UntestablePath */ - } - -#ifdef SO_BINDTODEVICE - if (ares_strlen(channel->local_dev_name)) { - /* Only root can do this, and usually not fatal if it doesn't work, so - * just continue on. */ - (void)setsockopt(conn->fd, SOL_SOCKET, SO_BINDTODEVICE, - channel->local_dev_name, sizeof(channel->local_dev_name)); - } -#endif - - if (server->addr.family == AF_INET && channel->local_ip4) { - memset(&local.sa4, 0, sizeof(local.sa4)); - local.sa4.sin_family = AF_INET; - local.sa4.sin_addr.s_addr = htonl(channel->local_ip4); - bindlen = sizeof(local.sa4); - } else if (server->addr.family == AF_INET6 && server->ll_scope == 0 && - memcmp(channel->local_ip6, ares_in6addr_any._S6_un._S6_u8, - sizeof(channel->local_ip6)) != 0) { - /* Only if not link-local and an ip other than "::" is specified */ - memset(&local.sa6, 0, sizeof(local.sa6)); - local.sa6.sin6_family = AF_INET6; - memcpy(&local.sa6.sin6_addr, channel->local_ip6, - sizeof(channel->local_ip6)); - bindlen = sizeof(local.sa6); - } - - if (bindlen && bind(conn->fd, &local.sa, bindlen) < 0) { - return ARES_ECONNREFUSED; - } - - if (server->addr.family == AF_INET6) { - set_ipv6_v6only(conn->fd, 0); - } - - if (conn->flags & ARES_CONN_FLAG_TCP) { - int opt = 1; - -#ifdef TCP_NODELAY - /* - * Disable the Nagle algorithm (only relevant for TCP sockets, and thus not - * in configure_socket). In general, in DNS lookups we're pretty much - * interested in firing off a single request and then waiting for a reply, - * so batching isn't very interesting. - */ - if (setsockopt(conn->fd, IPPROTO_TCP, TCP_NODELAY, (void *)&opt, - sizeof(opt)) != 0) { - return ARES_ECONNREFUSED; - } -#endif - -#if defined(TFO_CLIENT_SOCKOPT) - if (conn->flags & ARES_CONN_FLAG_TFO && - setsockopt(conn->fd, IPPROTO_TCP, TFO_CLIENT_SOCKOPT, (void *)&opt, - sizeof(opt)) != 0) { - /* Disable TFO if flag can't be set. */ - conn->flags &= ~((unsigned int)ARES_CONN_FLAG_TFO); - } -#endif - } - - return ARES_SUCCESS; -} - -ares_bool_t ares_sockaddr_to_ares_addr(struct ares_addr *ares_addr, - unsigned short *port, - const struct sockaddr *sockaddr) -{ - if (sockaddr->sa_family == AF_INET) { - /* NOTE: memcpy sockaddr_in due to alignment issues found by UBSAN due to - * dnsinfo packing on MacOS */ - struct sockaddr_in sockaddr_in; - memcpy(&sockaddr_in, sockaddr, sizeof(sockaddr_in)); - - ares_addr->family = AF_INET; - memcpy(&ares_addr->addr.addr4, &(sockaddr_in.sin_addr), - sizeof(ares_addr->addr.addr4)); - - if (port) { - *port = ntohs(sockaddr_in.sin_port); - } - return ARES_TRUE; - } - - if (sockaddr->sa_family == AF_INET6) { - /* NOTE: memcpy sockaddr_in6 due to alignment issues found by UBSAN due to - * dnsinfo packing on MacOS */ - struct sockaddr_in6 sockaddr_in6; - memcpy(&sockaddr_in6, sockaddr, sizeof(sockaddr_in6)); - - ares_addr->family = AF_INET6; - memcpy(&ares_addr->addr.addr6, &(sockaddr_in6.sin6_addr), - sizeof(ares_addr->addr.addr6)); - if (port) { - *port = ntohs(sockaddr_in6.sin6_port); - } - return ARES_TRUE; - } - - return ARES_FALSE; -} - -static ares_status_t ares__conn_connect(ares_conn_t *conn, struct sockaddr *sa, - ares_socklen_t salen) -{ - /* Normal non TCPFastOpen style connect */ - if (!(conn->flags & ARES_CONN_FLAG_TFO)) { - return ares__connect_socket(conn->server->channel, conn->fd, sa, salen); - } - - /* FreeBSD don't want any sort of connect() so skip */ -#if defined(TFO_SKIP_CONNECT) && TFO_SKIP_CONNECT - return ARES_SUCCESS; -#elif defined(TFO_USE_CONNECTX) && TFO_USE_CONNECTX - { - int rv; - int err; - - do { - sa_endpoints_t endpoints; - memset(&endpoints, 0, sizeof(endpoints)); - endpoints.sae_dstaddr = sa; - endpoints.sae_dstaddrlen = salen; - - rv = connectx(conn->fd, &endpoints, SAE_ASSOCID_ANY, - CONNECT_DATA_IDEMPOTENT | CONNECT_RESUME_ON_READ_WRITE, - NULL, 0, NULL, NULL); - - err = SOCKERRNO; - if (rv == -1 && err != EINPROGRESS && err != EWOULDBLOCK) { - return ARES_ECONNREFUSED; - } - - } while (rv == -1 && err == EINTR); - } - return ARES_SUCCESS; -#elif defined(TFO_SUPPORTED) && TFO_SUPPORTED - return ares__connect_socket(conn->server->channel, conn->fd, sa, salen); -#else - /* Shouldn't be possible */ - return ARES_ECONNREFUSED; -#endif -} - -ares_status_t ares__open_connection(ares_conn_t **conn_out, - ares_channel_t *channel, - ares_server_t *server, ares_bool_t is_tcp) -{ - ares_status_t status; - struct sockaddr_storage sa_storage; - ares_socklen_t salen = sizeof(sa_storage); - struct sockaddr *sa = (struct sockaddr *)&sa_storage; - ares_conn_t *conn; - ares__llist_node_t *node = NULL; - int stype = is_tcp ? SOCK_STREAM : SOCK_DGRAM; - - *conn_out = NULL; - - conn = ares_malloc(sizeof(*conn)); - if (conn == NULL) { - return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ - } - - memset(conn, 0, sizeof(*conn)); - conn->fd = ARES_SOCKET_BAD; - conn->server = server; - conn->queries_to_conn = ares__llist_create(NULL); - conn->flags = is_tcp ? ARES_CONN_FLAG_TCP : ARES_CONN_FLAG_NONE; - - /* Enable TFO if the OS supports it and we were passed in data to send during - * the connect. It might be disabled later if an error is encountered. Make - * sure a user isn't overriding anything. */ - if (conn->flags & ARES_CONN_FLAG_TCP && channel->sock_funcs == NULL && - TFO_SUPPORTED) { - conn->flags |= ARES_CONN_FLAG_TFO; - } - - if (conn->queries_to_conn == NULL) { - /* LCOV_EXCL_START: OutOfMemory */ - status = ARES_ENOMEM; - goto done; - /* LCOV_EXCL_STOP */ - } - - /* Convert into the struct sockaddr structure needed by the OS */ - status = ares__conn_set_sockaddr(conn, sa, &salen); - if (status != ARES_SUCCESS) { - goto done; - } - - /* Acquire a socket. */ - conn->fd = ares__open_socket(channel, server->addr.family, stype, 0); - if (conn->fd == ARES_SOCKET_BAD) { - status = ARES_ECONNREFUSED; - goto done; - } - - /* Configure it. */ - status = configure_socket(conn); - if (status != ARES_SUCCESS) { - goto done; - } - - if (channel->sock_config_cb) { - int err = - channel->sock_config_cb(conn->fd, stype, channel->sock_config_cb_data); - if (err < 0) { - status = ARES_ECONNREFUSED; - goto done; - } - } - - /* Connect */ - status = ares__conn_connect(conn, sa, salen); - if (status != ARES_SUCCESS) { - goto done; - } - - if (channel->sock_create_cb) { - int err = - channel->sock_create_cb(conn->fd, stype, channel->sock_create_cb_data); - if (err < 0) { - status = ARES_ECONNREFUSED; - goto done; - } - } - - /* Let the connection know we haven't written our first packet yet for TFO */ - if (conn->flags & ARES_CONN_FLAG_TFO) { - conn->flags |= ARES_CONN_FLAG_TFO_INITIAL; - } - - /* Need to store our own ip for DNS cookie support */ - status = ares_conn_set_self_ip(conn, ARES_FALSE); - if (status != ARES_SUCCESS) { - goto done; /* LCOV_EXCL_LINE: UntestablePath */ - } - - /* TCP connections are thrown to the end as we don't spawn multiple TCP - * connections. UDP connections are put on front where the newest connection - * can be quickly pulled */ - if (is_tcp) { - node = ares__llist_insert_last(server->connections, conn); - } else { - node = ares__llist_insert_first(server->connections, conn); - } - if (node == NULL) { - /* LCOV_EXCL_START: OutOfMemory */ - status = ARES_ENOMEM; - goto done; - /* LCOV_EXCL_STOP */ - } - - /* Register globally to quickly map event on file descriptor to connection - * node object */ - if (!ares__htable_asvp_insert(channel->connnode_by_socket, conn->fd, node)) { - /* LCOV_EXCL_START: OutOfMemory */ - status = ARES_ENOMEM; - goto done; - /* LCOV_EXCL_STOP */ - } - - SOCK_STATE_CALLBACK(channel, conn->fd, 1, is_tcp ? 1 : 0); - - if (is_tcp) { - server->tcp_conn = conn; - } - -done: - if (status != ARES_SUCCESS) { - ares__llist_node_claim(node); - ares__llist_destroy(conn->queries_to_conn); - ares__close_socket(channel, conn->fd); - ares_free(conn); - } else { - *conn_out = conn; - } - return status; -} - -ares_socket_t ares__open_socket(ares_channel_t *channel, int af, int type, - int protocol) -{ - if (channel->sock_funcs && channel->sock_funcs->asocket) { - return channel->sock_funcs->asocket(af, type, protocol, - channel->sock_func_cb_data); - } - - return socket(af, type, protocol); -} - -ares_status_t ares__connect_socket(ares_channel_t *channel, - ares_socket_t sockfd, - const struct sockaddr *addr, - ares_socklen_t addrlen) -{ - int rv; - int err; - - do { - if (channel->sock_funcs && channel->sock_funcs->aconnect) { - rv = channel->sock_funcs->aconnect(sockfd, addr, addrlen, - channel->sock_func_cb_data); - } else { - rv = connect(sockfd, addr, addrlen); - } - - err = SOCKERRNO; - - if (rv == -1 && err != EINPROGRESS && err != EWOULDBLOCK) { - return ARES_ECONNREFUSED; - } - - } while (rv == -1 && err == EINTR); - - return ARES_SUCCESS; -} - -void ares__close_socket(ares_channel_t *channel, ares_socket_t s) -{ - if (s == ARES_SOCKET_BAD) { - return; - } - - if (channel->sock_funcs && channel->sock_funcs->aclose) { - channel->sock_funcs->aclose(s, channel->sock_func_cb_data); - } else { - sclose(s); - } -} - -void ares_set_socket_callback(ares_channel_t *channel, - ares_sock_create_callback cb, void *data) -{ - if (channel == NULL) { - return; - } - channel->sock_create_cb = cb; - channel->sock_create_cb_data = data; -} - -void ares_set_socket_configure_callback(ares_channel_t *channel, - ares_sock_config_callback cb, - void *data) -{ - if (channel == NULL || channel->optmask & ARES_OPT_EVENT_THREAD) { - return; - } - channel->sock_config_cb = cb; - channel->sock_config_cb_data = data; -} - -void ares_set_socket_functions(ares_channel_t *channel, - const struct ares_socket_functions *funcs, - void *data) -{ - if (channel == NULL || channel->optmask & ARES_OPT_EVENT_THREAD) { - return; - } - channel->sock_funcs = funcs; - channel->sock_func_cb_data = data; -} diff --git a/deps/cares/src/lib/ares__addrinfo2hostent.c b/deps/cares/src/lib/ares_addrinfo2hostent.c similarity index 93% rename from deps/cares/src/lib/ares__addrinfo2hostent.c rename to deps/cares/src/lib/ares_addrinfo2hostent.c index f7b6d1edd251f2..2bbc791157b01e 100644 --- a/deps/cares/src/lib/ares__addrinfo2hostent.c +++ b/deps/cares/src/lib/ares_addrinfo2hostent.c @@ -48,8 +48,8 @@ #endif -ares_status_t ares__addrinfo2hostent(const struct ares_addrinfo *ai, int family, - struct hostent **host) +ares_status_t ares_addrinfo2hostent(const struct ares_addrinfo *ai, int family, + struct hostent **host) { struct ares_addrinfo_node *next; struct ares_addrinfo_cname *next_cname; @@ -196,11 +196,11 @@ ares_status_t ares__addrinfo2hostent(const struct ares_addrinfo *ai, int family, /* LCOV_EXCL_STOP */ } -ares_status_t ares__addrinfo2addrttl(const struct ares_addrinfo *ai, int family, - size_t req_naddrttls, - struct ares_addrttl *addrttls, - struct ares_addr6ttl *addr6ttls, - size_t *naddrttls) +ares_status_t ares_addrinfo2addrttl(const struct ares_addrinfo *ai, int family, + size_t req_naddrttls, + struct ares_addrttl *addrttls, + struct ares_addr6ttl *addr6ttls, + size_t *naddrttls) { struct ares_addrinfo_node *next; struct ares_addrinfo_cname *next_cname; diff --git a/deps/cares/src/lib/ares__addrinfo_localhost.c b/deps/cares/src/lib/ares_addrinfo_localhost.c similarity index 89% rename from deps/cares/src/lib/ares__addrinfo_localhost.c rename to deps/cares/src/lib/ares_addrinfo_localhost.c index e98dd4e277b056..6f4f2a373b3feb 100644 --- a/deps/cares/src/lib/ares__addrinfo_localhost.c +++ b/deps/cares/src/lib/ares_addrinfo_localhost.c @@ -55,7 +55,7 @@ ares_status_t ares_append_ai_node(int aftype, unsigned short port, { struct ares_addrinfo_node *node; - node = ares__append_addrinfo_node(nodes); + node = ares_append_addrinfo_node(nodes); if (!node) { return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -102,8 +102,8 @@ ares_status_t ares_append_ai_node(int aftype, unsigned short port, } static ares_status_t - ares__default_loopback_addrs(int aftype, unsigned short port, - struct ares_addrinfo_node **nodes) + ares_default_loopback_addrs(int aftype, unsigned short port, + struct ares_addrinfo_node **nodes) { ares_status_t status = ARES_SUCCESS; @@ -129,8 +129,8 @@ static ares_status_t } static ares_status_t - ares__system_loopback_addrs(int aftype, unsigned short port, - struct ares_addrinfo_node **nodes) + ares_system_loopback_addrs(int aftype, unsigned short port, + struct ares_addrinfo_node **nodes) { #if defined(USE_WINSOCK) && defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0600 && \ !defined(__WATCOMC__) @@ -176,7 +176,7 @@ static ares_status_t FreeMibTable(table); if (status != ARES_SUCCESS) { - ares__freeaddrinfo_nodes(*nodes); + ares_freeaddrinfo_nodes(*nodes); *nodes = NULL; } @@ -191,9 +191,9 @@ static ares_status_t #endif } -ares_status_t ares__addrinfo_localhost(const char *name, unsigned short port, - const struct ares_addrinfo_hints *hints, - struct ares_addrinfo *ai) +ares_status_t ares_addrinfo_localhost(const char *name, unsigned short port, + const struct ares_addrinfo_hints *hints, + struct ares_addrinfo *ai) { struct ares_addrinfo_node *nodes = NULL; ares_status_t status; @@ -213,19 +213,19 @@ ares_status_t ares__addrinfo_localhost(const char *name, unsigned short port, goto enomem; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__system_loopback_addrs(hints->ai_family, port, &nodes); + status = ares_system_loopback_addrs(hints->ai_family, port, &nodes); if (status == ARES_ENOTFOUND) { - status = ares__default_loopback_addrs(hints->ai_family, port, &nodes); + status = ares_default_loopback_addrs(hints->ai_family, port, &nodes); } - ares__addrinfo_cat_nodes(&ai->nodes, nodes); + ares_addrinfo_cat_nodes(&ai->nodes, nodes); return status; /* LCOV_EXCL_START: OutOfMemory */ enomem: - ares__freeaddrinfo_nodes(nodes); + ares_freeaddrinfo_nodes(nodes); ares_free(ai->name); ai->name = NULL; return ARES_ENOMEM; diff --git a/deps/cares/src/lib/ares_android.c b/deps/cares/src/lib/ares_android.c index 06ab8940ad736d..a8284c1e50235a 100644 --- a/deps/cares/src/lib/ares_android.c +++ b/deps/cares/src/lib/ares_android.c @@ -84,9 +84,9 @@ static jmethodID jni_get_method_id(JNIEnv *env, jclass cls, static int jvm_attach(JNIEnv **env) { - char name[17] = {0}; + char name[17] = { 0 }; - JavaVMAttachArgs args; + JavaVMAttachArgs args; args.version = JNI_VERSION_1_6; if (prctl(PR_GET_NAME, name) == 0) { @@ -94,7 +94,7 @@ static int jvm_attach(JNIEnv **env) } else { args.name = NULL; } - args.group = NULL; + args.group = NULL; return (*android_jvm)->AttachCurrentThread(android_jvm, env, &args); } diff --git a/deps/cares/src/lib/ares_cancel.c b/deps/cares/src/lib/ares_cancel.c index c29d8ef82f4d1a..75600dea6bcdaf 100644 --- a/deps/cares/src/lib/ares_cancel.c +++ b/deps/cares/src/lib/ares_cancel.c @@ -37,18 +37,18 @@ void ares_cancel(ares_channel_t *channel) return; } - ares__channel_lock(channel); + ares_channel_lock(channel); - if (ares__llist_len(channel->all_queries) > 0) { - ares__llist_node_t *node = NULL; - ares__llist_node_t *next = NULL; + if (ares_llist_len(channel->all_queries) > 0) { + ares_llist_node_t *node = NULL; + ares_llist_node_t *next = NULL; /* Swap list heads, so that only those queries which were present on entry * into this function are cancelled. New queries added by callbacks of * queries being cancelled will not be cancelled themselves. */ - ares__llist_t *list_copy = channel->all_queries; - channel->all_queries = ares__llist_create(NULL); + ares_llist_t *list_copy = channel->all_queries; + channel->all_queries = ares_llist_create(NULL); /* Out of memory, this function doesn't return a result code though so we * can't report to caller */ @@ -57,31 +57,31 @@ void ares_cancel(ares_channel_t *channel) goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - node = ares__llist_node_first(list_copy); + node = ares_llist_node_first(list_copy); while (node != NULL) { ares_query_t *query; /* Cache next since this node is being deleted */ - next = ares__llist_node_next(node); + next = ares_llist_node_next(node); - query = ares__llist_node_claim(node); + query = ares_llist_node_claim(node); query->node_all_queries = NULL; /* NOTE: its possible this may enqueue new queries */ query->callback(query->arg, ARES_ECANCELLED, 0, NULL); - ares__free_query(query); + ares_free_query(query); node = next; } - ares__llist_destroy(list_copy); + ares_llist_destroy(list_copy); } /* See if the connections should be cleaned up */ - ares__check_cleanup_conns(channel); + ares_check_cleanup_conns(channel); ares_queue_notify_empty(channel); done: - ares__channel_unlock(channel); + ares_channel_unlock(channel); } diff --git a/deps/cares/src/lib/ares__close_sockets.c b/deps/cares/src/lib/ares_close_sockets.c similarity index 59% rename from deps/cares/src/lib/ares__close_sockets.c rename to deps/cares/src/lib/ares_close_sockets.c index 71c7e64f08ad38..fd3bf3c4b1e09e 100644 --- a/deps/cares/src/lib/ares__close_sockets.c +++ b/deps/cares/src/lib/ares_close_sockets.c @@ -28,81 +28,82 @@ #include "ares_private.h" #include -static void ares__requeue_queries(ares_conn_t *conn, - ares_status_t requeue_status) +static void ares_requeue_queries(ares_conn_t *conn, + ares_status_t requeue_status) { ares_query_t *query; ares_timeval_t now; - ares__tvnow(&now); + ares_tvnow(&now); - while ((query = ares__llist_first_val(conn->queries_to_conn)) != NULL) { - ares__requeue_query(query, &now, requeue_status, ARES_TRUE, NULL); + while ((query = ares_llist_first_val(conn->queries_to_conn)) != NULL) { + ares_requeue_query(query, &now, requeue_status, ARES_TRUE, NULL); } } -void ares__close_connection(ares_conn_t *conn, ares_status_t requeue_status) +void ares_close_connection(ares_conn_t *conn, ares_status_t requeue_status) { ares_server_t *server = conn->server; ares_channel_t *channel = server->channel; /* Unlink */ - ares__llist_node_claim( - ares__htable_asvp_get_direct(channel->connnode_by_socket, conn->fd)); - ares__htable_asvp_remove(channel->connnode_by_socket, conn->fd); + ares_llist_node_claim( + ares_htable_asvp_get_direct(channel->connnode_by_socket, conn->fd)); + ares_htable_asvp_remove(channel->connnode_by_socket, conn->fd); if (conn->flags & ARES_CONN_FLAG_TCP) { - /* Reset any existing input and output buffer. */ - ares__buf_consume(server->tcp_parser, ares__buf_len(server->tcp_parser)); - ares__buf_consume(server->tcp_send, ares__buf_len(server->tcp_send)); server->tcp_conn = NULL; } + ares_buf_destroy(conn->in_buf); + ares_buf_destroy(conn->out_buf); + /* Requeue queries to other connections */ - ares__requeue_queries(conn, requeue_status); + ares_requeue_queries(conn, requeue_status); + + ares_llist_destroy(conn->queries_to_conn); - ares__llist_destroy(conn->queries_to_conn); + ares_conn_sock_state_cb_update(conn, ARES_CONN_STATE_NONE); - SOCK_STATE_CALLBACK(channel, conn->fd, 0, 0); - ares__close_socket(channel, conn->fd); + ares_socket_close(channel, conn->fd); ares_free(conn); } -void ares__close_sockets(ares_server_t *server) +void ares_close_sockets(ares_server_t *server) { - ares__llist_node_t *node; + ares_llist_node_t *node; - while ((node = ares__llist_node_first(server->connections)) != NULL) { - ares_conn_t *conn = ares__llist_node_val(node); - ares__close_connection(conn, ARES_SUCCESS); + while ((node = ares_llist_node_first(server->connections)) != NULL) { + ares_conn_t *conn = ares_llist_node_val(node); + ares_close_connection(conn, ARES_SUCCESS); } } -void ares__check_cleanup_conns(const ares_channel_t *channel) +void ares_check_cleanup_conns(const ares_channel_t *channel) { - ares__slist_node_t *snode; + ares_slist_node_t *snode; if (channel == NULL) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ } /* Iterate across each server */ - for (snode = ares__slist_node_first(channel->servers); snode != NULL; - snode = ares__slist_node_next(snode)) { - ares_server_t *server = ares__slist_node_val(snode); - ares__llist_node_t *cnode; + for (snode = ares_slist_node_first(channel->servers); snode != NULL; + snode = ares_slist_node_next(snode)) { + ares_server_t *server = ares_slist_node_val(snode); + ares_llist_node_t *cnode; /* Iterate across each connection */ - cnode = ares__llist_node_first(server->connections); + cnode = ares_llist_node_first(server->connections); while (cnode != NULL) { - ares__llist_node_t *next = ares__llist_node_next(cnode); - ares_conn_t *conn = ares__llist_node_val(cnode); - ares_bool_t do_cleanup = ARES_FALSE; - cnode = next; + ares_llist_node_t *next = ares_llist_node_next(cnode); + ares_conn_t *conn = ares_llist_node_val(cnode); + ares_bool_t do_cleanup = ARES_FALSE; + cnode = next; /* Has connections, not eligible */ - if (ares__llist_len(conn->queries_to_conn)) { + if (ares_llist_len(conn->queries_to_conn)) { continue; } @@ -130,7 +131,7 @@ void ares__check_cleanup_conns(const ares_channel_t *channel) } /* Clean it up */ - ares__close_connection(conn, ARES_SUCCESS); + ares_close_connection(conn, ARES_SUCCESS); } } } diff --git a/deps/cares/src/lib/ares_config.h.cmake b/deps/cares/src/lib/ares_config.h.cmake index da73867197145f..051b97f494fd32 100644 --- a/deps/cares/src/lib/ares_config.h.cmake +++ b/deps/cares/src/lib/ares_config.h.cmake @@ -82,6 +82,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_POLL_H 1 +/* Define to 1 if you have the memmem function. */ +#cmakedefine HAVE_MEMMEM 1 + /* Define to 1 if you have the poll function. */ #cmakedefine HAVE_POLL 1 @@ -242,6 +245,9 @@ /* Define to 1 if you have the send function. */ #cmakedefine HAVE_SEND 1 +/* Define to 1 if you have the sendto function. */ +#cmakedefine HAVE_SENDTO 1 + /* Define to 1 if you have the setsockopt function. */ #cmakedefine HAVE_SETSOCKOPT 1 diff --git a/deps/cares/src/lib/ares_config.h.in b/deps/cares/src/lib/ares_config.h.in index 3e75b4c2cd088e..d22fa863477fbf 100644 --- a/deps/cares/src/lib/ares_config.h.in +++ b/deps/cares/src/lib/ares_config.h.in @@ -177,6 +177,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H +/* Define to 1 if you have `memmem` */ +#undef HAVE_MEMMEM + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -249,6 +252,9 @@ /* Define to 1 if you have `send` */ #undef HAVE_SEND +/* Define to 1 if you have `sendto` */ +#undef HAVE_SENDTO + /* Define to 1 if you have `setsockopt` */ #undef HAVE_SETSOCKOPT diff --git a/deps/cares/src/lib/ares_conn.c b/deps/cares/src/lib/ares_conn.c new file mode 100644 index 00000000000000..6b315b05486d69 --- /dev/null +++ b/deps/cares/src/lib/ares_conn.c @@ -0,0 +1,511 @@ +/* MIT License + * + * Copyright (c) Massachusetts Institute of Technology + * Copyright (c) The c-ares project and its contributors + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ +#include "ares_private.h" + +void ares_conn_sock_state_cb_update(ares_conn_t *conn, + ares_conn_state_flags_t flags) +{ + ares_channel_t *channel = conn->server->channel; + + if ((conn->state_flags & ARES_CONN_STATE_CBFLAGS) != flags && + channel->sock_state_cb) { + channel->sock_state_cb(channel->sock_state_cb_data, conn->fd, + flags & ARES_CONN_STATE_READ ? 1 : 0, + flags & ARES_CONN_STATE_WRITE ? 1 : 0); + } + + conn->state_flags &= ~((unsigned int)ARES_CONN_STATE_CBFLAGS); + conn->state_flags |= flags; +} + +ares_conn_err_t ares_conn_read(ares_conn_t *conn, void *data, size_t len, + size_t *read_bytes) +{ + ares_channel_t *channel = conn->server->channel; + ares_conn_err_t err; + + if (!(conn->flags & ARES_CONN_FLAG_TCP)) { + struct sockaddr_storage sa_storage; + ares_socklen_t salen = sizeof(sa_storage); + + memset(&sa_storage, 0, sizeof(sa_storage)); + + err = + ares_socket_recvfrom(channel, conn->fd, ARES_FALSE, data, len, 0, + (struct sockaddr *)&sa_storage, &salen, read_bytes); + +#ifdef HAVE_RECVFROM + if (err == ARES_CONN_ERR_SUCCESS && + !ares_sockaddr_addr_eq((struct sockaddr *)&sa_storage, + &conn->server->addr)) { + err = ARES_CONN_ERR_WOULDBLOCK; + } +#endif + } else { + err = ares_socket_recv(channel, conn->fd, ARES_TRUE, data, len, read_bytes); + } + + /* Toggle connected state if needed */ + if (err == ARES_CONN_ERR_SUCCESS) { + conn->state_flags |= ARES_CONN_STATE_CONNECTED; + } + + return err; +} + +/* Use like: + * struct sockaddr_storage sa_storage; + * ares_socklen_t salen = sizeof(sa_storage); + * struct sockaddr *sa = (struct sockaddr *)&sa_storage; + * ares_conn_set_sockaddr(conn, sa, &salen); + */ +static ares_status_t ares_conn_set_sockaddr(const ares_conn_t *conn, + struct sockaddr *sa, + ares_socklen_t *salen) +{ + const ares_server_t *server = conn->server; + unsigned short port = + conn->flags & ARES_CONN_FLAG_TCP ? server->tcp_port : server->udp_port; + struct sockaddr_in *sin; + struct sockaddr_in6 *sin6; + + switch (server->addr.family) { + case AF_INET: + sin = (struct sockaddr_in *)(void *)sa; + if (*salen < (ares_socklen_t)sizeof(*sin)) { + return ARES_EFORMERR; + } + *salen = sizeof(*sin); + memset(sin, 0, sizeof(*sin)); + sin->sin_family = AF_INET; + sin->sin_port = htons(port); + memcpy(&sin->sin_addr, &server->addr.addr.addr4, sizeof(sin->sin_addr)); + return ARES_SUCCESS; + case AF_INET6: + sin6 = (struct sockaddr_in6 *)(void *)sa; + if (*salen < (ares_socklen_t)sizeof(*sin6)) { + return ARES_EFORMERR; + } + *salen = sizeof(*sin6); + memset(sin6, 0, sizeof(*sin6)); + sin6->sin6_family = AF_INET6; + sin6->sin6_port = htons(port); + memcpy(&sin6->sin6_addr, &server->addr.addr.addr6, + sizeof(sin6->sin6_addr)); +#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID + sin6->sin6_scope_id = server->ll_scope; +#endif + return ARES_SUCCESS; + default: + break; + } + + return ARES_EBADFAMILY; +} + +static ares_status_t ares_conn_set_self_ip(ares_conn_t *conn, ares_bool_t early) +{ + ares_channel_t *channel = conn->server->channel; + struct sockaddr_storage sa_storage; + int rv; + ares_socklen_t len = sizeof(sa_storage); + + /* We call this twice on TFO, if we already have the IP we can go ahead and + * skip processing */ + if (!early && conn->self_ip.family != AF_UNSPEC) { + return ARES_SUCCESS; + } + + memset(&sa_storage, 0, sizeof(sa_storage)); + + if (channel->sock_funcs.agetsockname == NULL) { + /* Not specified, we can still use cookies cooked with an empty self_ip */ + memset(&conn->self_ip, 0, sizeof(conn->self_ip)); + return ARES_SUCCESS; + } + rv = channel->sock_funcs.agetsockname(conn->fd, + (struct sockaddr *)(void *)&sa_storage, + &len, channel->sock_func_cb_data); + if (rv != 0) { + /* During TCP FastOpen, we can't get the IP this early since connect() + * may not be called. That's ok, we'll try again later */ + if (early && conn->flags & ARES_CONN_FLAG_TCP && + conn->flags & ARES_CONN_FLAG_TFO) { + memset(&conn->self_ip, 0, sizeof(conn->self_ip)); + return ARES_SUCCESS; + } + return ARES_ECONNREFUSED; + } + + if (!ares_sockaddr_to_ares_addr(&conn->self_ip, NULL, + (struct sockaddr *)(void *)&sa_storage)) { + return ARES_ECONNREFUSED; + } + + return ARES_SUCCESS; +} + +ares_conn_err_t ares_conn_write(ares_conn_t *conn, const void *data, size_t len, + size_t *written) +{ + ares_channel_t *channel = conn->server->channel; + ares_bool_t is_tfo = ARES_FALSE; + ares_conn_err_t err = ARES_CONN_ERR_SUCCESS; + struct sockaddr_storage sa_storage; + ares_socklen_t salen = 0; + struct sockaddr *sa = NULL; + + *written = 0; + + /* Don't try to write if not doing initial TFO and not connected */ + if (conn->flags & ARES_CONN_FLAG_TCP && + !(conn->state_flags & ARES_CONN_STATE_CONNECTED) && + !(conn->flags & ARES_CONN_FLAG_TFO_INITIAL)) { + return ARES_CONN_ERR_WOULDBLOCK; + } + + /* On initial write during TFO we need to send an address */ + if (conn->flags & ARES_CONN_FLAG_TFO_INITIAL) { + salen = sizeof(sa_storage); + sa = (struct sockaddr *)&sa_storage; + + conn->flags &= ~((unsigned int)ARES_CONN_FLAG_TFO_INITIAL); + is_tfo = ARES_TRUE; + + if (ares_conn_set_sockaddr(conn, sa, &salen) != ARES_SUCCESS) { + return ARES_CONN_ERR_FAILURE; + } + } + + err = ares_socket_write(channel, conn->fd, data, len, written, sa, salen); + if (err != ARES_CONN_ERR_SUCCESS) { + goto done; + } + + if (is_tfo) { + /* If using TFO, we might not have been able to get an IP earlier, since + * we hadn't informed the OS of the destination. When using sendto() + * now we have so we should be able to fetch it */ + ares_conn_set_self_ip(conn, ARES_FALSE); + goto done; + } + +done: + if (err == ARES_CONN_ERR_SUCCESS && len == *written) { + /* Wrote all data, make sure we're not listening for write events unless + * using TFO, in which case we'll need a write event to know when + * we're connected. */ + ares_conn_sock_state_cb_update( + conn, ARES_CONN_STATE_READ | + (is_tfo ? ARES_CONN_STATE_WRITE : ARES_CONN_STATE_NONE)); + } else if (err == ARES_CONN_ERR_WOULDBLOCK) { + /* Need to wait on more buffer space to write */ + ares_conn_sock_state_cb_update(conn, ARES_CONN_STATE_READ | + ARES_CONN_STATE_WRITE); + } + + return err; +} + +ares_status_t ares_conn_flush(ares_conn_t *conn) +{ + const unsigned char *data; + size_t data_len; + size_t count; + ares_conn_err_t err; + ares_status_t status; + ares_bool_t tfo = ARES_FALSE; + + if (conn == NULL) { + return ARES_EFORMERR; + } + + if (conn->flags & ARES_CONN_FLAG_TFO_INITIAL) { + tfo = ARES_TRUE; + } + + do { + if (ares_buf_len(conn->out_buf) == 0) { + status = ARES_SUCCESS; + goto done; + } + + if (conn->flags & ARES_CONN_FLAG_TCP) { + data = ares_buf_peek(conn->out_buf, &data_len); + } else { + unsigned short msg_len; + + /* Read length, then provide buffer without length */ + ares_buf_tag(conn->out_buf); + status = ares_buf_fetch_be16(conn->out_buf, &msg_len); + if (status != ARES_SUCCESS) { + return status; + } + ares_buf_tag_rollback(conn->out_buf); + + data = ares_buf_peek(conn->out_buf, &data_len); + if (data_len < (size_t)(msg_len + 2)) { + status = ARES_EFORMERR; + goto done; + } + data += 2; + data_len = msg_len; + } + + err = ares_conn_write(conn, data, data_len, &count); + if (err != ARES_CONN_ERR_SUCCESS) { + if (err != ARES_CONN_ERR_WOULDBLOCK) { + status = ARES_ECONNREFUSED; + goto done; + } + status = ARES_SUCCESS; + goto done; + } + + /* UDP didn't send the length prefix so augment that here */ + if (!(conn->flags & ARES_CONN_FLAG_TCP)) { + count += 2; + } + + /* Strip data written from the buffer */ + ares_buf_consume(conn->out_buf, count); + status = ARES_SUCCESS; + + /* Loop only for UDP since we have to send per-packet. We already + * sent everything we could if using tcp */ + } while (!(conn->flags & ARES_CONN_FLAG_TCP)); + +done: + if (status == ARES_SUCCESS) { + ares_conn_state_flags_t flags = ARES_CONN_STATE_READ; + + /* When using TFO, the we need to enabling waiting on a write event to + * be notified of when a connection is actually established */ + if (tfo) { + flags |= ARES_CONN_STATE_WRITE; + } + + /* If using TCP and not all data was written (partial write), that means + * we need to also wait on a write event */ + if (conn->flags & ARES_CONN_FLAG_TCP && ares_buf_len(conn->out_buf)) { + flags |= ARES_CONN_STATE_WRITE; + } + + ares_conn_sock_state_cb_update(conn, flags); + } + + return status; +} + +static ares_status_t ares_conn_connect(ares_conn_t *conn, + const struct sockaddr *sa, + ares_socklen_t salen) +{ + ares_conn_err_t err; + + err = ares_socket_connect( + conn->server->channel, conn->fd, + (conn->flags & ARES_CONN_FLAG_TFO) ? ARES_TRUE : ARES_FALSE, sa, salen); + + if (err != ARES_CONN_ERR_WOULDBLOCK && err != ARES_CONN_ERR_SUCCESS) { + return ARES_ECONNREFUSED; + } + return ARES_SUCCESS; +} + +ares_status_t ares_open_connection(ares_conn_t **conn_out, + ares_channel_t *channel, + ares_server_t *server, ares_bool_t is_tcp) +{ + ares_status_t status; + struct sockaddr_storage sa_storage; + ares_socklen_t salen = sizeof(sa_storage); + struct sockaddr *sa = (struct sockaddr *)&sa_storage; + ares_conn_t *conn; + ares_llist_node_t *node = NULL; + int stype = is_tcp ? SOCK_STREAM : SOCK_DGRAM; + ares_conn_state_flags_t state_flags; + + *conn_out = NULL; + + conn = ares_malloc(sizeof(*conn)); + if (conn == NULL) { + return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ + } + + memset(conn, 0, sizeof(*conn)); + conn->fd = ARES_SOCKET_BAD; + conn->server = server; + conn->queries_to_conn = ares_llist_create(NULL); + conn->flags = is_tcp ? ARES_CONN_FLAG_TCP : ARES_CONN_FLAG_NONE; + conn->out_buf = ares_buf_create(); + conn->in_buf = ares_buf_create(); + + if (conn->queries_to_conn == NULL || conn->out_buf == NULL || + conn->in_buf == NULL) { + /* LCOV_EXCL_START: OutOfMemory */ + status = ARES_ENOMEM; + goto done; + /* LCOV_EXCL_STOP */ + } + + /* Try to enable TFO always if using TCP. it will fail later on if its + * really not supported when we try to enable it on the socket. */ + if (conn->flags & ARES_CONN_FLAG_TCP) { + conn->flags |= ARES_CONN_FLAG_TFO; + } + + /* Convert into the struct sockaddr structure needed by the OS */ + status = ares_conn_set_sockaddr(conn, sa, &salen); + if (status != ARES_SUCCESS) { + goto done; + } + + /* Acquire a socket. */ + if (ares_socket_open(&conn->fd, channel, server->addr.family, stype, 0) != + ARES_CONN_ERR_SUCCESS) { + status = ARES_ECONNREFUSED; + goto done; + } + + /* Configure channel configured options */ + status = ares_socket_configure( + channel, server->addr.family, + (conn->flags & ARES_CONN_FLAG_TCP) ? ARES_TRUE : ARES_FALSE, conn->fd); + if (status != ARES_SUCCESS) { + goto done; + } + + /* Enable TFO if possible */ + if (conn->flags & ARES_CONN_FLAG_TFO && + ares_socket_enable_tfo(channel, conn->fd) != ARES_CONN_ERR_SUCCESS) { + conn->flags &= ~((unsigned int)ARES_CONN_FLAG_TFO); + } + + if (channel->sock_config_cb) { + int err = + channel->sock_config_cb(conn->fd, stype, channel->sock_config_cb_data); + if (err < 0) { + status = ARES_ECONNREFUSED; + goto done; + } + } + + /* Connect */ + status = ares_conn_connect(conn, sa, salen); + if (status != ARES_SUCCESS) { + goto done; + } + + if (channel->sock_create_cb) { + int err = + channel->sock_create_cb(conn->fd, stype, channel->sock_create_cb_data); + if (err < 0) { + status = ARES_ECONNREFUSED; + goto done; + } + } + + /* Let the connection know we haven't written our first packet yet for TFO */ + if (conn->flags & ARES_CONN_FLAG_TFO) { + conn->flags |= ARES_CONN_FLAG_TFO_INITIAL; + } + + /* Need to store our own ip for DNS cookie support */ + status = ares_conn_set_self_ip(conn, ARES_TRUE); + if (status != ARES_SUCCESS) { + goto done; /* LCOV_EXCL_LINE: UntestablePath */ + } + + /* TCP connections are thrown to the end as we don't spawn multiple TCP + * connections. UDP connections are put on front where the newest connection + * can be quickly pulled */ + if (is_tcp) { + node = ares_llist_insert_last(server->connections, conn); + } else { + node = ares_llist_insert_first(server->connections, conn); + } + if (node == NULL) { + /* LCOV_EXCL_START: OutOfMemory */ + status = ARES_ENOMEM; + goto done; + /* LCOV_EXCL_STOP */ + } + + /* Register globally to quickly map event on file descriptor to connection + * node object */ + if (!ares_htable_asvp_insert(channel->connnode_by_socket, conn->fd, node)) { + /* LCOV_EXCL_START: OutOfMemory */ + status = ARES_ENOMEM; + goto done; + /* LCOV_EXCL_STOP */ + } + + state_flags = ARES_CONN_STATE_READ; + + /* Get notified on connect if using TCP */ + if (conn->flags & ARES_CONN_FLAG_TCP) { + state_flags |= ARES_CONN_STATE_WRITE; + } + + /* Dot no attempt to update sock state callbacks on TFO until *after* the + * initial write is performed. Due to the notification event, its possible + * an erroneous read can come in before the attempt to write the data which + * might be used to set the ip address */ + if (!(conn->flags & ARES_CONN_FLAG_TFO_INITIAL)) { + ares_conn_sock_state_cb_update(conn, state_flags); + } + + if (is_tcp) { + server->tcp_conn = conn; + } + +done: + if (status != ARES_SUCCESS) { + ares_llist_node_claim(node); + ares_llist_destroy(conn->queries_to_conn); + ares_socket_close(channel, conn->fd); + ares_buf_destroy(conn->out_buf); + ares_buf_destroy(conn->in_buf); + ares_free(conn); + } else { + *conn_out = conn; + } + return status; +} + +ares_conn_t *ares_conn_from_fd(const ares_channel_t *channel, ares_socket_t fd) +{ + ares_llist_node_t *node; + + node = ares_htable_asvp_get_direct(channel->connnode_by_socket, fd); + if (node == NULL) { + return NULL; + } + + return ares_llist_node_val(node); +} diff --git a/deps/cares/src/lib/ares_conn.h b/deps/cares/src/lib/ares_conn.h new file mode 100644 index 00000000000000..16ecefdd19fa67 --- /dev/null +++ b/deps/cares/src/lib/ares_conn.h @@ -0,0 +1,196 @@ +/* MIT License + * + * Copyright (c) 2024 Brad House + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ +#ifndef __ARES_CONN_H +#define __ARES_CONN_H + +#include "ares_socket.h" + +struct ares_conn; +typedef struct ares_conn ares_conn_t; + +struct ares_server; +typedef struct ares_server ares_server_t; + +typedef enum { + /*! No flags */ + ARES_CONN_FLAG_NONE = 0, + /*! TCP connection, not UDP */ + ARES_CONN_FLAG_TCP = 1 << 0, + /*! TCP Fast Open is enabled and being used if supported by the OS */ + ARES_CONN_FLAG_TFO = 1 << 1, + /*! TCP Fast Open has not yet sent its first packet. Gets unset on first + * write to a connection */ + ARES_CONN_FLAG_TFO_INITIAL = 1 << 2 +} ares_conn_flags_t; + +typedef enum { + ARES_CONN_STATE_NONE = 0, + ARES_CONN_STATE_READ = 1 << 0, + ARES_CONN_STATE_WRITE = 1 << 1, + ARES_CONN_STATE_CONNECTED = 1 << 2, /* This doesn't get a callback */ + ARES_CONN_STATE_CBFLAGS = ARES_CONN_STATE_READ | ARES_CONN_STATE_WRITE +} ares_conn_state_flags_t; + +struct ares_conn { + ares_server_t *server; + ares_socket_t fd; + struct ares_addr self_ip; + ares_conn_flags_t flags; + ares_conn_state_flags_t state_flags; + + /*! Outbound buffered data that is not yet sent. Exists as one contiguous + * stream in TCP format (big endian 16bit length prefix followed by DNS + * wire-format message). For TCP this can be sent as-is, UDP this must + * be sent per-packet (stripping the length prefix) */ + ares_buf_t *out_buf; + + /*! Inbound buffered data that is not yet parsed. Exists as one contiguous + * stream in TCP format (big endian 16bit length prefix followed by DNS + * wire-format message). TCP may have partial data and this needs to be + * handled gracefully, but UDP will always have a full message */ + ares_buf_t *in_buf; + + /* total number of queries run on this connection since it was established */ + size_t total_queries; + + /* list of outstanding queries to this connection */ + ares_llist_t *queries_to_conn; +}; + +/*! Various buckets for grouping history */ +typedef enum { + ARES_METRIC_1MINUTE = 0, /*!< Bucket for tracking over the last minute */ + ARES_METRIC_15MINUTES, /*!< Bucket for tracking over the last 15 minutes */ + ARES_METRIC_1HOUR, /*!< Bucket for tracking over the last hour */ + ARES_METRIC_1DAY, /*!< Bucket for tracking over the last day */ + ARES_METRIC_INCEPTION, /*!< Bucket for tracking since inception */ + ARES_METRIC_COUNT /*!< Count of buckets, not a real bucket */ +} ares_server_bucket_t; + +/*! Data metrics collected for each bucket */ +typedef struct { + time_t ts; /*!< Timestamp divided by bucket divisor */ + unsigned int latency_min_ms; /*!< Minimum latency for queries */ + unsigned int latency_max_ms; /*!< Maximum latency for queries */ + ares_uint64_t total_ms; /*!< Cumulative query time for bucket */ + ares_uint64_t total_count; /*!< Number of queries for bucket */ + + time_t prev_ts; /*!< Previous period bucket timestamp */ + ares_uint64_t + prev_total_ms; /*!< Previous period bucket cumulative query time */ + ares_uint64_t prev_total_count; /*!< Previous period bucket query count */ +} ares_server_metrics_t; + +typedef enum { + ARES_COOKIE_INITIAL = 0, + ARES_COOKIE_GENERATED = 1, + ARES_COOKIE_SUPPORTED = 2, + ARES_COOKIE_UNSUPPORTED = 3 +} ares_cookie_state_t; + +/*! Structure holding tracking data for RFC 7873/9018 DNS cookies. + * Implementation plan for this feature is here: + * https://github.com/c-ares/c-ares/issues/620 + */ +typedef struct { + /*! starts at INITIAL, transitions as needed. */ + ares_cookie_state_t state; + /*! randomly-generate client cookie */ + unsigned char client[8]; + /*! timestamp client cookie was generated, used for rotation purposes */ + ares_timeval_t client_ts; + /*! IP address last used for client to connect to server. If this changes + * The client cookie gets invalidated */ + struct ares_addr client_ip; + /*! Server Cookie last received, 8-32 bytes in length */ + unsigned char server[32]; + /*! Length of server cookie on file. */ + size_t server_len; + /*! Timestamp of last attempt to use cookies, but it was determined that the + * server didn't support them */ + ares_timeval_t unsupported_ts; +} ares_cookie_t; + +struct ares_server { + /* Configuration */ + size_t idx; /* index for server in system configuration */ + struct ares_addr addr; + unsigned short udp_port; /* host byte order */ + unsigned short tcp_port; /* host byte order */ + char ll_iface[64]; /* IPv6 Link Local Interface */ + unsigned int ll_scope; /* IPv6 Link Local Scope */ + + size_t consec_failures; /* Consecutive query failure count + * can be hard errors or timeouts + */ + ares_bool_t probe_pending; /* Whether a probe is pending for this + * server due to prior failures */ + ares_llist_t *connections; + ares_conn_t *tcp_conn; + + /* The next time when we will retry this server if it has hit failures */ + ares_timeval_t next_retry_time; + + /*! Buckets for collecting metrics about the server */ + ares_server_metrics_t metrics[ARES_METRIC_COUNT]; + + /*! RFC 7873/9018 DNS Cookies */ + ares_cookie_t cookie; + + /* Link back to owning channel */ + ares_channel_t *channel; +}; + +void ares_close_connection(ares_conn_t *conn, ares_status_t requeue_status); +void ares_close_sockets(ares_server_t *server); +void ares_check_cleanup_conns(const ares_channel_t *channel); + +void ares_destroy_servers_state(ares_channel_t *channel); +ares_status_t ares_open_connection(ares_conn_t **conn_out, + ares_channel_t *channel, + ares_server_t *server, ares_bool_t is_tcp); + +ares_conn_err_t ares_conn_write(ares_conn_t *conn, const void *data, size_t len, + size_t *written); +ares_status_t ares_conn_flush(ares_conn_t *conn); +ares_conn_err_t ares_conn_read(ares_conn_t *conn, void *data, size_t len, + size_t *read_bytes); +ares_conn_t *ares_conn_from_fd(const ares_channel_t *channel, ares_socket_t fd); +void ares_conn_sock_state_cb_update(ares_conn_t *conn, + ares_conn_state_flags_t flags); +ares_conn_err_t ares_socket_recv(ares_channel_t *channel, ares_socket_t s, + ares_bool_t is_tcp, void *data, + size_t data_len, size_t *read_bytes); +ares_conn_err_t ares_socket_recvfrom(ares_channel_t *channel, ares_socket_t s, + ares_bool_t is_tcp, void *data, + size_t data_len, int flags, + struct sockaddr *from, + ares_socklen_t *from_len, + size_t *read_bytes); + +void ares_destroy_server(ares_server_t *server); + +#endif diff --git a/deps/cares/src/lib/ares_cookie.c b/deps/cares/src/lib/ares_cookie.c index bf9d1ba25da41d..f31c74e748d974 100644 --- a/deps/cares/src/lib/ares_cookie.c +++ b/deps/cares/src/lib/ares_cookie.c @@ -229,7 +229,7 @@ static ares_bool_t timeval_expired(const ares_timeval_t *tv, { ares_int64_t tvdiff_ms; ares_timeval_t tvdiff; - ares__timeval_diff(&tvdiff, tv, now); + ares_timeval_diff(&tvdiff, tv, now); tvdiff_ms = tvdiff.sec * 1000 + tvdiff.usec / 1000; if (tvdiff_ms >= (ares_int64_t)millsecs) { @@ -249,7 +249,7 @@ static void ares_cookie_generate(ares_cookie_t *cookie, ares_conn_t *conn, { ares_channel_t *channel = conn->server->channel; - ares__rand_bytes(channel->rand_state, cookie->client, sizeof(cookie->client)); + ares_rand_bytes(channel->rand_state, cookie->client, sizeof(cookie->client)); memcpy(&cookie->client_ts, now, sizeof(cookie->client_ts)); memcpy(&cookie->client_ip, &conn->self_ip, sizeof(cookie->client_ip)); } @@ -426,9 +426,8 @@ ares_status_t ares_cookie_validate(ares_query_t *query, /* Resend the request, hopefully it will work the next time as we should * have recorded a server cookie */ - ares__requeue_query(query, now, ARES_SUCCESS, - ARES_FALSE /* Don't increment try count */, - NULL); + ares_requeue_query(query, now, ARES_SUCCESS, + ARES_FALSE /* Don't increment try count */, NULL); /* Parent needs to drop this response */ return ARES_EBADRESP; diff --git a/deps/cares/src/lib/ares_destroy.c b/deps/cares/src/lib/ares_destroy.c index d75b5e227cc28d..1e5706e0e06b80 100644 --- a/deps/cares/src/lib/ares_destroy.c +++ b/deps/cares/src/lib/ares_destroy.c @@ -31,17 +31,17 @@ void ares_destroy(ares_channel_t *channel) { - size_t i; - ares__llist_node_t *node = NULL; + size_t i; + ares_llist_node_t *node = NULL; if (channel == NULL) { return; } /* Mark as being shutdown */ - ares__channel_lock(channel); + ares_channel_lock(channel); channel->sys_up = ARES_FALSE; - ares__channel_unlock(channel); + ares_channel_unlock(channel); /* Disable configuration change monitoring. We can't hold a lock because * some cleanup routines, such as on Windows, are synchronous operations. @@ -61,23 +61,23 @@ void ares_destroy(ares_channel_t *channel) * holding a lock as the thread may take locks. */ if (channel->reinit_thread != NULL) { void *rv; - ares__thread_join(channel->reinit_thread, &rv); + ares_thread_join(channel->reinit_thread, &rv); channel->reinit_thread = NULL; } /* Lock because callbacks will be triggered, and any system-generated * callbacks need to hold a channel lock. */ - ares__channel_lock(channel); + ares_channel_lock(channel); /* Destroy all queries */ - node = ares__llist_node_first(channel->all_queries); + node = ares_llist_node_first(channel->all_queries); while (node != NULL) { - ares__llist_node_t *next = ares__llist_node_next(node); - ares_query_t *query = ares__llist_node_claim(node); + ares_llist_node_t *next = ares_llist_node_next(node); + ares_query_t *query = ares_llist_node_claim(node); query->node_all_queries = NULL; query->callback(query->arg, ARES_EDESTRUCTION, 0, NULL); - ares__free_query(query); + ares_free_query(query); node = next; } @@ -88,19 +88,19 @@ void ares_destroy(ares_channel_t *channel) /* Freeing the query should remove it from all the lists in which it sits, * so all query lists should be empty now. */ - assert(ares__llist_len(channel->all_queries) == 0); - assert(ares__htable_szvp_num_keys(channel->queries_by_qid) == 0); - assert(ares__slist_len(channel->queries_by_timeout) == 0); + assert(ares_llist_len(channel->all_queries) == 0); + assert(ares_htable_szvp_num_keys(channel->queries_by_qid) == 0); + assert(ares_slist_len(channel->queries_by_timeout) == 0); #endif - ares__destroy_servers_state(channel); + ares_destroy_servers_state(channel); #ifndef NDEBUG - assert(ares__htable_asvp_num_keys(channel->connnode_by_socket) == 0); + assert(ares_htable_asvp_num_keys(channel->connnode_by_socket) == 0); #endif /* No more callbacks will be triggered after this point, unlock */ - ares__channel_unlock(channel); + ares_channel_unlock(channel); /* Shut down the event thread */ if (channel->optmask & ARES_OPT_EVENT_THREAD) { @@ -114,48 +114,46 @@ void ares_destroy(ares_channel_t *channel) ares_free(channel->domains); } - ares__llist_destroy(channel->all_queries); - ares__slist_destroy(channel->queries_by_timeout); - ares__htable_szvp_destroy(channel->queries_by_qid); - ares__htable_asvp_destroy(channel->connnode_by_socket); + ares_llist_destroy(channel->all_queries); + ares_slist_destroy(channel->queries_by_timeout); + ares_htable_szvp_destroy(channel->queries_by_qid); + ares_htable_asvp_destroy(channel->connnode_by_socket); ares_free(channel->sortlist); ares_free(channel->lookups); ares_free(channel->resolvconf_path); ares_free(channel->hosts_path); - ares__destroy_rand_state(channel->rand_state); + ares_destroy_rand_state(channel->rand_state); - ares__hosts_file_destroy(channel->hf); + ares_hosts_file_destroy(channel->hf); - ares__qcache_destroy(channel->qcache); + ares_qcache_destroy(channel->qcache); - ares__channel_threading_destroy(channel); + ares_channel_threading_destroy(channel); ares_free(channel); } -void ares__destroy_server(ares_server_t *server) +void ares_destroy_server(ares_server_t *server) { if (server == NULL) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ } - ares__close_sockets(server); - ares__llist_destroy(server->connections); - ares__buf_destroy(server->tcp_parser); - ares__buf_destroy(server->tcp_send); + ares_close_sockets(server); + ares_llist_destroy(server->connections); ares_free(server); } -void ares__destroy_servers_state(ares_channel_t *channel) +void ares_destroy_servers_state(ares_channel_t *channel) { - ares__slist_node_t *node; + ares_slist_node_t *node; - while ((node = ares__slist_node_first(channel->servers)) != NULL) { - ares_server_t *server = ares__slist_node_claim(node); - ares__destroy_server(server); + while ((node = ares_slist_node_first(channel->servers)) != NULL) { + ares_server_t *server = ares_slist_node_claim(node); + ares_destroy_server(server); } - ares__slist_destroy(channel->servers); + ares_slist_destroy(channel->servers); channel->servers = NULL; } diff --git a/deps/cares/src/lib/ares_freeaddrinfo.c b/deps/cares/src/lib/ares_freeaddrinfo.c index 2a49f57531e9bb..c996df9104a18a 100644 --- a/deps/cares/src/lib/ares_freeaddrinfo.c +++ b/deps/cares/src/lib/ares_freeaddrinfo.c @@ -31,7 +31,7 @@ # include #endif -void ares__freeaddrinfo_cnames(struct ares_addrinfo_cname *head) +void ares_freeaddrinfo_cnames(struct ares_addrinfo_cname *head) { struct ares_addrinfo_cname *current; while (head) { @@ -43,7 +43,7 @@ void ares__freeaddrinfo_cnames(struct ares_addrinfo_cname *head) } } -void ares__freeaddrinfo_nodes(struct ares_addrinfo_node *head) +void ares_freeaddrinfo_nodes(struct ares_addrinfo_node *head) { struct ares_addrinfo_node *current; while (head) { @@ -59,8 +59,8 @@ void ares_freeaddrinfo(struct ares_addrinfo *ai) if (ai == NULL) { return; } - ares__freeaddrinfo_cnames(ai->cnames); - ares__freeaddrinfo_nodes(ai->nodes); + ares_freeaddrinfo_cnames(ai->cnames); + ares_freeaddrinfo_nodes(ai->nodes); ares_free(ai->name); ares_free(ai); diff --git a/deps/cares/src/lib/ares_getaddrinfo.c b/deps/cares/src/lib/ares_getaddrinfo.c index 713acf744a0dca..09d34d337834af 100644 --- a/deps/cares/src/lib/ares_getaddrinfo.c +++ b/deps/cares/src/lib/ares_getaddrinfo.c @@ -58,10 +58,6 @@ #include "ares_dns.h" -#ifdef _WIN32 -# include "ares_platform.h" -#endif - struct host_query { ares_channel_t *channel; char *name; @@ -101,7 +97,7 @@ static const struct ares_addrinfo_hints default_hints = { static ares_bool_t next_dns_lookup(struct host_query *hquery); struct ares_addrinfo_cname * - ares__append_addrinfo_cname(struct ares_addrinfo_cname **head) + ares_append_addrinfo_cname(struct ares_addrinfo_cname **head) { struct ares_addrinfo_cname *tail = ares_malloc_zero(sizeof(*tail)); struct ares_addrinfo_cname *last = *head; @@ -123,8 +119,8 @@ struct ares_addrinfo_cname * return tail; } -void ares__addrinfo_cat_cnames(struct ares_addrinfo_cname **head, - struct ares_addrinfo_cname *tail) +void ares_addrinfo_cat_cnames(struct ares_addrinfo_cname **head, + struct ares_addrinfo_cname *tail) { struct ares_addrinfo_cname *last = *head; if (!last) { @@ -141,7 +137,7 @@ void ares__addrinfo_cat_cnames(struct ares_addrinfo_cname **head, /* Allocate new addrinfo and append to the tail. */ struct ares_addrinfo_node * - ares__append_addrinfo_node(struct ares_addrinfo_node **head) + ares_append_addrinfo_node(struct ares_addrinfo_node **head) { struct ares_addrinfo_node *tail = ares_malloc_zero(sizeof(*tail)); struct ares_addrinfo_node *last = *head; @@ -163,8 +159,8 @@ struct ares_addrinfo_node * return tail; } -void ares__addrinfo_cat_nodes(struct ares_addrinfo_node **head, - struct ares_addrinfo_node *tail) +void ares_addrinfo_cat_nodes(struct ares_addrinfo_node **head, + struct ares_addrinfo_node *tail) { struct ares_addrinfo_node *last = *head; if (!last) { @@ -252,7 +248,7 @@ static ares_bool_t fake_addrinfo(const char *name, unsigned short port, ares_bool_t valid = ARES_TRUE; const char *p; for (p = name; *p; p++) { - if (!ares__isdigit(*p) && *p != '.') { + if (!ares_isdigit(*p) && *p != '.') { valid = ARES_FALSE; break; } else if (*p == '.') { @@ -297,7 +293,7 @@ static ares_bool_t fake_addrinfo(const char *name, unsigned short port, } if (hints->ai_flags & ARES_AI_CANONNAME) { - cname = ares__append_addrinfo_cname(&ai->cnames); + cname = ares_append_addrinfo_cname(&ai->cnames); if (!cname) { /* LCOV_EXCL_START: OutOfMemory */ ares_freeaddrinfo(ai); @@ -327,7 +323,7 @@ static void hquery_free(struct host_query *hquery, ares_bool_t cleanup_ai) if (cleanup_ai) { ares_freeaddrinfo(hquery->ai); } - ares__strsplit_free(hquery->names, hquery->names_cnt); + ares_strsplit_free(hquery->names, hquery->names_cnt); ares_free(hquery->name); ares_free(hquery->lookups); ares_free(hquery); @@ -341,7 +337,7 @@ static void end_hquery(struct host_query *hquery, ares_status_t status) if (status == ARES_SUCCESS) { if (!(hquery->hints.ai_flags & ARES_AI_NOSORT) && hquery->ai->nodes) { sentinel.ai_next = hquery->ai->nodes; - ares__sortaddrinfo(hquery->channel, &sentinel); + ares_sortaddrinfo(hquery->channel, &sentinel); hquery->ai->nodes = sentinel.ai_next; } next = hquery->ai->nodes; @@ -361,7 +357,7 @@ static void end_hquery(struct host_query *hquery, ares_status_t status) hquery_free(hquery, ARES_FALSE); } -ares_bool_t ares__is_localhost(const char *name) +ares_bool_t ares_is_localhost(const char *name) { /* RFC6761 6.3 says : The domain "localhost." and any names falling within * ".localhost." */ @@ -371,7 +367,7 @@ ares_bool_t ares__is_localhost(const char *name) return ARES_FALSE; /* LCOV_EXCL_LINE: DefensiveCoding */ } - if (strcmp(name, "localhost") == 0) { + if (ares_strcaseeq(name, "localhost")) { return ARES_TRUE; } @@ -380,7 +376,8 @@ ares_bool_t ares__is_localhost(const char *name) return ARES_FALSE; } - if (strcmp(name + (len - 10 /* strlen(".localhost") */), ".localhost") == 0) { + if (ares_strcaseeq(name + (len - 10 /* strlen(".localhost") */), + ".localhost")) { return ARES_TRUE; } @@ -393,11 +390,11 @@ static ares_status_t file_lookup(struct host_query *hquery) ares_status_t status; /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */ - if (ares__is_onion_domain(hquery->name)) { + if (ares_is_onion_domain(hquery->name)) { return ARES_ENOTFOUND; } - status = ares__hosts_search_host( + status = ares_hosts_search_host( hquery->channel, (hquery->hints.ai_flags & ARES_AI_ENVHOSTS) ? ARES_TRUE : ARES_FALSE, hquery->name, &entry); @@ -406,7 +403,7 @@ static ares_status_t file_lookup(struct host_query *hquery) goto done; } - status = ares__hosts_entry_to_addrinfo( + status = ares_hosts_entry_to_addrinfo( entry, hquery->name, hquery->hints.ai_family, hquery->port, (hquery->hints.ai_flags & ARES_AI_CANONNAME) ? ARES_TRUE : ARES_FALSE, hquery->ai); @@ -423,9 +420,9 @@ static ares_status_t file_lookup(struct host_query *hquery) * We will also ignore ALL errors when trying to resolve localhost, such * as permissions errors reading /etc/hosts or a malformed /etc/hosts */ if (status != ARES_SUCCESS && status != ARES_ENOMEM && - ares__is_localhost(hquery->name)) { - return ares__addrinfo_localhost(hquery->name, hquery->port, &hquery->hints, - hquery->ai); + ares_is_localhost(hquery->name)) { + return ares_addrinfo_localhost(hquery->name, hquery->port, &hquery->hints, + hquery->ai); } return status; @@ -439,7 +436,7 @@ static void next_lookup(struct host_query *hquery, ares_status_t status) * queries for localhost names to their configured caching DNS * server(s)." * Otherwise, DNS lookup. */ - if (!ares__is_localhost(hquery->name) && next_dns_lookup(hquery)) { + if (!ares_is_localhost(hquery->name) && next_dns_lookup(hquery)) { break; } @@ -476,7 +473,7 @@ static void terminate_retries(const struct host_query *hquery, return; } - query = ares__htable_szvp_get_direct(channel->queries_by_qid, term_qid); + query = ares_htable_szvp_get_direct(channel->queries_by_qid, term_qid); if (query == NULL) { return; } @@ -497,7 +494,7 @@ static void host_callback(void *arg, ares_status_t status, size_t timeouts, addinfostatus = ARES_EBADRESP; /* LCOV_EXCL_LINE: DefensiveCoding */ } else { addinfostatus = - ares__parse_into_addrinfo(dnsrec, ARES_TRUE, hquery->port, hquery->ai); + ares_parse_into_addrinfo(dnsrec, ARES_TRUE, hquery->port, hquery->ai); } if (addinfostatus == ARES_SUCCESS) { terminate_retries(hquery, ares_dns_record_get_id(dnsrec)); @@ -528,10 +525,9 @@ static void host_callback(void *arg, ares_status_t status, size_t timeouts, hquery->nodata_cnt++; } next_lookup(hquery, hquery->nodata_cnt ? ARES_ENODATA : status); - } else if ( - (status == ARES_ESERVFAIL || status == ARES_EREFUSED) && - ares__name_label_cnt(hquery->names[hquery->next_name_idx-1]) == 1 - ) { + } else if ((status == ARES_ESERVFAIL || status == ARES_EREFUSED) && + ares_name_label_cnt(hquery->names[hquery->next_name_idx - 1]) == + 1) { /* Issue #852, systemd-resolved may return SERVFAIL or REFUSED on a * single label domain name. */ next_lookup(hquery, hquery->nodata_cnt ? ARES_ENODATA : status); @@ -567,7 +563,7 @@ static void ares_getaddrinfo_int(ares_channel_t *channel, const char *name, return; } - if (ares__is_onion_domain(name)) { + if (ares_is_onion_domain(name)) { callback(arg, ARES_ENOTFOUND, 0, NULL); return; } @@ -630,7 +626,7 @@ static void ares_getaddrinfo_int(ares_channel_t *channel, const char *name, } status = - ares__search_name_list(channel, name, &hquery->names, &hquery->names_cnt); + ares_search_name_list(channel, name, &hquery->names, &hquery->names_cnt); if (status != ARES_SUCCESS) { hquery_free(hquery, ARES_TRUE); callback(arg, (int)status, 0, NULL); @@ -659,9 +655,9 @@ void ares_getaddrinfo(ares_channel_t *channel, const char *name, if (channel == NULL) { return; } - ares__channel_lock(channel); + ares_channel_lock(channel); ares_getaddrinfo_int(channel, name, service, hints, callback, arg); - ares__channel_unlock(channel); + ares_channel_unlock(channel); } static ares_bool_t next_dns_lookup(struct host_query *hquery) diff --git a/deps/cares/src/lib/ares_gethostbyaddr.c b/deps/cares/src/lib/ares_gethostbyaddr.c index 1db81ec2b48b9d..a7acf3c45c9e6d 100644 --- a/deps/cares/src/lib/ares_gethostbyaddr.c +++ b/deps/cares/src/lib/ares_gethostbyaddr.c @@ -39,7 +39,6 @@ #include "ares_nameser.h" #include "ares_inet_net_pton.h" -#include "ares_platform.h" struct addr_query { /* Arguments passed to ares_gethostbyaddr() */ @@ -112,9 +111,9 @@ void ares_gethostbyaddr(ares_channel_t *channel, const void *addr, int addrlen, if (channel == NULL) { return; } - ares__channel_lock(channel); + ares_channel_lock(channel); ares_gethostbyaddr_nolock(channel, addr, addrlen, family, callback, arg); - ares__channel_unlock(channel); + ares_channel_unlock(channel); } static void next_lookup(struct addr_query *aquery) @@ -216,12 +215,12 @@ static ares_status_t file_lookup(ares_channel_t *channel, return ARES_ENOTFOUND; } - status = ares__hosts_search_ipaddr(channel, ARES_FALSE, ipaddr, &entry); + status = ares_hosts_search_ipaddr(channel, ARES_FALSE, ipaddr, &entry); if (status != ARES_SUCCESS) { return status; } - status = ares__hosts_entry_to_hostent(entry, addr->family, host); + status = ares_hosts_entry_to_hostent(entry, addr->family, host); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } diff --git a/deps/cares/src/lib/ares_gethostbyname.c b/deps/cares/src/lib/ares_gethostbyname.c index 6db86e0eed1c65..56de729526af34 100644 --- a/deps/cares/src/lib/ares_gethostbyname.c +++ b/deps/cares/src/lib/ares_gethostbyname.c @@ -44,7 +44,6 @@ #endif #include "ares_inet_net_pton.h" -#include "ares_platform.h" static void sort_addresses(const struct hostent *host, const struct apattern *sortlist, size_t nsort); @@ -68,7 +67,7 @@ static void ares_gethostbyname_callback(void *arg, int status, int timeouts, struct host_query *ghbn_arg = arg; if (status == ARES_SUCCESS) { - status = (int)ares__addrinfo2hostent(result, AF_UNSPEC, &hostent); + status = (int)ares_addrinfo2hostent(result, AF_UNSPEC, &hostent); } /* addrinfo2hostent will only return ENODATA if there are no addresses _and_ @@ -175,7 +174,7 @@ static size_t get_address_index(const struct in_addr *addr, continue; } - if (ares__subnet_match(&aaddr, &sortlist[i].addr, sortlist[i].mask)) { + if (ares_subnet_match(&aaddr, &sortlist[i].addr, sortlist[i].mask)) { break; } } @@ -231,15 +230,15 @@ static size_t get6_address_index(const struct ares_in6_addr *addr, continue; } - if (ares__subnet_match(&aaddr, &sortlist[i].addr, sortlist[i].mask)) { + if (ares_subnet_match(&aaddr, &sortlist[i].addr, sortlist[i].mask)) { break; } } return i; } -static ares_status_t ares__hostent_localhost(const char *name, int family, - struct hostent **host_out) +static ares_status_t ares_hostent_localhost(const char *name, int family, + struct hostent **host_out) { ares_status_t status; struct ares_addrinfo *ai = NULL; @@ -254,12 +253,12 @@ static ares_status_t ares__hostent_localhost(const char *name, int family, goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__addrinfo_localhost(name, 0, &hints, ai); + status = ares_addrinfo_localhost(name, 0, &hints, ai); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__addrinfo2hostent(ai, family, host_out); + status = ares_addrinfo2hostent(ai, family, host_out); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -289,16 +288,16 @@ static ares_status_t ares_gethostbyname_file_int(ares_channel_t *channel, } /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */ - if (ares__is_onion_domain(name)) { + if (ares_is_onion_domain(name)) { return ARES_ENOTFOUND; } - status = ares__hosts_search_host(channel, ARES_FALSE, name, &entry); + status = ares_hosts_search_host(channel, ARES_FALSE, name, &entry); if (status != ARES_SUCCESS) { goto done; } - status = ares__hosts_entry_to_hostent(entry, family, host); + status = ares_hosts_entry_to_hostent(entry, family, host); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -310,8 +309,8 @@ static ares_status_t ares_gethostbyname_file_int(ares_channel_t *channel, * We will also ignore ALL errors when trying to resolve localhost, such * as permissions errors reading /etc/hosts or a malformed /etc/hosts */ if (status != ARES_SUCCESS && status != ARES_ENOMEM && - ares__is_localhost(name)) { - return ares__hostent_localhost(name, family, host); + ares_is_localhost(name)) { + return ares_hostent_localhost(name, family, host); } return status; @@ -325,8 +324,8 @@ int ares_gethostbyname_file(ares_channel_t *channel, const char *name, return ARES_ENOTFOUND; } - ares__channel_lock(channel); + ares_channel_lock(channel); status = ares_gethostbyname_file_int(channel, name, family, host); - ares__channel_unlock(channel); + ares_channel_unlock(channel); return (int)status; } diff --git a/deps/cares/src/lib/ares_getnameinfo.c b/deps/cares/src/lib/ares_getnameinfo.c index 622c1adb1c7342..01593545308cc4 100644 --- a/deps/cares/src/lib/ares_getnameinfo.c +++ b/deps/cares/src/lib/ares_getnameinfo.c @@ -193,9 +193,9 @@ void ares_getnameinfo(ares_channel_t *channel, const struct sockaddr *sa, return; } - ares__channel_lock(channel); + ares_channel_lock(channel); ares_getnameinfo_int(channel, sa, salen, flags_int, callback, arg); - ares__channel_unlock(channel); + ares_channel_unlock(channel); } static void nameinfo_callback(void *arg, int status, int timeouts, @@ -410,8 +410,8 @@ static char *ares_striendstr(const char *s1, const char *s2) c1 = c1_begin; c2 = s2; while (c2 < s2 + s2_len) { - lo1 = ares__tolower((unsigned char)*c1); - lo2 = ares__tolower((unsigned char)*c2); + lo1 = ares_tolower((unsigned char)*c1); + lo2 = ares_tolower((unsigned char)*c2); if (lo1 != lo2) { return NULL; } else { @@ -423,7 +423,7 @@ static char *ares_striendstr(const char *s1, const char *s2) return (char *)((size_t)c1_begin); } -ares_bool_t ares__is_onion_domain(const char *name) +ares_bool_t ares_is_onion_domain(const char *name) { if (ares_striendstr(name, ".onion")) { return ARES_TRUE; diff --git a/deps/cares/src/lib/ares__hosts_file.c b/deps/cares/src/lib/ares_hosts_file.c similarity index 64% rename from deps/cares/src/lib/ares__hosts_file.c rename to deps/cares/src/lib/ares_hosts_file.c index ae9c071d7aa90b..0439b8e1d476b9 100644 --- a/deps/cares/src/lib/ares__hosts_file.c +++ b/deps/cares/src/lib/ares_hosts_file.c @@ -40,7 +40,6 @@ # include #endif #include -#include "ares_platform.h" /* HOSTS FILE PROCESSING OVERVIEW * ============================== @@ -78,22 +77,22 @@ */ struct ares_hosts_file { - time_t ts; + time_t ts; /*! cache the filename so we know if the filename changes it automatically * invalidates the cache */ - char *filename; + char *filename; /*! iphash is the owner of the 'entry' object as there is only ever a single * match to the object. */ - ares__htable_strvp_t *iphash; + ares_htable_strvp_t *iphash; /*! hosthash does not own the entry so won't free on destruction */ - ares__htable_strvp_t *hosthash; + ares_htable_strvp_t *hosthash; }; struct ares_hosts_entry { - size_t refcnt; /*! If the entry is stored multiple times in the - * ip address hash, we have to reference count it */ - ares__llist_t *ips; - ares__llist_t *hosts; + size_t refcnt; /*! If the entry is stored multiple times in the + * ip address hash, we have to reference count it */ + ares_llist_t *ips; + ares_llist_t *hosts; }; const void *ares_dns_pton(const char *ipaddr, struct ares_addr *addr, @@ -132,8 +131,8 @@ const void *ares_dns_pton(const char *ipaddr, struct ares_addr *addr, return ptr; } -static ares_bool_t ares__normalize_ipaddr(const char *ipaddr, char *out, - size_t out_len) +static ares_bool_t ares_normalize_ipaddr(const char *ipaddr, char *out, + size_t out_len) { struct ares_addr data; const void *addr; @@ -154,7 +153,7 @@ static ares_bool_t ares__normalize_ipaddr(const char *ipaddr, char *out, return ARES_TRUE; } -static void ares__hosts_entry_destroy(ares_hosts_entry_t *entry) +static void ares_hosts_entry_destroy(ares_hosts_entry_t *entry) { if (entry == NULL) { return; @@ -169,29 +168,29 @@ static void ares__hosts_entry_destroy(ares_hosts_entry_t *entry) return; } - ares__llist_destroy(entry->hosts); - ares__llist_destroy(entry->ips); + ares_llist_destroy(entry->hosts); + ares_llist_destroy(entry->ips); ares_free(entry); } -static void ares__hosts_entry_destroy_cb(void *entry) +static void ares_hosts_entry_destroy_cb(void *entry) { - ares__hosts_entry_destroy(entry); + ares_hosts_entry_destroy(entry); } -void ares__hosts_file_destroy(ares_hosts_file_t *hf) +void ares_hosts_file_destroy(ares_hosts_file_t *hf) { if (hf == NULL) { return; } ares_free(hf->filename); - ares__htable_strvp_destroy(hf->hosthash); - ares__htable_strvp_destroy(hf->iphash); + ares_htable_strvp_destroy(hf->hosthash); + ares_htable_strvp_destroy(hf->iphash); ares_free(hf); } -static ares_hosts_file_t *ares__hosts_file_create(const char *filename) +static ares_hosts_file_t *ares_hosts_file_create(const char *filename) { ares_hosts_file_t *hf = ares_malloc_zero(sizeof(*hf)); if (hf == NULL) { @@ -205,12 +204,12 @@ static ares_hosts_file_t *ares__hosts_file_create(const char *filename) goto fail; } - hf->iphash = ares__htable_strvp_create(ares__hosts_entry_destroy_cb); + hf->iphash = ares_htable_strvp_create(ares_hosts_entry_destroy_cb); if (hf->iphash == NULL) { goto fail; } - hf->hosthash = ares__htable_strvp_create(NULL); + hf->hosthash = ares_htable_strvp_create(NULL); if (hf->hosthash == NULL) { goto fail; } @@ -218,7 +217,7 @@ static ares_hosts_file_t *ares__hosts_file_create(const char *filename) return hf; fail: - ares__hosts_file_destroy(hf); + ares_hosts_file_destroy(hf); return NULL; } @@ -228,63 +227,63 @@ typedef enum { ARES_MATCH_HOST = 2 } ares_hosts_file_match_t; -static ares_status_t ares__hosts_file_merge_entry( +static ares_status_t ares_hosts_file_merge_entry( const ares_hosts_file_t *hf, ares_hosts_entry_t *existing, ares_hosts_entry_t *entry, ares_hosts_file_match_t matchtype) { - ares__llist_node_t *node; + ares_llist_node_t *node; /* If we matched on IP address, we know there can only be 1, so there's no * reason to do anything */ if (matchtype != ARES_MATCH_IPADDR) { - while ((node = ares__llist_node_first(entry->ips)) != NULL) { - const char *ipaddr = ares__llist_node_val(node); + while ((node = ares_llist_node_first(entry->ips)) != NULL) { + const char *ipaddr = ares_llist_node_val(node); - if (ares__htable_strvp_get_direct(hf->iphash, ipaddr) != NULL) { - ares__llist_node_destroy(node); + if (ares_htable_strvp_get_direct(hf->iphash, ipaddr) != NULL) { + ares_llist_node_destroy(node); continue; } - ares__llist_node_move_parent_last(node, existing->ips); + ares_llist_node_mvparent_last(node, existing->ips); } } - while ((node = ares__llist_node_first(entry->hosts)) != NULL) { - const char *hostname = ares__llist_node_val(node); + while ((node = ares_llist_node_first(entry->hosts)) != NULL) { + const char *hostname = ares_llist_node_val(node); - if (ares__htable_strvp_get_direct(hf->hosthash, hostname) != NULL) { - ares__llist_node_destroy(node); + if (ares_htable_strvp_get_direct(hf->hosthash, hostname) != NULL) { + ares_llist_node_destroy(node); continue; } - ares__llist_node_move_parent_last(node, existing->hosts); + ares_llist_node_mvparent_last(node, existing->hosts); } - ares__hosts_entry_destroy(entry); + ares_hosts_entry_destroy(entry); return ARES_SUCCESS; } static ares_hosts_file_match_t - ares__hosts_file_match(const ares_hosts_file_t *hf, ares_hosts_entry_t *entry, - ares_hosts_entry_t **match) + ares_hosts_file_match(const ares_hosts_file_t *hf, ares_hosts_entry_t *entry, + ares_hosts_entry_t **match) { - ares__llist_node_t *node; + ares_llist_node_t *node; *match = NULL; - for (node = ares__llist_node_first(entry->ips); node != NULL; - node = ares__llist_node_next(node)) { - const char *ipaddr = ares__llist_node_val(node); - *match = ares__htable_strvp_get_direct(hf->iphash, ipaddr); + for (node = ares_llist_node_first(entry->ips); node != NULL; + node = ares_llist_node_next(node)) { + const char *ipaddr = ares_llist_node_val(node); + *match = ares_htable_strvp_get_direct(hf->iphash, ipaddr); if (*match != NULL) { return ARES_MATCH_IPADDR; } } - for (node = ares__llist_node_first(entry->hosts); node != NULL; - node = ares__llist_node_next(node)) { - const char *host = ares__llist_node_val(node); - *match = ares__htable_strvp_get_direct(hf->hosthash, host); + for (node = ares_llist_node_first(entry->hosts); node != NULL; + node = ares_llist_node_next(node)) { + const char *host = ares_llist_node_val(node); + *match = ares_htable_strvp_get_direct(hf->hosthash, host); if (*match != NULL) { return ARES_MATCH_HOST; } @@ -294,38 +293,38 @@ static ares_hosts_file_match_t } /*! entry is invalidated upon calling this function, always, even on error */ -static ares_status_t ares__hosts_file_add(ares_hosts_file_t *hosts, - ares_hosts_entry_t *entry) +static ares_status_t ares_hosts_file_add(ares_hosts_file_t *hosts, + ares_hosts_entry_t *entry) { ares_hosts_entry_t *match = NULL; ares_status_t status = ARES_SUCCESS; - ares__llist_node_t *node; + ares_llist_node_t *node; ares_hosts_file_match_t matchtype; size_t num_hostnames; /* Record the number of hostnames in this entry file. If we merge into an * existing record, these will be *appended* to the entry, so we'll count * backwards when adding to the hosts hashtable */ - num_hostnames = ares__llist_len(entry->hosts); + num_hostnames = ares_llist_len(entry->hosts); - matchtype = ares__hosts_file_match(hosts, entry, &match); + matchtype = ares_hosts_file_match(hosts, entry, &match); if (matchtype != ARES_MATCH_NONE) { - status = ares__hosts_file_merge_entry(hosts, match, entry, matchtype); + status = ares_hosts_file_merge_entry(hosts, match, entry, matchtype); if (status != ARES_SUCCESS) { - ares__hosts_entry_destroy(entry); /* LCOV_EXCL_LINE: DefensiveCoding */ - return status; /* LCOV_EXCL_LINE: DefensiveCoding */ + ares_hosts_entry_destroy(entry); /* LCOV_EXCL_LINE: DefensiveCoding */ + return status; /* LCOV_EXCL_LINE: DefensiveCoding */ } /* entry was invalidated above by merging */ entry = match; } if (matchtype != ARES_MATCH_IPADDR) { - const char *ipaddr = ares__llist_last_val(entry->ips); + const char *ipaddr = ares_llist_last_val(entry->ips); - if (!ares__htable_strvp_get(hosts->iphash, ipaddr, NULL)) { - if (!ares__htable_strvp_insert(hosts->iphash, ipaddr, entry)) { - ares__hosts_entry_destroy(entry); + if (!ares_htable_strvp_get(hosts->iphash, ipaddr, NULL)) { + if (!ares_htable_strvp_insert(hosts->iphash, ipaddr, entry)) { + ares_hosts_entry_destroy(entry); return ARES_ENOMEM; } entry->refcnt++; @@ -334,9 +333,9 @@ static ares_status_t ares__hosts_file_add(ares_hosts_file_t *hosts, /* Go backwards, on a merge, hostnames are appended. Breakout once we've * consumed all the hosts that we appended */ - for (node = ares__llist_node_last(entry->hosts); node != NULL; - node = ares__llist_node_prev(node)) { - const char *val = ares__llist_node_val(node); + for (node = ares_llist_node_last(entry->hosts); node != NULL; + node = ares_llist_node_prev(node)) { + const char *val = ares_llist_node_val(node); if (num_hostnames == 0) { break; @@ -346,11 +345,11 @@ static ares_status_t ares__hosts_file_add(ares_hosts_file_t *hosts, /* first hostname match wins. If we detect a duplicate hostname for another * ip it will automatically be added to the same entry */ - if (ares__htable_strvp_get(hosts->hosthash, val, NULL)) { + if (ares_htable_strvp_get(hosts->hosthash, val, NULL)) { continue; } - if (!ares__htable_strvp_insert(hosts->hosthash, val, entry)) { + if (!ares_htable_strvp_insert(hosts->hosthash, val, entry)) { return ARES_ENOMEM; } } @@ -358,15 +357,15 @@ static ares_status_t ares__hosts_file_add(ares_hosts_file_t *hosts, return ARES_SUCCESS; } -static ares_bool_t ares__hosts_entry_isdup(ares_hosts_entry_t *entry, - const char *host) +static ares_bool_t ares_hosts_entry_isdup(ares_hosts_entry_t *entry, + const char *host) { - ares__llist_node_t *node; + ares_llist_node_t *node; - for (node = ares__llist_node_first(entry->ips); node != NULL; - node = ares__llist_node_next(node)) { - const char *myhost = ares__llist_node_val(node); - if (strcasecmp(myhost, host) == 0) { + for (node = ares_llist_node_first(entry->ips); node != NULL; + node = ares_llist_node_next(node)) { + const char *myhost = ares_llist_node_val(node); + if (ares_strcaseeq(myhost, host)) { return ARES_TRUE; } } @@ -374,44 +373,44 @@ static ares_bool_t ares__hosts_entry_isdup(ares_hosts_entry_t *entry, return ARES_FALSE; } -static ares_status_t ares__parse_hosts_hostnames(ares__buf_t *buf, - ares_hosts_entry_t *entry) +static ares_status_t ares_parse_hosts_hostnames(ares_buf_t *buf, + ares_hosts_entry_t *entry) { - entry->hosts = ares__llist_create(ares_free); + entry->hosts = ares_llist_create(ares_free); if (entry->hosts == NULL) { return ARES_ENOMEM; } /* Parse hostnames and aliases */ - while (ares__buf_len(buf)) { + while (ares_buf_len(buf)) { char hostname[256]; char *temp; ares_status_t status; unsigned char comment = '#'; - ares__buf_consume_whitespace(buf, ARES_FALSE); + ares_buf_consume_whitespace(buf, ARES_FALSE); - if (ares__buf_len(buf) == 0) { + if (ares_buf_len(buf) == 0) { break; } /* See if it is a comment, if so stop processing */ - if (ares__buf_begins_with(buf, &comment, 1)) { + if (ares_buf_begins_with(buf, &comment, 1)) { break; } - ares__buf_tag(buf); + ares_buf_tag(buf); /* Must be at end of line */ - if (ares__buf_consume_nonwhitespace(buf) == 0) { + if (ares_buf_consume_nonwhitespace(buf) == 0) { break; } - status = ares__buf_tag_fetch_string(buf, hostname, sizeof(hostname)); + status = ares_buf_tag_fetch_string(buf, hostname, sizeof(hostname)); if (status != ARES_SUCCESS) { /* Bad entry, just ignore as long as its not the first. If its the first, * it must be valid */ - if (ares__llist_len(entry->hosts) == 0) { + if (ares_llist_len(entry->hosts) == 0) { return ARES_EBADSTR; } @@ -419,12 +418,12 @@ static ares_status_t ares__parse_hosts_hostnames(ares__buf_t *buf, } /* Validate it is a valid hostname characterset */ - if (!ares__is_hostname(hostname)) { + if (!ares_is_hostname(hostname)) { continue; } /* Don't add a duplicate to the same entry */ - if (ares__hosts_entry_isdup(entry, hostname)) { + if (ares_hosts_entry_isdup(entry, hostname)) { continue; } @@ -434,22 +433,22 @@ static ares_status_t ares__parse_hosts_hostnames(ares__buf_t *buf, return ARES_ENOMEM; } - if (ares__llist_insert_last(entry->hosts, temp) == NULL) { + if (ares_llist_insert_last(entry->hosts, temp) == NULL) { ares_free(temp); return ARES_ENOMEM; } } /* Must have at least 1 entry */ - if (ares__llist_len(entry->hosts) == 0) { + if (ares_llist_len(entry->hosts) == 0) { return ARES_EBADSTR; } return ARES_SUCCESS; } -static ares_status_t ares__parse_hosts_ipaddr(ares__buf_t *buf, - ares_hosts_entry_t **entry_out) +static ares_status_t ares_parse_hosts_ipaddr(ares_buf_t *buf, + ares_hosts_entry_t **entry_out) { char addr[INET6_ADDRSTRLEN]; char *temp; @@ -458,15 +457,15 @@ static ares_status_t ares__parse_hosts_ipaddr(ares__buf_t *buf, *entry_out = NULL; - ares__buf_tag(buf); - ares__buf_consume_nonwhitespace(buf); - status = ares__buf_tag_fetch_string(buf, addr, sizeof(addr)); + ares_buf_tag(buf); + ares_buf_consume_nonwhitespace(buf); + status = ares_buf_tag_fetch_string(buf, addr, sizeof(addr)); if (status != ARES_SUCCESS) { return status; } /* Validate and normalize the ip address format */ - if (!ares__normalize_ipaddr(addr, addr, sizeof(addr))) { + if (!ares_normalize_ipaddr(addr, addr, sizeof(addr))) { return ARES_EBADSTR; } @@ -475,21 +474,21 @@ static ares_status_t ares__parse_hosts_ipaddr(ares__buf_t *buf, return ARES_ENOMEM; } - entry->ips = ares__llist_create(ares_free); + entry->ips = ares_llist_create(ares_free); if (entry->ips == NULL) { - ares__hosts_entry_destroy(entry); + ares_hosts_entry_destroy(entry); return ARES_ENOMEM; } temp = ares_strdup(addr); if (temp == NULL) { - ares__hosts_entry_destroy(entry); + ares_hosts_entry_destroy(entry); return ARES_ENOMEM; } - if (ares__llist_insert_first(entry->ips, temp) == NULL) { + if (ares_llist_insert_first(entry->ips, temp) == NULL) { ares_free(temp); - ares__hosts_entry_destroy(entry); + ares_hosts_entry_destroy(entry); return ARES_ENOMEM; } @@ -498,100 +497,100 @@ static ares_status_t ares__parse_hosts_ipaddr(ares__buf_t *buf, return ARES_SUCCESS; } -static ares_status_t ares__parse_hosts(const char *filename, - ares_hosts_file_t **out) +static ares_status_t ares_parse_hosts(const char *filename, + ares_hosts_file_t **out) { - ares__buf_t *buf = NULL; + ares_buf_t *buf = NULL; ares_status_t status = ARES_EBADRESP; ares_hosts_file_t *hf = NULL; ares_hosts_entry_t *entry = NULL; *out = NULL; - buf = ares__buf_create(); + buf = ares_buf_create(); if (buf == NULL) { status = ARES_ENOMEM; goto done; } - status = ares__buf_load_file(filename, buf); + status = ares_buf_load_file(filename, buf); if (status != ARES_SUCCESS) { goto done; } - hf = ares__hosts_file_create(filename); + hf = ares_hosts_file_create(filename); if (hf == NULL) { status = ARES_ENOMEM; goto done; } - while (ares__buf_len(buf)) { + while (ares_buf_len(buf)) { unsigned char comment = '#'; /* -- Start of new line here -- */ /* Consume any leading whitespace */ - ares__buf_consume_whitespace(buf, ARES_FALSE); + ares_buf_consume_whitespace(buf, ARES_FALSE); - if (ares__buf_len(buf) == 0) { + if (ares_buf_len(buf) == 0) { break; } /* See if it is a comment, if so, consume remaining line */ - if (ares__buf_begins_with(buf, &comment, 1)) { - ares__buf_consume_line(buf, ARES_TRUE); + if (ares_buf_begins_with(buf, &comment, 1)) { + ares_buf_consume_line(buf, ARES_TRUE); continue; } /* Pull off ip address */ - status = ares__parse_hosts_ipaddr(buf, &entry); + status = ares_parse_hosts_ipaddr(buf, &entry); if (status == ARES_ENOMEM) { goto done; } if (status != ARES_SUCCESS) { /* Bad line, consume and go onto next */ - ares__buf_consume_line(buf, ARES_TRUE); + ares_buf_consume_line(buf, ARES_TRUE); continue; } /* Parse of the hostnames */ - status = ares__parse_hosts_hostnames(buf, entry); + status = ares_parse_hosts_hostnames(buf, entry); if (status == ARES_ENOMEM) { goto done; } else if (status != ARES_SUCCESS) { /* Bad line, consume and go onto next */ - ares__hosts_entry_destroy(entry); + ares_hosts_entry_destroy(entry); entry = NULL; - ares__buf_consume_line(buf, ARES_TRUE); + ares_buf_consume_line(buf, ARES_TRUE); continue; } /* Append the successful entry to the hosts file */ - status = ares__hosts_file_add(hf, entry); + status = ares_hosts_file_add(hf, entry); entry = NULL; /* is always invalidated by this function, even on error */ if (status != ARES_SUCCESS) { goto done; } /* Go to next line */ - ares__buf_consume_line(buf, ARES_TRUE); + ares_buf_consume_line(buf, ARES_TRUE); } status = ARES_SUCCESS; done: - ares__hosts_entry_destroy(entry); - ares__buf_destroy(buf); + ares_hosts_entry_destroy(entry); + ares_buf_destroy(buf); if (status != ARES_SUCCESS) { - ares__hosts_file_destroy(hf); + ares_hosts_file_destroy(hf); } else { *out = hf; } return status; } -static ares_bool_t ares__hosts_expired(const char *filename, - const ares_hosts_file_t *hf) +static ares_bool_t ares_hosts_expired(const char *filename, + const ares_hosts_file_t *hf) { time_t mod_ts = 0; @@ -620,7 +619,7 @@ static ares_bool_t ares__hosts_expired(const char *filename, } /* If filenames are different, its expired */ - if (strcasecmp(hf->filename, filename) != 0) { + if (!ares_strcaseeq(hf->filename, filename)) { return ARES_TRUE; } @@ -631,8 +630,8 @@ static ares_bool_t ares__hosts_expired(const char *filename, return ARES_FALSE; } -static ares_status_t ares__hosts_path(const ares_channel_t *channel, - ares_bool_t use_env, char **path) +static ares_status_t ares_hosts_path(const ares_channel_t *channel, + ares_bool_t use_env, char **path) { char *path_hosts = NULL; @@ -688,40 +687,40 @@ static ares_status_t ares__hosts_path(const ares_channel_t *channel, return ARES_SUCCESS; } -static ares_status_t ares__hosts_update(ares_channel_t *channel, - ares_bool_t use_env) +static ares_status_t ares_hosts_update(ares_channel_t *channel, + ares_bool_t use_env) { ares_status_t status; char *filename = NULL; - status = ares__hosts_path(channel, use_env, &filename); + status = ares_hosts_path(channel, use_env, &filename); if (status != ARES_SUCCESS) { return status; } - if (!ares__hosts_expired(filename, channel->hf)) { + if (!ares_hosts_expired(filename, channel->hf)) { ares_free(filename); return ARES_SUCCESS; } - ares__hosts_file_destroy(channel->hf); + ares_hosts_file_destroy(channel->hf); channel->hf = NULL; - status = ares__parse_hosts(filename, &channel->hf); + status = ares_parse_hosts(filename, &channel->hf); ares_free(filename); return status; } -ares_status_t ares__hosts_search_ipaddr(ares_channel_t *channel, - ares_bool_t use_env, const char *ipaddr, - const ares_hosts_entry_t **entry) +ares_status_t ares_hosts_search_ipaddr(ares_channel_t *channel, + ares_bool_t use_env, const char *ipaddr, + const ares_hosts_entry_t **entry) { ares_status_t status; char addr[INET6_ADDRSTRLEN]; *entry = NULL; - status = ares__hosts_update(channel, use_env); + status = ares_hosts_update(channel, use_env); if (status != ARES_SUCCESS) { return status; } @@ -730,11 +729,11 @@ ares_status_t ares__hosts_search_ipaddr(ares_channel_t *channel, return ARES_ENOTFOUND; /* LCOV_EXCL_LINE: DefensiveCoding */ } - if (!ares__normalize_ipaddr(ipaddr, addr, sizeof(addr))) { + if (!ares_normalize_ipaddr(ipaddr, addr, sizeof(addr))) { return ARES_EBADNAME; } - *entry = ares__htable_strvp_get_direct(channel->hf->iphash, addr); + *entry = ares_htable_strvp_get_direct(channel->hf->iphash, addr); if (*entry == NULL) { return ARES_ENOTFOUND; } @@ -742,15 +741,15 @@ ares_status_t ares__hosts_search_ipaddr(ares_channel_t *channel, return ARES_SUCCESS; } -ares_status_t ares__hosts_search_host(ares_channel_t *channel, - ares_bool_t use_env, const char *host, - const ares_hosts_entry_t **entry) +ares_status_t ares_hosts_search_host(ares_channel_t *channel, + ares_bool_t use_env, const char *host, + const ares_hosts_entry_t **entry) { ares_status_t status; *entry = NULL; - status = ares__hosts_update(channel, use_env); + status = ares_hosts_update(channel, use_env); if (status != ARES_SUCCESS) { return status; } @@ -759,7 +758,7 @@ ares_status_t ares__hosts_search_host(ares_channel_t *channel, return ARES_ENOTFOUND; /* LCOV_EXCL_LINE: DefensiveCoding */ } - *entry = ares__htable_strvp_get_direct(channel->hf->hosthash, host); + *entry = ares_htable_strvp_get_direct(channel->hf->hosthash, host); if (*entry == NULL) { return ARES_ENOTFOUND; } @@ -768,23 +767,23 @@ ares_status_t ares__hosts_search_host(ares_channel_t *channel, } static ares_status_t - ares__hosts_ai_append_cnames(const ares_hosts_entry_t *entry, - struct ares_addrinfo_cname **cnames_out) + ares_hosts_ai_append_cnames(const ares_hosts_entry_t *entry, + struct ares_addrinfo_cname **cnames_out) { struct ares_addrinfo_cname *cname = NULL; struct ares_addrinfo_cname *cnames = NULL; const char *primaryhost; - ares__llist_node_t *node; + ares_llist_node_t *node; ares_status_t status; size_t cnt = 0; - node = ares__llist_node_first(entry->hosts); - primaryhost = ares__llist_node_val(node); + node = ares_llist_node_first(entry->hosts); + primaryhost = ares_llist_node_val(node); /* Skip to next node to start with aliases */ - node = ares__llist_node_next(node); + node = ares_llist_node_next(node); while (node != NULL) { - const char *host = ares__llist_node_val(node); + const char *host = ares_llist_node_val(node); /* Cap at 100 entries. , some people use * https://github.com/StevenBlack/hosts and we don't need 200k+ aliases */ @@ -793,7 +792,7 @@ static ares_status_t break; /* LCOV_EXCL_LINE: DefensiveCoding */ } - cname = ares__append_addrinfo_cname(&cnames); + cname = ares_append_addrinfo_cname(&cnames); if (cname == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto done; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -811,12 +810,12 @@ static ares_status_t goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - node = ares__llist_node_next(node); + node = ares_llist_node_next(node); } /* No entries, add only primary */ if (cnames == NULL) { - cname = ares__append_addrinfo_cname(&cnames); + cname = ares_append_addrinfo_cname(&cnames); if (cname == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto done; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -832,24 +831,24 @@ static ares_status_t done: if (status != ARES_SUCCESS) { - ares__freeaddrinfo_cnames(cnames); /* LCOV_EXCL_LINE: DefensiveCoding */ - return status; /* LCOV_EXCL_LINE: DefensiveCoding */ + ares_freeaddrinfo_cnames(cnames); /* LCOV_EXCL_LINE: DefensiveCoding */ + return status; /* LCOV_EXCL_LINE: DefensiveCoding */ } *cnames_out = cnames; return ARES_SUCCESS; } -ares_status_t ares__hosts_entry_to_addrinfo(const ares_hosts_entry_t *entry, - const char *name, int family, - unsigned short port, - ares_bool_t want_cnames, - struct ares_addrinfo *ai) +ares_status_t ares_hosts_entry_to_addrinfo(const ares_hosts_entry_t *entry, + const char *name, int family, + unsigned short port, + ares_bool_t want_cnames, + struct ares_addrinfo *ai) { ares_status_t status; struct ares_addrinfo_cname *cnames = NULL; struct ares_addrinfo_node *ainodes = NULL; - ares__llist_node_t *node; + ares_llist_node_t *node; switch (family) { case AF_INET: @@ -868,12 +867,12 @@ ares_status_t ares__hosts_entry_to_addrinfo(const ares_hosts_entry_t *entry, } } - for (node = ares__llist_node_first(entry->ips); node != NULL; - node = ares__llist_node_next(node)) { + for (node = ares_llist_node_first(entry->ips); node != NULL; + node = ares_llist_node_next(node)) { struct ares_addr addr; const void *ptr = NULL; size_t ptr_len = 0; - const char *ipaddr = ares__llist_node_val(node); + const char *ipaddr = ares_llist_node_val(node); memset(&addr, 0, sizeof(addr)); addr.family = family; @@ -890,7 +889,7 @@ ares_status_t ares__hosts_entry_to_addrinfo(const ares_hosts_entry_t *entry, } if (want_cnames) { - status = ares__hosts_ai_append_cnames(entry, &cnames); + status = ares_hosts_ai_append_cnames(entry, &cnames); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: DefensiveCoding */ } @@ -901,21 +900,21 @@ ares_status_t ares__hosts_entry_to_addrinfo(const ares_hosts_entry_t *entry, done: if (status != ARES_SUCCESS) { /* LCOV_EXCL_START: defensive coding */ - ares__freeaddrinfo_cnames(cnames); - ares__freeaddrinfo_nodes(ainodes); + ares_freeaddrinfo_cnames(cnames); + ares_freeaddrinfo_nodes(ainodes); ares_free(ai->name); ai->name = NULL; return status; /* LCOV_EXCL_STOP */ } - ares__addrinfo_cat_cnames(&ai->cnames, cnames); - ares__addrinfo_cat_nodes(&ai->nodes, ainodes); + ares_addrinfo_cat_cnames(&ai->cnames, cnames); + ares_addrinfo_cat_nodes(&ai->nodes, ainodes); return status; } -ares_status_t ares__hosts_entry_to_hostent(const ares_hosts_entry_t *entry, - int family, struct hostent **hostent) +ares_status_t ares_hosts_entry_to_hostent(const ares_hosts_entry_t *entry, + int family, struct hostent **hostent) { ares_status_t status; struct ares_addrinfo *ai = ares_malloc_zero(sizeof(*ai)); @@ -926,12 +925,12 @@ ares_status_t ares__hosts_entry_to_hostent(const ares_hosts_entry_t *entry, return ARES_ENOMEM; } - status = ares__hosts_entry_to_addrinfo(entry, NULL, family, 0, ARES_TRUE, ai); + status = ares_hosts_entry_to_addrinfo(entry, NULL, family, 0, ARES_TRUE, ai); if (status != ARES_SUCCESS) { goto done; } - status = ares__addrinfo2hostent(ai, family, hostent); + status = ares_addrinfo2hostent(ai, family, hostent); if (status != ARES_SUCCESS) { goto done; } diff --git a/deps/cares/src/lib/ares_inet_net_pton.h b/deps/cares/src/lib/ares_inet_net_pton.h index 0a52855bd8c966..e3ed83a3cb1166 100644 --- a/deps/cares/src/lib/ares_inet_net_pton.h +++ b/deps/cares/src/lib/ares_inet_net_pton.h @@ -26,10 +26,6 @@ #ifndef HEADER_CARES_INET_NET_PTON_H #define HEADER_CARES_INET_NET_PTON_H -#ifdef HAVE_INET_NET_PTON -# define ares_inet_net_pton(w, x, y, z) inet_net_pton(w, x, y, z) -#else int ares_inet_net_pton(int af, const char *src, void *dst, size_t size); -#endif #endif /* HEADER_CARES_INET_NET_PTON_H */ diff --git a/deps/cares/src/lib/ares_init.c b/deps/cares/src/lib/ares_init.c index 6dc5f4f9353ce2..ae78262a112fc0 100644 --- a/deps/cares/src/lib/ares_init.c +++ b/deps/cares/src/lib/ares_init.c @@ -62,7 +62,6 @@ #endif #include "ares_inet_net_pton.h" -#include "ares_platform.h" #include "event/ares_event.h" int ares_init(ares_channel_t **channelptr) @@ -117,7 +116,7 @@ static void server_destroy_cb(void *data) if (data == NULL) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ } - ares__destroy_server(data); + ares_destroy_server(data); } static ares_status_t init_by_defaults(ares_channel_t *channel) @@ -128,7 +127,7 @@ static ares_status_t init_by_defaults(ares_channel_t *channel) const char *dot; #endif struct ares_addr addr; - ares__llist_t *sconfig = NULL; + ares_llist_t *sconfig = NULL; /* Enable EDNS by default */ if (!(channel->optmask & ARES_OPT_FLAGS)) { @@ -146,7 +145,7 @@ static ares_status_t init_by_defaults(ares_channel_t *channel) channel->tries = DEFAULT_TRIES; } - if (ares__slist_len(channel->servers) == 0) { + if (ares_slist_len(channel->servers) == 0) { /* Add a default local named server to the channel unless configured not * to (in which case return an error). */ @@ -158,28 +157,19 @@ static ares_status_t init_by_defaults(ares_channel_t *channel) addr.family = AF_INET; addr.addr.addr4.s_addr = htonl(INADDR_LOOPBACK); - rc = ares__sconfig_append(&sconfig, &addr, 0, 0, NULL); + rc = ares_sconfig_append(channel, &sconfig, &addr, 0, 0, NULL); if (rc != ARES_SUCCESS) { goto error; /* LCOV_EXCL_LINE: OutOfMemory */ } - rc = ares__servers_update(channel, sconfig, ARES_FALSE); - ares__llist_destroy(sconfig); + rc = ares_servers_update(channel, sconfig, ARES_FALSE); + ares_llist_destroy(sconfig); if (rc != ARES_SUCCESS) { goto error; } } -#if defined(USE_WINSOCK) -# define toolong(x) (x == -1) && (SOCKERRNO == WSAEFAULT) -#elif defined(ENAMETOOLONG) -# define toolong(x) \ - (x == -1) && ((SOCKERRNO == ENAMETOOLONG) || (SOCKERRNO == EINVAL)) -#else -# define toolong(x) (x == -1) && (SOCKERRNO == EINVAL) -#endif - if (channel->ndomains == 0) { /* Derive a default domain search list from the kernel hostname, * or set it to empty if the hostname isn't helpful. @@ -187,9 +177,7 @@ static ares_status_t init_by_defaults(ares_channel_t *channel) #ifndef HAVE_GETHOSTNAME channel->ndomains = 0; /* default to none */ #else - GETHOSTNAME_TYPE_ARG2 lenv = 64; - size_t len = 64; - int res; + size_t len = 256; channel->ndomains = 0; /* default to none */ hostname = ares_malloc(len); @@ -198,28 +186,11 @@ static ares_status_t init_by_defaults(ares_channel_t *channel) goto error; /* LCOV_EXCL_LINE: OutOfMemory */ } - do { - res = gethostname(hostname, lenv); - - if (toolong(res)) { - char *p; - len *= 2; - lenv *= 2; - p = ares_realloc(hostname, len); - if (!p) { - rc = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ - goto error; /* LCOV_EXCL_LINE: OutOfMemory */ - } - hostname = p; - continue; - } else if (res) { - /* Lets not treat a gethostname failure as critical, since we - * are ok if gethostname doesn't even exist */ - *hostname = '\0'; - break; - } - - } while (res != 0); + if (gethostname(hostname, (GETHOSTNAME_TYPE_ARG2)len) != 0) { + /* Lets not treat a gethostname failure as critical, since we + * are ok if gethostname doesn't even exist */ + *hostname = '\0'; + } dot = strchr(hostname, '.'); if (dot) { @@ -286,13 +257,13 @@ int ares_init_options(ares_channel_t **channelptr, /* One option where zero is valid, so set default value here */ channel->ndots = 1; - status = ares__channel_threading_init(channel); + status = ares_channel_threading_init(channel); if (status != ARES_SUCCESS) { goto done; } /* Generate random key */ - channel->rand_state = ares__init_rand_state(); + channel->rand_state = ares_init_rand_state(); if (channel->rand_state == NULL) { status = ARES_ENOMEM; DEBUGF(fprintf(stderr, "Error: init_id_key failed: %s\n", @@ -302,33 +273,33 @@ int ares_init_options(ares_channel_t **channelptr, /* Initialize Server List */ channel->servers = - ares__slist_create(channel->rand_state, server_sort_cb, server_destroy_cb); + ares_slist_create(channel->rand_state, server_sort_cb, server_destroy_cb); if (channel->servers == NULL) { status = ARES_ENOMEM; goto done; } /* Initialize our lists of queries */ - channel->all_queries = ares__llist_create(NULL); + channel->all_queries = ares_llist_create(NULL); if (channel->all_queries == NULL) { status = ARES_ENOMEM; goto done; } - channel->queries_by_qid = ares__htable_szvp_create(NULL); + channel->queries_by_qid = ares_htable_szvp_create(NULL); if (channel->queries_by_qid == NULL) { status = ARES_ENOMEM; goto done; } channel->queries_by_timeout = - ares__slist_create(channel->rand_state, ares_query_timeout_cmp_cb, NULL); + ares_slist_create(channel->rand_state, ares_query_timeout_cmp_cb, NULL); if (channel->queries_by_timeout == NULL) { status = ARES_ENOMEM; goto done; } - channel->connnode_by_socket = ares__htable_asvp_create(NULL); + channel->connnode_by_socket = ares_htable_asvp_create(NULL); if (channel->connnode_by_socket == NULL) { status = ARES_ENOMEM; goto done; @@ -338,7 +309,7 @@ int ares_init_options(ares_channel_t **channelptr, * precedence to lowest. */ - status = ares__init_by_options(channel, options, optmask); + status = ares_init_by_options(channel, options, optmask); if (status != ARES_SUCCESS) { DEBUGF(fprintf(stderr, "Error: init_by_options failed: %s\n", ares_strerror(status))); @@ -350,14 +321,14 @@ int ares_init_options(ares_channel_t **channelptr, /* Go ahead and let it initialize the query cache even if the ttl is 0 and * completely unused. This reduces the number of different code paths that * might be followed even if there is a minor performance hit. */ - status = ares__qcache_create(channel->rand_state, channel->qcache_max_ttl, - &channel->qcache); + status = ares_qcache_create(channel->rand_state, channel->qcache_max_ttl, + &channel->qcache); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } if (status == ARES_SUCCESS) { - status = ares__init_by_sysconfig(channel); + status = ares_init_by_sysconfig(channel); if (status != ARES_SUCCESS) { DEBUGF(fprintf(stderr, "Error: init_by_sysconfig failed: %s\n", ares_strerror(status))); @@ -375,6 +346,8 @@ int ares_init_options(ares_channel_t **channelptr, goto done; } + ares_set_socket_functions_def(channel); + /* Initialize the event thread */ if (channel->optmask & ARES_OPT_EVENT_THREAD) { ares_event_thread_t *e = NULL; @@ -409,23 +382,23 @@ static void *ares_reinit_thread(void *arg) ares_channel_t *channel = arg; ares_status_t status; - /* ares__init_by_sysconfig() will lock when applying the config, but not + /* ares_init_by_sysconfig() will lock when applying the config, but not * when retrieving. */ - status = ares__init_by_sysconfig(channel); + status = ares_init_by_sysconfig(channel); if (status != ARES_SUCCESS) { DEBUGF(fprintf(stderr, "Error: init_by_sysconfig failed: %s\n", ares_strerror(status))); } - ares__channel_lock(channel); + ares_channel_lock(channel); /* Flush cached queries on reinit */ if (status == ARES_SUCCESS && channel->qcache) { - ares__qcache_flush(channel->qcache); + ares_qcache_flush(channel->qcache); } channel->reinit_pending = ARES_FALSE; - ares__channel_unlock(channel); + ares_channel_unlock(channel); return NULL; } @@ -438,34 +411,34 @@ ares_status_t ares_reinit(ares_channel_t *channel) return ARES_EFORMERR; } - ares__channel_lock(channel); + ares_channel_lock(channel); /* If a reinit is already in process, lets not do it again. Or if we are * shutting down, skip. */ if (!channel->sys_up || channel->reinit_pending) { - ares__channel_unlock(channel); + ares_channel_unlock(channel); return ARES_SUCCESS; } channel->reinit_pending = ARES_TRUE; - ares__channel_unlock(channel); + ares_channel_unlock(channel); if (ares_threadsafety()) { /* clean up the prior reinit process's thread. We know the thread isn't * running since reinit_pending was false */ if (channel->reinit_thread != NULL) { void *rv; - ares__thread_join(channel->reinit_thread, &rv); + ares_thread_join(channel->reinit_thread, &rv); channel->reinit_thread = NULL; } /* Spawn a new thread */ status = - ares__thread_create(&channel->reinit_thread, ares_reinit_thread, channel); + ares_thread_create(&channel->reinit_thread, ares_reinit_thread, channel); if (status != ARES_SUCCESS) { /* LCOV_EXCL_START: UntestablePath */ - ares__channel_lock(channel); + ares_channel_lock(channel); channel->reinit_pending = ARES_FALSE; - ares__channel_unlock(channel); + ares_channel_unlock(channel); /* LCOV_EXCL_STOP */ } } else { @@ -508,23 +481,25 @@ int ares_dup(ares_channel_t **dest, const ares_channel_t *src) goto done; } - ares__channel_lock(src); + ares_channel_lock(src); /* Now clone the options that ares_save_options() doesn't support, but are * user-provided */ - (*dest)->sock_create_cb = src->sock_create_cb; - (*dest)->sock_create_cb_data = src->sock_create_cb_data; - (*dest)->sock_config_cb = src->sock_config_cb; - (*dest)->sock_config_cb_data = src->sock_config_cb_data; - (*dest)->sock_funcs = src->sock_funcs; - (*dest)->sock_func_cb_data = src->sock_func_cb_data; - (*dest)->server_state_cb = src->server_state_cb; - (*dest)->server_state_cb_data = src->server_state_cb_data; + (*dest)->sock_create_cb = src->sock_create_cb; + (*dest)->sock_create_cb_data = src->sock_create_cb_data; + (*dest)->sock_config_cb = src->sock_config_cb; + (*dest)->sock_config_cb_data = src->sock_config_cb_data; + memcpy(&(*dest)->sock_funcs, &(src->sock_funcs), sizeof((*dest)->sock_funcs)); + (*dest)->sock_func_cb_data = src->sock_func_cb_data; + (*dest)->legacy_sock_funcs = src->legacy_sock_funcs; + (*dest)->legacy_sock_funcs_cb_data = src->legacy_sock_funcs_cb_data; + (*dest)->server_state_cb = src->server_state_cb; + (*dest)->server_state_cb_data = src->server_state_cb_data; ares_strcpy((*dest)->local_dev_name, src->local_dev_name, sizeof((*dest)->local_dev_name)); (*dest)->local_ip4 = src->local_ip4; memcpy((*dest)->local_ip6, src->local_ip6, sizeof(src->local_ip6)); - ares__channel_unlock(src); + ares_channel_unlock(src); /* Servers are a bit unique as ares_init_options() only allows ipv4 servers * and not a port per server, but there are other user specified ways, that @@ -568,9 +543,9 @@ void ares_set_local_ip4(ares_channel_t *channel, unsigned int local_ip) if (channel == NULL) { return; } - ares__channel_lock(channel); + ares_channel_lock(channel); channel->local_ip4 = local_ip; - ares__channel_unlock(channel); + ares_channel_unlock(channel); } /* local_ip6 should be 16 bytes in length */ @@ -579,9 +554,9 @@ void ares_set_local_ip6(ares_channel_t *channel, const unsigned char *local_ip6) if (channel == NULL) { return; } - ares__channel_lock(channel); + ares_channel_lock(channel); memcpy(&channel->local_ip6, local_ip6, sizeof(channel->local_ip6)); - ares__channel_unlock(channel); + ares_channel_unlock(channel); } /* local_dev_name should be null terminated. */ @@ -591,11 +566,11 @@ void ares_set_local_dev(ares_channel_t *channel, const char *local_dev_name) return; } - ares__channel_lock(channel); + ares_channel_lock(channel); ares_strcpy(channel->local_dev_name, local_dev_name, sizeof(channel->local_dev_name)); channel->local_dev_name[sizeof(channel->local_dev_name) - 1] = 0; - ares__channel_unlock(channel); + ares_channel_unlock(channel); } int ares_set_sortlist(ares_channel_t *channel, const char *sortstr) @@ -607,9 +582,9 @@ int ares_set_sortlist(ares_channel_t *channel, const char *sortstr) if (!channel) { return ARES_ENODATA; } - ares__channel_lock(channel); + ares_channel_lock(channel); - status = ares__parse_sortlist(&sortlist, &nsort, sortstr); + status = ares_parse_sortlist(&sortlist, &nsort, sortstr); if (status == ARES_SUCCESS && sortlist) { if (channel->sortlist) { ares_free(channel->sortlist); @@ -620,6 +595,6 @@ int ares_set_sortlist(ares_channel_t *channel, const char *sortstr) /* Save sortlist as if it was passed in as an option */ channel->optmask |= ARES_OPT_SORTLIST; } - ares__channel_unlock(channel); + ares_channel_unlock(channel); return (int)status; } diff --git a/deps/cares/src/lib/ares_ipv6.h b/deps/cares/src/lib/ares_ipv6.h index e7e0b6d3a5e60c..5da341b010603f 100644 --- a/deps/cares/src/lib/ares_ipv6.h +++ b/deps/cares/src/lib/ares_ipv6.h @@ -94,7 +94,7 @@ struct addrinfo { # ifdef IFNAMSIZ # define IF_NAMESIZE IFNAMSIZ # else -# define IF_NAMESIZE 256 +# define IF_NAMESIZE 32 # endif #endif diff --git a/deps/cares/src/lib/ares_library_init.c b/deps/cares/src/lib/ares_library_init.c index 6c2f7c0f8ce9ee..2b91692baec6d5 100644 --- a/deps/cares/src/lib/ares_library_init.c +++ b/deps/cares/src/lib/ares_library_init.c @@ -52,8 +52,6 @@ static void *default_malloc(size_t size) return malloc(size); } -#if defined(_WIN32) -/* We need indirections to handle Windows DLL rules. */ static void *default_realloc(void *p, size_t size) { return realloc(p, size); @@ -63,13 +61,25 @@ static void default_free(void *p) { free(p); } -#else -# define default_realloc realloc -# define default_free free -#endif -void *(*ares_malloc)(size_t size) = default_malloc; -void *(*ares_realloc)(void *ptr, size_t size) = default_realloc; -void (*ares_free)(void *ptr) = default_free; + +static void *(*__ares_malloc)(size_t size) = default_malloc; +static void *(*__ares_realloc)(void *ptr, size_t size) = default_realloc; +static void (*__ares_free)(void *ptr) = default_free; + +void *ares_malloc(size_t size) +{ + return __ares_malloc(size); +} + +void *ares_realloc(void *ptr, size_t size) +{ + return __ares_realloc(ptr, size); +} + +void ares_free(void *ptr) +{ + __ares_free(ptr); +} void *ares_malloc_zero(size_t size) { @@ -115,13 +125,13 @@ int ares_library_init_mem(int flags, void *(*amalloc)(size_t size), void *(*arealloc)(void *ptr, size_t size)) { if (amalloc) { - ares_malloc = amalloc; + __ares_malloc = amalloc; } if (arealloc) { - ares_realloc = arealloc; + __ares_realloc = arealloc; } if (afree) { - ares_free = afree; + __ares_free = afree; } return ares_library_init(flags); } @@ -143,9 +153,9 @@ void ares_library_cleanup(void) #endif ares_init_flags = ARES_LIB_INIT_NONE; - ares_malloc = malloc; - ares_realloc = realloc; - ares_free = free; + __ares_malloc = default_malloc; + __ares_realloc = default_realloc; + __ares_free = default_free; } int ares_library_initialized(void) diff --git a/deps/cares/src/lib/ares_metrics.c b/deps/cares/src/lib/ares_metrics.c index 0e22fc37e7cb46..13e34decc06ae6 100644 --- a/deps/cares/src/lib/ares_metrics.c +++ b/deps/cares/src/lib/ares_metrics.c @@ -162,14 +162,14 @@ void ares_metrics_record(const ares_query_t *query, ares_server_t *server, return; } - ares__tvnow(&now); + ares_tvnow(&now); rcode = ares_dns_record_get_rcode(dnsrec); if (rcode != ARES_RCODE_NOERROR && rcode != ARES_RCODE_NXDOMAIN) { return; } - ares__timeval_diff(&tvdiff, &query->ts, &now); + ares_timeval_diff(&tvdiff, &query->ts, &now); query_ms = (unsigned int)((tvdiff.sec * 1000) + (tvdiff.usec / 1000)); if (query_ms == 0) { query_ms = 1; diff --git a/deps/cares/src/lib/ares_options.c b/deps/cares/src/lib/ares_options.c index 9aeb4bad3d743b..3082f332457c22 100644 --- a/deps/cares/src/lib/ares_options.c +++ b/deps/cares/src/lib/ares_options.c @@ -54,9 +54,9 @@ void ares_destroy_options(struct ares_options *options) static struct in_addr *ares_save_opt_servers(const ares_channel_t *channel, int *nservers) { - ares__slist_node_t *snode; - struct in_addr *out = - ares_malloc_zero(ares__slist_len(channel->servers) * sizeof(*out)); + ares_slist_node_t *snode; + struct in_addr *out = + ares_malloc_zero(ares_slist_len(channel->servers) * sizeof(*out)); *nservers = 0; @@ -64,9 +64,9 @@ static struct in_addr *ares_save_opt_servers(const ares_channel_t *channel, return NULL; } - for (snode = ares__slist_node_first(channel->servers); snode != NULL; - snode = ares__slist_node_next(snode)) { - const ares_server_t *server = ares__slist_node_val(snode); + for (snode = ares_slist_node_first(channel->servers); snode != NULL; + snode = ares_slist_node_next(snode)) { + const ares_server_t *server = ares_slist_node_val(snode); if (server->addr.family != AF_INET) { continue; @@ -111,7 +111,7 @@ int ares_save_options(const ares_channel_t *channel, } /* We convert ARES_OPT_TIMEOUT to ARES_OPT_TIMEOUTMS in - * ares__init_by_options() */ + * ares_init_by_options() */ if (channel->optmask & ARES_OPT_TIMEOUTMS) { options->timeout = (int)channel->timeout; } @@ -238,28 +238,28 @@ int ares_save_options(const ares_channel_t *channel, return ARES_SUCCESS; } -static ares_status_t ares__init_options_servers(ares_channel_t *channel, - const struct in_addr *servers, - size_t nservers) +static ares_status_t ares_init_options_servers(ares_channel_t *channel, + const struct in_addr *servers, + size_t nservers) { - ares__llist_t *slist = NULL; - ares_status_t status; + ares_llist_t *slist = NULL; + ares_status_t status; - status = ares_in_addr_to_server_config_llist(servers, nservers, &slist); + status = ares_in_addr_to_sconfig_llist(servers, nservers, &slist); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__servers_update(channel, slist, ARES_TRUE); + status = ares_servers_update(channel, slist, ARES_TRUE); - ares__llist_destroy(slist); + ares_llist_destroy(slist); return status; } -ares_status_t ares__init_by_options(ares_channel_t *channel, - const struct ares_options *options, - int optmask) +ares_status_t ares_init_by_options(ares_channel_t *channel, + const struct ares_options *options, + int optmask) { size_t i; @@ -472,8 +472,8 @@ ares_status_t ares__init_by_options(ares_channel_t *channel, optmask &= ~(ARES_OPT_SERVERS); } else { ares_status_t status; - status = ares__init_options_servers(channel, options->servers, - (size_t)options->nservers); + status = ares_init_options_servers(channel, options->servers, + (size_t)options->nservers); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } diff --git a/deps/cares/src/lib/ares__parse_into_addrinfo.c b/deps/cares/src/lib/ares_parse_into_addrinfo.c similarity index 89% rename from deps/cares/src/lib/ares__parse_into_addrinfo.c rename to deps/cares/src/lib/ares_parse_into_addrinfo.c index 65c94c0401441b..2108f9b8615816 100644 --- a/deps/cares/src/lib/ares__parse_into_addrinfo.c +++ b/deps/cares/src/lib/ares_parse_into_addrinfo.c @@ -45,10 +45,10 @@ #endif -ares_status_t ares__parse_into_addrinfo(const ares_dns_record_t *dnsrec, - ares_bool_t cname_only_is_enodata, - unsigned short port, - struct ares_addrinfo *ai) +ares_status_t ares_parse_into_addrinfo(const ares_dns_record_t *dnsrec, + ares_bool_t cname_only_is_enodata, + unsigned short port, + struct ares_addrinfo *ai) { ares_status_t status; size_t i; @@ -90,7 +90,7 @@ ares_status_t ares__parse_into_addrinfo(const ares_dns_record_t *dnsrec, * * rname = ares_dns_rr_get_name(rr); * if ((rtype == ARES_REC_TYPE_A || rtype == ARES_REC_TYPE_AAAA) && - * strcasecmp(rname, hostname) != 0) { + * !ares_strcaseeq(rname, hostname)) { * continue; * } */ @@ -103,7 +103,7 @@ ares_status_t ares__parse_into_addrinfo(const ares_dns_record_t *dnsrec, * SA: Seems wrong as it introduces order dependency. */ hostname = ares_dns_rr_get_str(rr, ARES_RR_CNAME_CNAME); - cname = ares__append_addrinfo_cname(&cnames); + cname = ares_append_addrinfo_cname(&cnames); if (cname == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto done; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -147,7 +147,7 @@ ares_status_t ares__parse_into_addrinfo(const ares_dns_record_t *dnsrec, } /* save the hostname as ai->name */ - if (ai->name == NULL || strcasecmp(ai->name, hostname) != 0) { + if (ai->name == NULL || !ares_strcaseeq(ai->name, hostname)) { ares_free(ai->name); ai->name = ares_strdup(hostname); if (ai->name == NULL) { @@ -157,18 +157,18 @@ ares_status_t ares__parse_into_addrinfo(const ares_dns_record_t *dnsrec, } if (got_a || got_aaaa) { - ares__addrinfo_cat_nodes(&ai->nodes, nodes); + ares_addrinfo_cat_nodes(&ai->nodes, nodes); nodes = NULL; } if (got_cname) { - ares__addrinfo_cat_cnames(&ai->cnames, cnames); + ares_addrinfo_cat_cnames(&ai->cnames, cnames); cnames = NULL; } done: - ares__freeaddrinfo_cnames(cnames); - ares__freeaddrinfo_nodes(nodes); + ares_freeaddrinfo_cnames(cnames); + ares_freeaddrinfo_nodes(nodes); /* compatibility */ if (status == ARES_EBADNAME) { diff --git a/deps/cares/src/lib/ares_platform.c b/deps/cares/src/lib/ares_platform.c deleted file mode 100644 index 8f0a1dbffb8173..00000000000000 --- a/deps/cares/src/lib/ares_platform.c +++ /dev/null @@ -1,11047 +0,0 @@ -/* MIT License - * - * Copyright (c) 1998 Massachusetts Institute of Technology - * Copyright (c) 2004 Daniel Stenberg - * - * 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 (including the next - * paragraph) 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 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * SPDX-License-Identifier: MIT - */ - -#include "ares_private.h" -#include "ares_platform.h" - -#if defined(_WIN32) && !defined(MSDOS) - -# define V_PLATFORM_WIN32s 0 -# define V_PLATFORM_WIN32_WINDOWS 1 -# define V_PLATFORM_WIN32_NT 2 -# define V_PLATFORM_WIN32_CE 3 - -win_platform ares__getplatform(void) -{ - OSVERSIONINFOEX OsvEx; - - memset(&OsvEx, 0, sizeof(OsvEx)); - OsvEx.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); -# ifdef _MSC_VER -# pragma warning(push) -# pragma warning(disable : 4996) /* warning C4996: 'GetVersionExW': was \ - declared deprecated */ -# endif - if (!GetVersionEx((void *)&OsvEx)) { - memset(&OsvEx, 0, sizeof(OsvEx)); - OsvEx.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if (!GetVersionEx((void *)&OsvEx)) { - return WIN_UNKNOWN; - } - } -# ifdef _MSC_VER -# pragma warning(pop) -# endif - - switch (OsvEx.dwPlatformId) { - case V_PLATFORM_WIN32s: - return WIN_3X; - - case V_PLATFORM_WIN32_WINDOWS: - return WIN_9X; - - case V_PLATFORM_WIN32_NT: - return WIN_NT; - - case V_PLATFORM_WIN32_CE: - return WIN_CE; - - default: - return WIN_UNKNOWN; - } -} - -#endif /* _WIN32 && ! MSDOS */ - -#if defined(_WIN32_WCE) - -/* IANA Well Known Ports are in range 0-1023 */ -# define USE_IANA_WELL_KNOWN_PORTS 1 - -/* IANA Registered Ports are in range 1024-49151 */ -# define USE_IANA_REGISTERED_PORTS 1 - -struct pvt_servent { - char *s_name; - char **s_aliases; - unsigned short s_port; - char *s_proto; -}; - -/* - * Ref: http://www.iana.org/assignments/port-numbers - */ - -static struct pvt_servent IANAports[] = { -# ifdef USE_IANA_WELL_KNOWN_PORTS - { "tcpmux", { NULL }, 1, "tcp" }, - { "tcpmux", { NULL }, 1, "udp" }, - { "compressnet", { NULL }, 2, "tcp" }, - { "compressnet", { NULL }, 2, "udp" }, - { "compressnet", { NULL }, 3, "tcp" }, - { "compressnet", { NULL }, 3, "udp" }, - { "rje", { NULL }, 5, "tcp" }, - { "rje", { NULL }, 5, "udp" }, - { "echo", { NULL }, 7, "tcp" }, - { "echo", { NULL }, 7, "udp" }, - { "discard", { NULL }, 9, "tcp" }, - { "discard", { NULL }, 9, "udp" }, - { "discard", { NULL }, 9, "sctp" }, - { "discard", { NULL }, 9, "dccp" }, - { "systat", { NULL }, 11, "tcp" }, - { "systat", { NULL }, 11, "udp" }, - { "daytime", { NULL }, 13, "tcp" }, - { "daytime", { NULL }, 13, "udp" }, - { "qotd", { NULL }, 17, "tcp" }, - { "qotd", { NULL }, 17, "udp" }, - { "msp", { NULL }, 18, "tcp" }, - { "msp", { NULL }, 18, "udp" }, - { "chargen", { NULL }, 19, "tcp" }, - { "chargen", { NULL }, 19, "udp" }, - { "ftp-data", { NULL }, 20, "tcp" }, - { "ftp-data", { NULL }, 20, "udp" }, - { "ftp-data", { NULL }, 20, "sctp" }, - { "ftp", { NULL }, 21, "tcp" }, - { "ftp", { NULL }, 21, "udp" }, - { "ftp", { NULL }, 21, "sctp" }, - { "ssh", { NULL }, 22, "tcp" }, - { "ssh", { NULL }, 22, "udp" }, - { "ssh", { NULL }, 22, "sctp" }, - { "telnet", { NULL }, 23, "tcp" }, - { "telnet", { NULL }, 23, "udp" }, - { "smtp", { NULL }, 25, "tcp" }, - { "smtp", { NULL }, 25, "udp" }, - { "nsw-fe", { NULL }, 27, "tcp" }, - { "nsw-fe", { NULL }, 27, "udp" }, - { "msg-icp", { NULL }, 29, "tcp" }, - { "msg-icp", { NULL }, 29, "udp" }, - { "msg-auth", { NULL }, 31, "tcp" }, - { "msg-auth", { NULL }, 31, "udp" }, - { "dsp", { NULL }, 33, "tcp" }, - { "dsp", { NULL }, 33, "udp" }, - { "time", { NULL }, 37, "tcp" }, - { "time", { NULL }, 37, "udp" }, - { "rap", { NULL }, 38, "tcp" }, - { "rap", { NULL }, 38, "udp" }, - { "rlp", { NULL }, 39, "tcp" }, - { "rlp", { NULL }, 39, "udp" }, - { "graphics", { NULL }, 41, "tcp" }, - { "graphics", { NULL }, 41, "udp" }, - { "name", { NULL }, 42, "tcp" }, - { "name", { NULL }, 42, "udp" }, - { "nameserver", { NULL }, 42, "tcp" }, - { "nameserver", { NULL }, 42, "udp" }, - { "nicname", { NULL }, 43, "tcp" }, - { "nicname", { NULL }, 43, "udp" }, - { "mpm-flags", { NULL }, 44, "tcp" }, - { "mpm-flags", { NULL }, 44, "udp" }, - { "mpm", { NULL }, 45, "tcp" }, - { "mpm", { NULL }, 45, "udp" }, - { "mpm-snd", { NULL }, 46, "tcp" }, - { "mpm-snd", { NULL }, 46, "udp" }, - { "ni-ftp", { NULL }, 47, "tcp" }, - { "ni-ftp", { NULL }, 47, "udp" }, - { "auditd", { NULL }, 48, "tcp" }, - { "auditd", { NULL }, 48, "udp" }, - { "tacacs", { NULL }, 49, "tcp" }, - { "tacacs", { NULL }, 49, "udp" }, - { "re-mail-ck", { NULL }, 50, "tcp" }, - { "re-mail-ck", { NULL }, 50, "udp" }, - { "la-maint", { NULL }, 51, "tcp" }, - { "la-maint", { NULL }, 51, "udp" }, - { "xns-time", { NULL }, 52, "tcp" }, - { "xns-time", { NULL }, 52, "udp" }, - { "domain", { NULL }, 53, "tcp" }, - { "domain", { NULL }, 53, "udp" }, - { "xns-ch", { NULL }, 54, "tcp" }, - { "xns-ch", { NULL }, 54, "udp" }, - { "isi-gl", { NULL }, 55, "tcp" }, - { "isi-gl", { NULL }, 55, "udp" }, - { "xns-auth", { NULL }, 56, "tcp" }, - { "xns-auth", { NULL }, 56, "udp" }, - { "xns-mail", { NULL }, 58, "tcp" }, - { "xns-mail", { NULL }, 58, "udp" }, - { "ni-mail", { NULL }, 61, "tcp" }, - { "ni-mail", { NULL }, 61, "udp" }, - { "acas", { NULL }, 62, "tcp" }, - { "acas", { NULL }, 62, "udp" }, - { "whois++", { NULL }, 63, "tcp" }, - { "whois++", { NULL }, 63, "udp" }, - { "covia", { NULL }, 64, "tcp" }, - { "covia", { NULL }, 64, "udp" }, - { "tacacs-ds", { NULL }, 65, "tcp" }, - { "tacacs-ds", { NULL }, 65, "udp" }, - { "sql*net", { NULL }, 66, "tcp" }, - { "sql*net", { NULL }, 66, "udp" }, - { "bootps", { NULL }, 67, "tcp" }, - { "bootps", { NULL }, 67, "udp" }, - { "bootpc", { NULL }, 68, "tcp" }, - { "bootpc", { NULL }, 68, "udp" }, - { "tftp", { NULL }, 69, "tcp" }, - { "tftp", { NULL }, 69, "udp" }, - { "gopher", { NULL }, 70, "tcp" }, - { "gopher", { NULL }, 70, "udp" }, - { "netrjs-1", { NULL }, 71, "tcp" }, - { "netrjs-1", { NULL }, 71, "udp" }, - { "netrjs-2", { NULL }, 72, "tcp" }, - { "netrjs-2", { NULL }, 72, "udp" }, - { "netrjs-3", { NULL }, 73, "tcp" }, - { "netrjs-3", { NULL }, 73, "udp" }, - { "netrjs-4", { NULL }, 74, "tcp" }, - { "netrjs-4", { NULL }, 74, "udp" }, - { "deos", { NULL }, 76, "tcp" }, - { "deos", { NULL }, 76, "udp" }, - { "vettcp", { NULL }, 78, "tcp" }, - { "vettcp", { NULL }, 78, "udp" }, - { "finger", { NULL }, 79, "tcp" }, - { "finger", { NULL }, 79, "udp" }, - { "http", { NULL }, 80, "tcp" }, - { "http", { NULL }, 80, "udp" }, - { "www", { NULL }, 80, "tcp" }, - { "www", { NULL }, 80, "udp" }, - { "www-http", { NULL }, 80, "tcp" }, - { "www-http", { NULL }, 80, "udp" }, - { "http", { NULL }, 80, "sctp" }, - { "xfer", { NULL }, 82, "tcp" }, - { "xfer", { NULL }, 82, "udp" }, - { "mit-ml-dev", { NULL }, 83, "tcp" }, - { "mit-ml-dev", { NULL }, 83, "udp" }, - { "ctf", { NULL }, 84, "tcp" }, - { "ctf", { NULL }, 84, "udp" }, - { "mit-ml-dev", { NULL }, 85, "tcp" }, - { "mit-ml-dev", { NULL }, 85, "udp" }, - { "mfcobol", { NULL }, 86, "tcp" }, - { "mfcobol", { NULL }, 86, "udp" }, - { "kerberos", { NULL }, 88, "tcp" }, - { "kerberos", { NULL }, 88, "udp" }, - { "su-mit-tg", { NULL }, 89, "tcp" }, - { "su-mit-tg", { NULL }, 89, "udp" }, - { "dnsix", { NULL }, 90, "tcp" }, - { "dnsix", { NULL }, 90, "udp" }, - { "mit-dov", { NULL }, 91, "tcp" }, - { "mit-dov", { NULL }, 91, "udp" }, - { "npp", { NULL }, 92, "tcp" }, - { "npp", { NULL }, 92, "udp" }, - { "dcp", { NULL }, 93, "tcp" }, - { "dcp", { NULL }, 93, "udp" }, - { "objcall", { NULL }, 94, "tcp" }, - { "objcall", { NULL }, 94, "udp" }, - { "supdup", { NULL }, 95, "tcp" }, - { "supdup", { NULL }, 95, "udp" }, - { "dixie", { NULL }, 96, "tcp" }, - { "dixie", { NULL }, 96, "udp" }, - { "swift-rvf", { NULL }, 97, "tcp" }, - { "swift-rvf", { NULL }, 97, "udp" }, - { "tacnews", { NULL }, 98, "tcp" }, - { "tacnews", { NULL }, 98, "udp" }, - { "metagram", { NULL }, 99, "tcp" }, - { "metagram", { NULL }, 99, "udp" }, - { "newacct", { NULL }, 100, "tcp" }, - { "hostname", { NULL }, 101, "tcp" }, - { "hostname", { NULL }, 101, "udp" }, - { "iso-tsap", { NULL }, 102, "tcp" }, - { "iso-tsap", { NULL }, 102, "udp" }, - { "gppitnp", { NULL }, 103, "tcp" }, - { "gppitnp", { NULL }, 103, "udp" }, - { "acr-nema", { NULL }, 104, "tcp" }, - { "acr-nema", { NULL }, 104, "udp" }, - { "cso", { NULL }, 105, "tcp" }, - { "cso", { NULL }, 105, "udp" }, - { "csnet-ns", { NULL }, 105, "tcp" }, - { "csnet-ns", { NULL }, 105, "udp" }, - { "3com-tsmux", { NULL }, 106, "tcp" }, - { "3com-tsmux", { NULL }, 106, "udp" }, - { "rtelnet", { NULL }, 107, "tcp" }, - { "rtelnet", { NULL }, 107, "udp" }, - { "snagas", { NULL }, 108, "tcp" }, - { "snagas", { NULL }, 108, "udp" }, - { "pop2", { NULL }, 109, "tcp" }, - { "pop2", { NULL }, 109, "udp" }, - { "pop3", { NULL }, 110, "tcp" }, - { "pop3", { NULL }, 110, "udp" }, - { "sunrpc", { NULL }, 111, "tcp" }, - { "sunrpc", { NULL }, 111, "udp" }, - { "mcidas", { NULL }, 112, "tcp" }, - { "mcidas", { NULL }, 112, "udp" }, - { "ident", { NULL }, 113, "tcp" }, - { "auth", { NULL }, 113, "tcp" }, - { "auth", { NULL }, 113, "udp" }, - { "sftp", { NULL }, 115, "tcp" }, - { "sftp", { NULL }, 115, "udp" }, - { "ansanotify", { NULL }, 116, "tcp" }, - { "ansanotify", { NULL }, 116, "udp" }, - { "uucp-path", { NULL }, 117, "tcp" }, - { "uucp-path", { NULL }, 117, "udp" }, - { "sqlserv", { NULL }, 118, "tcp" }, - { "sqlserv", { NULL }, 118, "udp" }, - { "nntp", { NULL }, 119, "tcp" }, - { "nntp", { NULL }, 119, "udp" }, - { "cfdptkt", { NULL }, 120, "tcp" }, - { "cfdptkt", { NULL }, 120, "udp" }, - { "erpc", { NULL }, 121, "tcp" }, - { "erpc", { NULL }, 121, "udp" }, - { "smakynet", { NULL }, 122, "tcp" }, - { "smakynet", { NULL }, 122, "udp" }, - { "ntp", { NULL }, 123, "tcp" }, - { "ntp", { NULL }, 123, "udp" }, - { "ansatrader", { NULL }, 124, "tcp" }, - { "ansatrader", { NULL }, 124, "udp" }, - { "locus-map", { NULL }, 125, "tcp" }, - { "locus-map", { NULL }, 125, "udp" }, - { "nxedit", { NULL }, 126, "tcp" }, - { "nxedit", { NULL }, 126, "udp" }, - { "locus-con", { NULL }, 127, "tcp" }, - { "locus-con", { NULL }, 127, "udp" }, - { "gss-xlicen", { NULL }, 128, "tcp" }, - { "gss-xlicen", { NULL }, 128, "udp" }, - { "pwdgen", { NULL }, 129, "tcp" }, - { "pwdgen", { NULL }, 129, "udp" }, - { "cisco-fna", { NULL }, 130, "tcp" }, - { "cisco-fna", { NULL }, 130, "udp" }, - { "cisco-tna", { NULL }, 131, "tcp" }, - { "cisco-tna", { NULL }, 131, "udp" }, - { "cisco-sys", { NULL }, 132, "tcp" }, - { "cisco-sys", { NULL }, 132, "udp" }, - { "statsrv", { NULL }, 133, "tcp" }, - { "statsrv", { NULL }, 133, "udp" }, - { "ingres-net", { NULL }, 134, "tcp" }, - { "ingres-net", { NULL }, 134, "udp" }, - { "epmap", { NULL }, 135, "tcp" }, - { "epmap", { NULL }, 135, "udp" }, - { "profile", { NULL }, 136, "tcp" }, - { "profile", { NULL }, 136, "udp" }, - { "netbios-ns", { NULL }, 137, "tcp" }, - { "netbios-ns", { NULL }, 137, "udp" }, - { "netbios-dgm", { NULL }, 138, "tcp" }, - { "netbios-dgm", { NULL }, 138, "udp" }, - { "netbios-ssn", { NULL }, 139, "tcp" }, - { "netbios-ssn", { NULL }, 139, "udp" }, - { "emfis-data", { NULL }, 140, "tcp" }, - { "emfis-data", { NULL }, 140, "udp" }, - { "emfis-cntl", { NULL }, 141, "tcp" }, - { "emfis-cntl", { NULL }, 141, "udp" }, - { "bl-idm", { NULL }, 142, "tcp" }, - { "bl-idm", { NULL }, 142, "udp" }, - { "imap", { NULL }, 143, "tcp" }, - { "imap", { NULL }, 143, "udp" }, - { "uma", { NULL }, 144, "tcp" }, - { "uma", { NULL }, 144, "udp" }, - { "uaac", { NULL }, 145, "tcp" }, - { "uaac", { NULL }, 145, "udp" }, - { "iso-tp0", { NULL }, 146, "tcp" }, - { "iso-tp0", { NULL }, 146, "udp" }, - { "iso-ip", { NULL }, 147, "tcp" }, - { "iso-ip", { NULL }, 147, "udp" }, - { "jargon", { NULL }, 148, "tcp" }, - { "jargon", { NULL }, 148, "udp" }, - { "aed-512", { NULL }, 149, "tcp" }, - { "aed-512", { NULL }, 149, "udp" }, - { "sql-net", { NULL }, 150, "tcp" }, - { "sql-net", { NULL }, 150, "udp" }, - { "hems", { NULL }, 151, "tcp" }, - { "hems", { NULL }, 151, "udp" }, - { "bftp", { NULL }, 152, "tcp" }, - { "bftp", { NULL }, 152, "udp" }, - { "sgmp", { NULL }, 153, "tcp" }, - { "sgmp", { NULL }, 153, "udp" }, - { "netsc-prod", { NULL }, 154, "tcp" }, - { "netsc-prod", { NULL }, 154, "udp" }, - { "netsc-dev", { NULL }, 155, "tcp" }, - { "netsc-dev", { NULL }, 155, "udp" }, - { "sqlsrv", { NULL }, 156, "tcp" }, - { "sqlsrv", { NULL }, 156, "udp" }, - { "knet-cmp", { NULL }, 157, "tcp" }, - { "knet-cmp", { NULL }, 157, "udp" }, - { "pcmail-srv", { NULL }, 158, "tcp" }, - { "pcmail-srv", { NULL }, 158, "udp" }, - { "nss-routing", { NULL }, 159, "tcp" }, - { "nss-routing", { NULL }, 159, "udp" }, - { "sgmp-traps", { NULL }, 160, "tcp" }, - { "sgmp-traps", { NULL }, 160, "udp" }, - { "snmp", { NULL }, 161, "tcp" }, - { "snmp", { NULL }, 161, "udp" }, - { "snmptrap", { NULL }, 162, "tcp" }, - { "snmptrap", { NULL }, 162, "udp" }, - { "cmip-man", { NULL }, 163, "tcp" }, - { "cmip-man", { NULL }, 163, "udp" }, - { "cmip-agent", { NULL }, 164, "tcp" }, - { "cmip-agent", { NULL }, 164, "udp" }, - { "xns-courier", { NULL }, 165, "tcp" }, - { "xns-courier", { NULL }, 165, "udp" }, - { "s-net", { NULL }, 166, "tcp" }, - { "s-net", { NULL }, 166, "udp" }, - { "namp", { NULL }, 167, "tcp" }, - { "namp", { NULL }, 167, "udp" }, - { "rsvd", { NULL }, 168, "tcp" }, - { "rsvd", { NULL }, 168, "udp" }, - { "send", { NULL }, 169, "tcp" }, - { "send", { NULL }, 169, "udp" }, - { "print-srv", { NULL }, 170, "tcp" }, - { "print-srv", { NULL }, 170, "udp" }, - { "multiplex", { NULL }, 171, "tcp" }, - { "multiplex", { NULL }, 171, "udp" }, - { "cl/1", { NULL }, 172, "tcp" }, - { "cl/1", { NULL }, 172, "udp" }, - { "xyplex-mux", { NULL }, 173, "tcp" }, - { "xyplex-mux", { NULL }, 173, "udp" }, - { "mailq", { NULL }, 174, "tcp" }, - { "mailq", { NULL }, 174, "udp" }, - { "vmnet", { NULL }, 175, "tcp" }, - { "vmnet", { NULL }, 175, "udp" }, - { "genrad-mux", { NULL }, 176, "tcp" }, - { "genrad-mux", { NULL }, 176, "udp" }, - { "xdmcp", { NULL }, 177, "tcp" }, - { "xdmcp", { NULL }, 177, "udp" }, - { "nextstep", { NULL }, 178, "tcp" }, - { "nextstep", { NULL }, 178, "udp" }, - { "bgp", { NULL }, 179, "tcp" }, - { "bgp", { NULL }, 179, "udp" }, - { "bgp", { NULL }, 179, "sctp" }, - { "ris", { NULL }, 180, "tcp" }, - { "ris", { NULL }, 180, "udp" }, - { "unify", { NULL }, 181, "tcp" }, - { "unify", { NULL }, 181, "udp" }, - { "audit", { NULL }, 182, "tcp" }, - { "audit", { NULL }, 182, "udp" }, - { "ocbinder", { NULL }, 183, "tcp" }, - { "ocbinder", { NULL }, 183, "udp" }, - { "ocserver", { NULL }, 184, "tcp" }, - { "ocserver", { NULL }, 184, "udp" }, - { "remote-kis", { NULL }, 185, "tcp" }, - { "remote-kis", { NULL }, 185, "udp" }, - { "kis", { NULL }, 186, "tcp" }, - { "kis", { NULL }, 186, "udp" }, - { "aci", { NULL }, 187, "tcp" }, - { "aci", { NULL }, 187, "udp" }, - { "mumps", { NULL }, 188, "tcp" }, - { "mumps", { NULL }, 188, "udp" }, - { "qft", { NULL }, 189, "tcp" }, - { "qft", { NULL }, 189, "udp" }, - { "gacp", { NULL }, 190, "tcp" }, - { "gacp", { NULL }, 190, "udp" }, - { "prospero", { NULL }, 191, "tcp" }, - { "prospero", { NULL }, 191, "udp" }, - { "osu-nms", { NULL }, 192, "tcp" }, - { "osu-nms", { NULL }, 192, "udp" }, - { "srmp", { NULL }, 193, "tcp" }, - { "srmp", { NULL }, 193, "udp" }, - { "irc", { NULL }, 194, "tcp" }, - { "irc", { NULL }, 194, "udp" }, - { "dn6-nlm-aud", { NULL }, 195, "tcp" }, - { "dn6-nlm-aud", { NULL }, 195, "udp" }, - { "dn6-smm-red", { NULL }, 196, "tcp" }, - { "dn6-smm-red", { NULL }, 196, "udp" }, - { "dls", { NULL }, 197, "tcp" }, - { "dls", { NULL }, 197, "udp" }, - { "dls-mon", { NULL }, 198, "tcp" }, - { "dls-mon", { NULL }, 198, "udp" }, - { "smux", { NULL }, 199, "tcp" }, - { "smux", { NULL }, 199, "udp" }, - { "src", { NULL }, 200, "tcp" }, - { "src", { NULL }, 200, "udp" }, - { "at-rtmp", { NULL }, 201, "tcp" }, - { "at-rtmp", { NULL }, 201, "udp" }, - { "at-nbp", { NULL }, 202, "tcp" }, - { "at-nbp", { NULL }, 202, "udp" }, - { "at-3", { NULL }, 203, "tcp" }, - { "at-3", { NULL }, 203, "udp" }, - { "at-echo", { NULL }, 204, "tcp" }, - { "at-echo", { NULL }, 204, "udp" }, - { "at-5", { NULL }, 205, "tcp" }, - { "at-5", { NULL }, 205, "udp" }, - { "at-zis", { NULL }, 206, "tcp" }, - { "at-zis", { NULL }, 206, "udp" }, - { "at-7", { NULL }, 207, "tcp" }, - { "at-7", { NULL }, 207, "udp" }, - { "at-8", { NULL }, 208, "tcp" }, - { "at-8", { NULL }, 208, "udp" }, - { "qmtp", { NULL }, 209, "tcp" }, - { "qmtp", { NULL }, 209, "udp" }, - { "z39.50", { NULL }, 210, "tcp" }, - { "z39.50", { NULL }, 210, "udp" }, - { "914c/g", { NULL }, 211, "tcp" }, - { "914c/g", { NULL }, 211, "udp" }, - { "anet", { NULL }, 212, "tcp" }, - { "anet", { NULL }, 212, "udp" }, - { "ipx", { NULL }, 213, "tcp" }, - { "ipx", { NULL }, 213, "udp" }, - { "vmpwscs", { NULL }, 214, "tcp" }, - { "vmpwscs", { NULL }, 214, "udp" }, - { "softpc", { NULL }, 215, "tcp" }, - { "softpc", { NULL }, 215, "udp" }, - { "CAIlic", { NULL }, 216, "tcp" }, - { "CAIlic", { NULL }, 216, "udp" }, - { "dbase", { NULL }, 217, "tcp" }, - { "dbase", { NULL }, 217, "udp" }, - { "mpp", { NULL }, 218, "tcp" }, - { "mpp", { NULL }, 218, "udp" }, - { "uarps", { NULL }, 219, "tcp" }, - { "uarps", { NULL }, 219, "udp" }, - { "imap3", { NULL }, 220, "tcp" }, - { "imap3", { NULL }, 220, "udp" }, - { "fln-spx", { NULL }, 221, "tcp" }, - { "fln-spx", { NULL }, 221, "udp" }, - { "rsh-spx", { NULL }, 222, "tcp" }, - { "rsh-spx", { NULL }, 222, "udp" }, - { "cdc", { NULL }, 223, "tcp" }, - { "cdc", { NULL }, 223, "udp" }, - { "masqdialer", { NULL }, 224, "tcp" }, - { "masqdialer", { NULL }, 224, "udp" }, - { "direct", { NULL }, 242, "tcp" }, - { "direct", { NULL }, 242, "udp" }, - { "sur-meas", { NULL }, 243, "tcp" }, - { "sur-meas", { NULL }, 243, "udp" }, - { "inbusiness", { NULL }, 244, "tcp" }, - { "inbusiness", { NULL }, 244, "udp" }, - { "link", { NULL }, 245, "tcp" }, - { "link", { NULL }, 245, "udp" }, - { "dsp3270", { NULL }, 246, "tcp" }, - { "dsp3270", { NULL }, 246, "udp" }, - { "subntbcst_tftp", { NULL }, 247, "tcp" }, - { "subntbcst_tftp", { NULL }, 247, "udp" }, - { "bhfhs", { NULL }, 248, "tcp" }, - { "bhfhs", { NULL }, 248, "udp" }, - { "rap", { NULL }, 256, "tcp" }, - { "rap", { NULL }, 256, "udp" }, - { "set", { NULL }, 257, "tcp" }, - { "set", { NULL }, 257, "udp" }, - { "esro-gen", { NULL }, 259, "tcp" }, - { "esro-gen", { NULL }, 259, "udp" }, - { "openport", { NULL }, 260, "tcp" }, - { "openport", { NULL }, 260, "udp" }, - { "nsiiops", { NULL }, 261, "tcp" }, - { "nsiiops", { NULL }, 261, "udp" }, - { "arcisdms", { NULL }, 262, "tcp" }, - { "arcisdms", { NULL }, 262, "udp" }, - { "hdap", { NULL }, 263, "tcp" }, - { "hdap", { NULL }, 263, "udp" }, - { "bgmp", { NULL }, 264, "tcp" }, - { "bgmp", { NULL }, 264, "udp" }, - { "x-bone-ctl", { NULL }, 265, "tcp" }, - { "x-bone-ctl", { NULL }, 265, "udp" }, - { "sst", { NULL }, 266, "tcp" }, - { "sst", { NULL }, 266, "udp" }, - { "td-service", { NULL }, 267, "tcp" }, - { "td-service", { NULL }, 267, "udp" }, - { "td-replica", { NULL }, 268, "tcp" }, - { "td-replica", { NULL }, 268, "udp" }, - { "manet", { NULL }, 269, "tcp" }, - { "manet", { NULL }, 269, "udp" }, - { "gist", { NULL }, 270, "udp" }, - { "http-mgmt", { NULL }, 280, "tcp" }, - { "http-mgmt", { NULL }, 280, "udp" }, - { "personal-link", { NULL }, 281, "tcp" }, - { "personal-link", { NULL }, 281, "udp" }, - { "cableport-ax", { NULL }, 282, "tcp" }, - { "cableport-ax", { NULL }, 282, "udp" }, - { "rescap", { NULL }, 283, "tcp" }, - { "rescap", { NULL }, 283, "udp" }, - { "corerjd", { NULL }, 284, "tcp" }, - { "corerjd", { NULL }, 284, "udp" }, - { "fxp", { NULL }, 286, "tcp" }, - { "fxp", { NULL }, 286, "udp" }, - { "k-block", { NULL }, 287, "tcp" }, - { "k-block", { NULL }, 287, "udp" }, - { "novastorbakcup", { NULL }, 308, "tcp" }, - { "novastorbakcup", { NULL }, 308, "udp" }, - { "entrusttime", { NULL }, 309, "tcp" }, - { "entrusttime", { NULL }, 309, "udp" }, - { "bhmds", { NULL }, 310, "tcp" }, - { "bhmds", { NULL }, 310, "udp" }, - { "asip-webadmin", { NULL }, 311, "tcp" }, - { "asip-webadmin", { NULL }, 311, "udp" }, - { "vslmp", { NULL }, 312, "tcp" }, - { "vslmp", { NULL }, 312, "udp" }, - { "magenta-logic", { NULL }, 313, "tcp" }, - { "magenta-logic", { NULL }, 313, "udp" }, - { "opalis-robot", { NULL }, 314, "tcp" }, - { "opalis-robot", { NULL }, 314, "udp" }, - { "dpsi", { NULL }, 315, "tcp" }, - { "dpsi", { NULL }, 315, "udp" }, - { "decauth", { NULL }, 316, "tcp" }, - { "decauth", { NULL }, 316, "udp" }, - { "zannet", { NULL }, 317, "tcp" }, - { "zannet", { NULL }, 317, "udp" }, - { "pkix-timestamp", { NULL }, 318, "tcp" }, - { "pkix-timestamp", { NULL }, 318, "udp" }, - { "ptp-event", { NULL }, 319, "tcp" }, - { "ptp-event", { NULL }, 319, "udp" }, - { "ptp-general", { NULL }, 320, "tcp" }, - { "ptp-general", { NULL }, 320, "udp" }, - { "pip", { NULL }, 321, "tcp" }, - { "pip", { NULL }, 321, "udp" }, - { "rtsps", { NULL }, 322, "tcp" }, - { "rtsps", { NULL }, 322, "udp" }, - { "texar", { NULL }, 333, "tcp" }, - { "texar", { NULL }, 333, "udp" }, - { "pdap", { NULL }, 344, "tcp" }, - { "pdap", { NULL }, 344, "udp" }, - { "pawserv", { NULL }, 345, "tcp" }, - { "pawserv", { NULL }, 345, "udp" }, - { "zserv", { NULL }, 346, "tcp" }, - { "zserv", { NULL }, 346, "udp" }, - { "fatserv", { NULL }, 347, "tcp" }, - { "fatserv", { NULL }, 347, "udp" }, - { "csi-sgwp", { NULL }, 348, "tcp" }, - { "csi-sgwp", { NULL }, 348, "udp" }, - { "mftp", { NULL }, 349, "tcp" }, - { "mftp", { NULL }, 349, "udp" }, - { "matip-type-a", { NULL }, 350, "tcp" }, - { "matip-type-a", { NULL }, 350, "udp" }, - { "matip-type-b", { NULL }, 351, "tcp" }, - { "matip-type-b", { NULL }, 351, "udp" }, - { "bhoetty", { NULL }, 351, "tcp" }, - { "bhoetty", { NULL }, 351, "udp" }, - { "dtag-ste-sb", { NULL }, 352, "tcp" }, - { "dtag-ste-sb", { NULL }, 352, "udp" }, - { "bhoedap4", { NULL }, 352, "tcp" }, - { "bhoedap4", { NULL }, 352, "udp" }, - { "ndsauth", { NULL }, 353, "tcp" }, - { "ndsauth", { NULL }, 353, "udp" }, - { "bh611", { NULL }, 354, "tcp" }, - { "bh611", { NULL }, 354, "udp" }, - { "datex-asn", { NULL }, 355, "tcp" }, - { "datex-asn", { NULL }, 355, "udp" }, - { "cloanto-net-1", { NULL }, 356, "tcp" }, - { "cloanto-net-1", { NULL }, 356, "udp" }, - { "bhevent", { NULL }, 357, "tcp" }, - { "bhevent", { NULL }, 357, "udp" }, - { "shrinkwrap", { NULL }, 358, "tcp" }, - { "shrinkwrap", { NULL }, 358, "udp" }, - { "nsrmp", { NULL }, 359, "tcp" }, - { "nsrmp", { NULL }, 359, "udp" }, - { "scoi2odialog", { NULL }, 360, "tcp" }, - { "scoi2odialog", { NULL }, 360, "udp" }, - { "semantix", { NULL }, 361, "tcp" }, - { "semantix", { NULL }, 361, "udp" }, - { "srssend", { NULL }, 362, "tcp" }, - { "srssend", { NULL }, 362, "udp" }, - { "rsvp_tunnel", { NULL }, 363, "tcp" }, - { "rsvp_tunnel", { NULL }, 363, "udp" }, - { "aurora-cmgr", { NULL }, 364, "tcp" }, - { "aurora-cmgr", { NULL }, 364, "udp" }, - { "dtk", { NULL }, 365, "tcp" }, - { "dtk", { NULL }, 365, "udp" }, - { "odmr", { NULL }, 366, "tcp" }, - { "odmr", { NULL }, 366, "udp" }, - { "mortgageware", { NULL }, 367, "tcp" }, - { "mortgageware", { NULL }, 367, "udp" }, - { "qbikgdp", { NULL }, 368, "tcp" }, - { "qbikgdp", { NULL }, 368, "udp" }, - { "rpc2portmap", { NULL }, 369, "tcp" }, - { "rpc2portmap", { NULL }, 369, "udp" }, - { "codaauth2", { NULL }, 370, "tcp" }, - { "codaauth2", { NULL }, 370, "udp" }, - { "clearcase", { NULL }, 371, "tcp" }, - { "clearcase", { NULL }, 371, "udp" }, - { "ulistproc", { NULL }, 372, "tcp" }, - { "ulistproc", { NULL }, 372, "udp" }, - { "legent-1", { NULL }, 373, "tcp" }, - { "legent-1", { NULL }, 373, "udp" }, - { "legent-2", { NULL }, 374, "tcp" }, - { "legent-2", { NULL }, 374, "udp" }, - { "hassle", { NULL }, 375, "tcp" }, - { "hassle", { NULL }, 375, "udp" }, - { "nip", { NULL }, 376, "tcp" }, - { "nip", { NULL }, 376, "udp" }, - { "tnETOS", { NULL }, 377, "tcp" }, - { "tnETOS", { NULL }, 377, "udp" }, - { "dsETOS", { NULL }, 378, "tcp" }, - { "dsETOS", { NULL }, 378, "udp" }, - { "is99c", { NULL }, 379, "tcp" }, - { "is99c", { NULL }, 379, "udp" }, - { "is99s", { NULL }, 380, "tcp" }, - { "is99s", { NULL }, 380, "udp" }, - { "hp-collector", { NULL }, 381, "tcp" }, - { "hp-collector", { NULL }, 381, "udp" }, - { "hp-managed-node", { NULL }, 382, "tcp" }, - { "hp-managed-node", { NULL }, 382, "udp" }, - { "hp-alarm-mgr", { NULL }, 383, "tcp" }, - { "hp-alarm-mgr", { NULL }, 383, "udp" }, - { "arns", { NULL }, 384, "tcp" }, - { "arns", { NULL }, 384, "udp" }, - { "ibm-app", { NULL }, 385, "tcp" }, - { "ibm-app", { NULL }, 385, "udp" }, - { "asa", { NULL }, 386, "tcp" }, - { "asa", { NULL }, 386, "udp" }, - { "aurp", { NULL }, 387, "tcp" }, - { "aurp", { NULL }, 387, "udp" }, - { "unidata-ldm", { NULL }, 388, "tcp" }, - { "unidata-ldm", { NULL }, 388, "udp" }, - { "ldap", { NULL }, 389, "tcp" }, - { "ldap", { NULL }, 389, "udp" }, - { "uis", { NULL }, 390, "tcp" }, - { "uis", { NULL }, 390, "udp" }, - { "synotics-relay", { NULL }, 391, "tcp" }, - { "synotics-relay", { NULL }, 391, "udp" }, - { "synotics-broker", { NULL }, 392, "tcp" }, - { "synotics-broker", { NULL }, 392, "udp" }, - { "meta5", { NULL }, 393, "tcp" }, - { "meta5", { NULL }, 393, "udp" }, - { "embl-ndt", { NULL }, 394, "tcp" }, - { "embl-ndt", { NULL }, 394, "udp" }, - { "netcp", { NULL }, 395, "tcp" }, - { "netcp", { NULL }, 395, "udp" }, - { "netware-ip", { NULL }, 396, "tcp" }, - { "netware-ip", { NULL }, 396, "udp" }, - { "mptn", { NULL }, 397, "tcp" }, - { "mptn", { NULL }, 397, "udp" }, - { "kryptolan", { NULL }, 398, "tcp" }, - { "kryptolan", { NULL }, 398, "udp" }, - { "iso-tsap-c2", { NULL }, 399, "tcp" }, - { "iso-tsap-c2", { NULL }, 399, "udp" }, - { "osb-sd", { NULL }, 400, "tcp" }, - { "osb-sd", { NULL }, 400, "udp" }, - { "ups", { NULL }, 401, "tcp" }, - { "ups", { NULL }, 401, "udp" }, - { "genie", { NULL }, 402, "tcp" }, - { "genie", { NULL }, 402, "udp" }, - { "decap", { NULL }, 403, "tcp" }, - { "decap", { NULL }, 403, "udp" }, - { "nced", { NULL }, 404, "tcp" }, - { "nced", { NULL }, 404, "udp" }, - { "ncld", { NULL }, 405, "tcp" }, - { "ncld", { NULL }, 405, "udp" }, - { "imsp", { NULL }, 406, "tcp" }, - { "imsp", { NULL }, 406, "udp" }, - { "timbuktu", { NULL }, 407, "tcp" }, - { "timbuktu", { NULL }, 407, "udp" }, - { "prm-sm", { NULL }, 408, "tcp" }, - { "prm-sm", { NULL }, 408, "udp" }, - { "prm-nm", { NULL }, 409, "tcp" }, - { "prm-nm", { NULL }, 409, "udp" }, - { "decladebug", { NULL }, 410, "tcp" }, - { "decladebug", { NULL }, 410, "udp" }, - { "rmt", { NULL }, 411, "tcp" }, - { "rmt", { NULL }, 411, "udp" }, - { "synoptics-trap", { NULL }, 412, "tcp" }, - { "synoptics-trap", { NULL }, 412, "udp" }, - { "smsp", { NULL }, 413, "tcp" }, - { "smsp", { NULL }, 413, "udp" }, - { "infoseek", { NULL }, 414, "tcp" }, - { "infoseek", { NULL }, 414, "udp" }, - { "bnet", { NULL }, 415, "tcp" }, - { "bnet", { NULL }, 415, "udp" }, - { "silverplatter", { NULL }, 416, "tcp" }, - { "silverplatter", { NULL }, 416, "udp" }, - { "onmux", { NULL }, 417, "tcp" }, - { "onmux", { NULL }, 417, "udp" }, - { "hyper-g", { NULL }, 418, "tcp" }, - { "hyper-g", { NULL }, 418, "udp" }, - { "ariel1", { NULL }, 419, "tcp" }, - { "ariel1", { NULL }, 419, "udp" }, - { "smpte", { NULL }, 420, "tcp" }, - { "smpte", { NULL }, 420, "udp" }, - { "ariel2", { NULL }, 421, "tcp" }, - { "ariel2", { NULL }, 421, "udp" }, - { "ariel3", { NULL }, 422, "tcp" }, - { "ariel3", { NULL }, 422, "udp" }, - { "opc-job-start", { NULL }, 423, "tcp" }, - { "opc-job-start", { NULL }, 423, "udp" }, - { "opc-job-track", { NULL }, 424, "tcp" }, - { "opc-job-track", { NULL }, 424, "udp" }, - { "icad-el", { NULL }, 425, "tcp" }, - { "icad-el", { NULL }, 425, "udp" }, - { "smartsdp", { NULL }, 426, "tcp" }, - { "smartsdp", { NULL }, 426, "udp" }, - { "svrloc", { NULL }, 427, "tcp" }, - { "svrloc", { NULL }, 427, "udp" }, - { "ocs_cmu", { NULL }, 428, "tcp" }, - { "ocs_cmu", { NULL }, 428, "udp" }, - { "ocs_amu", { NULL }, 429, "tcp" }, - { "ocs_amu", { NULL }, 429, "udp" }, - { "utmpsd", { NULL }, 430, "tcp" }, - { "utmpsd", { NULL }, 430, "udp" }, - { "utmpcd", { NULL }, 431, "tcp" }, - { "utmpcd", { NULL }, 431, "udp" }, - { "iasd", { NULL }, 432, "tcp" }, - { "iasd", { NULL }, 432, "udp" }, - { "nnsp", { NULL }, 433, "tcp" }, - { "nnsp", { NULL }, 433, "udp" }, - { "mobileip-agent", { NULL }, 434, "tcp" }, - { "mobileip-agent", { NULL }, 434, "udp" }, - { "mobilip-mn", { NULL }, 435, "tcp" }, - { "mobilip-mn", { NULL }, 435, "udp" }, - { "dna-cml", { NULL }, 436, "tcp" }, - { "dna-cml", { NULL }, 436, "udp" }, - { "comscm", { NULL }, 437, "tcp" }, - { "comscm", { NULL }, 437, "udp" }, - { "dsfgw", { NULL }, 438, "tcp" }, - { "dsfgw", { NULL }, 438, "udp" }, - { "dasp", { NULL }, 439, "tcp" }, - { "dasp", { NULL }, 439, "udp" }, - { "sgcp", { NULL }, 440, "tcp" }, - { "sgcp", { NULL }, 440, "udp" }, - { "decvms-sysmgt", { NULL }, 441, "tcp" }, - { "decvms-sysmgt", { NULL }, 441, "udp" }, - { "cvc_hostd", { NULL }, 442, "tcp" }, - { "cvc_hostd", { NULL }, 442, "udp" }, - { "https", { NULL }, 443, "tcp" }, - { "https", { NULL }, 443, "udp" }, - { "https", { NULL }, 443, "sctp" }, - { "snpp", { NULL }, 444, "tcp" }, - { "snpp", { NULL }, 444, "udp" }, - { "microsoft-ds", { NULL }, 445, "tcp" }, - { "microsoft-ds", { NULL }, 445, "udp" }, - { "ddm-rdb", { NULL }, 446, "tcp" }, - { "ddm-rdb", { NULL }, 446, "udp" }, - { "ddm-dfm", { NULL }, 447, "tcp" }, - { "ddm-dfm", { NULL }, 447, "udp" }, - { "ddm-ssl", { NULL }, 448, "tcp" }, - { "ddm-ssl", { NULL }, 448, "udp" }, - { "as-servermap", { NULL }, 449, "tcp" }, - { "as-servermap", { NULL }, 449, "udp" }, - { "tserver", { NULL }, 450, "tcp" }, - { "tserver", { NULL }, 450, "udp" }, - { "sfs-smp-net", { NULL }, 451, "tcp" }, - { "sfs-smp-net", { NULL }, 451, "udp" }, - { "sfs-config", { NULL }, 452, "tcp" }, - { "sfs-config", { NULL }, 452, "udp" }, - { "creativeserver", { NULL }, 453, "tcp" }, - { "creativeserver", { NULL }, 453, "udp" }, - { "contentserver", { NULL }, 454, "tcp" }, - { "contentserver", { NULL }, 454, "udp" }, - { "creativepartnr", { NULL }, 455, "tcp" }, - { "creativepartnr", { NULL }, 455, "udp" }, - { "macon-tcp", { NULL }, 456, "tcp" }, - { "macon-udp", { NULL }, 456, "udp" }, - { "scohelp", { NULL }, 457, "tcp" }, - { "scohelp", { NULL }, 457, "udp" }, - { "appleqtc", { NULL }, 458, "tcp" }, - { "appleqtc", { NULL }, 458, "udp" }, - { "ampr-rcmd", { NULL }, 459, "tcp" }, - { "ampr-rcmd", { NULL }, 459, "udp" }, - { "skronk", { NULL }, 460, "tcp" }, - { "skronk", { NULL }, 460, "udp" }, - { "datasurfsrv", { NULL }, 461, "tcp" }, - { "datasurfsrv", { NULL }, 461, "udp" }, - { "datasurfsrvsec", { NULL }, 462, "tcp" }, - { "datasurfsrvsec", { NULL }, 462, "udp" }, - { "alpes", { NULL }, 463, "tcp" }, - { "alpes", { NULL }, 463, "udp" }, - { "kpasswd", { NULL }, 464, "tcp" }, - { "kpasswd", { NULL }, 464, "udp" }, - { "urd", { NULL }, 465, "tcp" }, - { "igmpv3lite", { NULL }, 465, "udp" }, - { "digital-vrc", { NULL }, 466, "tcp" }, - { "digital-vrc", { NULL }, 466, "udp" }, - { "mylex-mapd", { NULL }, 467, "tcp" }, - { "mylex-mapd", { NULL }, 467, "udp" }, - { "photuris", { NULL }, 468, "tcp" }, - { "photuris", { NULL }, 468, "udp" }, - { "rcp", { NULL }, 469, "tcp" }, - { "rcp", { NULL }, 469, "udp" }, - { "scx-proxy", { NULL }, 470, "tcp" }, - { "scx-proxy", { NULL }, 470, "udp" }, - { "mondex", { NULL }, 471, "tcp" }, - { "mondex", { NULL }, 471, "udp" }, - { "ljk-login", { NULL }, 472, "tcp" }, - { "ljk-login", { NULL }, 472, "udp" }, - { "hybrid-pop", { NULL }, 473, "tcp" }, - { "hybrid-pop", { NULL }, 473, "udp" }, - { "tn-tl-w1", { NULL }, 474, "tcp" }, - { "tn-tl-w2", { NULL }, 474, "udp" }, - { "tcpnethaspsrv", { NULL }, 475, "tcp" }, - { "tcpnethaspsrv", { NULL }, 475, "udp" }, - { "tn-tl-fd1", { NULL }, 476, "tcp" }, - { "tn-tl-fd1", { NULL }, 476, "udp" }, - { "ss7ns", { NULL }, 477, "tcp" }, - { "ss7ns", { NULL }, 477, "udp" }, - { "spsc", { NULL }, 478, "tcp" }, - { "spsc", { NULL }, 478, "udp" }, - { "iafserver", { NULL }, 479, "tcp" }, - { "iafserver", { NULL }, 479, "udp" }, - { "iafdbase", { NULL }, 480, "tcp" }, - { "iafdbase", { NULL }, 480, "udp" }, - { "ph", { NULL }, 481, "tcp" }, - { "ph", { NULL }, 481, "udp" }, - { "bgs-nsi", { NULL }, 482, "tcp" }, - { "bgs-nsi", { NULL }, 482, "udp" }, - { "ulpnet", { NULL }, 483, "tcp" }, - { "ulpnet", { NULL }, 483, "udp" }, - { "integra-sme", { NULL }, 484, "tcp" }, - { "integra-sme", { NULL }, 484, "udp" }, - { "powerburst", { NULL }, 485, "tcp" }, - { "powerburst", { NULL }, 485, "udp" }, - { "avian", { NULL }, 486, "tcp" }, - { "avian", { NULL }, 486, "udp" }, - { "saft", { NULL }, 487, "tcp" }, - { "saft", { NULL }, 487, "udp" }, - { "gss-http", { NULL }, 488, "tcp" }, - { "gss-http", { NULL }, 488, "udp" }, - { "nest-protocol", { NULL }, 489, "tcp" }, - { "nest-protocol", { NULL }, 489, "udp" }, - { "micom-pfs", { NULL }, 490, "tcp" }, - { "micom-pfs", { NULL }, 490, "udp" }, - { "go-login", { NULL }, 491, "tcp" }, - { "go-login", { NULL }, 491, "udp" }, - { "ticf-1", { NULL }, 492, "tcp" }, - { "ticf-1", { NULL }, 492, "udp" }, - { "ticf-2", { NULL }, 493, "tcp" }, - { "ticf-2", { NULL }, 493, "udp" }, - { "pov-ray", { NULL }, 494, "tcp" }, - { "pov-ray", { NULL }, 494, "udp" }, - { "intecourier", { NULL }, 495, "tcp" }, - { "intecourier", { NULL }, 495, "udp" }, - { "pim-rp-disc", { NULL }, 496, "tcp" }, - { "pim-rp-disc", { NULL }, 496, "udp" }, - { "dantz", { NULL }, 497, "tcp" }, - { "dantz", { NULL }, 497, "udp" }, - { "siam", { NULL }, 498, "tcp" }, - { "siam", { NULL }, 498, "udp" }, - { "iso-ill", { NULL }, 499, "tcp" }, - { "iso-ill", { NULL }, 499, "udp" }, - { "isakmp", { NULL }, 500, "tcp" }, - { "isakmp", { NULL }, 500, "udp" }, - { "stmf", { NULL }, 501, "tcp" }, - { "stmf", { NULL }, 501, "udp" }, - { "asa-appl-proto", { NULL }, 502, "tcp" }, - { "asa-appl-proto", { NULL }, 502, "udp" }, - { "intrinsa", { NULL }, 503, "tcp" }, - { "intrinsa", { NULL }, 503, "udp" }, - { "citadel", { NULL }, 504, "tcp" }, - { "citadel", { NULL }, 504, "udp" }, - { "mailbox-lm", { NULL }, 505, "tcp" }, - { "mailbox-lm", { NULL }, 505, "udp" }, - { "ohimsrv", { NULL }, 506, "tcp" }, - { "ohimsrv", { NULL }, 506, "udp" }, - { "crs", { NULL }, 507, "tcp" }, - { "crs", { NULL }, 507, "udp" }, - { "xvttp", { NULL }, 508, "tcp" }, - { "xvttp", { NULL }, 508, "udp" }, - { "snare", { NULL }, 509, "tcp" }, - { "snare", { NULL }, 509, "udp" }, - { "fcp", { NULL }, 510, "tcp" }, - { "fcp", { NULL }, 510, "udp" }, - { "passgo", { NULL }, 511, "tcp" }, - { "passgo", { NULL }, 511, "udp" }, - { "exec", { NULL }, 512, "tcp" }, - { "comsat", { NULL }, 512, "udp" }, - { "biff", { NULL }, 512, "udp" }, - { "login", { NULL }, 513, "tcp" }, - { "who", { NULL }, 513, "udp" }, - { "shell", { NULL }, 514, "tcp" }, - { "syslog", { NULL }, 514, "udp" }, - { "printer", { NULL }, 515, "tcp" }, - { "printer", { NULL }, 515, "udp" }, - { "videotex", { NULL }, 516, "tcp" }, - { "videotex", { NULL }, 516, "udp" }, - { "talk", { NULL }, 517, "tcp" }, - { "talk", { NULL }, 517, "udp" }, - { "ntalk", { NULL }, 518, "tcp" }, - { "ntalk", { NULL }, 518, "udp" }, - { "utime", { NULL }, 519, "tcp" }, - { "utime", { NULL }, 519, "udp" }, - { "efs", { NULL }, 520, "tcp" }, - { "router", { NULL }, 520, "udp" }, - { "ripng", { NULL }, 521, "tcp" }, - { "ripng", { NULL }, 521, "udp" }, - { "ulp", { NULL }, 522, "tcp" }, - { "ulp", { NULL }, 522, "udp" }, - { "ibm-db2", { NULL }, 523, "tcp" }, - { "ibm-db2", { NULL }, 523, "udp" }, - { "ncp", { NULL }, 524, "tcp" }, - { "ncp", { NULL }, 524, "udp" }, - { "timed", { NULL }, 525, "tcp" }, - { "timed", { NULL }, 525, "udp" }, - { "tempo", { NULL }, 526, "tcp" }, - { "tempo", { NULL }, 526, "udp" }, - { "stx", { NULL }, 527, "tcp" }, - { "stx", { NULL }, 527, "udp" }, - { "custix", { NULL }, 528, "tcp" }, - { "custix", { NULL }, 528, "udp" }, - { "irc-serv", { NULL }, 529, "tcp" }, - { "irc-serv", { NULL }, 529, "udp" }, - { "courier", { NULL }, 530, "tcp" }, - { "courier", { NULL }, 530, "udp" }, - { "conference", { NULL }, 531, "tcp" }, - { "conference", { NULL }, 531, "udp" }, - { "netnews", { NULL }, 532, "tcp" }, - { "netnews", { NULL }, 532, "udp" }, - { "netwall", { NULL }, 533, "tcp" }, - { "netwall", { NULL }, 533, "udp" }, - { "windream", { NULL }, 534, "tcp" }, - { "windream", { NULL }, 534, "udp" }, - { "iiop", { NULL }, 535, "tcp" }, - { "iiop", { NULL }, 535, "udp" }, - { "opalis-rdv", { NULL }, 536, "tcp" }, - { "opalis-rdv", { NULL }, 536, "udp" }, - { "nmsp", { NULL }, 537, "tcp" }, - { "nmsp", { NULL }, 537, "udp" }, - { "gdomap", { NULL }, 538, "tcp" }, - { "gdomap", { NULL }, 538, "udp" }, - { "apertus-ldp", { NULL }, 539, "tcp" }, - { "apertus-ldp", { NULL }, 539, "udp" }, - { "uucp", { NULL }, 540, "tcp" }, - { "uucp", { NULL }, 540, "udp" }, - { "uucp-rlogin", { NULL }, 541, "tcp" }, - { "uucp-rlogin", { NULL }, 541, "udp" }, - { "commerce", { NULL }, 542, "tcp" }, - { "commerce", { NULL }, 542, "udp" }, - { "klogin", { NULL }, 543, "tcp" }, - { "klogin", { NULL }, 543, "udp" }, - { "kshell", { NULL }, 544, "tcp" }, - { "kshell", { NULL }, 544, "udp" }, - { "appleqtcsrvr", { NULL }, 545, "tcp" }, - { "appleqtcsrvr", { NULL }, 545, "udp" }, - { "dhcpv6-client", { NULL }, 546, "tcp" }, - { "dhcpv6-client", { NULL }, 546, "udp" }, - { "dhcpv6-server", { NULL }, 547, "tcp" }, - { "dhcpv6-server", { NULL }, 547, "udp" }, - { "afpovertcp", { NULL }, 548, "tcp" }, - { "afpovertcp", { NULL }, 548, "udp" }, - { "idfp", { NULL }, 549, "tcp" }, - { "idfp", { NULL }, 549, "udp" }, - { "new-rwho", { NULL }, 550, "tcp" }, - { "new-rwho", { NULL }, 550, "udp" }, - { "cybercash", { NULL }, 551, "tcp" }, - { "cybercash", { NULL }, 551, "udp" }, - { "devshr-nts", { NULL }, 552, "tcp" }, - { "devshr-nts", { NULL }, 552, "udp" }, - { "pirp", { NULL }, 553, "tcp" }, - { "pirp", { NULL }, 553, "udp" }, - { "rtsp", { NULL }, 554, "tcp" }, - { "rtsp", { NULL }, 554, "udp" }, - { "dsf", { NULL }, 555, "tcp" }, - { "dsf", { NULL }, 555, "udp" }, - { "remotefs", { NULL }, 556, "tcp" }, - { "remotefs", { NULL }, 556, "udp" }, - { "openvms-sysipc", { NULL }, 557, "tcp" }, - { "openvms-sysipc", { NULL }, 557, "udp" }, - { "sdnskmp", { NULL }, 558, "tcp" }, - { "sdnskmp", { NULL }, 558, "udp" }, - { "teedtap", { NULL }, 559, "tcp" }, - { "teedtap", { NULL }, 559, "udp" }, - { "rmonitor", { NULL }, 560, "tcp" }, - { "rmonitor", { NULL }, 560, "udp" }, - { "monitor", { NULL }, 561, "tcp" }, - { "monitor", { NULL }, 561, "udp" }, - { "chshell", { NULL }, 562, "tcp" }, - { "chshell", { NULL }, 562, "udp" }, - { "nntps", { NULL }, 563, "tcp" }, - { "nntps", { NULL }, 563, "udp" }, - { "9pfs", { NULL }, 564, "tcp" }, - { "9pfs", { NULL }, 564, "udp" }, - { "whoami", { NULL }, 565, "tcp" }, - { "whoami", { NULL }, 565, "udp" }, - { "streettalk", { NULL }, 566, "tcp" }, - { "streettalk", { NULL }, 566, "udp" }, - { "banyan-rpc", { NULL }, 567, "tcp" }, - { "banyan-rpc", { NULL }, 567, "udp" }, - { "ms-shuttle", { NULL }, 568, "tcp" }, - { "ms-shuttle", { NULL }, 568, "udp" }, - { "ms-rome", { NULL }, 569, "tcp" }, - { "ms-rome", { NULL }, 569, "udp" }, - { "meter", { NULL }, 570, "tcp" }, - { "meter", { NULL }, 570, "udp" }, - { "meter", { NULL }, 571, "tcp" }, - { "meter", { NULL }, 571, "udp" }, - { "sonar", { NULL }, 572, "tcp" }, - { "sonar", { NULL }, 572, "udp" }, - { "banyan-vip", { NULL }, 573, "tcp" }, - { "banyan-vip", { NULL }, 573, "udp" }, - { "ftp-agent", { NULL }, 574, "tcp" }, - { "ftp-agent", { NULL }, 574, "udp" }, - { "vemmi", { NULL }, 575, "tcp" }, - { "vemmi", { NULL }, 575, "udp" }, - { "ipcd", { NULL }, 576, "tcp" }, - { "ipcd", { NULL }, 576, "udp" }, - { "vnas", { NULL }, 577, "tcp" }, - { "vnas", { NULL }, 577, "udp" }, - { "ipdd", { NULL }, 578, "tcp" }, - { "ipdd", { NULL }, 578, "udp" }, - { "decbsrv", { NULL }, 579, "tcp" }, - { "decbsrv", { NULL }, 579, "udp" }, - { "sntp-heartbeat", { NULL }, 580, "tcp" }, - { "sntp-heartbeat", { NULL }, 580, "udp" }, - { "bdp", { NULL }, 581, "tcp" }, - { "bdp", { NULL }, 581, "udp" }, - { "scc-security", { NULL }, 582, "tcp" }, - { "scc-security", { NULL }, 582, "udp" }, - { "philips-vc", { NULL }, 583, "tcp" }, - { "philips-vc", { NULL }, 583, "udp" }, - { "keyserver", { NULL }, 584, "tcp" }, - { "keyserver", { NULL }, 584, "udp" }, - { "password-chg", { NULL }, 586, "tcp" }, - { "password-chg", { NULL }, 586, "udp" }, - { "submission", { NULL }, 587, "tcp" }, - { "submission", { NULL }, 587, "udp" }, - { "cal", { NULL }, 588, "tcp" }, - { "cal", { NULL }, 588, "udp" }, - { "eyelink", { NULL }, 589, "tcp" }, - { "eyelink", { NULL }, 589, "udp" }, - { "tns-cml", { NULL }, 590, "tcp" }, - { "tns-cml", { NULL }, 590, "udp" }, - { "http-alt", { NULL }, 591, "tcp" }, - { "http-alt", { NULL }, 591, "udp" }, - { "eudora-set", { NULL }, 592, "tcp" }, - { "eudora-set", { NULL }, 592, "udp" }, - { "http-rpc-epmap", { NULL }, 593, "tcp" }, - { "http-rpc-epmap", { NULL }, 593, "udp" }, - { "tpip", { NULL }, 594, "tcp" }, - { "tpip", { NULL }, 594, "udp" }, - { "cab-protocol", { NULL }, 595, "tcp" }, - { "cab-protocol", { NULL }, 595, "udp" }, - { "smsd", { NULL }, 596, "tcp" }, - { "smsd", { NULL }, 596, "udp" }, - { "ptcnameservice", { NULL }, 597, "tcp" }, - { "ptcnameservice", { NULL }, 597, "udp" }, - { "sco-websrvrmg3", { NULL }, 598, "tcp" }, - { "sco-websrvrmg3", { NULL }, 598, "udp" }, - { "acp", { NULL }, 599, "tcp" }, - { "acp", { NULL }, 599, "udp" }, - { "ipcserver", { NULL }, 600, "tcp" }, - { "ipcserver", { NULL }, 600, "udp" }, - { "syslog-conn", { NULL }, 601, "tcp" }, - { "syslog-conn", { NULL }, 601, "udp" }, - { "xmlrpc-beep", { NULL }, 602, "tcp" }, - { "xmlrpc-beep", { NULL }, 602, "udp" }, - { "idxp", { NULL }, 603, "tcp" }, - { "idxp", { NULL }, 603, "udp" }, - { "tunnel", { NULL }, 604, "tcp" }, - { "tunnel", { NULL }, 604, "udp" }, - { "soap-beep", { NULL }, 605, "tcp" }, - { "soap-beep", { NULL }, 605, "udp" }, - { "urm", { NULL }, 606, "tcp" }, - { "urm", { NULL }, 606, "udp" }, - { "nqs", { NULL }, 607, "tcp" }, - { "nqs", { NULL }, 607, "udp" }, - { "sift-uft", { NULL }, 608, "tcp" }, - { "sift-uft", { NULL }, 608, "udp" }, - { "npmp-trap", { NULL }, 609, "tcp" }, - { "npmp-trap", { NULL }, 609, "udp" }, - { "npmp-local", { NULL }, 610, "tcp" }, - { "npmp-local", { NULL }, 610, "udp" }, - { "npmp-gui", { NULL }, 611, "tcp" }, - { "npmp-gui", { NULL }, 611, "udp" }, - { "hmmp-ind", { NULL }, 612, "tcp" }, - { "hmmp-ind", { NULL }, 612, "udp" }, - { "hmmp-op", { NULL }, 613, "tcp" }, - { "hmmp-op", { NULL }, 613, "udp" }, - { "sshell", { NULL }, 614, "tcp" }, - { "sshell", { NULL }, 614, "udp" }, - { "sco-inetmgr", { NULL }, 615, "tcp" }, - { "sco-inetmgr", { NULL }, 615, "udp" }, - { "sco-sysmgr", { NULL }, 616, "tcp" }, - { "sco-sysmgr", { NULL }, 616, "udp" }, - { "sco-dtmgr", { NULL }, 617, "tcp" }, - { "sco-dtmgr", { NULL }, 617, "udp" }, - { "dei-icda", { NULL }, 618, "tcp" }, - { "dei-icda", { NULL }, 618, "udp" }, - { "compaq-evm", { NULL }, 619, "tcp" }, - { "compaq-evm", { NULL }, 619, "udp" }, - { "sco-websrvrmgr", { NULL }, 620, "tcp" }, - { "sco-websrvrmgr", { NULL }, 620, "udp" }, - { "escp-ip", { NULL }, 621, "tcp" }, - { "escp-ip", { NULL }, 621, "udp" }, - { "collaborator", { NULL }, 622, "tcp" }, - { "collaborator", { NULL }, 622, "udp" }, - { "oob-ws-http", { NULL }, 623, "tcp" }, - { "asf-rmcp", { NULL }, 623, "udp" }, - { "cryptoadmin", { NULL }, 624, "tcp" }, - { "cryptoadmin", { NULL }, 624, "udp" }, - { "dec_dlm", { NULL }, 625, "tcp" }, - { "dec_dlm", { NULL }, 625, "udp" }, - { "asia", { NULL }, 626, "tcp" }, - { "asia", { NULL }, 626, "udp" }, - { "passgo-tivoli", { NULL }, 627, "tcp" }, - { "passgo-tivoli", { NULL }, 627, "udp" }, - { "qmqp", { NULL }, 628, "tcp" }, - { "qmqp", { NULL }, 628, "udp" }, - { "3com-amp3", { NULL }, 629, "tcp" }, - { "3com-amp3", { NULL }, 629, "udp" }, - { "rda", { NULL }, 630, "tcp" }, - { "rda", { NULL }, 630, "udp" }, - { "ipp", { NULL }, 631, "tcp" }, - { "ipp", { NULL }, 631, "udp" }, - { "bmpp", { NULL }, 632, "tcp" }, - { "bmpp", { NULL }, 632, "udp" }, - { "servstat", { NULL }, 633, "tcp" }, - { "servstat", { NULL }, 633, "udp" }, - { "ginad", { NULL }, 634, "tcp" }, - { "ginad", { NULL }, 634, "udp" }, - { "rlzdbase", { NULL }, 635, "tcp" }, - { "rlzdbase", { NULL }, 635, "udp" }, - { "ldaps", { NULL }, 636, "tcp" }, - { "ldaps", { NULL }, 636, "udp" }, - { "lanserver", { NULL }, 637, "tcp" }, - { "lanserver", { NULL }, 637, "udp" }, - { "mcns-sec", { NULL }, 638, "tcp" }, - { "mcns-sec", { NULL }, 638, "udp" }, - { "msdp", { NULL }, 639, "tcp" }, - { "msdp", { NULL }, 639, "udp" }, - { "entrust-sps", { NULL }, 640, "tcp" }, - { "entrust-sps", { NULL }, 640, "udp" }, - { "repcmd", { NULL }, 641, "tcp" }, - { "repcmd", { NULL }, 641, "udp" }, - { "esro-emsdp", { NULL }, 642, "tcp" }, - { "esro-emsdp", { NULL }, 642, "udp" }, - { "sanity", { NULL }, 643, "tcp" }, - { "sanity", { NULL }, 643, "udp" }, - { "dwr", { NULL }, 644, "tcp" }, - { "dwr", { NULL }, 644, "udp" }, - { "pssc", { NULL }, 645, "tcp" }, - { "pssc", { NULL }, 645, "udp" }, - { "ldp", { NULL }, 646, "tcp" }, - { "ldp", { NULL }, 646, "udp" }, - { "dhcp-failover", { NULL }, 647, "tcp" }, - { "dhcp-failover", { NULL }, 647, "udp" }, - { "rrp", { NULL }, 648, "tcp" }, - { "rrp", { NULL }, 648, "udp" }, - { "cadview-3d", { NULL }, 649, "tcp" }, - { "cadview-3d", { NULL }, 649, "udp" }, - { "obex", { NULL }, 650, "tcp" }, - { "obex", { NULL }, 650, "udp" }, - { "ieee-mms", { NULL }, 651, "tcp" }, - { "ieee-mms", { NULL }, 651, "udp" }, - { "hello-port", { NULL }, 652, "tcp" }, - { "hello-port", { NULL }, 652, "udp" }, - { "repscmd", { NULL }, 653, "tcp" }, - { "repscmd", { NULL }, 653, "udp" }, - { "aodv", { NULL }, 654, "tcp" }, - { "aodv", { NULL }, 654, "udp" }, - { "tinc", { NULL }, 655, "tcp" }, - { "tinc", { NULL }, 655, "udp" }, - { "spmp", { NULL }, 656, "tcp" }, - { "spmp", { NULL }, 656, "udp" }, - { "rmc", { NULL }, 657, "tcp" }, - { "rmc", { NULL }, 657, "udp" }, - { "tenfold", { NULL }, 658, "tcp" }, - { "tenfold", { NULL }, 658, "udp" }, - { "mac-srvr-admin", { NULL }, 660, "tcp" }, - { "mac-srvr-admin", { NULL }, 660, "udp" }, - { "hap", { NULL }, 661, "tcp" }, - { "hap", { NULL }, 661, "udp" }, - { "pftp", { NULL }, 662, "tcp" }, - { "pftp", { NULL }, 662, "udp" }, - { "purenoise", { NULL }, 663, "tcp" }, - { "purenoise", { NULL }, 663, "udp" }, - { "oob-ws-https", { NULL }, 664, "tcp" }, - { "asf-secure-rmcp", { NULL }, 664, "udp" }, - { "sun-dr", { NULL }, 665, "tcp" }, - { "sun-dr", { NULL }, 665, "udp" }, - { "mdqs", { NULL }, 666, "tcp" }, - { "mdqs", { NULL }, 666, "udp" }, - { "doom", { NULL }, 666, "tcp" }, - { "doom", { NULL }, 666, "udp" }, - { "disclose", { NULL }, 667, "tcp" }, - { "disclose", { NULL }, 667, "udp" }, - { "mecomm", { NULL }, 668, "tcp" }, - { "mecomm", { NULL }, 668, "udp" }, - { "meregister", { NULL }, 669, "tcp" }, - { "meregister", { NULL }, 669, "udp" }, - { "vacdsm-sws", { NULL }, 670, "tcp" }, - { "vacdsm-sws", { NULL }, 670, "udp" }, - { "vacdsm-app", { NULL }, 671, "tcp" }, - { "vacdsm-app", { NULL }, 671, "udp" }, - { "vpps-qua", { NULL }, 672, "tcp" }, - { "vpps-qua", { NULL }, 672, "udp" }, - { "cimplex", { NULL }, 673, "tcp" }, - { "cimplex", { NULL }, 673, "udp" }, - { "acap", { NULL }, 674, "tcp" }, - { "acap", { NULL }, 674, "udp" }, - { "dctp", { NULL }, 675, "tcp" }, - { "dctp", { NULL }, 675, "udp" }, - { "vpps-via", { NULL }, 676, "tcp" }, - { "vpps-via", { NULL }, 676, "udp" }, - { "vpp", { NULL }, 677, "tcp" }, - { "vpp", { NULL }, 677, "udp" }, - { "ggf-ncp", { NULL }, 678, "tcp" }, - { "ggf-ncp", { NULL }, 678, "udp" }, - { "mrm", { NULL }, 679, "tcp" }, - { "mrm", { NULL }, 679, "udp" }, - { "entrust-aaas", { NULL }, 680, "tcp" }, - { "entrust-aaas", { NULL }, 680, "udp" }, - { "entrust-aams", { NULL }, 681, "tcp" }, - { "entrust-aams", { NULL }, 681, "udp" }, - { "xfr", { NULL }, 682, "tcp" }, - { "xfr", { NULL }, 682, "udp" }, - { "corba-iiop", { NULL }, 683, "tcp" }, - { "corba-iiop", { NULL }, 683, "udp" }, - { "corba-iiop-ssl", { NULL }, 684, "tcp" }, - { "corba-iiop-ssl", { NULL }, 684, "udp" }, - { "mdc-portmapper", { NULL }, 685, "tcp" }, - { "mdc-portmapper", { NULL }, 685, "udp" }, - { "hcp-wismar", { NULL }, 686, "tcp" }, - { "hcp-wismar", { NULL }, 686, "udp" }, - { "asipregistry", { NULL }, 687, "tcp" }, - { "asipregistry", { NULL }, 687, "udp" }, - { "realm-rusd", { NULL }, 688, "tcp" }, - { "realm-rusd", { NULL }, 688, "udp" }, - { "nmap", { NULL }, 689, "tcp" }, - { "nmap", { NULL }, 689, "udp" }, - { "vatp", { NULL }, 690, "tcp" }, - { "vatp", { NULL }, 690, "udp" }, - { "msexch-routing", { NULL }, 691, "tcp" }, - { "msexch-routing", { NULL }, 691, "udp" }, - { "hyperwave-isp", { NULL }, 692, "tcp" }, - { "hyperwave-isp", { NULL }, 692, "udp" }, - { "connendp", { NULL }, 693, "tcp" }, - { "connendp", { NULL }, 693, "udp" }, - { "ha-cluster", { NULL }, 694, "tcp" }, - { "ha-cluster", { NULL }, 694, "udp" }, - { "ieee-mms-ssl", { NULL }, 695, "tcp" }, - { "ieee-mms-ssl", { NULL }, 695, "udp" }, - { "rushd", { NULL }, 696, "tcp" }, - { "rushd", { NULL }, 696, "udp" }, - { "uuidgen", { NULL }, 697, "tcp" }, - { "uuidgen", { NULL }, 697, "udp" }, - { "olsr", { NULL }, 698, "tcp" }, - { "olsr", { NULL }, 698, "udp" }, - { "accessnetwork", { NULL }, 699, "tcp" }, - { "accessnetwork", { NULL }, 699, "udp" }, - { "epp", { NULL }, 700, "tcp" }, - { "epp", { NULL }, 700, "udp" }, - { "lmp", { NULL }, 701, "tcp" }, - { "lmp", { NULL }, 701, "udp" }, - { "iris-beep", { NULL }, 702, "tcp" }, - { "iris-beep", { NULL }, 702, "udp" }, - { "elcsd", { NULL }, 704, "tcp" }, - { "elcsd", { NULL }, 704, "udp" }, - { "agentx", { NULL }, 705, "tcp" }, - { "agentx", { NULL }, 705, "udp" }, - { "silc", { NULL }, 706, "tcp" }, - { "silc", { NULL }, 706, "udp" }, - { "borland-dsj", { NULL }, 707, "tcp" }, - { "borland-dsj", { NULL }, 707, "udp" }, - { "entrust-kmsh", { NULL }, 709, "tcp" }, - { "entrust-kmsh", { NULL }, 709, "udp" }, - { "entrust-ash", { NULL }, 710, "tcp" }, - { "entrust-ash", { NULL }, 710, "udp" }, - { "cisco-tdp", { NULL }, 711, "tcp" }, - { "cisco-tdp", { NULL }, 711, "udp" }, - { "tbrpf", { NULL }, 712, "tcp" }, - { "tbrpf", { NULL }, 712, "udp" }, - { "iris-xpc", { NULL }, 713, "tcp" }, - { "iris-xpc", { NULL }, 713, "udp" }, - { "iris-xpcs", { NULL }, 714, "tcp" }, - { "iris-xpcs", { NULL }, 714, "udp" }, - { "iris-lwz", { NULL }, 715, "tcp" }, - { "iris-lwz", { NULL }, 715, "udp" }, - { "pana", { NULL }, 716, "udp" }, - { "netviewdm1", { NULL }, 729, "tcp" }, - { "netviewdm1", { NULL }, 729, "udp" }, - { "netviewdm2", { NULL }, 730, "tcp" }, - { "netviewdm2", { NULL }, 730, "udp" }, - { "netviewdm3", { NULL }, 731, "tcp" }, - { "netviewdm3", { NULL }, 731, "udp" }, - { "netgw", { NULL }, 741, "tcp" }, - { "netgw", { NULL }, 741, "udp" }, - { "netrcs", { NULL }, 742, "tcp" }, - { "netrcs", { NULL }, 742, "udp" }, - { "flexlm", { NULL }, 744, "tcp" }, - { "flexlm", { NULL }, 744, "udp" }, - { "fujitsu-dev", { NULL }, 747, "tcp" }, - { "fujitsu-dev", { NULL }, 747, "udp" }, - { "ris-cm", { NULL }, 748, "tcp" }, - { "ris-cm", { NULL }, 748, "udp" }, - { "kerberos-adm", { NULL }, 749, "tcp" }, - { "kerberos-adm", { NULL }, 749, "udp" }, - { "rfile", { NULL }, 750, "tcp" }, - { "loadav", { NULL }, 750, "udp" }, - { "kerberos-iv", { NULL }, 750, "udp" }, - { "pump", { NULL }, 751, "tcp" }, - { "pump", { NULL }, 751, "udp" }, - { "qrh", { NULL }, 752, "tcp" }, - { "qrh", { NULL }, 752, "udp" }, - { "rrh", { NULL }, 753, "tcp" }, - { "rrh", { NULL }, 753, "udp" }, - { "tell", { NULL }, 754, "tcp" }, - { "tell", { NULL }, 754, "udp" }, - { "nlogin", { NULL }, 758, "tcp" }, - { "nlogin", { NULL }, 758, "udp" }, - { "con", { NULL }, 759, "tcp" }, - { "con", { NULL }, 759, "udp" }, - { "ns", { NULL }, 760, "tcp" }, - { "ns", { NULL }, 760, "udp" }, - { "rxe", { NULL }, 761, "tcp" }, - { "rxe", { NULL }, 761, "udp" }, - { "quotad", { NULL }, 762, "tcp" }, - { "quotad", { NULL }, 762, "udp" }, - { "cycleserv", { NULL }, 763, "tcp" }, - { "cycleserv", { NULL }, 763, "udp" }, - { "omserv", { NULL }, 764, "tcp" }, - { "omserv", { NULL }, 764, "udp" }, - { "webster", { NULL }, 765, "tcp" }, - { "webster", { NULL }, 765, "udp" }, - { "phonebook", { NULL }, 767, "tcp" }, - { "phonebook", { NULL }, 767, "udp" }, - { "vid", { NULL }, 769, "tcp" }, - { "vid", { NULL }, 769, "udp" }, - { "cadlock", { NULL }, 770, "tcp" }, - { "cadlock", { NULL }, 770, "udp" }, - { "rtip", { NULL }, 771, "tcp" }, - { "rtip", { NULL }, 771, "udp" }, - { "cycleserv2", { NULL }, 772, "tcp" }, - { "cycleserv2", { NULL }, 772, "udp" }, - { "submit", { NULL }, 773, "tcp" }, - { "notify", { NULL }, 773, "udp" }, - { "rpasswd", { NULL }, 774, "tcp" }, - { "acmaint_dbd", { NULL }, 774, "udp" }, - { "entomb", { NULL }, 775, "tcp" }, - { "acmaint_transd", { NULL }, 775, "udp" }, - { "wpages", { NULL }, 776, "tcp" }, - { "wpages", { NULL }, 776, "udp" }, - { "multiling-http", { NULL }, 777, "tcp" }, - { "multiling-http", { NULL }, 777, "udp" }, - { "wpgs", { NULL }, 780, "tcp" }, - { "wpgs", { NULL }, 780, "udp" }, - { "mdbs_daemon", { NULL }, 800, "tcp" }, - { "mdbs_daemon", { NULL }, 800, "udp" }, - { "device", { NULL }, 801, "tcp" }, - { "device", { NULL }, 801, "udp" }, - { "fcp-udp", { NULL }, 810, "tcp" }, - { "fcp-udp", { NULL }, 810, "udp" }, - { "itm-mcell-s", { NULL }, 828, "tcp" }, - { "itm-mcell-s", { NULL }, 828, "udp" }, - { "pkix-3-ca-ra", { NULL }, 829, "tcp" }, - { "pkix-3-ca-ra", { NULL }, 829, "udp" }, - { "netconf-ssh", { NULL }, 830, "tcp" }, - { "netconf-ssh", { NULL }, 830, "udp" }, - { "netconf-beep", { NULL }, 831, "tcp" }, - { "netconf-beep", { NULL }, 831, "udp" }, - { "netconfsoaphttp", { NULL }, 832, "tcp" }, - { "netconfsoaphttp", { NULL }, 832, "udp" }, - { "netconfsoapbeep", { NULL }, 833, "tcp" }, - { "netconfsoapbeep", { NULL }, 833, "udp" }, - { "dhcp-failover2", { NULL }, 847, "tcp" }, - { "dhcp-failover2", { NULL }, 847, "udp" }, - { "gdoi", { NULL }, 848, "tcp" }, - { "gdoi", { NULL }, 848, "udp" }, - { "iscsi", { NULL }, 860, "tcp" }, - { "iscsi", { NULL }, 860, "udp" }, - { "owamp-control", { NULL }, 861, "tcp" }, - { "owamp-control", { NULL }, 861, "udp" }, - { "twamp-control", { NULL }, 862, "tcp" }, - { "twamp-control", { NULL }, 862, "udp" }, - { "rsync", { NULL }, 873, "tcp" }, - { "rsync", { NULL }, 873, "udp" }, - { "iclcnet-locate", { NULL }, 886, "tcp" }, - { "iclcnet-locate", { NULL }, 886, "udp" }, - { "iclcnet_svinfo", { NULL }, 887, "tcp" }, - { "iclcnet_svinfo", { NULL }, 887, "udp" }, - { "accessbuilder", { NULL }, 888, "tcp" }, - { "accessbuilder", { NULL }, 888, "udp" }, - { "cddbp", { NULL }, 888, "tcp" }, - { "omginitialrefs", { NULL }, 900, "tcp" }, - { "omginitialrefs", { NULL }, 900, "udp" }, - { "smpnameres", { NULL }, 901, "tcp" }, - { "smpnameres", { NULL }, 901, "udp" }, - { "ideafarm-door", { NULL }, 902, "tcp" }, - { "ideafarm-door", { NULL }, 902, "udp" }, - { "ideafarm-panic", { NULL }, 903, "tcp" }, - { "ideafarm-panic", { NULL }, 903, "udp" }, - { "kink", { NULL }, 910, "tcp" }, - { "kink", { NULL }, 910, "udp" }, - { "xact-backup", { NULL }, 911, "tcp" }, - { "xact-backup", { NULL }, 911, "udp" }, - { "apex-mesh", { NULL }, 912, "tcp" }, - { "apex-mesh", { NULL }, 912, "udp" }, - { "apex-edge", { NULL }, 913, "tcp" }, - { "apex-edge", { NULL }, 913, "udp" }, - { "ftps-data", { NULL }, 989, "tcp" }, - { "ftps-data", { NULL }, 989, "udp" }, - { "ftps", { NULL }, 990, "tcp" }, - { "ftps", { NULL }, 990, "udp" }, - { "nas", { NULL }, 991, "tcp" }, - { "nas", { NULL }, 991, "udp" }, - { "telnets", { NULL }, 992, "tcp" }, - { "telnets", { NULL }, 992, "udp" }, - { "imaps", { NULL }, 993, "tcp" }, - { "imaps", { NULL }, 993, "udp" }, - { "ircs", { NULL }, 994, "tcp" }, - { "ircs", { NULL }, 994, "udp" }, - { "pop3s", { NULL }, 995, "tcp" }, - { "pop3s", { NULL }, 995, "udp" }, - { "vsinet", { NULL }, 996, "tcp" }, - { "vsinet", { NULL }, 996, "udp" }, - { "maitrd", { NULL }, 997, "tcp" }, - { "maitrd", { NULL }, 997, "udp" }, - { "busboy", { NULL }, 998, "tcp" }, - { "puparp", { NULL }, 998, "udp" }, - { "garcon", { NULL }, 999, "tcp" }, - { "applix", { NULL }, 999, "udp" }, - { "puprouter", { NULL }, 999, "tcp" }, - { "puprouter", { NULL }, 999, "udp" }, - { "cadlock2", { NULL }, 1000, "tcp" }, - { "cadlock2", { NULL }, 1000, "udp" }, - { "surf", { NULL }, 1010, "tcp" }, - { "surf", { NULL }, 1010, "udp" }, - { "exp1", { NULL }, 1021, "tcp" }, - { "exp1", { NULL }, 1021, "udp" }, - { "exp2", { NULL }, 1022, "tcp" }, - { "exp2", { NULL }, 1022, "udp" }, -# endif /* USE_IANA_WELL_KNOWN_PORTS */ -# ifdef USE_IANA_REGISTERED_PORTS - { "blackjack", { NULL }, 1025, "tcp" }, - { "blackjack", { NULL }, 1025, "udp" }, - { "cap", { NULL }, 1026, "tcp" }, - { "cap", { NULL }, 1026, "udp" }, - { "solid-mux", { NULL }, 1029, "tcp" }, - { "solid-mux", { NULL }, 1029, "udp" }, - { "iad1", { NULL }, 1030, "tcp" }, - { "iad1", { NULL }, 1030, "udp" }, - { "iad2", { NULL }, 1031, "tcp" }, - { "iad2", { NULL }, 1031, "udp" }, - { "iad3", { NULL }, 1032, "tcp" }, - { "iad3", { NULL }, 1032, "udp" }, - { "netinfo-local", { NULL }, 1033, "tcp" }, - { "netinfo-local", { NULL }, 1033, "udp" }, - { "activesync", { NULL }, 1034, "tcp" }, - { "activesync", { NULL }, 1034, "udp" }, - { "mxxrlogin", { NULL }, 1035, "tcp" }, - { "mxxrlogin", { NULL }, 1035, "udp" }, - { "nsstp", { NULL }, 1036, "tcp" }, - { "nsstp", { NULL }, 1036, "udp" }, - { "ams", { NULL }, 1037, "tcp" }, - { "ams", { NULL }, 1037, "udp" }, - { "mtqp", { NULL }, 1038, "tcp" }, - { "mtqp", { NULL }, 1038, "udp" }, - { "sbl", { NULL }, 1039, "tcp" }, - { "sbl", { NULL }, 1039, "udp" }, - { "netarx", { NULL }, 1040, "tcp" }, - { "netarx", { NULL }, 1040, "udp" }, - { "danf-ak2", { NULL }, 1041, "tcp" }, - { "danf-ak2", { NULL }, 1041, "udp" }, - { "afrog", { NULL }, 1042, "tcp" }, - { "afrog", { NULL }, 1042, "udp" }, - { "boinc-client", { NULL }, 1043, "tcp" }, - { "boinc-client", { NULL }, 1043, "udp" }, - { "dcutility", { NULL }, 1044, "tcp" }, - { "dcutility", { NULL }, 1044, "udp" }, - { "fpitp", { NULL }, 1045, "tcp" }, - { "fpitp", { NULL }, 1045, "udp" }, - { "wfremotertm", { NULL }, 1046, "tcp" }, - { "wfremotertm", { NULL }, 1046, "udp" }, - { "neod1", { NULL }, 1047, "tcp" }, - { "neod1", { NULL }, 1047, "udp" }, - { "neod2", { NULL }, 1048, "tcp" }, - { "neod2", { NULL }, 1048, "udp" }, - { "td-postman", { NULL }, 1049, "tcp" }, - { "td-postman", { NULL }, 1049, "udp" }, - { "cma", { NULL }, 1050, "tcp" }, - { "cma", { NULL }, 1050, "udp" }, - { "optima-vnet", { NULL }, 1051, "tcp" }, - { "optima-vnet", { NULL }, 1051, "udp" }, - { "ddt", { NULL }, 1052, "tcp" }, - { "ddt", { NULL }, 1052, "udp" }, - { "remote-as", { NULL }, 1053, "tcp" }, - { "remote-as", { NULL }, 1053, "udp" }, - { "brvread", { NULL }, 1054, "tcp" }, - { "brvread", { NULL }, 1054, "udp" }, - { "ansyslmd", { NULL }, 1055, "tcp" }, - { "ansyslmd", { NULL }, 1055, "udp" }, - { "vfo", { NULL }, 1056, "tcp" }, - { "vfo", { NULL }, 1056, "udp" }, - { "startron", { NULL }, 1057, "tcp" }, - { "startron", { NULL }, 1057, "udp" }, - { "nim", { NULL }, 1058, "tcp" }, - { "nim", { NULL }, 1058, "udp" }, - { "nimreg", { NULL }, 1059, "tcp" }, - { "nimreg", { NULL }, 1059, "udp" }, - { "polestar", { NULL }, 1060, "tcp" }, - { "polestar", { NULL }, 1060, "udp" }, - { "kiosk", { NULL }, 1061, "tcp" }, - { "kiosk", { NULL }, 1061, "udp" }, - { "veracity", { NULL }, 1062, "tcp" }, - { "veracity", { NULL }, 1062, "udp" }, - { "kyoceranetdev", { NULL }, 1063, "tcp" }, - { "kyoceranetdev", { NULL }, 1063, "udp" }, - { "jstel", { NULL }, 1064, "tcp" }, - { "jstel", { NULL }, 1064, "udp" }, - { "syscomlan", { NULL }, 1065, "tcp" }, - { "syscomlan", { NULL }, 1065, "udp" }, - { "fpo-fns", { NULL }, 1066, "tcp" }, - { "fpo-fns", { NULL }, 1066, "udp" }, - { "instl_boots", { NULL }, 1067, "tcp" }, - { "instl_boots", { NULL }, 1067, "udp" }, - { "instl_bootc", { NULL }, 1068, "tcp" }, - { "instl_bootc", { NULL }, 1068, "udp" }, - { "cognex-insight", { NULL }, 1069, "tcp" }, - { "cognex-insight", { NULL }, 1069, "udp" }, - { "gmrupdateserv", { NULL }, 1070, "tcp" }, - { "gmrupdateserv", { NULL }, 1070, "udp" }, - { "bsquare-voip", { NULL }, 1071, "tcp" }, - { "bsquare-voip", { NULL }, 1071, "udp" }, - { "cardax", { NULL }, 1072, "tcp" }, - { "cardax", { NULL }, 1072, "udp" }, - { "bridgecontrol", { NULL }, 1073, "tcp" }, - { "bridgecontrol", { NULL }, 1073, "udp" }, - { "warmspotMgmt", { NULL }, 1074, "tcp" }, - { "warmspotMgmt", { NULL }, 1074, "udp" }, - { "rdrmshc", { NULL }, 1075, "tcp" }, - { "rdrmshc", { NULL }, 1075, "udp" }, - { "dab-sti-c", { NULL }, 1076, "tcp" }, - { "dab-sti-c", { NULL }, 1076, "udp" }, - { "imgames", { NULL }, 1077, "tcp" }, - { "imgames", { NULL }, 1077, "udp" }, - { "avocent-proxy", { NULL }, 1078, "tcp" }, - { "avocent-proxy", { NULL }, 1078, "udp" }, - { "asprovatalk", { NULL }, 1079, "tcp" }, - { "asprovatalk", { NULL }, 1079, "udp" }, - { "socks", { NULL }, 1080, "tcp" }, - { "socks", { NULL }, 1080, "udp" }, - { "pvuniwien", { NULL }, 1081, "tcp" }, - { "pvuniwien", { NULL }, 1081, "udp" }, - { "amt-esd-prot", { NULL }, 1082, "tcp" }, - { "amt-esd-prot", { NULL }, 1082, "udp" }, - { "ansoft-lm-1", { NULL }, 1083, "tcp" }, - { "ansoft-lm-1", { NULL }, 1083, "udp" }, - { "ansoft-lm-2", { NULL }, 1084, "tcp" }, - { "ansoft-lm-2", { NULL }, 1084, "udp" }, - { "webobjects", { NULL }, 1085, "tcp" }, - { "webobjects", { NULL }, 1085, "udp" }, - { "cplscrambler-lg", { NULL }, 1086, "tcp" }, - { "cplscrambler-lg", { NULL }, 1086, "udp" }, - { "cplscrambler-in", { NULL }, 1087, "tcp" }, - { "cplscrambler-in", { NULL }, 1087, "udp" }, - { "cplscrambler-al", { NULL }, 1088, "tcp" }, - { "cplscrambler-al", { NULL }, 1088, "udp" }, - { "ff-annunc", { NULL }, 1089, "tcp" }, - { "ff-annunc", { NULL }, 1089, "udp" }, - { "ff-fms", { NULL }, 1090, "tcp" }, - { "ff-fms", { NULL }, 1090, "udp" }, - { "ff-sm", { NULL }, 1091, "tcp" }, - { "ff-sm", { NULL }, 1091, "udp" }, - { "obrpd", { NULL }, 1092, "tcp" }, - { "obrpd", { NULL }, 1092, "udp" }, - { "proofd", { NULL }, 1093, "tcp" }, - { "proofd", { NULL }, 1093, "udp" }, - { "rootd", { NULL }, 1094, "tcp" }, - { "rootd", { NULL }, 1094, "udp" }, - { "nicelink", { NULL }, 1095, "tcp" }, - { "nicelink", { NULL }, 1095, "udp" }, - { "cnrprotocol", { NULL }, 1096, "tcp" }, - { "cnrprotocol", { NULL }, 1096, "udp" }, - { "sunclustermgr", { NULL }, 1097, "tcp" }, - { "sunclustermgr", { NULL }, 1097, "udp" }, - { "rmiactivation", { NULL }, 1098, "tcp" }, - { "rmiactivation", { NULL }, 1098, "udp" }, - { "rmiregistry", { NULL }, 1099, "tcp" }, - { "rmiregistry", { NULL }, 1099, "udp" }, - { "mctp", { NULL }, 1100, "tcp" }, - { "mctp", { NULL }, 1100, "udp" }, - { "pt2-discover", { NULL }, 1101, "tcp" }, - { "pt2-discover", { NULL }, 1101, "udp" }, - { "adobeserver-1", { NULL }, 1102, "tcp" }, - { "adobeserver-1", { NULL }, 1102, "udp" }, - { "adobeserver-2", { NULL }, 1103, "tcp" }, - { "adobeserver-2", { NULL }, 1103, "udp" }, - { "xrl", { NULL }, 1104, "tcp" }, - { "xrl", { NULL }, 1104, "udp" }, - { "ftranhc", { NULL }, 1105, "tcp" }, - { "ftranhc", { NULL }, 1105, "udp" }, - { "isoipsigport-1", { NULL }, 1106, "tcp" }, - { "isoipsigport-1", { NULL }, 1106, "udp" }, - { "isoipsigport-2", { NULL }, 1107, "tcp" }, - { "isoipsigport-2", { NULL }, 1107, "udp" }, - { "ratio-adp", { NULL }, 1108, "tcp" }, - { "ratio-adp", { NULL }, 1108, "udp" }, - { "webadmstart", { NULL }, 1110, "tcp" }, - { "nfsd-keepalive", { NULL }, 1110, "udp" }, - { "lmsocialserver", { NULL }, 1111, "tcp" }, - { "lmsocialserver", { NULL }, 1111, "udp" }, - { "icp", { NULL }, 1112, "tcp" }, - { "icp", { NULL }, 1112, "udp" }, - { "ltp-deepspace", { NULL }, 1113, "tcp" }, - { "ltp-deepspace", { NULL }, 1113, "udp" }, - { "mini-sql", { NULL }, 1114, "tcp" }, - { "mini-sql", { NULL }, 1114, "udp" }, - { "ardus-trns", { NULL }, 1115, "tcp" }, - { "ardus-trns", { NULL }, 1115, "udp" }, - { "ardus-cntl", { NULL }, 1116, "tcp" }, - { "ardus-cntl", { NULL }, 1116, "udp" }, - { "ardus-mtrns", { NULL }, 1117, "tcp" }, - { "ardus-mtrns", { NULL }, 1117, "udp" }, - { "sacred", { NULL }, 1118, "tcp" }, - { "sacred", { NULL }, 1118, "udp" }, - { "bnetgame", { NULL }, 1119, "tcp" }, - { "bnetgame", { NULL }, 1119, "udp" }, - { "bnetfile", { NULL }, 1120, "tcp" }, - { "bnetfile", { NULL }, 1120, "udp" }, - { "rmpp", { NULL }, 1121, "tcp" }, - { "rmpp", { NULL }, 1121, "udp" }, - { "availant-mgr", { NULL }, 1122, "tcp" }, - { "availant-mgr", { NULL }, 1122, "udp" }, - { "murray", { NULL }, 1123, "tcp" }, - { "murray", { NULL }, 1123, "udp" }, - { "hpvmmcontrol", { NULL }, 1124, "tcp" }, - { "hpvmmcontrol", { NULL }, 1124, "udp" }, - { "hpvmmagent", { NULL }, 1125, "tcp" }, - { "hpvmmagent", { NULL }, 1125, "udp" }, - { "hpvmmdata", { NULL }, 1126, "tcp" }, - { "hpvmmdata", { NULL }, 1126, "udp" }, - { "kwdb-commn", { NULL }, 1127, "tcp" }, - { "kwdb-commn", { NULL }, 1127, "udp" }, - { "saphostctrl", { NULL }, 1128, "tcp" }, - { "saphostctrl", { NULL }, 1128, "udp" }, - { "saphostctrls", { NULL }, 1129, "tcp" }, - { "saphostctrls", { NULL }, 1129, "udp" }, - { "casp", { NULL }, 1130, "tcp" }, - { "casp", { NULL }, 1130, "udp" }, - { "caspssl", { NULL }, 1131, "tcp" }, - { "caspssl", { NULL }, 1131, "udp" }, - { "kvm-via-ip", { NULL }, 1132, "tcp" }, - { "kvm-via-ip", { NULL }, 1132, "udp" }, - { "dfn", { NULL }, 1133, "tcp" }, - { "dfn", { NULL }, 1133, "udp" }, - { "aplx", { NULL }, 1134, "tcp" }, - { "aplx", { NULL }, 1134, "udp" }, - { "omnivision", { NULL }, 1135, "tcp" }, - { "omnivision", { NULL }, 1135, "udp" }, - { "hhb-gateway", { NULL }, 1136, "tcp" }, - { "hhb-gateway", { NULL }, 1136, "udp" }, - { "trim", { NULL }, 1137, "tcp" }, - { "trim", { NULL }, 1137, "udp" }, - { "encrypted_admin", { NULL }, 1138, "tcp" }, - { "encrypted_admin", { NULL }, 1138, "udp" }, - { "evm", { NULL }, 1139, "tcp" }, - { "evm", { NULL }, 1139, "udp" }, - { "autonoc", { NULL }, 1140, "tcp" }, - { "autonoc", { NULL }, 1140, "udp" }, - { "mxomss", { NULL }, 1141, "tcp" }, - { "mxomss", { NULL }, 1141, "udp" }, - { "edtools", { NULL }, 1142, "tcp" }, - { "edtools", { NULL }, 1142, "udp" }, - { "imyx", { NULL }, 1143, "tcp" }, - { "imyx", { NULL }, 1143, "udp" }, - { "fuscript", { NULL }, 1144, "tcp" }, - { "fuscript", { NULL }, 1144, "udp" }, - { "x9-icue", { NULL }, 1145, "tcp" }, - { "x9-icue", { NULL }, 1145, "udp" }, - { "audit-transfer", { NULL }, 1146, "tcp" }, - { "audit-transfer", { NULL }, 1146, "udp" }, - { "capioverlan", { NULL }, 1147, "tcp" }, - { "capioverlan", { NULL }, 1147, "udp" }, - { "elfiq-repl", { NULL }, 1148, "tcp" }, - { "elfiq-repl", { NULL }, 1148, "udp" }, - { "bvtsonar", { NULL }, 1149, "tcp" }, - { "bvtsonar", { NULL }, 1149, "udp" }, - { "blaze", { NULL }, 1150, "tcp" }, - { "blaze", { NULL }, 1150, "udp" }, - { "unizensus", { NULL }, 1151, "tcp" }, - { "unizensus", { NULL }, 1151, "udp" }, - { "winpoplanmess", { NULL }, 1152, "tcp" }, - { "winpoplanmess", { NULL }, 1152, "udp" }, - { "c1222-acse", { NULL }, 1153, "tcp" }, - { "c1222-acse", { NULL }, 1153, "udp" }, - { "resacommunity", { NULL }, 1154, "tcp" }, - { "resacommunity", { NULL }, 1154, "udp" }, - { "nfa", { NULL }, 1155, "tcp" }, - { "nfa", { NULL }, 1155, "udp" }, - { "iascontrol-oms", { NULL }, 1156, "tcp" }, - { "iascontrol-oms", { NULL }, 1156, "udp" }, - { "iascontrol", { NULL }, 1157, "tcp" }, - { "iascontrol", { NULL }, 1157, "udp" }, - { "dbcontrol-oms", { NULL }, 1158, "tcp" }, - { "dbcontrol-oms", { NULL }, 1158, "udp" }, - { "oracle-oms", { NULL }, 1159, "tcp" }, - { "oracle-oms", { NULL }, 1159, "udp" }, - { "olsv", { NULL }, 1160, "tcp" }, - { "olsv", { NULL }, 1160, "udp" }, - { "health-polling", { NULL }, 1161, "tcp" }, - { "health-polling", { NULL }, 1161, "udp" }, - { "health-trap", { NULL }, 1162, "tcp" }, - { "health-trap", { NULL }, 1162, "udp" }, - { "sddp", { NULL }, 1163, "tcp" }, - { "sddp", { NULL }, 1163, "udp" }, - { "qsm-proxy", { NULL }, 1164, "tcp" }, - { "qsm-proxy", { NULL }, 1164, "udp" }, - { "qsm-gui", { NULL }, 1165, "tcp" }, - { "qsm-gui", { NULL }, 1165, "udp" }, - { "qsm-remote", { NULL }, 1166, "tcp" }, - { "qsm-remote", { NULL }, 1166, "udp" }, - { "cisco-ipsla", { NULL }, 1167, "tcp" }, - { "cisco-ipsla", { NULL }, 1167, "udp" }, - { "cisco-ipsla", { NULL }, 1167, "sctp" }, - { "vchat", { NULL }, 1168, "tcp" }, - { "vchat", { NULL }, 1168, "udp" }, - { "tripwire", { NULL }, 1169, "tcp" }, - { "tripwire", { NULL }, 1169, "udp" }, - { "atc-lm", { NULL }, 1170, "tcp" }, - { "atc-lm", { NULL }, 1170, "udp" }, - { "atc-appserver", { NULL }, 1171, "tcp" }, - { "atc-appserver", { NULL }, 1171, "udp" }, - { "dnap", { NULL }, 1172, "tcp" }, - { "dnap", { NULL }, 1172, "udp" }, - { "d-cinema-rrp", { NULL }, 1173, "tcp" }, - { "d-cinema-rrp", { NULL }, 1173, "udp" }, - { "fnet-remote-ui", { NULL }, 1174, "tcp" }, - { "fnet-remote-ui", { NULL }, 1174, "udp" }, - { "dossier", { NULL }, 1175, "tcp" }, - { "dossier", { NULL }, 1175, "udp" }, - { "indigo-server", { NULL }, 1176, "tcp" }, - { "indigo-server", { NULL }, 1176, "udp" }, - { "dkmessenger", { NULL }, 1177, "tcp" }, - { "dkmessenger", { NULL }, 1177, "udp" }, - { "sgi-storman", { NULL }, 1178, "tcp" }, - { "sgi-storman", { NULL }, 1178, "udp" }, - { "b2n", { NULL }, 1179, "tcp" }, - { "b2n", { NULL }, 1179, "udp" }, - { "mc-client", { NULL }, 1180, "tcp" }, - { "mc-client", { NULL }, 1180, "udp" }, - { "3comnetman", { NULL }, 1181, "tcp" }, - { "3comnetman", { NULL }, 1181, "udp" }, - { "accelenet", { NULL }, 1182, "tcp" }, - { "accelenet-data", { NULL }, 1182, "udp" }, - { "llsurfup-http", { NULL }, 1183, "tcp" }, - { "llsurfup-http", { NULL }, 1183, "udp" }, - { "llsurfup-https", { NULL }, 1184, "tcp" }, - { "llsurfup-https", { NULL }, 1184, "udp" }, - { "catchpole", { NULL }, 1185, "tcp" }, - { "catchpole", { NULL }, 1185, "udp" }, - { "mysql-cluster", { NULL }, 1186, "tcp" }, - { "mysql-cluster", { NULL }, 1186, "udp" }, - { "alias", { NULL }, 1187, "tcp" }, - { "alias", { NULL }, 1187, "udp" }, - { "hp-webadmin", { NULL }, 1188, "tcp" }, - { "hp-webadmin", { NULL }, 1188, "udp" }, - { "unet", { NULL }, 1189, "tcp" }, - { "unet", { NULL }, 1189, "udp" }, - { "commlinx-avl", { NULL }, 1190, "tcp" }, - { "commlinx-avl", { NULL }, 1190, "udp" }, - { "gpfs", { NULL }, 1191, "tcp" }, - { "gpfs", { NULL }, 1191, "udp" }, - { "caids-sensor", { NULL }, 1192, "tcp" }, - { "caids-sensor", { NULL }, 1192, "udp" }, - { "fiveacross", { NULL }, 1193, "tcp" }, - { "fiveacross", { NULL }, 1193, "udp" }, - { "openvpn", { NULL }, 1194, "tcp" }, - { "openvpn", { NULL }, 1194, "udp" }, - { "rsf-1", { NULL }, 1195, "tcp" }, - { "rsf-1", { NULL }, 1195, "udp" }, - { "netmagic", { NULL }, 1196, "tcp" }, - { "netmagic", { NULL }, 1196, "udp" }, - { "carrius-rshell", { NULL }, 1197, "tcp" }, - { "carrius-rshell", { NULL }, 1197, "udp" }, - { "cajo-discovery", { NULL }, 1198, "tcp" }, - { "cajo-discovery", { NULL }, 1198, "udp" }, - { "dmidi", { NULL }, 1199, "tcp" }, - { "dmidi", { NULL }, 1199, "udp" }, - { "scol", { NULL }, 1200, "tcp" }, - { "scol", { NULL }, 1200, "udp" }, - { "nucleus-sand", { NULL }, 1201, "tcp" }, - { "nucleus-sand", { NULL }, 1201, "udp" }, - { "caiccipc", { NULL }, 1202, "tcp" }, - { "caiccipc", { NULL }, 1202, "udp" }, - { "ssslic-mgr", { NULL }, 1203, "tcp" }, - { "ssslic-mgr", { NULL }, 1203, "udp" }, - { "ssslog-mgr", { NULL }, 1204, "tcp" }, - { "ssslog-mgr", { NULL }, 1204, "udp" }, - { "accord-mgc", { NULL }, 1205, "tcp" }, - { "accord-mgc", { NULL }, 1205, "udp" }, - { "anthony-data", { NULL }, 1206, "tcp" }, - { "anthony-data", { NULL }, 1206, "udp" }, - { "metasage", { NULL }, 1207, "tcp" }, - { "metasage", { NULL }, 1207, "udp" }, - { "seagull-ais", { NULL }, 1208, "tcp" }, - { "seagull-ais", { NULL }, 1208, "udp" }, - { "ipcd3", { NULL }, 1209, "tcp" }, - { "ipcd3", { NULL }, 1209, "udp" }, - { "eoss", { NULL }, 1210, "tcp" }, - { "eoss", { NULL }, 1210, "udp" }, - { "groove-dpp", { NULL }, 1211, "tcp" }, - { "groove-dpp", { NULL }, 1211, "udp" }, - { "lupa", { NULL }, 1212, "tcp" }, - { "lupa", { NULL }, 1212, "udp" }, - { "mpc-lifenet", { NULL }, 1213, "tcp" }, - { "mpc-lifenet", { NULL }, 1213, "udp" }, - { "kazaa", { NULL }, 1214, "tcp" }, - { "kazaa", { NULL }, 1214, "udp" }, - { "scanstat-1", { NULL }, 1215, "tcp" }, - { "scanstat-1", { NULL }, 1215, "udp" }, - { "etebac5", { NULL }, 1216, "tcp" }, - { "etebac5", { NULL }, 1216, "udp" }, - { "hpss-ndapi", { NULL }, 1217, "tcp" }, - { "hpss-ndapi", { NULL }, 1217, "udp" }, - { "aeroflight-ads", { NULL }, 1218, "tcp" }, - { "aeroflight-ads", { NULL }, 1218, "udp" }, - { "aeroflight-ret", { NULL }, 1219, "tcp" }, - { "aeroflight-ret", { NULL }, 1219, "udp" }, - { "qt-serveradmin", { NULL }, 1220, "tcp" }, - { "qt-serveradmin", { NULL }, 1220, "udp" }, - { "sweetware-apps", { NULL }, 1221, "tcp" }, - { "sweetware-apps", { NULL }, 1221, "udp" }, - { "nerv", { NULL }, 1222, "tcp" }, - { "nerv", { NULL }, 1222, "udp" }, - { "tgp", { NULL }, 1223, "tcp" }, - { "tgp", { NULL }, 1223, "udp" }, - { "vpnz", { NULL }, 1224, "tcp" }, - { "vpnz", { NULL }, 1224, "udp" }, - { "slinkysearch", { NULL }, 1225, "tcp" }, - { "slinkysearch", { NULL }, 1225, "udp" }, - { "stgxfws", { NULL }, 1226, "tcp" }, - { "stgxfws", { NULL }, 1226, "udp" }, - { "dns2go", { NULL }, 1227, "tcp" }, - { "dns2go", { NULL }, 1227, "udp" }, - { "florence", { NULL }, 1228, "tcp" }, - { "florence", { NULL }, 1228, "udp" }, - { "zented", { NULL }, 1229, "tcp" }, - { "zented", { NULL }, 1229, "udp" }, - { "periscope", { NULL }, 1230, "tcp" }, - { "periscope", { NULL }, 1230, "udp" }, - { "menandmice-lpm", { NULL }, 1231, "tcp" }, - { "menandmice-lpm", { NULL }, 1231, "udp" }, - { "univ-appserver", { NULL }, 1233, "tcp" }, - { "univ-appserver", { NULL }, 1233, "udp" }, - { "search-agent", { NULL }, 1234, "tcp" }, - { "search-agent", { NULL }, 1234, "udp" }, - { "mosaicsyssvc1", { NULL }, 1235, "tcp" }, - { "mosaicsyssvc1", { NULL }, 1235, "udp" }, - { "bvcontrol", { NULL }, 1236, "tcp" }, - { "bvcontrol", { NULL }, 1236, "udp" }, - { "tsdos390", { NULL }, 1237, "tcp" }, - { "tsdos390", { NULL }, 1237, "udp" }, - { "hacl-qs", { NULL }, 1238, "tcp" }, - { "hacl-qs", { NULL }, 1238, "udp" }, - { "nmsd", { NULL }, 1239, "tcp" }, - { "nmsd", { NULL }, 1239, "udp" }, - { "instantia", { NULL }, 1240, "tcp" }, - { "instantia", { NULL }, 1240, "udp" }, - { "nessus", { NULL }, 1241, "tcp" }, - { "nessus", { NULL }, 1241, "udp" }, - { "nmasoverip", { NULL }, 1242, "tcp" }, - { "nmasoverip", { NULL }, 1242, "udp" }, - { "serialgateway", { NULL }, 1243, "tcp" }, - { "serialgateway", { NULL }, 1243, "udp" }, - { "isbconference1", { NULL }, 1244, "tcp" }, - { "isbconference1", { NULL }, 1244, "udp" }, - { "isbconference2", { NULL }, 1245, "tcp" }, - { "isbconference2", { NULL }, 1245, "udp" }, - { "payrouter", { NULL }, 1246, "tcp" }, - { "payrouter", { NULL }, 1246, "udp" }, - { "visionpyramid", { NULL }, 1247, "tcp" }, - { "visionpyramid", { NULL }, 1247, "udp" }, - { "hermes", { NULL }, 1248, "tcp" }, - { "hermes", { NULL }, 1248, "udp" }, - { "mesavistaco", { NULL }, 1249, "tcp" }, - { "mesavistaco", { NULL }, 1249, "udp" }, - { "swldy-sias", { NULL }, 1250, "tcp" }, - { "swldy-sias", { NULL }, 1250, "udp" }, - { "servergraph", { NULL }, 1251, "tcp" }, - { "servergraph", { NULL }, 1251, "udp" }, - { "bspne-pcc", { NULL }, 1252, "tcp" }, - { "bspne-pcc", { NULL }, 1252, "udp" }, - { "q55-pcc", { NULL }, 1253, "tcp" }, - { "q55-pcc", { NULL }, 1253, "udp" }, - { "de-noc", { NULL }, 1254, "tcp" }, - { "de-noc", { NULL }, 1254, "udp" }, - { "de-cache-query", { NULL }, 1255, "tcp" }, - { "de-cache-query", { NULL }, 1255, "udp" }, - { "de-server", { NULL }, 1256, "tcp" }, - { "de-server", { NULL }, 1256, "udp" }, - { "shockwave2", { NULL }, 1257, "tcp" }, - { "shockwave2", { NULL }, 1257, "udp" }, - { "opennl", { NULL }, 1258, "tcp" }, - { "opennl", { NULL }, 1258, "udp" }, - { "opennl-voice", { NULL }, 1259, "tcp" }, - { "opennl-voice", { NULL }, 1259, "udp" }, - { "ibm-ssd", { NULL }, 1260, "tcp" }, - { "ibm-ssd", { NULL }, 1260, "udp" }, - { "mpshrsv", { NULL }, 1261, "tcp" }, - { "mpshrsv", { NULL }, 1261, "udp" }, - { "qnts-orb", { NULL }, 1262, "tcp" }, - { "qnts-orb", { NULL }, 1262, "udp" }, - { "dka", { NULL }, 1263, "tcp" }, - { "dka", { NULL }, 1263, "udp" }, - { "prat", { NULL }, 1264, "tcp" }, - { "prat", { NULL }, 1264, "udp" }, - { "dssiapi", { NULL }, 1265, "tcp" }, - { "dssiapi", { NULL }, 1265, "udp" }, - { "dellpwrappks", { NULL }, 1266, "tcp" }, - { "dellpwrappks", { NULL }, 1266, "udp" }, - { "epc", { NULL }, 1267, "tcp" }, - { "epc", { NULL }, 1267, "udp" }, - { "propel-msgsys", { NULL }, 1268, "tcp" }, - { "propel-msgsys", { NULL }, 1268, "udp" }, - { "watilapp", { NULL }, 1269, "tcp" }, - { "watilapp", { NULL }, 1269, "udp" }, - { "opsmgr", { NULL }, 1270, "tcp" }, - { "opsmgr", { NULL }, 1270, "udp" }, - { "excw", { NULL }, 1271, "tcp" }, - { "excw", { NULL }, 1271, "udp" }, - { "cspmlockmgr", { NULL }, 1272, "tcp" }, - { "cspmlockmgr", { NULL }, 1272, "udp" }, - { "emc-gateway", { NULL }, 1273, "tcp" }, - { "emc-gateway", { NULL }, 1273, "udp" }, - { "t1distproc", { NULL }, 1274, "tcp" }, - { "t1distproc", { NULL }, 1274, "udp" }, - { "ivcollector", { NULL }, 1275, "tcp" }, - { "ivcollector", { NULL }, 1275, "udp" }, - { "ivmanager", { NULL }, 1276, "tcp" }, - { "ivmanager", { NULL }, 1276, "udp" }, - { "miva-mqs", { NULL }, 1277, "tcp" }, - { "miva-mqs", { NULL }, 1277, "udp" }, - { "dellwebadmin-1", { NULL }, 1278, "tcp" }, - { "dellwebadmin-1", { NULL }, 1278, "udp" }, - { "dellwebadmin-2", { NULL }, 1279, "tcp" }, - { "dellwebadmin-2", { NULL }, 1279, "udp" }, - { "pictrography", { NULL }, 1280, "tcp" }, - { "pictrography", { NULL }, 1280, "udp" }, - { "healthd", { NULL }, 1281, "tcp" }, - { "healthd", { NULL }, 1281, "udp" }, - { "emperion", { NULL }, 1282, "tcp" }, - { "emperion", { NULL }, 1282, "udp" }, - { "productinfo", { NULL }, 1283, "tcp" }, - { "productinfo", { NULL }, 1283, "udp" }, - { "iee-qfx", { NULL }, 1284, "tcp" }, - { "iee-qfx", { NULL }, 1284, "udp" }, - { "neoiface", { NULL }, 1285, "tcp" }, - { "neoiface", { NULL }, 1285, "udp" }, - { "netuitive", { NULL }, 1286, "tcp" }, - { "netuitive", { NULL }, 1286, "udp" }, - { "routematch", { NULL }, 1287, "tcp" }, - { "routematch", { NULL }, 1287, "udp" }, - { "navbuddy", { NULL }, 1288, "tcp" }, - { "navbuddy", { NULL }, 1288, "udp" }, - { "jwalkserver", { NULL }, 1289, "tcp" }, - { "jwalkserver", { NULL }, 1289, "udp" }, - { "winjaserver", { NULL }, 1290, "tcp" }, - { "winjaserver", { NULL }, 1290, "udp" }, - { "seagulllms", { NULL }, 1291, "tcp" }, - { "seagulllms", { NULL }, 1291, "udp" }, - { "dsdn", { NULL }, 1292, "tcp" }, - { "dsdn", { NULL }, 1292, "udp" }, - { "pkt-krb-ipsec", { NULL }, 1293, "tcp" }, - { "pkt-krb-ipsec", { NULL }, 1293, "udp" }, - { "cmmdriver", { NULL }, 1294, "tcp" }, - { "cmmdriver", { NULL }, 1294, "udp" }, - { "ehtp", { NULL }, 1295, "tcp" }, - { "ehtp", { NULL }, 1295, "udp" }, - { "dproxy", { NULL }, 1296, "tcp" }, - { "dproxy", { NULL }, 1296, "udp" }, - { "sdproxy", { NULL }, 1297, "tcp" }, - { "sdproxy", { NULL }, 1297, "udp" }, - { "lpcp", { NULL }, 1298, "tcp" }, - { "lpcp", { NULL }, 1298, "udp" }, - { "hp-sci", { NULL }, 1299, "tcp" }, - { "hp-sci", { NULL }, 1299, "udp" }, - { "h323hostcallsc", { NULL }, 1300, "tcp" }, - { "h323hostcallsc", { NULL }, 1300, "udp" }, - { "ci3-software-1", { NULL }, 1301, "tcp" }, - { "ci3-software-1", { NULL }, 1301, "udp" }, - { "ci3-software-2", { NULL }, 1302, "tcp" }, - { "ci3-software-2", { NULL }, 1302, "udp" }, - { "sftsrv", { NULL }, 1303, "tcp" }, - { "sftsrv", { NULL }, 1303, "udp" }, - { "boomerang", { NULL }, 1304, "tcp" }, - { "boomerang", { NULL }, 1304, "udp" }, - { "pe-mike", { NULL }, 1305, "tcp" }, - { "pe-mike", { NULL }, 1305, "udp" }, - { "re-conn-proto", { NULL }, 1306, "tcp" }, - { "re-conn-proto", { NULL }, 1306, "udp" }, - { "pacmand", { NULL }, 1307, "tcp" }, - { "pacmand", { NULL }, 1307, "udp" }, - { "odsi", { NULL }, 1308, "tcp" }, - { "odsi", { NULL }, 1308, "udp" }, - { "jtag-server", { NULL }, 1309, "tcp" }, - { "jtag-server", { NULL }, 1309, "udp" }, - { "husky", { NULL }, 1310, "tcp" }, - { "husky", { NULL }, 1310, "udp" }, - { "rxmon", { NULL }, 1311, "tcp" }, - { "rxmon", { NULL }, 1311, "udp" }, - { "sti-envision", { NULL }, 1312, "tcp" }, - { "sti-envision", { NULL }, 1312, "udp" }, - { "bmc_patroldb", { NULL }, 1313, "tcp" }, - { "bmc_patroldb", { NULL }, 1313, "udp" }, - { "pdps", { NULL }, 1314, "tcp" }, - { "pdps", { NULL }, 1314, "udp" }, - { "els", { NULL }, 1315, "tcp" }, - { "els", { NULL }, 1315, "udp" }, - { "exbit-escp", { NULL }, 1316, "tcp" }, - { "exbit-escp", { NULL }, 1316, "udp" }, - { "vrts-ipcserver", { NULL }, 1317, "tcp" }, - { "vrts-ipcserver", { NULL }, 1317, "udp" }, - { "krb5gatekeeper", { NULL }, 1318, "tcp" }, - { "krb5gatekeeper", { NULL }, 1318, "udp" }, - { "amx-icsp", { NULL }, 1319, "tcp" }, - { "amx-icsp", { NULL }, 1319, "udp" }, - { "amx-axbnet", { NULL }, 1320, "tcp" }, - { "amx-axbnet", { NULL }, 1320, "udp" }, - { "pip", { NULL }, 1321, "tcp" }, - { "pip", { NULL }, 1321, "udp" }, - { "novation", { NULL }, 1322, "tcp" }, - { "novation", { NULL }, 1322, "udp" }, - { "brcd", { NULL }, 1323, "tcp" }, - { "brcd", { NULL }, 1323, "udp" }, - { "delta-mcp", { NULL }, 1324, "tcp" }, - { "delta-mcp", { NULL }, 1324, "udp" }, - { "dx-instrument", { NULL }, 1325, "tcp" }, - { "dx-instrument", { NULL }, 1325, "udp" }, - { "wimsic", { NULL }, 1326, "tcp" }, - { "wimsic", { NULL }, 1326, "udp" }, - { "ultrex", { NULL }, 1327, "tcp" }, - { "ultrex", { NULL }, 1327, "udp" }, - { "ewall", { NULL }, 1328, "tcp" }, - { "ewall", { NULL }, 1328, "udp" }, - { "netdb-export", { NULL }, 1329, "tcp" }, - { "netdb-export", { NULL }, 1329, "udp" }, - { "streetperfect", { NULL }, 1330, "tcp" }, - { "streetperfect", { NULL }, 1330, "udp" }, - { "intersan", { NULL }, 1331, "tcp" }, - { "intersan", { NULL }, 1331, "udp" }, - { "pcia-rxp-b", { NULL }, 1332, "tcp" }, - { "pcia-rxp-b", { NULL }, 1332, "udp" }, - { "passwrd-policy", { NULL }, 1333, "tcp" }, - { "passwrd-policy", { NULL }, 1333, "udp" }, - { "writesrv", { NULL }, 1334, "tcp" }, - { "writesrv", { NULL }, 1334, "udp" }, - { "digital-notary", { NULL }, 1335, "tcp" }, - { "digital-notary", { NULL }, 1335, "udp" }, - { "ischat", { NULL }, 1336, "tcp" }, - { "ischat", { NULL }, 1336, "udp" }, - { "menandmice-dns", { NULL }, 1337, "tcp" }, - { "menandmice-dns", { NULL }, 1337, "udp" }, - { "wmc-log-svc", { NULL }, 1338, "tcp" }, - { "wmc-log-svc", { NULL }, 1338, "udp" }, - { "kjtsiteserver", { NULL }, 1339, "tcp" }, - { "kjtsiteserver", { NULL }, 1339, "udp" }, - { "naap", { NULL }, 1340, "tcp" }, - { "naap", { NULL }, 1340, "udp" }, - { "qubes", { NULL }, 1341, "tcp" }, - { "qubes", { NULL }, 1341, "udp" }, - { "esbroker", { NULL }, 1342, "tcp" }, - { "esbroker", { NULL }, 1342, "udp" }, - { "re101", { NULL }, 1343, "tcp" }, - { "re101", { NULL }, 1343, "udp" }, - { "icap", { NULL }, 1344, "tcp" }, - { "icap", { NULL }, 1344, "udp" }, - { "vpjp", { NULL }, 1345, "tcp" }, - { "vpjp", { NULL }, 1345, "udp" }, - { "alta-ana-lm", { NULL }, 1346, "tcp" }, - { "alta-ana-lm", { NULL }, 1346, "udp" }, - { "bbn-mmc", { NULL }, 1347, "tcp" }, - { "bbn-mmc", { NULL }, 1347, "udp" }, - { "bbn-mmx", { NULL }, 1348, "tcp" }, - { "bbn-mmx", { NULL }, 1348, "udp" }, - { "sbook", { NULL }, 1349, "tcp" }, - { "sbook", { NULL }, 1349, "udp" }, - { "editbench", { NULL }, 1350, "tcp" }, - { "editbench", { NULL }, 1350, "udp" }, - { "equationbuilder", { NULL }, 1351, "tcp" }, - { "equationbuilder", { NULL }, 1351, "udp" }, - { "lotusnote", { NULL }, 1352, "tcp" }, - { "lotusnote", { NULL }, 1352, "udp" }, - { "relief", { NULL }, 1353, "tcp" }, - { "relief", { NULL }, 1353, "udp" }, - { "XSIP-network", { NULL }, 1354, "tcp" }, - { "XSIP-network", { NULL }, 1354, "udp" }, - { "intuitive-edge", { NULL }, 1355, "tcp" }, - { "intuitive-edge", { NULL }, 1355, "udp" }, - { "cuillamartin", { NULL }, 1356, "tcp" }, - { "cuillamartin", { NULL }, 1356, "udp" }, - { "pegboard", { NULL }, 1357, "tcp" }, - { "pegboard", { NULL }, 1357, "udp" }, - { "connlcli", { NULL }, 1358, "tcp" }, - { "connlcli", { NULL }, 1358, "udp" }, - { "ftsrv", { NULL }, 1359, "tcp" }, - { "ftsrv", { NULL }, 1359, "udp" }, - { "mimer", { NULL }, 1360, "tcp" }, - { "mimer", { NULL }, 1360, "udp" }, - { "linx", { NULL }, 1361, "tcp" }, - { "linx", { NULL }, 1361, "udp" }, - { "timeflies", { NULL }, 1362, "tcp" }, - { "timeflies", { NULL }, 1362, "udp" }, - { "ndm-requester", { NULL }, 1363, "tcp" }, - { "ndm-requester", { NULL }, 1363, "udp" }, - { "ndm-server", { NULL }, 1364, "tcp" }, - { "ndm-server", { NULL }, 1364, "udp" }, - { "adapt-sna", { NULL }, 1365, "tcp" }, - { "adapt-sna", { NULL }, 1365, "udp" }, - { "netware-csp", { NULL }, 1366, "tcp" }, - { "netware-csp", { NULL }, 1366, "udp" }, - { "dcs", { NULL }, 1367, "tcp" }, - { "dcs", { NULL }, 1367, "udp" }, - { "screencast", { NULL }, 1368, "tcp" }, - { "screencast", { NULL }, 1368, "udp" }, - { "gv-us", { NULL }, 1369, "tcp" }, - { "gv-us", { NULL }, 1369, "udp" }, - { "us-gv", { NULL }, 1370, "tcp" }, - { "us-gv", { NULL }, 1370, "udp" }, - { "fc-cli", { NULL }, 1371, "tcp" }, - { "fc-cli", { NULL }, 1371, "udp" }, - { "fc-ser", { NULL }, 1372, "tcp" }, - { "fc-ser", { NULL }, 1372, "udp" }, - { "chromagrafx", { NULL }, 1373, "tcp" }, - { "chromagrafx", { NULL }, 1373, "udp" }, - { "molly", { NULL }, 1374, "tcp" }, - { "molly", { NULL }, 1374, "udp" }, - { "bytex", { NULL }, 1375, "tcp" }, - { "bytex", { NULL }, 1375, "udp" }, - { "ibm-pps", { NULL }, 1376, "tcp" }, - { "ibm-pps", { NULL }, 1376, "udp" }, - { "cichlid", { NULL }, 1377, "tcp" }, - { "cichlid", { NULL }, 1377, "udp" }, - { "elan", { NULL }, 1378, "tcp" }, - { "elan", { NULL }, 1378, "udp" }, - { "dbreporter", { NULL }, 1379, "tcp" }, - { "dbreporter", { NULL }, 1379, "udp" }, - { "telesis-licman", { NULL }, 1380, "tcp" }, - { "telesis-licman", { NULL }, 1380, "udp" }, - { "apple-licman", { NULL }, 1381, "tcp" }, - { "apple-licman", { NULL }, 1381, "udp" }, - { "udt_os", { NULL }, 1382, "tcp" }, - { "udt_os", { NULL }, 1382, "udp" }, - { "gwha", { NULL }, 1383, "tcp" }, - { "gwha", { NULL }, 1383, "udp" }, - { "os-licman", { NULL }, 1384, "tcp" }, - { "os-licman", { NULL }, 1384, "udp" }, - { "atex_elmd", { NULL }, 1385, "tcp" }, - { "atex_elmd", { NULL }, 1385, "udp" }, - { "checksum", { NULL }, 1386, "tcp" }, - { "checksum", { NULL }, 1386, "udp" }, - { "cadsi-lm", { NULL }, 1387, "tcp" }, - { "cadsi-lm", { NULL }, 1387, "udp" }, - { "objective-dbc", { NULL }, 1388, "tcp" }, - { "objective-dbc", { NULL }, 1388, "udp" }, - { "iclpv-dm", { NULL }, 1389, "tcp" }, - { "iclpv-dm", { NULL }, 1389, "udp" }, - { "iclpv-sc", { NULL }, 1390, "tcp" }, - { "iclpv-sc", { NULL }, 1390, "udp" }, - { "iclpv-sas", { NULL }, 1391, "tcp" }, - { "iclpv-sas", { NULL }, 1391, "udp" }, - { "iclpv-pm", { NULL }, 1392, "tcp" }, - { "iclpv-pm", { NULL }, 1392, "udp" }, - { "iclpv-nls", { NULL }, 1393, "tcp" }, - { "iclpv-nls", { NULL }, 1393, "udp" }, - { "iclpv-nlc", { NULL }, 1394, "tcp" }, - { "iclpv-nlc", { NULL }, 1394, "udp" }, - { "iclpv-wsm", { NULL }, 1395, "tcp" }, - { "iclpv-wsm", { NULL }, 1395, "udp" }, - { "dvl-activemail", { NULL }, 1396, "tcp" }, - { "dvl-activemail", { NULL }, 1396, "udp" }, - { "audio-activmail", { NULL }, 1397, "tcp" }, - { "audio-activmail", { NULL }, 1397, "udp" }, - { "video-activmail", { NULL }, 1398, "tcp" }, - { "video-activmail", { NULL }, 1398, "udp" }, - { "cadkey-licman", { NULL }, 1399, "tcp" }, - { "cadkey-licman", { NULL }, 1399, "udp" }, - { "cadkey-tablet", { NULL }, 1400, "tcp" }, - { "cadkey-tablet", { NULL }, 1400, "udp" }, - { "goldleaf-licman", { NULL }, 1401, "tcp" }, - { "goldleaf-licman", { NULL }, 1401, "udp" }, - { "prm-sm-np", { NULL }, 1402, "tcp" }, - { "prm-sm-np", { NULL }, 1402, "udp" }, - { "prm-nm-np", { NULL }, 1403, "tcp" }, - { "prm-nm-np", { NULL }, 1403, "udp" }, - { "igi-lm", { NULL }, 1404, "tcp" }, - { "igi-lm", { NULL }, 1404, "udp" }, - { "ibm-res", { NULL }, 1405, "tcp" }, - { "ibm-res", { NULL }, 1405, "udp" }, - { "netlabs-lm", { NULL }, 1406, "tcp" }, - { "netlabs-lm", { NULL }, 1406, "udp" }, - { "dbsa-lm", { NULL }, 1407, "tcp" }, - { "dbsa-lm", { NULL }, 1407, "udp" }, - { "sophia-lm", { NULL }, 1408, "tcp" }, - { "sophia-lm", { NULL }, 1408, "udp" }, - { "here-lm", { NULL }, 1409, "tcp" }, - { "here-lm", { NULL }, 1409, "udp" }, - { "hiq", { NULL }, 1410, "tcp" }, - { "hiq", { NULL }, 1410, "udp" }, - { "af", { NULL }, 1411, "tcp" }, - { "af", { NULL }, 1411, "udp" }, - { "innosys", { NULL }, 1412, "tcp" }, - { "innosys", { NULL }, 1412, "udp" }, - { "innosys-acl", { NULL }, 1413, "tcp" }, - { "innosys-acl", { NULL }, 1413, "udp" }, - { "ibm-mqseries", { NULL }, 1414, "tcp" }, - { "ibm-mqseries", { NULL }, 1414, "udp" }, - { "dbstar", { NULL }, 1415, "tcp" }, - { "dbstar", { NULL }, 1415, "udp" }, - { "novell-lu6.2", { NULL }, 1416, "tcp" }, - { "novell-lu6.2", { NULL }, 1416, "udp" }, - { "timbuktu-srv1", { NULL }, 1417, "tcp" }, - { "timbuktu-srv1", { NULL }, 1417, "udp" }, - { "timbuktu-srv2", { NULL }, 1418, "tcp" }, - { "timbuktu-srv2", { NULL }, 1418, "udp" }, - { "timbuktu-srv3", { NULL }, 1419, "tcp" }, - { "timbuktu-srv3", { NULL }, 1419, "udp" }, - { "timbuktu-srv4", { NULL }, 1420, "tcp" }, - { "timbuktu-srv4", { NULL }, 1420, "udp" }, - { "gandalf-lm", { NULL }, 1421, "tcp" }, - { "gandalf-lm", { NULL }, 1421, "udp" }, - { "autodesk-lm", { NULL }, 1422, "tcp" }, - { "autodesk-lm", { NULL }, 1422, "udp" }, - { "essbase", { NULL }, 1423, "tcp" }, - { "essbase", { NULL }, 1423, "udp" }, - { "hybrid", { NULL }, 1424, "tcp" }, - { "hybrid", { NULL }, 1424, "udp" }, - { "zion-lm", { NULL }, 1425, "tcp" }, - { "zion-lm", { NULL }, 1425, "udp" }, - { "sais", { NULL }, 1426, "tcp" }, - { "sais", { NULL }, 1426, "udp" }, - { "mloadd", { NULL }, 1427, "tcp" }, - { "mloadd", { NULL }, 1427, "udp" }, - { "informatik-lm", { NULL }, 1428, "tcp" }, - { "informatik-lm", { NULL }, 1428, "udp" }, - { "nms", { NULL }, 1429, "tcp" }, - { "nms", { NULL }, 1429, "udp" }, - { "tpdu", { NULL }, 1430, "tcp" }, - { "tpdu", { NULL }, 1430, "udp" }, - { "rgtp", { NULL }, 1431, "tcp" }, - { "rgtp", { NULL }, 1431, "udp" }, - { "blueberry-lm", { NULL }, 1432, "tcp" }, - { "blueberry-lm", { NULL }, 1432, "udp" }, - { "ms-sql-s", { NULL }, 1433, "tcp" }, - { "ms-sql-s", { NULL }, 1433, "udp" }, - { "ms-sql-m", { NULL }, 1434, "tcp" }, - { "ms-sql-m", { NULL }, 1434, "udp" }, - { "ibm-cics", { NULL }, 1435, "tcp" }, - { "ibm-cics", { NULL }, 1435, "udp" }, - { "saism", { NULL }, 1436, "tcp" }, - { "saism", { NULL }, 1436, "udp" }, - { "tabula", { NULL }, 1437, "tcp" }, - { "tabula", { NULL }, 1437, "udp" }, - { "eicon-server", { NULL }, 1438, "tcp" }, - { "eicon-server", { NULL }, 1438, "udp" }, - { "eicon-x25", { NULL }, 1439, "tcp" }, - { "eicon-x25", { NULL }, 1439, "udp" }, - { "eicon-slp", { NULL }, 1440, "tcp" }, - { "eicon-slp", { NULL }, 1440, "udp" }, - { "cadis-1", { NULL }, 1441, "tcp" }, - { "cadis-1", { NULL }, 1441, "udp" }, - { "cadis-2", { NULL }, 1442, "tcp" }, - { "cadis-2", { NULL }, 1442, "udp" }, - { "ies-lm", { NULL }, 1443, "tcp" }, - { "ies-lm", { NULL }, 1443, "udp" }, - { "marcam-lm", { NULL }, 1444, "tcp" }, - { "marcam-lm", { NULL }, 1444, "udp" }, - { "proxima-lm", { NULL }, 1445, "tcp" }, - { "proxima-lm", { NULL }, 1445, "udp" }, - { "ora-lm", { NULL }, 1446, "tcp" }, - { "ora-lm", { NULL }, 1446, "udp" }, - { "apri-lm", { NULL }, 1447, "tcp" }, - { "apri-lm", { NULL }, 1447, "udp" }, - { "oc-lm", { NULL }, 1448, "tcp" }, - { "oc-lm", { NULL }, 1448, "udp" }, - { "peport", { NULL }, 1449, "tcp" }, - { "peport", { NULL }, 1449, "udp" }, - { "dwf", { NULL }, 1450, "tcp" }, - { "dwf", { NULL }, 1450, "udp" }, - { "infoman", { NULL }, 1451, "tcp" }, - { "infoman", { NULL }, 1451, "udp" }, - { "gtegsc-lm", { NULL }, 1452, "tcp" }, - { "gtegsc-lm", { NULL }, 1452, "udp" }, - { "genie-lm", { NULL }, 1453, "tcp" }, - { "genie-lm", { NULL }, 1453, "udp" }, - { "interhdl_elmd", { NULL }, 1454, "tcp" }, - { "interhdl_elmd", { NULL }, 1454, "udp" }, - { "esl-lm", { NULL }, 1455, "tcp" }, - { "esl-lm", { NULL }, 1455, "udp" }, - { "dca", { NULL }, 1456, "tcp" }, - { "dca", { NULL }, 1456, "udp" }, - { "valisys-lm", { NULL }, 1457, "tcp" }, - { "valisys-lm", { NULL }, 1457, "udp" }, - { "nrcabq-lm", { NULL }, 1458, "tcp" }, - { "nrcabq-lm", { NULL }, 1458, "udp" }, - { "proshare1", { NULL }, 1459, "tcp" }, - { "proshare1", { NULL }, 1459, "udp" }, - { "proshare2", { NULL }, 1460, "tcp" }, - { "proshare2", { NULL }, 1460, "udp" }, - { "ibm_wrless_lan", { NULL }, 1461, "tcp" }, - { "ibm_wrless_lan", { NULL }, 1461, "udp" }, - { "world-lm", { NULL }, 1462, "tcp" }, - { "world-lm", { NULL }, 1462, "udp" }, - { "nucleus", { NULL }, 1463, "tcp" }, - { "nucleus", { NULL }, 1463, "udp" }, - { "msl_lmd", { NULL }, 1464, "tcp" }, - { "msl_lmd", { NULL }, 1464, "udp" }, - { "pipes", { NULL }, 1465, "tcp" }, - { "pipes", { NULL }, 1465, "udp" }, - { "oceansoft-lm", { NULL }, 1466, "tcp" }, - { "oceansoft-lm", { NULL }, 1466, "udp" }, - { "csdmbase", { NULL }, 1467, "tcp" }, - { "csdmbase", { NULL }, 1467, "udp" }, - { "csdm", { NULL }, 1468, "tcp" }, - { "csdm", { NULL }, 1468, "udp" }, - { "aal-lm", { NULL }, 1469, "tcp" }, - { "aal-lm", { NULL }, 1469, "udp" }, - { "uaiact", { NULL }, 1470, "tcp" }, - { "uaiact", { NULL }, 1470, "udp" }, - { "csdmbase", { NULL }, 1471, "tcp" }, - { "csdmbase", { NULL }, 1471, "udp" }, - { "csdm", { NULL }, 1472, "tcp" }, - { "csdm", { NULL }, 1472, "udp" }, - { "openmath", { NULL }, 1473, "tcp" }, - { "openmath", { NULL }, 1473, "udp" }, - { "telefinder", { NULL }, 1474, "tcp" }, - { "telefinder", { NULL }, 1474, "udp" }, - { "taligent-lm", { NULL }, 1475, "tcp" }, - { "taligent-lm", { NULL }, 1475, "udp" }, - { "clvm-cfg", { NULL }, 1476, "tcp" }, - { "clvm-cfg", { NULL }, 1476, "udp" }, - { "ms-sna-server", { NULL }, 1477, "tcp" }, - { "ms-sna-server", { NULL }, 1477, "udp" }, - { "ms-sna-base", { NULL }, 1478, "tcp" }, - { "ms-sna-base", { NULL }, 1478, "udp" }, - { "dberegister", { NULL }, 1479, "tcp" }, - { "dberegister", { NULL }, 1479, "udp" }, - { "pacerforum", { NULL }, 1480, "tcp" }, - { "pacerforum", { NULL }, 1480, "udp" }, - { "airs", { NULL }, 1481, "tcp" }, - { "airs", { NULL }, 1481, "udp" }, - { "miteksys-lm", { NULL }, 1482, "tcp" }, - { "miteksys-lm", { NULL }, 1482, "udp" }, - { "afs", { NULL }, 1483, "tcp" }, - { "afs", { NULL }, 1483, "udp" }, - { "confluent", { NULL }, 1484, "tcp" }, - { "confluent", { NULL }, 1484, "udp" }, - { "lansource", { NULL }, 1485, "tcp" }, - { "lansource", { NULL }, 1485, "udp" }, - { "nms_topo_serv", { NULL }, 1486, "tcp" }, - { "nms_topo_serv", { NULL }, 1486, "udp" }, - { "localinfosrvr", { NULL }, 1487, "tcp" }, - { "localinfosrvr", { NULL }, 1487, "udp" }, - { "docstor", { NULL }, 1488, "tcp" }, - { "docstor", { NULL }, 1488, "udp" }, - { "dmdocbroker", { NULL }, 1489, "tcp" }, - { "dmdocbroker", { NULL }, 1489, "udp" }, - { "insitu-conf", { NULL }, 1490, "tcp" }, - { "insitu-conf", { NULL }, 1490, "udp" }, - { "stone-design-1", { NULL }, 1492, "tcp" }, - { "stone-design-1", { NULL }, 1492, "udp" }, - { "netmap_lm", { NULL }, 1493, "tcp" }, - { "netmap_lm", { NULL }, 1493, "udp" }, - { "ica", { NULL }, 1494, "tcp" }, - { "ica", { NULL }, 1494, "udp" }, - { "cvc", { NULL }, 1495, "tcp" }, - { "cvc", { NULL }, 1495, "udp" }, - { "liberty-lm", { NULL }, 1496, "tcp" }, - { "liberty-lm", { NULL }, 1496, "udp" }, - { "rfx-lm", { NULL }, 1497, "tcp" }, - { "rfx-lm", { NULL }, 1497, "udp" }, - { "sybase-sqlany", { NULL }, 1498, "tcp" }, - { "sybase-sqlany", { NULL }, 1498, "udp" }, - { "fhc", { NULL }, 1499, "tcp" }, - { "fhc", { NULL }, 1499, "udp" }, - { "vlsi-lm", { NULL }, 1500, "tcp" }, - { "vlsi-lm", { NULL }, 1500, "udp" }, - { "saiscm", { NULL }, 1501, "tcp" }, - { "saiscm", { NULL }, 1501, "udp" }, - { "shivadiscovery", { NULL }, 1502, "tcp" }, - { "shivadiscovery", { NULL }, 1502, "udp" }, - { "imtc-mcs", { NULL }, 1503, "tcp" }, - { "imtc-mcs", { NULL }, 1503, "udp" }, - { "evb-elm", { NULL }, 1504, "tcp" }, - { "evb-elm", { NULL }, 1504, "udp" }, - { "funkproxy", { NULL }, 1505, "tcp" }, - { "funkproxy", { NULL }, 1505, "udp" }, - { "utcd", { NULL }, 1506, "tcp" }, - { "utcd", { NULL }, 1506, "udp" }, - { "symplex", { NULL }, 1507, "tcp" }, - { "symplex", { NULL }, 1507, "udp" }, - { "diagmond", { NULL }, 1508, "tcp" }, - { "diagmond", { NULL }, 1508, "udp" }, - { "robcad-lm", { NULL }, 1509, "tcp" }, - { "robcad-lm", { NULL }, 1509, "udp" }, - { "mvx-lm", { NULL }, 1510, "tcp" }, - { "mvx-lm", { NULL }, 1510, "udp" }, - { "3l-l1", { NULL }, 1511, "tcp" }, - { "3l-l1", { NULL }, 1511, "udp" }, - { "wins", { NULL }, 1512, "tcp" }, - { "wins", { NULL }, 1512, "udp" }, - { "fujitsu-dtc", { NULL }, 1513, "tcp" }, - { "fujitsu-dtc", { NULL }, 1513, "udp" }, - { "fujitsu-dtcns", { NULL }, 1514, "tcp" }, - { "fujitsu-dtcns", { NULL }, 1514, "udp" }, - { "ifor-protocol", { NULL }, 1515, "tcp" }, - { "ifor-protocol", { NULL }, 1515, "udp" }, - { "vpad", { NULL }, 1516, "tcp" }, - { "vpad", { NULL }, 1516, "udp" }, - { "vpac", { NULL }, 1517, "tcp" }, - { "vpac", { NULL }, 1517, "udp" }, - { "vpvd", { NULL }, 1518, "tcp" }, - { "vpvd", { NULL }, 1518, "udp" }, - { "vpvc", { NULL }, 1519, "tcp" }, - { "vpvc", { NULL }, 1519, "udp" }, - { "atm-zip-office", { NULL }, 1520, "tcp" }, - { "atm-zip-office", { NULL }, 1520, "udp" }, - { "ncube-lm", { NULL }, 1521, "tcp" }, - { "ncube-lm", { NULL }, 1521, "udp" }, - { "ricardo-lm", { NULL }, 1522, "tcp" }, - { "ricardo-lm", { NULL }, 1522, "udp" }, - { "cichild-lm", { NULL }, 1523, "tcp" }, - { "cichild-lm", { NULL }, 1523, "udp" }, - { "ingreslock", { NULL }, 1524, "tcp" }, - { "ingreslock", { NULL }, 1524, "udp" }, - { "orasrv", { NULL }, 1525, "tcp" }, - { "orasrv", { NULL }, 1525, "udp" }, - { "prospero-np", { NULL }, 1525, "tcp" }, - { "prospero-np", { NULL }, 1525, "udp" }, - { "pdap-np", { NULL }, 1526, "tcp" }, - { "pdap-np", { NULL }, 1526, "udp" }, - { "tlisrv", { NULL }, 1527, "tcp" }, - { "tlisrv", { NULL }, 1527, "udp" }, - { "coauthor", { NULL }, 1529, "tcp" }, - { "coauthor", { NULL }, 1529, "udp" }, - { "rap-service", { NULL }, 1530, "tcp" }, - { "rap-service", { NULL }, 1530, "udp" }, - { "rap-listen", { NULL }, 1531, "tcp" }, - { "rap-listen", { NULL }, 1531, "udp" }, - { "miroconnect", { NULL }, 1532, "tcp" }, - { "miroconnect", { NULL }, 1532, "udp" }, - { "virtual-places", { NULL }, 1533, "tcp" }, - { "virtual-places", { NULL }, 1533, "udp" }, - { "micromuse-lm", { NULL }, 1534, "tcp" }, - { "micromuse-lm", { NULL }, 1534, "udp" }, - { "ampr-info", { NULL }, 1535, "tcp" }, - { "ampr-info", { NULL }, 1535, "udp" }, - { "ampr-inter", { NULL }, 1536, "tcp" }, - { "ampr-inter", { NULL }, 1536, "udp" }, - { "sdsc-lm", { NULL }, 1537, "tcp" }, - { "sdsc-lm", { NULL }, 1537, "udp" }, - { "3ds-lm", { NULL }, 1538, "tcp" }, - { "3ds-lm", { NULL }, 1538, "udp" }, - { "intellistor-lm", { NULL }, 1539, "tcp" }, - { "intellistor-lm", { NULL }, 1539, "udp" }, - { "rds", { NULL }, 1540, "tcp" }, - { "rds", { NULL }, 1540, "udp" }, - { "rds2", { NULL }, 1541, "tcp" }, - { "rds2", { NULL }, 1541, "udp" }, - { "gridgen-elmd", { NULL }, 1542, "tcp" }, - { "gridgen-elmd", { NULL }, 1542, "udp" }, - { "simba-cs", { NULL }, 1543, "tcp" }, - { "simba-cs", { NULL }, 1543, "udp" }, - { "aspeclmd", { NULL }, 1544, "tcp" }, - { "aspeclmd", { NULL }, 1544, "udp" }, - { "vistium-share", { NULL }, 1545, "tcp" }, - { "vistium-share", { NULL }, 1545, "udp" }, - { "abbaccuray", { NULL }, 1546, "tcp" }, - { "abbaccuray", { NULL }, 1546, "udp" }, - { "laplink", { NULL }, 1547, "tcp" }, - { "laplink", { NULL }, 1547, "udp" }, - { "axon-lm", { NULL }, 1548, "tcp" }, - { "axon-lm", { NULL }, 1548, "udp" }, - { "shivahose", { NULL }, 1549, "tcp" }, - { "shivasound", { NULL }, 1549, "udp" }, - { "3m-image-lm", { NULL }, 1550, "tcp" }, - { "3m-image-lm", { NULL }, 1550, "udp" }, - { "hecmtl-db", { NULL }, 1551, "tcp" }, - { "hecmtl-db", { NULL }, 1551, "udp" }, - { "pciarray", { NULL }, 1552, "tcp" }, - { "pciarray", { NULL }, 1552, "udp" }, - { "sna-cs", { NULL }, 1553, "tcp" }, - { "sna-cs", { NULL }, 1553, "udp" }, - { "caci-lm", { NULL }, 1554, "tcp" }, - { "caci-lm", { NULL }, 1554, "udp" }, - { "livelan", { NULL }, 1555, "tcp" }, - { "livelan", { NULL }, 1555, "udp" }, - { "veritas_pbx", { NULL }, 1556, "tcp" }, - { "veritas_pbx", { NULL }, 1556, "udp" }, - { "arbortext-lm", { NULL }, 1557, "tcp" }, - { "arbortext-lm", { NULL }, 1557, "udp" }, - { "xingmpeg", { NULL }, 1558, "tcp" }, - { "xingmpeg", { NULL }, 1558, "udp" }, - { "web2host", { NULL }, 1559, "tcp" }, - { "web2host", { NULL }, 1559, "udp" }, - { "asci-val", { NULL }, 1560, "tcp" }, - { "asci-val", { NULL }, 1560, "udp" }, - { "facilityview", { NULL }, 1561, "tcp" }, - { "facilityview", { NULL }, 1561, "udp" }, - { "pconnectmgr", { NULL }, 1562, "tcp" }, - { "pconnectmgr", { NULL }, 1562, "udp" }, - { "cadabra-lm", { NULL }, 1563, "tcp" }, - { "cadabra-lm", { NULL }, 1563, "udp" }, - { "pay-per-view", { NULL }, 1564, "tcp" }, - { "pay-per-view", { NULL }, 1564, "udp" }, - { "winddlb", { NULL }, 1565, "tcp" }, - { "winddlb", { NULL }, 1565, "udp" }, - { "corelvideo", { NULL }, 1566, "tcp" }, - { "corelvideo", { NULL }, 1566, "udp" }, - { "jlicelmd", { NULL }, 1567, "tcp" }, - { "jlicelmd", { NULL }, 1567, "udp" }, - { "tsspmap", { NULL }, 1568, "tcp" }, - { "tsspmap", { NULL }, 1568, "udp" }, - { "ets", { NULL }, 1569, "tcp" }, - { "ets", { NULL }, 1569, "udp" }, - { "orbixd", { NULL }, 1570, "tcp" }, - { "orbixd", { NULL }, 1570, "udp" }, - { "rdb-dbs-disp", { NULL }, 1571, "tcp" }, - { "rdb-dbs-disp", { NULL }, 1571, "udp" }, - { "chip-lm", { NULL }, 1572, "tcp" }, - { "chip-lm", { NULL }, 1572, "udp" }, - { "itscomm-ns", { NULL }, 1573, "tcp" }, - { "itscomm-ns", { NULL }, 1573, "udp" }, - { "mvel-lm", { NULL }, 1574, "tcp" }, - { "mvel-lm", { NULL }, 1574, "udp" }, - { "oraclenames", { NULL }, 1575, "tcp" }, - { "oraclenames", { NULL }, 1575, "udp" }, - { "moldflow-lm", { NULL }, 1576, "tcp" }, - { "moldflow-lm", { NULL }, 1576, "udp" }, - { "hypercube-lm", { NULL }, 1577, "tcp" }, - { "hypercube-lm", { NULL }, 1577, "udp" }, - { "jacobus-lm", { NULL }, 1578, "tcp" }, - { "jacobus-lm", { NULL }, 1578, "udp" }, - { "ioc-sea-lm", { NULL }, 1579, "tcp" }, - { "ioc-sea-lm", { NULL }, 1579, "udp" }, - { "tn-tl-r1", { NULL }, 1580, "tcp" }, - { "tn-tl-r2", { NULL }, 1580, "udp" }, - { "mil-2045-47001", { NULL }, 1581, "tcp" }, - { "mil-2045-47001", { NULL }, 1581, "udp" }, - { "msims", { NULL }, 1582, "tcp" }, - { "msims", { NULL }, 1582, "udp" }, - { "simbaexpress", { NULL }, 1583, "tcp" }, - { "simbaexpress", { NULL }, 1583, "udp" }, - { "tn-tl-fd2", { NULL }, 1584, "tcp" }, - { "tn-tl-fd2", { NULL }, 1584, "udp" }, - { "intv", { NULL }, 1585, "tcp" }, - { "intv", { NULL }, 1585, "udp" }, - { "ibm-abtact", { NULL }, 1586, "tcp" }, - { "ibm-abtact", { NULL }, 1586, "udp" }, - { "pra_elmd", { NULL }, 1587, "tcp" }, - { "pra_elmd", { NULL }, 1587, "udp" }, - { "triquest-lm", { NULL }, 1588, "tcp" }, - { "triquest-lm", { NULL }, 1588, "udp" }, - { "vqp", { NULL }, 1589, "tcp" }, - { "vqp", { NULL }, 1589, "udp" }, - { "gemini-lm", { NULL }, 1590, "tcp" }, - { "gemini-lm", { NULL }, 1590, "udp" }, - { "ncpm-pm", { NULL }, 1591, "tcp" }, - { "ncpm-pm", { NULL }, 1591, "udp" }, - { "commonspace", { NULL }, 1592, "tcp" }, - { "commonspace", { NULL }, 1592, "udp" }, - { "mainsoft-lm", { NULL }, 1593, "tcp" }, - { "mainsoft-lm", { NULL }, 1593, "udp" }, - { "sixtrak", { NULL }, 1594, "tcp" }, - { "sixtrak", { NULL }, 1594, "udp" }, - { "radio", { NULL }, 1595, "tcp" }, - { "radio", { NULL }, 1595, "udp" }, - { "radio-sm", { NULL }, 1596, "tcp" }, - { "radio-bc", { NULL }, 1596, "udp" }, - { "orbplus-iiop", { NULL }, 1597, "tcp" }, - { "orbplus-iiop", { NULL }, 1597, "udp" }, - { "picknfs", { NULL }, 1598, "tcp" }, - { "picknfs", { NULL }, 1598, "udp" }, - { "simbaservices", { NULL }, 1599, "tcp" }, - { "simbaservices", { NULL }, 1599, "udp" }, - { "issd", { NULL }, 1600, "tcp" }, - { "issd", { NULL }, 1600, "udp" }, - { "aas", { NULL }, 1601, "tcp" }, - { "aas", { NULL }, 1601, "udp" }, - { "inspect", { NULL }, 1602, "tcp" }, - { "inspect", { NULL }, 1602, "udp" }, - { "picodbc", { NULL }, 1603, "tcp" }, - { "picodbc", { NULL }, 1603, "udp" }, - { "icabrowser", { NULL }, 1604, "tcp" }, - { "icabrowser", { NULL }, 1604, "udp" }, - { "slp", { NULL }, 1605, "tcp" }, - { "slp", { NULL }, 1605, "udp" }, - { "slm-api", { NULL }, 1606, "tcp" }, - { "slm-api", { NULL }, 1606, "udp" }, - { "stt", { NULL }, 1607, "tcp" }, - { "stt", { NULL }, 1607, "udp" }, - { "smart-lm", { NULL }, 1608, "tcp" }, - { "smart-lm", { NULL }, 1608, "udp" }, - { "isysg-lm", { NULL }, 1609, "tcp" }, - { "isysg-lm", { NULL }, 1609, "udp" }, - { "taurus-wh", { NULL }, 1610, "tcp" }, - { "taurus-wh", { NULL }, 1610, "udp" }, - { "ill", { NULL }, 1611, "tcp" }, - { "ill", { NULL }, 1611, "udp" }, - { "netbill-trans", { NULL }, 1612, "tcp" }, - { "netbill-trans", { NULL }, 1612, "udp" }, - { "netbill-keyrep", { NULL }, 1613, "tcp" }, - { "netbill-keyrep", { NULL }, 1613, "udp" }, - { "netbill-cred", { NULL }, 1614, "tcp" }, - { "netbill-cred", { NULL }, 1614, "udp" }, - { "netbill-auth", { NULL }, 1615, "tcp" }, - { "netbill-auth", { NULL }, 1615, "udp" }, - { "netbill-prod", { NULL }, 1616, "tcp" }, - { "netbill-prod", { NULL }, 1616, "udp" }, - { "nimrod-agent", { NULL }, 1617, "tcp" }, - { "nimrod-agent", { NULL }, 1617, "udp" }, - { "skytelnet", { NULL }, 1618, "tcp" }, - { "skytelnet", { NULL }, 1618, "udp" }, - { "xs-openstorage", { NULL }, 1619, "tcp" }, - { "xs-openstorage", { NULL }, 1619, "udp" }, - { "faxportwinport", { NULL }, 1620, "tcp" }, - { "faxportwinport", { NULL }, 1620, "udp" }, - { "softdataphone", { NULL }, 1621, "tcp" }, - { "softdataphone", { NULL }, 1621, "udp" }, - { "ontime", { NULL }, 1622, "tcp" }, - { "ontime", { NULL }, 1622, "udp" }, - { "jaleosnd", { NULL }, 1623, "tcp" }, - { "jaleosnd", { NULL }, 1623, "udp" }, - { "udp-sr-port", { NULL }, 1624, "tcp" }, - { "udp-sr-port", { NULL }, 1624, "udp" }, - { "svs-omagent", { NULL }, 1625, "tcp" }, - { "svs-omagent", { NULL }, 1625, "udp" }, - { "shockwave", { NULL }, 1626, "tcp" }, - { "shockwave", { NULL }, 1626, "udp" }, - { "t128-gateway", { NULL }, 1627, "tcp" }, - { "t128-gateway", { NULL }, 1627, "udp" }, - { "lontalk-norm", { NULL }, 1628, "tcp" }, - { "lontalk-norm", { NULL }, 1628, "udp" }, - { "lontalk-urgnt", { NULL }, 1629, "tcp" }, - { "lontalk-urgnt", { NULL }, 1629, "udp" }, - { "oraclenet8cman", { NULL }, 1630, "tcp" }, - { "oraclenet8cman", { NULL }, 1630, "udp" }, - { "visitview", { NULL }, 1631, "tcp" }, - { "visitview", { NULL }, 1631, "udp" }, - { "pammratc", { NULL }, 1632, "tcp" }, - { "pammratc", { NULL }, 1632, "udp" }, - { "pammrpc", { NULL }, 1633, "tcp" }, - { "pammrpc", { NULL }, 1633, "udp" }, - { "loaprobe", { NULL }, 1634, "tcp" }, - { "loaprobe", { NULL }, 1634, "udp" }, - { "edb-server1", { NULL }, 1635, "tcp" }, - { "edb-server1", { NULL }, 1635, "udp" }, - { "isdc", { NULL }, 1636, "tcp" }, - { "isdc", { NULL }, 1636, "udp" }, - { "islc", { NULL }, 1637, "tcp" }, - { "islc", { NULL }, 1637, "udp" }, - { "ismc", { NULL }, 1638, "tcp" }, - { "ismc", { NULL }, 1638, "udp" }, - { "cert-initiator", { NULL }, 1639, "tcp" }, - { "cert-initiator", { NULL }, 1639, "udp" }, - { "cert-responder", { NULL }, 1640, "tcp" }, - { "cert-responder", { NULL }, 1640, "udp" }, - { "invision", { NULL }, 1641, "tcp" }, - { "invision", { NULL }, 1641, "udp" }, - { "isis-am", { NULL }, 1642, "tcp" }, - { "isis-am", { NULL }, 1642, "udp" }, - { "isis-ambc", { NULL }, 1643, "tcp" }, - { "isis-ambc", { NULL }, 1643, "udp" }, - { "saiseh", { NULL }, 1644, "tcp" }, - { "sightline", { NULL }, 1645, "tcp" }, - { "sightline", { NULL }, 1645, "udp" }, - { "sa-msg-port", { NULL }, 1646, "tcp" }, - { "sa-msg-port", { NULL }, 1646, "udp" }, - { "rsap", { NULL }, 1647, "tcp" }, - { "rsap", { NULL }, 1647, "udp" }, - { "concurrent-lm", { NULL }, 1648, "tcp" }, - { "concurrent-lm", { NULL }, 1648, "udp" }, - { "kermit", { NULL }, 1649, "tcp" }, - { "kermit", { NULL }, 1649, "udp" }, - { "nkd", { NULL }, 1650, "tcp" }, - { "nkd", { NULL }, 1650, "udp" }, - { "shiva_confsrvr", { NULL }, 1651, "tcp" }, - { "shiva_confsrvr", { NULL }, 1651, "udp" }, - { "xnmp", { NULL }, 1652, "tcp" }, - { "xnmp", { NULL }, 1652, "udp" }, - { "alphatech-lm", { NULL }, 1653, "tcp" }, - { "alphatech-lm", { NULL }, 1653, "udp" }, - { "stargatealerts", { NULL }, 1654, "tcp" }, - { "stargatealerts", { NULL }, 1654, "udp" }, - { "dec-mbadmin", { NULL }, 1655, "tcp" }, - { "dec-mbadmin", { NULL }, 1655, "udp" }, - { "dec-mbadmin-h", { NULL }, 1656, "tcp" }, - { "dec-mbadmin-h", { NULL }, 1656, "udp" }, - { "fujitsu-mmpdc", { NULL }, 1657, "tcp" }, - { "fujitsu-mmpdc", { NULL }, 1657, "udp" }, - { "sixnetudr", { NULL }, 1658, "tcp" }, - { "sixnetudr", { NULL }, 1658, "udp" }, - { "sg-lm", { NULL }, 1659, "tcp" }, - { "sg-lm", { NULL }, 1659, "udp" }, - { "skip-mc-gikreq", { NULL }, 1660, "tcp" }, - { "skip-mc-gikreq", { NULL }, 1660, "udp" }, - { "netview-aix-1", { NULL }, 1661, "tcp" }, - { "netview-aix-1", { NULL }, 1661, "udp" }, - { "netview-aix-2", { NULL }, 1662, "tcp" }, - { "netview-aix-2", { NULL }, 1662, "udp" }, - { "netview-aix-3", { NULL }, 1663, "tcp" }, - { "netview-aix-3", { NULL }, 1663, "udp" }, - { "netview-aix-4", { NULL }, 1664, "tcp" }, - { "netview-aix-4", { NULL }, 1664, "udp" }, - { "netview-aix-5", { NULL }, 1665, "tcp" }, - { "netview-aix-5", { NULL }, 1665, "udp" }, - { "netview-aix-6", { NULL }, 1666, "tcp" }, - { "netview-aix-6", { NULL }, 1666, "udp" }, - { "netview-aix-7", { NULL }, 1667, "tcp" }, - { "netview-aix-7", { NULL }, 1667, "udp" }, - { "netview-aix-8", { NULL }, 1668, "tcp" }, - { "netview-aix-8", { NULL }, 1668, "udp" }, - { "netview-aix-9", { NULL }, 1669, "tcp" }, - { "netview-aix-9", { NULL }, 1669, "udp" }, - { "netview-aix-10", { NULL }, 1670, "tcp" }, - { "netview-aix-10", { NULL }, 1670, "udp" }, - { "netview-aix-11", { NULL }, 1671, "tcp" }, - { "netview-aix-11", { NULL }, 1671, "udp" }, - { "netview-aix-12", { NULL }, 1672, "tcp" }, - { "netview-aix-12", { NULL }, 1672, "udp" }, - { "proshare-mc-1", { NULL }, 1673, "tcp" }, - { "proshare-mc-1", { NULL }, 1673, "udp" }, - { "proshare-mc-2", { NULL }, 1674, "tcp" }, - { "proshare-mc-2", { NULL }, 1674, "udp" }, - { "pdp", { NULL }, 1675, "tcp" }, - { "pdp", { NULL }, 1675, "udp" }, - { "netcomm1", { NULL }, 1676, "tcp" }, - { "netcomm2", { NULL }, 1676, "udp" }, - { "groupwise", { NULL }, 1677, "tcp" }, - { "groupwise", { NULL }, 1677, "udp" }, - { "prolink", { NULL }, 1678, "tcp" }, - { "prolink", { NULL }, 1678, "udp" }, - { "darcorp-lm", { NULL }, 1679, "tcp" }, - { "darcorp-lm", { NULL }, 1679, "udp" }, - { "microcom-sbp", { NULL }, 1680, "tcp" }, - { "microcom-sbp", { NULL }, 1680, "udp" }, - { "sd-elmd", { NULL }, 1681, "tcp" }, - { "sd-elmd", { NULL }, 1681, "udp" }, - { "lanyon-lantern", { NULL }, 1682, "tcp" }, - { "lanyon-lantern", { NULL }, 1682, "udp" }, - { "ncpm-hip", { NULL }, 1683, "tcp" }, - { "ncpm-hip", { NULL }, 1683, "udp" }, - { "snaresecure", { NULL }, 1684, "tcp" }, - { "snaresecure", { NULL }, 1684, "udp" }, - { "n2nremote", { NULL }, 1685, "tcp" }, - { "n2nremote", { NULL }, 1685, "udp" }, - { "cvmon", { NULL }, 1686, "tcp" }, - { "cvmon", { NULL }, 1686, "udp" }, - { "nsjtp-ctrl", { NULL }, 1687, "tcp" }, - { "nsjtp-ctrl", { NULL }, 1687, "udp" }, - { "nsjtp-data", { NULL }, 1688, "tcp" }, - { "nsjtp-data", { NULL }, 1688, "udp" }, - { "firefox", { NULL }, 1689, "tcp" }, - { "firefox", { NULL }, 1689, "udp" }, - { "ng-umds", { NULL }, 1690, "tcp" }, - { "ng-umds", { NULL }, 1690, "udp" }, - { "empire-empuma", { NULL }, 1691, "tcp" }, - { "empire-empuma", { NULL }, 1691, "udp" }, - { "sstsys-lm", { NULL }, 1692, "tcp" }, - { "sstsys-lm", { NULL }, 1692, "udp" }, - { "rrirtr", { NULL }, 1693, "tcp" }, - { "rrirtr", { NULL }, 1693, "udp" }, - { "rrimwm", { NULL }, 1694, "tcp" }, - { "rrimwm", { NULL }, 1694, "udp" }, - { "rrilwm", { NULL }, 1695, "tcp" }, - { "rrilwm", { NULL }, 1695, "udp" }, - { "rrifmm", { NULL }, 1696, "tcp" }, - { "rrifmm", { NULL }, 1696, "udp" }, - { "rrisat", { NULL }, 1697, "tcp" }, - { "rrisat", { NULL }, 1697, "udp" }, - { "rsvp-encap-1", { NULL }, 1698, "tcp" }, - { "rsvp-encap-1", { NULL }, 1698, "udp" }, - { "rsvp-encap-2", { NULL }, 1699, "tcp" }, - { "rsvp-encap-2", { NULL }, 1699, "udp" }, - { "mps-raft", { NULL }, 1700, "tcp" }, - { "mps-raft", { NULL }, 1700, "udp" }, - { "l2f", { NULL }, 1701, "tcp" }, - { "l2f", { NULL }, 1701, "udp" }, - { "l2tp", { NULL }, 1701, "tcp" }, - { "l2tp", { NULL }, 1701, "udp" }, - { "deskshare", { NULL }, 1702, "tcp" }, - { "deskshare", { NULL }, 1702, "udp" }, - { "hb-engine", { NULL }, 1703, "tcp" }, - { "hb-engine", { NULL }, 1703, "udp" }, - { "bcs-broker", { NULL }, 1704, "tcp" }, - { "bcs-broker", { NULL }, 1704, "udp" }, - { "slingshot", { NULL }, 1705, "tcp" }, - { "slingshot", { NULL }, 1705, "udp" }, - { "jetform", { NULL }, 1706, "tcp" }, - { "jetform", { NULL }, 1706, "udp" }, - { "vdmplay", { NULL }, 1707, "tcp" }, - { "vdmplay", { NULL }, 1707, "udp" }, - { "gat-lmd", { NULL }, 1708, "tcp" }, - { "gat-lmd", { NULL }, 1708, "udp" }, - { "centra", { NULL }, 1709, "tcp" }, - { "centra", { NULL }, 1709, "udp" }, - { "impera", { NULL }, 1710, "tcp" }, - { "impera", { NULL }, 1710, "udp" }, - { "pptconference", { NULL }, 1711, "tcp" }, - { "pptconference", { NULL }, 1711, "udp" }, - { "registrar", { NULL }, 1712, "tcp" }, - { "registrar", { NULL }, 1712, "udp" }, - { "conferencetalk", { NULL }, 1713, "tcp" }, - { "conferencetalk", { NULL }, 1713, "udp" }, - { "sesi-lm", { NULL }, 1714, "tcp" }, - { "sesi-lm", { NULL }, 1714, "udp" }, - { "houdini-lm", { NULL }, 1715, "tcp" }, - { "houdini-lm", { NULL }, 1715, "udp" }, - { "xmsg", { NULL }, 1716, "tcp" }, - { "xmsg", { NULL }, 1716, "udp" }, - { "fj-hdnet", { NULL }, 1717, "tcp" }, - { "fj-hdnet", { NULL }, 1717, "udp" }, - { "h323gatedisc", { NULL }, 1718, "tcp" }, - { "h323gatedisc", { NULL }, 1718, "udp" }, - { "h323gatestat", { NULL }, 1719, "tcp" }, - { "h323gatestat", { NULL }, 1719, "udp" }, - { "h323hostcall", { NULL }, 1720, "tcp" }, - { "h323hostcall", { NULL }, 1720, "udp" }, - { "caicci", { NULL }, 1721, "tcp" }, - { "caicci", { NULL }, 1721, "udp" }, - { "hks-lm", { NULL }, 1722, "tcp" }, - { "hks-lm", { NULL }, 1722, "udp" }, - { "pptp", { NULL }, 1723, "tcp" }, - { "pptp", { NULL }, 1723, "udp" }, - { "csbphonemaster", { NULL }, 1724, "tcp" }, - { "csbphonemaster", { NULL }, 1724, "udp" }, - { "iden-ralp", { NULL }, 1725, "tcp" }, - { "iden-ralp", { NULL }, 1725, "udp" }, - { "iberiagames", { NULL }, 1726, "tcp" }, - { "iberiagames", { NULL }, 1726, "udp" }, - { "winddx", { NULL }, 1727, "tcp" }, - { "winddx", { NULL }, 1727, "udp" }, - { "telindus", { NULL }, 1728, "tcp" }, - { "telindus", { NULL }, 1728, "udp" }, - { "citynl", { NULL }, 1729, "tcp" }, - { "citynl", { NULL }, 1729, "udp" }, - { "roketz", { NULL }, 1730, "tcp" }, - { "roketz", { NULL }, 1730, "udp" }, - { "msiccp", { NULL }, 1731, "tcp" }, - { "msiccp", { NULL }, 1731, "udp" }, - { "proxim", { NULL }, 1732, "tcp" }, - { "proxim", { NULL }, 1732, "udp" }, - { "siipat", { NULL }, 1733, "tcp" }, - { "siipat", { NULL }, 1733, "udp" }, - { "cambertx-lm", { NULL }, 1734, "tcp" }, - { "cambertx-lm", { NULL }, 1734, "udp" }, - { "privatechat", { NULL }, 1735, "tcp" }, - { "privatechat", { NULL }, 1735, "udp" }, - { "street-stream", { NULL }, 1736, "tcp" }, - { "street-stream", { NULL }, 1736, "udp" }, - { "ultimad", { NULL }, 1737, "tcp" }, - { "ultimad", { NULL }, 1737, "udp" }, - { "gamegen1", { NULL }, 1738, "tcp" }, - { "gamegen1", { NULL }, 1738, "udp" }, - { "webaccess", { NULL }, 1739, "tcp" }, - { "webaccess", { NULL }, 1739, "udp" }, - { "encore", { NULL }, 1740, "tcp" }, - { "encore", { NULL }, 1740, "udp" }, - { "cisco-net-mgmt", { NULL }, 1741, "tcp" }, - { "cisco-net-mgmt", { NULL }, 1741, "udp" }, - { "3Com-nsd", { NULL }, 1742, "tcp" }, - { "3Com-nsd", { NULL }, 1742, "udp" }, - { "cinegrfx-lm", { NULL }, 1743, "tcp" }, - { "cinegrfx-lm", { NULL }, 1743, "udp" }, - { "ncpm-ft", { NULL }, 1744, "tcp" }, - { "ncpm-ft", { NULL }, 1744, "udp" }, - { "remote-winsock", { NULL }, 1745, "tcp" }, - { "remote-winsock", { NULL }, 1745, "udp" }, - { "ftrapid-1", { NULL }, 1746, "tcp" }, - { "ftrapid-1", { NULL }, 1746, "udp" }, - { "ftrapid-2", { NULL }, 1747, "tcp" }, - { "ftrapid-2", { NULL }, 1747, "udp" }, - { "oracle-em1", { NULL }, 1748, "tcp" }, - { "oracle-em1", { NULL }, 1748, "udp" }, - { "aspen-services", { NULL }, 1749, "tcp" }, - { "aspen-services", { NULL }, 1749, "udp" }, - { "sslp", { NULL }, 1750, "tcp" }, - { "sslp", { NULL }, 1750, "udp" }, - { "swiftnet", { NULL }, 1751, "tcp" }, - { "swiftnet", { NULL }, 1751, "udp" }, - { "lofr-lm", { NULL }, 1752, "tcp" }, - { "lofr-lm", { NULL }, 1752, "udp" }, - { "oracle-em2", { NULL }, 1754, "tcp" }, - { "oracle-em2", { NULL }, 1754, "udp" }, - { "ms-streaming", { NULL }, 1755, "tcp" }, - { "ms-streaming", { NULL }, 1755, "udp" }, - { "capfast-lmd", { NULL }, 1756, "tcp" }, - { "capfast-lmd", { NULL }, 1756, "udp" }, - { "cnhrp", { NULL }, 1757, "tcp" }, - { "cnhrp", { NULL }, 1757, "udp" }, - { "tftp-mcast", { NULL }, 1758, "tcp" }, - { "tftp-mcast", { NULL }, 1758, "udp" }, - { "spss-lm", { NULL }, 1759, "tcp" }, - { "spss-lm", { NULL }, 1759, "udp" }, - { "www-ldap-gw", { NULL }, 1760, "tcp" }, - { "www-ldap-gw", { NULL }, 1760, "udp" }, - { "cft-0", { NULL }, 1761, "tcp" }, - { "cft-0", { NULL }, 1761, "udp" }, - { "cft-1", { NULL }, 1762, "tcp" }, - { "cft-1", { NULL }, 1762, "udp" }, - { "cft-2", { NULL }, 1763, "tcp" }, - { "cft-2", { NULL }, 1763, "udp" }, - { "cft-3", { NULL }, 1764, "tcp" }, - { "cft-3", { NULL }, 1764, "udp" }, - { "cft-4", { NULL }, 1765, "tcp" }, - { "cft-4", { NULL }, 1765, "udp" }, - { "cft-5", { NULL }, 1766, "tcp" }, - { "cft-5", { NULL }, 1766, "udp" }, - { "cft-6", { NULL }, 1767, "tcp" }, - { "cft-6", { NULL }, 1767, "udp" }, - { "cft-7", { NULL }, 1768, "tcp" }, - { "cft-7", { NULL }, 1768, "udp" }, - { "bmc-net-adm", { NULL }, 1769, "tcp" }, - { "bmc-net-adm", { NULL }, 1769, "udp" }, - { "bmc-net-svc", { NULL }, 1770, "tcp" }, - { "bmc-net-svc", { NULL }, 1770, "udp" }, - { "vaultbase", { NULL }, 1771, "tcp" }, - { "vaultbase", { NULL }, 1771, "udp" }, - { "essweb-gw", { NULL }, 1772, "tcp" }, - { "essweb-gw", { NULL }, 1772, "udp" }, - { "kmscontrol", { NULL }, 1773, "tcp" }, - { "kmscontrol", { NULL }, 1773, "udp" }, - { "global-dtserv", { NULL }, 1774, "tcp" }, - { "global-dtserv", { NULL }, 1774, "udp" }, - { "femis", { NULL }, 1776, "tcp" }, - { "femis", { NULL }, 1776, "udp" }, - { "powerguardian", { NULL }, 1777, "tcp" }, - { "powerguardian", { NULL }, 1777, "udp" }, - { "prodigy-intrnet", { NULL }, 1778, "tcp" }, - { "prodigy-intrnet", { NULL }, 1778, "udp" }, - { "pharmasoft", { NULL }, 1779, "tcp" }, - { "pharmasoft", { NULL }, 1779, "udp" }, - { "dpkeyserv", { NULL }, 1780, "tcp" }, - { "dpkeyserv", { NULL }, 1780, "udp" }, - { "answersoft-lm", { NULL }, 1781, "tcp" }, - { "answersoft-lm", { NULL }, 1781, "udp" }, - { "hp-hcip", { NULL }, 1782, "tcp" }, - { "hp-hcip", { NULL }, 1782, "udp" }, - { "finle-lm", { NULL }, 1784, "tcp" }, - { "finle-lm", { NULL }, 1784, "udp" }, - { "windlm", { NULL }, 1785, "tcp" }, - { "windlm", { NULL }, 1785, "udp" }, - { "funk-logger", { NULL }, 1786, "tcp" }, - { "funk-logger", { NULL }, 1786, "udp" }, - { "funk-license", { NULL }, 1787, "tcp" }, - { "funk-license", { NULL }, 1787, "udp" }, - { "psmond", { NULL }, 1788, "tcp" }, - { "psmond", { NULL }, 1788, "udp" }, - { "hello", { NULL }, 1789, "tcp" }, - { "hello", { NULL }, 1789, "udp" }, - { "nmsp", { NULL }, 1790, "tcp" }, - { "nmsp", { NULL }, 1790, "udp" }, - { "ea1", { NULL }, 1791, "tcp" }, - { "ea1", { NULL }, 1791, "udp" }, - { "ibm-dt-2", { NULL }, 1792, "tcp" }, - { "ibm-dt-2", { NULL }, 1792, "udp" }, - { "rsc-robot", { NULL }, 1793, "tcp" }, - { "rsc-robot", { NULL }, 1793, "udp" }, - { "cera-bcm", { NULL }, 1794, "tcp" }, - { "cera-bcm", { NULL }, 1794, "udp" }, - { "dpi-proxy", { NULL }, 1795, "tcp" }, - { "dpi-proxy", { NULL }, 1795, "udp" }, - { "vocaltec-admin", { NULL }, 1796, "tcp" }, - { "vocaltec-admin", { NULL }, 1796, "udp" }, - { "uma", { NULL }, 1797, "tcp" }, - { "uma", { NULL }, 1797, "udp" }, - { "etp", { NULL }, 1798, "tcp" }, - { "etp", { NULL }, 1798, "udp" }, - { "netrisk", { NULL }, 1799, "tcp" }, - { "netrisk", { NULL }, 1799, "udp" }, - { "ansys-lm", { NULL }, 1800, "tcp" }, - { "ansys-lm", { NULL }, 1800, "udp" }, - { "msmq", { NULL }, 1801, "tcp" }, - { "msmq", { NULL }, 1801, "udp" }, - { "concomp1", { NULL }, 1802, "tcp" }, - { "concomp1", { NULL }, 1802, "udp" }, - { "hp-hcip-gwy", { NULL }, 1803, "tcp" }, - { "hp-hcip-gwy", { NULL }, 1803, "udp" }, - { "enl", { NULL }, 1804, "tcp" }, - { "enl", { NULL }, 1804, "udp" }, - { "enl-name", { NULL }, 1805, "tcp" }, - { "enl-name", { NULL }, 1805, "udp" }, - { "musiconline", { NULL }, 1806, "tcp" }, - { "musiconline", { NULL }, 1806, "udp" }, - { "fhsp", { NULL }, 1807, "tcp" }, - { "fhsp", { NULL }, 1807, "udp" }, - { "oracle-vp2", { NULL }, 1808, "tcp" }, - { "oracle-vp2", { NULL }, 1808, "udp" }, - { "oracle-vp1", { NULL }, 1809, "tcp" }, - { "oracle-vp1", { NULL }, 1809, "udp" }, - { "jerand-lm", { NULL }, 1810, "tcp" }, - { "jerand-lm", { NULL }, 1810, "udp" }, - { "scientia-sdb", { NULL }, 1811, "tcp" }, - { "scientia-sdb", { NULL }, 1811, "udp" }, - { "radius", { NULL }, 1812, "tcp" }, - { "radius", { NULL }, 1812, "udp" }, - { "radius-acct", { NULL }, 1813, "tcp" }, - { "radius-acct", { NULL }, 1813, "udp" }, - { "tdp-suite", { NULL }, 1814, "tcp" }, - { "tdp-suite", { NULL }, 1814, "udp" }, - { "mmpft", { NULL }, 1815, "tcp" }, - { "mmpft", { NULL }, 1815, "udp" }, - { "harp", { NULL }, 1816, "tcp" }, - { "harp", { NULL }, 1816, "udp" }, - { "rkb-oscs", { NULL }, 1817, "tcp" }, - { "rkb-oscs", { NULL }, 1817, "udp" }, - { "etftp", { NULL }, 1818, "tcp" }, - { "etftp", { NULL }, 1818, "udp" }, - { "plato-lm", { NULL }, 1819, "tcp" }, - { "plato-lm", { NULL }, 1819, "udp" }, - { "mcagent", { NULL }, 1820, "tcp" }, - { "mcagent", { NULL }, 1820, "udp" }, - { "donnyworld", { NULL }, 1821, "tcp" }, - { "donnyworld", { NULL }, 1821, "udp" }, - { "es-elmd", { NULL }, 1822, "tcp" }, - { "es-elmd", { NULL }, 1822, "udp" }, - { "unisys-lm", { NULL }, 1823, "tcp" }, - { "unisys-lm", { NULL }, 1823, "udp" }, - { "metrics-pas", { NULL }, 1824, "tcp" }, - { "metrics-pas", { NULL }, 1824, "udp" }, - { "direcpc-video", { NULL }, 1825, "tcp" }, - { "direcpc-video", { NULL }, 1825, "udp" }, - { "ardt", { NULL }, 1826, "tcp" }, - { "ardt", { NULL }, 1826, "udp" }, - { "asi", { NULL }, 1827, "tcp" }, - { "asi", { NULL }, 1827, "udp" }, - { "itm-mcell-u", { NULL }, 1828, "tcp" }, - { "itm-mcell-u", { NULL }, 1828, "udp" }, - { "optika-emedia", { NULL }, 1829, "tcp" }, - { "optika-emedia", { NULL }, 1829, "udp" }, - { "net8-cman", { NULL }, 1830, "tcp" }, - { "net8-cman", { NULL }, 1830, "udp" }, - { "myrtle", { NULL }, 1831, "tcp" }, - { "myrtle", { NULL }, 1831, "udp" }, - { "tht-treasure", { NULL }, 1832, "tcp" }, - { "tht-treasure", { NULL }, 1832, "udp" }, - { "udpradio", { NULL }, 1833, "tcp" }, - { "udpradio", { NULL }, 1833, "udp" }, - { "ardusuni", { NULL }, 1834, "tcp" }, - { "ardusuni", { NULL }, 1834, "udp" }, - { "ardusmul", { NULL }, 1835, "tcp" }, - { "ardusmul", { NULL }, 1835, "udp" }, - { "ste-smsc", { NULL }, 1836, "tcp" }, - { "ste-smsc", { NULL }, 1836, "udp" }, - { "csoft1", { NULL }, 1837, "tcp" }, - { "csoft1", { NULL }, 1837, "udp" }, - { "talnet", { NULL }, 1838, "tcp" }, - { "talnet", { NULL }, 1838, "udp" }, - { "netopia-vo1", { NULL }, 1839, "tcp" }, - { "netopia-vo1", { NULL }, 1839, "udp" }, - { "netopia-vo2", { NULL }, 1840, "tcp" }, - { "netopia-vo2", { NULL }, 1840, "udp" }, - { "netopia-vo3", { NULL }, 1841, "tcp" }, - { "netopia-vo3", { NULL }, 1841, "udp" }, - { "netopia-vo4", { NULL }, 1842, "tcp" }, - { "netopia-vo4", { NULL }, 1842, "udp" }, - { "netopia-vo5", { NULL }, 1843, "tcp" }, - { "netopia-vo5", { NULL }, 1843, "udp" }, - { "direcpc-dll", { NULL }, 1844, "tcp" }, - { "direcpc-dll", { NULL }, 1844, "udp" }, - { "altalink", { NULL }, 1845, "tcp" }, - { "altalink", { NULL }, 1845, "udp" }, - { "tunstall-pnc", { NULL }, 1846, "tcp" }, - { "tunstall-pnc", { NULL }, 1846, "udp" }, - { "slp-notify", { NULL }, 1847, "tcp" }, - { "slp-notify", { NULL }, 1847, "udp" }, - { "fjdocdist", { NULL }, 1848, "tcp" }, - { "fjdocdist", { NULL }, 1848, "udp" }, - { "alpha-sms", { NULL }, 1849, "tcp" }, - { "alpha-sms", { NULL }, 1849, "udp" }, - { "gsi", { NULL }, 1850, "tcp" }, - { "gsi", { NULL }, 1850, "udp" }, - { "ctcd", { NULL }, 1851, "tcp" }, - { "ctcd", { NULL }, 1851, "udp" }, - { "virtual-time", { NULL }, 1852, "tcp" }, - { "virtual-time", { NULL }, 1852, "udp" }, - { "vids-avtp", { NULL }, 1853, "tcp" }, - { "vids-avtp", { NULL }, 1853, "udp" }, - { "buddy-draw", { NULL }, 1854, "tcp" }, - { "buddy-draw", { NULL }, 1854, "udp" }, - { "fiorano-rtrsvc", { NULL }, 1855, "tcp" }, - { "fiorano-rtrsvc", { NULL }, 1855, "udp" }, - { "fiorano-msgsvc", { NULL }, 1856, "tcp" }, - { "fiorano-msgsvc", { NULL }, 1856, "udp" }, - { "datacaptor", { NULL }, 1857, "tcp" }, - { "datacaptor", { NULL }, 1857, "udp" }, - { "privateark", { NULL }, 1858, "tcp" }, - { "privateark", { NULL }, 1858, "udp" }, - { "gammafetchsvr", { NULL }, 1859, "tcp" }, - { "gammafetchsvr", { NULL }, 1859, "udp" }, - { "sunscalar-svc", { NULL }, 1860, "tcp" }, - { "sunscalar-svc", { NULL }, 1860, "udp" }, - { "lecroy-vicp", { NULL }, 1861, "tcp" }, - { "lecroy-vicp", { NULL }, 1861, "udp" }, - { "mysql-cm-agent", { NULL }, 1862, "tcp" }, - { "mysql-cm-agent", { NULL }, 1862, "udp" }, - { "msnp", { NULL }, 1863, "tcp" }, - { "msnp", { NULL }, 1863, "udp" }, - { "paradym-31port", { NULL }, 1864, "tcp" }, - { "paradym-31port", { NULL }, 1864, "udp" }, - { "entp", { NULL }, 1865, "tcp" }, - { "entp", { NULL }, 1865, "udp" }, - { "swrmi", { NULL }, 1866, "tcp" }, - { "swrmi", { NULL }, 1866, "udp" }, - { "udrive", { NULL }, 1867, "tcp" }, - { "udrive", { NULL }, 1867, "udp" }, - { "viziblebrowser", { NULL }, 1868, "tcp" }, - { "viziblebrowser", { NULL }, 1868, "udp" }, - { "transact", { NULL }, 1869, "tcp" }, - { "transact", { NULL }, 1869, "udp" }, - { "sunscalar-dns", { NULL }, 1870, "tcp" }, - { "sunscalar-dns", { NULL }, 1870, "udp" }, - { "canocentral0", { NULL }, 1871, "tcp" }, - { "canocentral0", { NULL }, 1871, "udp" }, - { "canocentral1", { NULL }, 1872, "tcp" }, - { "canocentral1", { NULL }, 1872, "udp" }, - { "fjmpjps", { NULL }, 1873, "tcp" }, - { "fjmpjps", { NULL }, 1873, "udp" }, - { "fjswapsnp", { NULL }, 1874, "tcp" }, - { "fjswapsnp", { NULL }, 1874, "udp" }, - { "westell-stats", { NULL }, 1875, "tcp" }, - { "westell-stats", { NULL }, 1875, "udp" }, - { "ewcappsrv", { NULL }, 1876, "tcp" }, - { "ewcappsrv", { NULL }, 1876, "udp" }, - { "hp-webqosdb", { NULL }, 1877, "tcp" }, - { "hp-webqosdb", { NULL }, 1877, "udp" }, - { "drmsmc", { NULL }, 1878, "tcp" }, - { "drmsmc", { NULL }, 1878, "udp" }, - { "nettgain-nms", { NULL }, 1879, "tcp" }, - { "nettgain-nms", { NULL }, 1879, "udp" }, - { "vsat-control", { NULL }, 1880, "tcp" }, - { "vsat-control", { NULL }, 1880, "udp" }, - { "ibm-mqseries2", { NULL }, 1881, "tcp" }, - { "ibm-mqseries2", { NULL }, 1881, "udp" }, - { "ecsqdmn", { NULL }, 1882, "tcp" }, - { "ecsqdmn", { NULL }, 1882, "udp" }, - { "ibm-mqisdp", { NULL }, 1883, "tcp" }, - { "ibm-mqisdp", { NULL }, 1883, "udp" }, - { "idmaps", { NULL }, 1884, "tcp" }, - { "idmaps", { NULL }, 1884, "udp" }, - { "vrtstrapserver", { NULL }, 1885, "tcp" }, - { "vrtstrapserver", { NULL }, 1885, "udp" }, - { "leoip", { NULL }, 1886, "tcp" }, - { "leoip", { NULL }, 1886, "udp" }, - { "filex-lport", { NULL }, 1887, "tcp" }, - { "filex-lport", { NULL }, 1887, "udp" }, - { "ncconfig", { NULL }, 1888, "tcp" }, - { "ncconfig", { NULL }, 1888, "udp" }, - { "unify-adapter", { NULL }, 1889, "tcp" }, - { "unify-adapter", { NULL }, 1889, "udp" }, - { "wilkenlistener", { NULL }, 1890, "tcp" }, - { "wilkenlistener", { NULL }, 1890, "udp" }, - { "childkey-notif", { NULL }, 1891, "tcp" }, - { "childkey-notif", { NULL }, 1891, "udp" }, - { "childkey-ctrl", { NULL }, 1892, "tcp" }, - { "childkey-ctrl", { NULL }, 1892, "udp" }, - { "elad", { NULL }, 1893, "tcp" }, - { "elad", { NULL }, 1893, "udp" }, - { "o2server-port", { NULL }, 1894, "tcp" }, - { "o2server-port", { NULL }, 1894, "udp" }, - { "b-novative-ls", { NULL }, 1896, "tcp" }, - { "b-novative-ls", { NULL }, 1896, "udp" }, - { "metaagent", { NULL }, 1897, "tcp" }, - { "metaagent", { NULL }, 1897, "udp" }, - { "cymtec-port", { NULL }, 1898, "tcp" }, - { "cymtec-port", { NULL }, 1898, "udp" }, - { "mc2studios", { NULL }, 1899, "tcp" }, - { "mc2studios", { NULL }, 1899, "udp" }, - { "ssdp", { NULL }, 1900, "tcp" }, - { "ssdp", { NULL }, 1900, "udp" }, - { "fjicl-tep-a", { NULL }, 1901, "tcp" }, - { "fjicl-tep-a", { NULL }, 1901, "udp" }, - { "fjicl-tep-b", { NULL }, 1902, "tcp" }, - { "fjicl-tep-b", { NULL }, 1902, "udp" }, - { "linkname", { NULL }, 1903, "tcp" }, - { "linkname", { NULL }, 1903, "udp" }, - { "fjicl-tep-c", { NULL }, 1904, "tcp" }, - { "fjicl-tep-c", { NULL }, 1904, "udp" }, - { "sugp", { NULL }, 1905, "tcp" }, - { "sugp", { NULL }, 1905, "udp" }, - { "tpmd", { NULL }, 1906, "tcp" }, - { "tpmd", { NULL }, 1906, "udp" }, - { "intrastar", { NULL }, 1907, "tcp" }, - { "intrastar", { NULL }, 1907, "udp" }, - { "dawn", { NULL }, 1908, "tcp" }, - { "dawn", { NULL }, 1908, "udp" }, - { "global-wlink", { NULL }, 1909, "tcp" }, - { "global-wlink", { NULL }, 1909, "udp" }, - { "ultrabac", { NULL }, 1910, "tcp" }, - { "ultrabac", { NULL }, 1910, "udp" }, - { "mtp", { NULL }, 1911, "tcp" }, - { "mtp", { NULL }, 1911, "udp" }, - { "rhp-iibp", { NULL }, 1912, "tcp" }, - { "rhp-iibp", { NULL }, 1912, "udp" }, - { "armadp", { NULL }, 1913, "tcp" }, - { "armadp", { NULL }, 1913, "udp" }, - { "elm-momentum", { NULL }, 1914, "tcp" }, - { "elm-momentum", { NULL }, 1914, "udp" }, - { "facelink", { NULL }, 1915, "tcp" }, - { "facelink", { NULL }, 1915, "udp" }, - { "persona", { NULL }, 1916, "tcp" }, - { "persona", { NULL }, 1916, "udp" }, - { "noagent", { NULL }, 1917, "tcp" }, - { "noagent", { NULL }, 1917, "udp" }, - { "can-nds", { NULL }, 1918, "tcp" }, - { "can-nds", { NULL }, 1918, "udp" }, - { "can-dch", { NULL }, 1919, "tcp" }, - { "can-dch", { NULL }, 1919, "udp" }, - { "can-ferret", { NULL }, 1920, "tcp" }, - { "can-ferret", { NULL }, 1920, "udp" }, - { "noadmin", { NULL }, 1921, "tcp" }, - { "noadmin", { NULL }, 1921, "udp" }, - { "tapestry", { NULL }, 1922, "tcp" }, - { "tapestry", { NULL }, 1922, "udp" }, - { "spice", { NULL }, 1923, "tcp" }, - { "spice", { NULL }, 1923, "udp" }, - { "xiip", { NULL }, 1924, "tcp" }, - { "xiip", { NULL }, 1924, "udp" }, - { "discovery-port", { NULL }, 1925, "tcp" }, - { "discovery-port", { NULL }, 1925, "udp" }, - { "egs", { NULL }, 1926, "tcp" }, - { "egs", { NULL }, 1926, "udp" }, - { "videte-cipc", { NULL }, 1927, "tcp" }, - { "videte-cipc", { NULL }, 1927, "udp" }, - { "emsd-port", { NULL }, 1928, "tcp" }, - { "emsd-port", { NULL }, 1928, "udp" }, - { "bandwiz-system", { NULL }, 1929, "tcp" }, - { "bandwiz-system", { NULL }, 1929, "udp" }, - { "driveappserver", { NULL }, 1930, "tcp" }, - { "driveappserver", { NULL }, 1930, "udp" }, - { "amdsched", { NULL }, 1931, "tcp" }, - { "amdsched", { NULL }, 1931, "udp" }, - { "ctt-broker", { NULL }, 1932, "tcp" }, - { "ctt-broker", { NULL }, 1932, "udp" }, - { "xmapi", { NULL }, 1933, "tcp" }, - { "xmapi", { NULL }, 1933, "udp" }, - { "xaapi", { NULL }, 1934, "tcp" }, - { "xaapi", { NULL }, 1934, "udp" }, - { "macromedia-fcs", { NULL }, 1935, "tcp" }, - { "macromedia-fcs", { NULL }, 1935, "udp" }, - { "jetcmeserver", { NULL }, 1936, "tcp" }, - { "jetcmeserver", { NULL }, 1936, "udp" }, - { "jwserver", { NULL }, 1937, "tcp" }, - { "jwserver", { NULL }, 1937, "udp" }, - { "jwclient", { NULL }, 1938, "tcp" }, - { "jwclient", { NULL }, 1938, "udp" }, - { "jvserver", { NULL }, 1939, "tcp" }, - { "jvserver", { NULL }, 1939, "udp" }, - { "jvclient", { NULL }, 1940, "tcp" }, - { "jvclient", { NULL }, 1940, "udp" }, - { "dic-aida", { NULL }, 1941, "tcp" }, - { "dic-aida", { NULL }, 1941, "udp" }, - { "res", { NULL }, 1942, "tcp" }, - { "res", { NULL }, 1942, "udp" }, - { "beeyond-media", { NULL }, 1943, "tcp" }, - { "beeyond-media", { NULL }, 1943, "udp" }, - { "close-combat", { NULL }, 1944, "tcp" }, - { "close-combat", { NULL }, 1944, "udp" }, - { "dialogic-elmd", { NULL }, 1945, "tcp" }, - { "dialogic-elmd", { NULL }, 1945, "udp" }, - { "tekpls", { NULL }, 1946, "tcp" }, - { "tekpls", { NULL }, 1946, "udp" }, - { "sentinelsrm", { NULL }, 1947, "tcp" }, - { "sentinelsrm", { NULL }, 1947, "udp" }, - { "eye2eye", { NULL }, 1948, "tcp" }, - { "eye2eye", { NULL }, 1948, "udp" }, - { "ismaeasdaqlive", { NULL }, 1949, "tcp" }, - { "ismaeasdaqlive", { NULL }, 1949, "udp" }, - { "ismaeasdaqtest", { NULL }, 1950, "tcp" }, - { "ismaeasdaqtest", { NULL }, 1950, "udp" }, - { "bcs-lmserver", { NULL }, 1951, "tcp" }, - { "bcs-lmserver", { NULL }, 1951, "udp" }, - { "mpnjsc", { NULL }, 1952, "tcp" }, - { "mpnjsc", { NULL }, 1952, "udp" }, - { "rapidbase", { NULL }, 1953, "tcp" }, - { "rapidbase", { NULL }, 1953, "udp" }, - { "abr-api", { NULL }, 1954, "tcp" }, - { "abr-api", { NULL }, 1954, "udp" }, - { "abr-secure", { NULL }, 1955, "tcp" }, - { "abr-secure", { NULL }, 1955, "udp" }, - { "vrtl-vmf-ds", { NULL }, 1956, "tcp" }, - { "vrtl-vmf-ds", { NULL }, 1956, "udp" }, - { "unix-status", { NULL }, 1957, "tcp" }, - { "unix-status", { NULL }, 1957, "udp" }, - { "dxadmind", { NULL }, 1958, "tcp" }, - { "dxadmind", { NULL }, 1958, "udp" }, - { "simp-all", { NULL }, 1959, "tcp" }, - { "simp-all", { NULL }, 1959, "udp" }, - { "nasmanager", { NULL }, 1960, "tcp" }, - { "nasmanager", { NULL }, 1960, "udp" }, - { "bts-appserver", { NULL }, 1961, "tcp" }, - { "bts-appserver", { NULL }, 1961, "udp" }, - { "biap-mp", { NULL }, 1962, "tcp" }, - { "biap-mp", { NULL }, 1962, "udp" }, - { "webmachine", { NULL }, 1963, "tcp" }, - { "webmachine", { NULL }, 1963, "udp" }, - { "solid-e-engine", { NULL }, 1964, "tcp" }, - { "solid-e-engine", { NULL }, 1964, "udp" }, - { "tivoli-npm", { NULL }, 1965, "tcp" }, - { "tivoli-npm", { NULL }, 1965, "udp" }, - { "slush", { NULL }, 1966, "tcp" }, - { "slush", { NULL }, 1966, "udp" }, - { "sns-quote", { NULL }, 1967, "tcp" }, - { "sns-quote", { NULL }, 1967, "udp" }, - { "lipsinc", { NULL }, 1968, "tcp" }, - { "lipsinc", { NULL }, 1968, "udp" }, - { "lipsinc1", { NULL }, 1969, "tcp" }, - { "lipsinc1", { NULL }, 1969, "udp" }, - { "netop-rc", { NULL }, 1970, "tcp" }, - { "netop-rc", { NULL }, 1970, "udp" }, - { "netop-school", { NULL }, 1971, "tcp" }, - { "netop-school", { NULL }, 1971, "udp" }, - { "intersys-cache", { NULL }, 1972, "tcp" }, - { "intersys-cache", { NULL }, 1972, "udp" }, - { "dlsrap", { NULL }, 1973, "tcp" }, - { "dlsrap", { NULL }, 1973, "udp" }, - { "drp", { NULL }, 1974, "tcp" }, - { "drp", { NULL }, 1974, "udp" }, - { "tcoflashagent", { NULL }, 1975, "tcp" }, - { "tcoflashagent", { NULL }, 1975, "udp" }, - { "tcoregagent", { NULL }, 1976, "tcp" }, - { "tcoregagent", { NULL }, 1976, "udp" }, - { "tcoaddressbook", { NULL }, 1977, "tcp" }, - { "tcoaddressbook", { NULL }, 1977, "udp" }, - { "unisql", { NULL }, 1978, "tcp" }, - { "unisql", { NULL }, 1978, "udp" }, - { "unisql-java", { NULL }, 1979, "tcp" }, - { "unisql-java", { NULL }, 1979, "udp" }, - { "pearldoc-xact", { NULL }, 1980, "tcp" }, - { "pearldoc-xact", { NULL }, 1980, "udp" }, - { "p2pq", { NULL }, 1981, "tcp" }, - { "p2pq", { NULL }, 1981, "udp" }, - { "estamp", { NULL }, 1982, "tcp" }, - { "estamp", { NULL }, 1982, "udp" }, - { "lhtp", { NULL }, 1983, "tcp" }, - { "lhtp", { NULL }, 1983, "udp" }, - { "bb", { NULL }, 1984, "tcp" }, - { "bb", { NULL }, 1984, "udp" }, - { "hsrp", { NULL }, 1985, "tcp" }, - { "hsrp", { NULL }, 1985, "udp" }, - { "licensedaemon", { NULL }, 1986, "tcp" }, - { "licensedaemon", { NULL }, 1986, "udp" }, - { "tr-rsrb-p1", { NULL }, 1987, "tcp" }, - { "tr-rsrb-p1", { NULL }, 1987, "udp" }, - { "tr-rsrb-p2", { NULL }, 1988, "tcp" }, - { "tr-rsrb-p2", { NULL }, 1988, "udp" }, - { "tr-rsrb-p3", { NULL }, 1989, "tcp" }, - { "tr-rsrb-p3", { NULL }, 1989, "udp" }, - { "mshnet", { NULL }, 1989, "tcp" }, - { "mshnet", { NULL }, 1989, "udp" }, - { "stun-p1", { NULL }, 1990, "tcp" }, - { "stun-p1", { NULL }, 1990, "udp" }, - { "stun-p2", { NULL }, 1991, "tcp" }, - { "stun-p2", { NULL }, 1991, "udp" }, - { "stun-p3", { NULL }, 1992, "tcp" }, - { "stun-p3", { NULL }, 1992, "udp" }, - { "ipsendmsg", { NULL }, 1992, "tcp" }, - { "ipsendmsg", { NULL }, 1992, "udp" }, - { "snmp-tcp-port", { NULL }, 1993, "tcp" }, - { "snmp-tcp-port", { NULL }, 1993, "udp" }, - { "stun-port", { NULL }, 1994, "tcp" }, - { "stun-port", { NULL }, 1994, "udp" }, - { "perf-port", { NULL }, 1995, "tcp" }, - { "perf-port", { NULL }, 1995, "udp" }, - { "tr-rsrb-port", { NULL }, 1996, "tcp" }, - { "tr-rsrb-port", { NULL }, 1996, "udp" }, - { "gdp-port", { NULL }, 1997, "tcp" }, - { "gdp-port", { NULL }, 1997, "udp" }, - { "x25-svc-port", { NULL }, 1998, "tcp" }, - { "x25-svc-port", { NULL }, 1998, "udp" }, - { "tcp-id-port", { NULL }, 1999, "tcp" }, - { "tcp-id-port", { NULL }, 1999, "udp" }, - { "cisco-sccp", { NULL }, 2000, "tcp" }, - { "cisco-sccp", { NULL }, 2000, "udp" }, - { "dc", { NULL }, 2001, "tcp" }, - { "wizard", { NULL }, 2001, "udp" }, - { "globe", { NULL }, 2002, "tcp" }, - { "globe", { NULL }, 2002, "udp" }, - { "brutus", { NULL }, 2003, "tcp" }, - { "brutus", { NULL }, 2003, "udp" }, - { "mailbox", { NULL }, 2004, "tcp" }, - { "emce", { NULL }, 2004, "udp" }, - { "berknet", { NULL }, 2005, "tcp" }, - { "oracle", { NULL }, 2005, "udp" }, - { "invokator", { NULL }, 2006, "tcp" }, - { "raid-cd", { NULL }, 2006, "udp" }, - { "dectalk", { NULL }, 2007, "tcp" }, - { "raid-am", { NULL }, 2007, "udp" }, - { "conf", { NULL }, 2008, "tcp" }, - { "terminaldb", { NULL }, 2008, "udp" }, - { "news", { NULL }, 2009, "tcp" }, - { "whosockami", { NULL }, 2009, "udp" }, - { "search", { NULL }, 2010, "tcp" }, - { "pipe_server", { NULL }, 2010, "udp" }, - { "raid-cc", { NULL }, 2011, "tcp" }, - { "servserv", { NULL }, 2011, "udp" }, - { "ttyinfo", { NULL }, 2012, "tcp" }, - { "raid-ac", { NULL }, 2012, "udp" }, - { "raid-am", { NULL }, 2013, "tcp" }, - { "raid-cd", { NULL }, 2013, "udp" }, - { "troff", { NULL }, 2014, "tcp" }, - { "raid-sf", { NULL }, 2014, "udp" }, - { "cypress", { NULL }, 2015, "tcp" }, - { "raid-cs", { NULL }, 2015, "udp" }, - { "bootserver", { NULL }, 2016, "tcp" }, - { "bootserver", { NULL }, 2016, "udp" }, - { "cypress-stat", { NULL }, 2017, "tcp" }, - { "bootclient", { NULL }, 2017, "udp" }, - { "terminaldb", { NULL }, 2018, "tcp" }, - { "rellpack", { NULL }, 2018, "udp" }, - { "whosockami", { NULL }, 2019, "tcp" }, - { "about", { NULL }, 2019, "udp" }, - { "xinupageserver", { NULL }, 2020, "tcp" }, - { "xinupageserver", { NULL }, 2020, "udp" }, - { "servexec", { NULL }, 2021, "tcp" }, - { "xinuexpansion1", { NULL }, 2021, "udp" }, - { "down", { NULL }, 2022, "tcp" }, - { "xinuexpansion2", { NULL }, 2022, "udp" }, - { "xinuexpansion3", { NULL }, 2023, "tcp" }, - { "xinuexpansion3", { NULL }, 2023, "udp" }, - { "xinuexpansion4", { NULL }, 2024, "tcp" }, - { "xinuexpansion4", { NULL }, 2024, "udp" }, - { "ellpack", { NULL }, 2025, "tcp" }, - { "xribs", { NULL }, 2025, "udp" }, - { "scrabble", { NULL }, 2026, "tcp" }, - { "scrabble", { NULL }, 2026, "udp" }, - { "shadowserver", { NULL }, 2027, "tcp" }, - { "shadowserver", { NULL }, 2027, "udp" }, - { "submitserver", { NULL }, 2028, "tcp" }, - { "submitserver", { NULL }, 2028, "udp" }, - { "hsrpv6", { NULL }, 2029, "tcp" }, - { "hsrpv6", { NULL }, 2029, "udp" }, - { "device2", { NULL }, 2030, "tcp" }, - { "device2", { NULL }, 2030, "udp" }, - { "mobrien-chat", { NULL }, 2031, "tcp" }, - { "mobrien-chat", { NULL }, 2031, "udp" }, - { "blackboard", { NULL }, 2032, "tcp" }, - { "blackboard", { NULL }, 2032, "udp" }, - { "glogger", { NULL }, 2033, "tcp" }, - { "glogger", { NULL }, 2033, "udp" }, - { "scoremgr", { NULL }, 2034, "tcp" }, - { "scoremgr", { NULL }, 2034, "udp" }, - { "imsldoc", { NULL }, 2035, "tcp" }, - { "imsldoc", { NULL }, 2035, "udp" }, - { "e-dpnet", { NULL }, 2036, "tcp" }, - { "e-dpnet", { NULL }, 2036, "udp" }, - { "applus", { NULL }, 2037, "tcp" }, - { "applus", { NULL }, 2037, "udp" }, - { "objectmanager", { NULL }, 2038, "tcp" }, - { "objectmanager", { NULL }, 2038, "udp" }, - { "prizma", { NULL }, 2039, "tcp" }, - { "prizma", { NULL }, 2039, "udp" }, - { "lam", { NULL }, 2040, "tcp" }, - { "lam", { NULL }, 2040, "udp" }, - { "interbase", { NULL }, 2041, "tcp" }, - { "interbase", { NULL }, 2041, "udp" }, - { "isis", { NULL }, 2042, "tcp" }, - { "isis", { NULL }, 2042, "udp" }, - { "isis-bcast", { NULL }, 2043, "tcp" }, - { "isis-bcast", { NULL }, 2043, "udp" }, - { "rimsl", { NULL }, 2044, "tcp" }, - { "rimsl", { NULL }, 2044, "udp" }, - { "cdfunc", { NULL }, 2045, "tcp" }, - { "cdfunc", { NULL }, 2045, "udp" }, - { "sdfunc", { NULL }, 2046, "tcp" }, - { "sdfunc", { NULL }, 2046, "udp" }, - { "dls", { NULL }, 2047, "tcp" }, - { "dls", { NULL }, 2047, "udp" }, - { "dls-monitor", { NULL }, 2048, "tcp" }, - { "dls-monitor", { NULL }, 2048, "udp" }, - { "shilp", { NULL }, 2049, "tcp" }, - { "shilp", { NULL }, 2049, "udp" }, - { "nfs", { NULL }, 2049, "tcp" }, - { "nfs", { NULL }, 2049, "udp" }, - { "nfs", { NULL }, 2049, "sctp" }, - { "av-emb-config", { NULL }, 2050, "tcp" }, - { "av-emb-config", { NULL }, 2050, "udp" }, - { "epnsdp", { NULL }, 2051, "tcp" }, - { "epnsdp", { NULL }, 2051, "udp" }, - { "clearvisn", { NULL }, 2052, "tcp" }, - { "clearvisn", { NULL }, 2052, "udp" }, - { "lot105-ds-upd", { NULL }, 2053, "tcp" }, - { "lot105-ds-upd", { NULL }, 2053, "udp" }, - { "weblogin", { NULL }, 2054, "tcp" }, - { "weblogin", { NULL }, 2054, "udp" }, - { "iop", { NULL }, 2055, "tcp" }, - { "iop", { NULL }, 2055, "udp" }, - { "omnisky", { NULL }, 2056, "tcp" }, - { "omnisky", { NULL }, 2056, "udp" }, - { "rich-cp", { NULL }, 2057, "tcp" }, - { "rich-cp", { NULL }, 2057, "udp" }, - { "newwavesearch", { NULL }, 2058, "tcp" }, - { "newwavesearch", { NULL }, 2058, "udp" }, - { "bmc-messaging", { NULL }, 2059, "tcp" }, - { "bmc-messaging", { NULL }, 2059, "udp" }, - { "teleniumdaemon", { NULL }, 2060, "tcp" }, - { "teleniumdaemon", { NULL }, 2060, "udp" }, - { "netmount", { NULL }, 2061, "tcp" }, - { "netmount", { NULL }, 2061, "udp" }, - { "icg-swp", { NULL }, 2062, "tcp" }, - { "icg-swp", { NULL }, 2062, "udp" }, - { "icg-bridge", { NULL }, 2063, "tcp" }, - { "icg-bridge", { NULL }, 2063, "udp" }, - { "icg-iprelay", { NULL }, 2064, "tcp" }, - { "icg-iprelay", { NULL }, 2064, "udp" }, - { "dlsrpn", { NULL }, 2065, "tcp" }, - { "dlsrpn", { NULL }, 2065, "udp" }, - { "aura", { NULL }, 2066, "tcp" }, - { "aura", { NULL }, 2066, "udp" }, - { "dlswpn", { NULL }, 2067, "tcp" }, - { "dlswpn", { NULL }, 2067, "udp" }, - { "avauthsrvprtcl", { NULL }, 2068, "tcp" }, - { "avauthsrvprtcl", { NULL }, 2068, "udp" }, - { "event-port", { NULL }, 2069, "tcp" }, - { "event-port", { NULL }, 2069, "udp" }, - { "ah-esp-encap", { NULL }, 2070, "tcp" }, - { "ah-esp-encap", { NULL }, 2070, "udp" }, - { "acp-port", { NULL }, 2071, "tcp" }, - { "acp-port", { NULL }, 2071, "udp" }, - { "msync", { NULL }, 2072, "tcp" }, - { "msync", { NULL }, 2072, "udp" }, - { "gxs-data-port", { NULL }, 2073, "tcp" }, - { "gxs-data-port", { NULL }, 2073, "udp" }, - { "vrtl-vmf-sa", { NULL }, 2074, "tcp" }, - { "vrtl-vmf-sa", { NULL }, 2074, "udp" }, - { "newlixengine", { NULL }, 2075, "tcp" }, - { "newlixengine", { NULL }, 2075, "udp" }, - { "newlixconfig", { NULL }, 2076, "tcp" }, - { "newlixconfig", { NULL }, 2076, "udp" }, - { "tsrmagt", { NULL }, 2077, "tcp" }, - { "tsrmagt", { NULL }, 2077, "udp" }, - { "tpcsrvr", { NULL }, 2078, "tcp" }, - { "tpcsrvr", { NULL }, 2078, "udp" }, - { "idware-router", { NULL }, 2079, "tcp" }, - { "idware-router", { NULL }, 2079, "udp" }, - { "autodesk-nlm", { NULL }, 2080, "tcp" }, - { "autodesk-nlm", { NULL }, 2080, "udp" }, - { "kme-trap-port", { NULL }, 2081, "tcp" }, - { "kme-trap-port", { NULL }, 2081, "udp" }, - { "infowave", { NULL }, 2082, "tcp" }, - { "infowave", { NULL }, 2082, "udp" }, - { "radsec", { NULL }, 2083, "tcp" }, - { "radsec", { NULL }, 2083, "udp" }, - { "sunclustergeo", { NULL }, 2084, "tcp" }, - { "sunclustergeo", { NULL }, 2084, "udp" }, - { "ada-cip", { NULL }, 2085, "tcp" }, - { "ada-cip", { NULL }, 2085, "udp" }, - { "gnunet", { NULL }, 2086, "tcp" }, - { "gnunet", { NULL }, 2086, "udp" }, - { "eli", { NULL }, 2087, "tcp" }, - { "eli", { NULL }, 2087, "udp" }, - { "ip-blf", { NULL }, 2088, "tcp" }, - { "ip-blf", { NULL }, 2088, "udp" }, - { "sep", { NULL }, 2089, "tcp" }, - { "sep", { NULL }, 2089, "udp" }, - { "lrp", { NULL }, 2090, "tcp" }, - { "lrp", { NULL }, 2090, "udp" }, - { "prp", { NULL }, 2091, "tcp" }, - { "prp", { NULL }, 2091, "udp" }, - { "descent3", { NULL }, 2092, "tcp" }, - { "descent3", { NULL }, 2092, "udp" }, - { "nbx-cc", { NULL }, 2093, "tcp" }, - { "nbx-cc", { NULL }, 2093, "udp" }, - { "nbx-au", { NULL }, 2094, "tcp" }, - { "nbx-au", { NULL }, 2094, "udp" }, - { "nbx-ser", { NULL }, 2095, "tcp" }, - { "nbx-ser", { NULL }, 2095, "udp" }, - { "nbx-dir", { NULL }, 2096, "tcp" }, - { "nbx-dir", { NULL }, 2096, "udp" }, - { "jetformpreview", { NULL }, 2097, "tcp" }, - { "jetformpreview", { NULL }, 2097, "udp" }, - { "dialog-port", { NULL }, 2098, "tcp" }, - { "dialog-port", { NULL }, 2098, "udp" }, - { "h2250-annex-g", { NULL }, 2099, "tcp" }, - { "h2250-annex-g", { NULL }, 2099, "udp" }, - { "amiganetfs", { NULL }, 2100, "tcp" }, - { "amiganetfs", { NULL }, 2100, "udp" }, - { "rtcm-sc104", { NULL }, 2101, "tcp" }, - { "rtcm-sc104", { NULL }, 2101, "udp" }, - { "zephyr-srv", { NULL }, 2102, "tcp" }, - { "zephyr-srv", { NULL }, 2102, "udp" }, - { "zephyr-clt", { NULL }, 2103, "tcp" }, - { "zephyr-clt", { NULL }, 2103, "udp" }, - { "zephyr-hm", { NULL }, 2104, "tcp" }, - { "zephyr-hm", { NULL }, 2104, "udp" }, - { "minipay", { NULL }, 2105, "tcp" }, - { "minipay", { NULL }, 2105, "udp" }, - { "mzap", { NULL }, 2106, "tcp" }, - { "mzap", { NULL }, 2106, "udp" }, - { "bintec-admin", { NULL }, 2107, "tcp" }, - { "bintec-admin", { NULL }, 2107, "udp" }, - { "comcam", { NULL }, 2108, "tcp" }, - { "comcam", { NULL }, 2108, "udp" }, - { "ergolight", { NULL }, 2109, "tcp" }, - { "ergolight", { NULL }, 2109, "udp" }, - { "umsp", { NULL }, 2110, "tcp" }, - { "umsp", { NULL }, 2110, "udp" }, - { "dsatp", { NULL }, 2111, "tcp" }, - { "dsatp", { NULL }, 2111, "udp" }, - { "idonix-metanet", { NULL }, 2112, "tcp" }, - { "idonix-metanet", { NULL }, 2112, "udp" }, - { "hsl-storm", { NULL }, 2113, "tcp" }, - { "hsl-storm", { NULL }, 2113, "udp" }, - { "newheights", { NULL }, 2114, "tcp" }, - { "newheights", { NULL }, 2114, "udp" }, - { "kdm", { NULL }, 2115, "tcp" }, - { "kdm", { NULL }, 2115, "udp" }, - { "ccowcmr", { NULL }, 2116, "tcp" }, - { "ccowcmr", { NULL }, 2116, "udp" }, - { "mentaclient", { NULL }, 2117, "tcp" }, - { "mentaclient", { NULL }, 2117, "udp" }, - { "mentaserver", { NULL }, 2118, "tcp" }, - { "mentaserver", { NULL }, 2118, "udp" }, - { "gsigatekeeper", { NULL }, 2119, "tcp" }, - { "gsigatekeeper", { NULL }, 2119, "udp" }, - { "qencp", { NULL }, 2120, "tcp" }, - { "qencp", { NULL }, 2120, "udp" }, - { "scientia-ssdb", { NULL }, 2121, "tcp" }, - { "scientia-ssdb", { NULL }, 2121, "udp" }, - { "caupc-remote", { NULL }, 2122, "tcp" }, - { "caupc-remote", { NULL }, 2122, "udp" }, - { "gtp-control", { NULL }, 2123, "tcp" }, - { "gtp-control", { NULL }, 2123, "udp" }, - { "elatelink", { NULL }, 2124, "tcp" }, - { "elatelink", { NULL }, 2124, "udp" }, - { "lockstep", { NULL }, 2125, "tcp" }, - { "lockstep", { NULL }, 2125, "udp" }, - { "pktcable-cops", { NULL }, 2126, "tcp" }, - { "pktcable-cops", { NULL }, 2126, "udp" }, - { "index-pc-wb", { NULL }, 2127, "tcp" }, - { "index-pc-wb", { NULL }, 2127, "udp" }, - { "net-steward", { NULL }, 2128, "tcp" }, - { "net-steward", { NULL }, 2128, "udp" }, - { "cs-live", { NULL }, 2129, "tcp" }, - { "cs-live", { NULL }, 2129, "udp" }, - { "xds", { NULL }, 2130, "tcp" }, - { "xds", { NULL }, 2130, "udp" }, - { "avantageb2b", { NULL }, 2131, "tcp" }, - { "avantageb2b", { NULL }, 2131, "udp" }, - { "solera-epmap", { NULL }, 2132, "tcp" }, - { "solera-epmap", { NULL }, 2132, "udp" }, - { "zymed-zpp", { NULL }, 2133, "tcp" }, - { "zymed-zpp", { NULL }, 2133, "udp" }, - { "avenue", { NULL }, 2134, "tcp" }, - { "avenue", { NULL }, 2134, "udp" }, - { "gris", { NULL }, 2135, "tcp" }, - { "gris", { NULL }, 2135, "udp" }, - { "appworxsrv", { NULL }, 2136, "tcp" }, - { "appworxsrv", { NULL }, 2136, "udp" }, - { "connect", { NULL }, 2137, "tcp" }, - { "connect", { NULL }, 2137, "udp" }, - { "unbind-cluster", { NULL }, 2138, "tcp" }, - { "unbind-cluster", { NULL }, 2138, "udp" }, - { "ias-auth", { NULL }, 2139, "tcp" }, - { "ias-auth", { NULL }, 2139, "udp" }, - { "ias-reg", { NULL }, 2140, "tcp" }, - { "ias-reg", { NULL }, 2140, "udp" }, - { "ias-admind", { NULL }, 2141, "tcp" }, - { "ias-admind", { NULL }, 2141, "udp" }, - { "tdmoip", { NULL }, 2142, "tcp" }, - { "tdmoip", { NULL }, 2142, "udp" }, - { "lv-jc", { NULL }, 2143, "tcp" }, - { "lv-jc", { NULL }, 2143, "udp" }, - { "lv-ffx", { NULL }, 2144, "tcp" }, - { "lv-ffx", { NULL }, 2144, "udp" }, - { "lv-pici", { NULL }, 2145, "tcp" }, - { "lv-pici", { NULL }, 2145, "udp" }, - { "lv-not", { NULL }, 2146, "tcp" }, - { "lv-not", { NULL }, 2146, "udp" }, - { "lv-auth", { NULL }, 2147, "tcp" }, - { "lv-auth", { NULL }, 2147, "udp" }, - { "veritas-ucl", { NULL }, 2148, "tcp" }, - { "veritas-ucl", { NULL }, 2148, "udp" }, - { "acptsys", { NULL }, 2149, "tcp" }, - { "acptsys", { NULL }, 2149, "udp" }, - { "dynamic3d", { NULL }, 2150, "tcp" }, - { "dynamic3d", { NULL }, 2150, "udp" }, - { "docent", { NULL }, 2151, "tcp" }, - { "docent", { NULL }, 2151, "udp" }, - { "gtp-user", { NULL }, 2152, "tcp" }, - { "gtp-user", { NULL }, 2152, "udp" }, - { "ctlptc", { NULL }, 2153, "tcp" }, - { "ctlptc", { NULL }, 2153, "udp" }, - { "stdptc", { NULL }, 2154, "tcp" }, - { "stdptc", { NULL }, 2154, "udp" }, - { "brdptc", { NULL }, 2155, "tcp" }, - { "brdptc", { NULL }, 2155, "udp" }, - { "trp", { NULL }, 2156, "tcp" }, - { "trp", { NULL }, 2156, "udp" }, - { "xnds", { NULL }, 2157, "tcp" }, - { "xnds", { NULL }, 2157, "udp" }, - { "touchnetplus", { NULL }, 2158, "tcp" }, - { "touchnetplus", { NULL }, 2158, "udp" }, - { "gdbremote", { NULL }, 2159, "tcp" }, - { "gdbremote", { NULL }, 2159, "udp" }, - { "apc-2160", { NULL }, 2160, "tcp" }, - { "apc-2160", { NULL }, 2160, "udp" }, - { "apc-2161", { NULL }, 2161, "tcp" }, - { "apc-2161", { NULL }, 2161, "udp" }, - { "navisphere", { NULL }, 2162, "tcp" }, - { "navisphere", { NULL }, 2162, "udp" }, - { "navisphere-sec", { NULL }, 2163, "tcp" }, - { "navisphere-sec", { NULL }, 2163, "udp" }, - { "ddns-v3", { NULL }, 2164, "tcp" }, - { "ddns-v3", { NULL }, 2164, "udp" }, - { "x-bone-api", { NULL }, 2165, "tcp" }, - { "x-bone-api", { NULL }, 2165, "udp" }, - { "iwserver", { NULL }, 2166, "tcp" }, - { "iwserver", { NULL }, 2166, "udp" }, - { "raw-serial", { NULL }, 2167, "tcp" }, - { "raw-serial", { NULL }, 2167, "udp" }, - { "easy-soft-mux", { NULL }, 2168, "tcp" }, - { "easy-soft-mux", { NULL }, 2168, "udp" }, - { "brain", { NULL }, 2169, "tcp" }, - { "brain", { NULL }, 2169, "udp" }, - { "eyetv", { NULL }, 2170, "tcp" }, - { "eyetv", { NULL }, 2170, "udp" }, - { "msfw-storage", { NULL }, 2171, "tcp" }, - { "msfw-storage", { NULL }, 2171, "udp" }, - { "msfw-s-storage", { NULL }, 2172, "tcp" }, - { "msfw-s-storage", { NULL }, 2172, "udp" }, - { "msfw-replica", { NULL }, 2173, "tcp" }, - { "msfw-replica", { NULL }, 2173, "udp" }, - { "msfw-array", { NULL }, 2174, "tcp" }, - { "msfw-array", { NULL }, 2174, "udp" }, - { "airsync", { NULL }, 2175, "tcp" }, - { "airsync", { NULL }, 2175, "udp" }, - { "rapi", { NULL }, 2176, "tcp" }, - { "rapi", { NULL }, 2176, "udp" }, - { "qwave", { NULL }, 2177, "tcp" }, - { "qwave", { NULL }, 2177, "udp" }, - { "bitspeer", { NULL }, 2178, "tcp" }, - { "bitspeer", { NULL }, 2178, "udp" }, - { "vmrdp", { NULL }, 2179, "tcp" }, - { "vmrdp", { NULL }, 2179, "udp" }, - { "mc-gt-srv", { NULL }, 2180, "tcp" }, - { "mc-gt-srv", { NULL }, 2180, "udp" }, - { "eforward", { NULL }, 2181, "tcp" }, - { "eforward", { NULL }, 2181, "udp" }, - { "cgn-stat", { NULL }, 2182, "tcp" }, - { "cgn-stat", { NULL }, 2182, "udp" }, - { "cgn-config", { NULL }, 2183, "tcp" }, - { "cgn-config", { NULL }, 2183, "udp" }, - { "nvd", { NULL }, 2184, "tcp" }, - { "nvd", { NULL }, 2184, "udp" }, - { "onbase-dds", { NULL }, 2185, "tcp" }, - { "onbase-dds", { NULL }, 2185, "udp" }, - { "gtaua", { NULL }, 2186, "tcp" }, - { "gtaua", { NULL }, 2186, "udp" }, - { "ssmc", { NULL }, 2187, "tcp" }, - { "ssmd", { NULL }, 2187, "udp" }, - { "tivoconnect", { NULL }, 2190, "tcp" }, - { "tivoconnect", { NULL }, 2190, "udp" }, - { "tvbus", { NULL }, 2191, "tcp" }, - { "tvbus", { NULL }, 2191, "udp" }, - { "asdis", { NULL }, 2192, "tcp" }, - { "asdis", { NULL }, 2192, "udp" }, - { "drwcs", { NULL }, 2193, "tcp" }, - { "drwcs", { NULL }, 2193, "udp" }, - { "mnp-exchange", { NULL }, 2197, "tcp" }, - { "mnp-exchange", { NULL }, 2197, "udp" }, - { "onehome-remote", { NULL }, 2198, "tcp" }, - { "onehome-remote", { NULL }, 2198, "udp" }, - { "onehome-help", { NULL }, 2199, "tcp" }, - { "onehome-help", { NULL }, 2199, "udp" }, - { "ici", { NULL }, 2200, "tcp" }, - { "ici", { NULL }, 2200, "udp" }, - { "ats", { NULL }, 2201, "tcp" }, - { "ats", { NULL }, 2201, "udp" }, - { "imtc-map", { NULL }, 2202, "tcp" }, - { "imtc-map", { NULL }, 2202, "udp" }, - { "b2-runtime", { NULL }, 2203, "tcp" }, - { "b2-runtime", { NULL }, 2203, "udp" }, - { "b2-license", { NULL }, 2204, "tcp" }, - { "b2-license", { NULL }, 2204, "udp" }, - { "jps", { NULL }, 2205, "tcp" }, - { "jps", { NULL }, 2205, "udp" }, - { "hpocbus", { NULL }, 2206, "tcp" }, - { "hpocbus", { NULL }, 2206, "udp" }, - { "hpssd", { NULL }, 2207, "tcp" }, - { "hpssd", { NULL }, 2207, "udp" }, - { "hpiod", { NULL }, 2208, "tcp" }, - { "hpiod", { NULL }, 2208, "udp" }, - { "rimf-ps", { NULL }, 2209, "tcp" }, - { "rimf-ps", { NULL }, 2209, "udp" }, - { "noaaport", { NULL }, 2210, "tcp" }, - { "noaaport", { NULL }, 2210, "udp" }, - { "emwin", { NULL }, 2211, "tcp" }, - { "emwin", { NULL }, 2211, "udp" }, - { "leecoposserver", { NULL }, 2212, "tcp" }, - { "leecoposserver", { NULL }, 2212, "udp" }, - { "kali", { NULL }, 2213, "tcp" }, - { "kali", { NULL }, 2213, "udp" }, - { "rpi", { NULL }, 2214, "tcp" }, - { "rpi", { NULL }, 2214, "udp" }, - { "ipcore", { NULL }, 2215, "tcp" }, - { "ipcore", { NULL }, 2215, "udp" }, - { "vtu-comms", { NULL }, 2216, "tcp" }, - { "vtu-comms", { NULL }, 2216, "udp" }, - { "gotodevice", { NULL }, 2217, "tcp" }, - { "gotodevice", { NULL }, 2217, "udp" }, - { "bounzza", { NULL }, 2218, "tcp" }, - { "bounzza", { NULL }, 2218, "udp" }, - { "netiq-ncap", { NULL }, 2219, "tcp" }, - { "netiq-ncap", { NULL }, 2219, "udp" }, - { "netiq", { NULL }, 2220, "tcp" }, - { "netiq", { NULL }, 2220, "udp" }, - { "rockwell-csp1", { NULL }, 2221, "tcp" }, - { "rockwell-csp1", { NULL }, 2221, "udp" }, - { "EtherNet/IP-1", { NULL }, 2222, "tcp" }, - { "EtherNet/IP-1", { NULL }, 2222, "udp" }, - { "rockwell-csp2", { NULL }, 2223, "tcp" }, - { "rockwell-csp2", { NULL }, 2223, "udp" }, - { "efi-mg", { NULL }, 2224, "tcp" }, - { "efi-mg", { NULL }, 2224, "udp" }, - { "rcip-itu", { NULL }, 2225, "tcp" }, - { "rcip-itu", { NULL }, 2225, "sctp" }, - { "di-drm", { NULL }, 2226, "tcp" }, - { "di-drm", { NULL }, 2226, "udp" }, - { "di-msg", { NULL }, 2227, "tcp" }, - { "di-msg", { NULL }, 2227, "udp" }, - { "ehome-ms", { NULL }, 2228, "tcp" }, - { "ehome-ms", { NULL }, 2228, "udp" }, - { "datalens", { NULL }, 2229, "tcp" }, - { "datalens", { NULL }, 2229, "udp" }, - { "queueadm", { NULL }, 2230, "tcp" }, - { "queueadm", { NULL }, 2230, "udp" }, - { "wimaxasncp", { NULL }, 2231, "tcp" }, - { "wimaxasncp", { NULL }, 2231, "udp" }, - { "ivs-video", { NULL }, 2232, "tcp" }, - { "ivs-video", { NULL }, 2232, "udp" }, - { "infocrypt", { NULL }, 2233, "tcp" }, - { "infocrypt", { NULL }, 2233, "udp" }, - { "directplay", { NULL }, 2234, "tcp" }, - { "directplay", { NULL }, 2234, "udp" }, - { "sercomm-wlink", { NULL }, 2235, "tcp" }, - { "sercomm-wlink", { NULL }, 2235, "udp" }, - { "nani", { NULL }, 2236, "tcp" }, - { "nani", { NULL }, 2236, "udp" }, - { "optech-port1-lm", { NULL }, 2237, "tcp" }, - { "optech-port1-lm", { NULL }, 2237, "udp" }, - { "aviva-sna", { NULL }, 2238, "tcp" }, - { "aviva-sna", { NULL }, 2238, "udp" }, - { "imagequery", { NULL }, 2239, "tcp" }, - { "imagequery", { NULL }, 2239, "udp" }, - { "recipe", { NULL }, 2240, "tcp" }, - { "recipe", { NULL }, 2240, "udp" }, - { "ivsd", { NULL }, 2241, "tcp" }, - { "ivsd", { NULL }, 2241, "udp" }, - { "foliocorp", { NULL }, 2242, "tcp" }, - { "foliocorp", { NULL }, 2242, "udp" }, - { "magicom", { NULL }, 2243, "tcp" }, - { "magicom", { NULL }, 2243, "udp" }, - { "nmsserver", { NULL }, 2244, "tcp" }, - { "nmsserver", { NULL }, 2244, "udp" }, - { "hao", { NULL }, 2245, "tcp" }, - { "hao", { NULL }, 2245, "udp" }, - { "pc-mta-addrmap", { NULL }, 2246, "tcp" }, - { "pc-mta-addrmap", { NULL }, 2246, "udp" }, - { "antidotemgrsvr", { NULL }, 2247, "tcp" }, - { "antidotemgrsvr", { NULL }, 2247, "udp" }, - { "ums", { NULL }, 2248, "tcp" }, - { "ums", { NULL }, 2248, "udp" }, - { "rfmp", { NULL }, 2249, "tcp" }, - { "rfmp", { NULL }, 2249, "udp" }, - { "remote-collab", { NULL }, 2250, "tcp" }, - { "remote-collab", { NULL }, 2250, "udp" }, - { "dif-port", { NULL }, 2251, "tcp" }, - { "dif-port", { NULL }, 2251, "udp" }, - { "njenet-ssl", { NULL }, 2252, "tcp" }, - { "njenet-ssl", { NULL }, 2252, "udp" }, - { "dtv-chan-req", { NULL }, 2253, "tcp" }, - { "dtv-chan-req", { NULL }, 2253, "udp" }, - { "seispoc", { NULL }, 2254, "tcp" }, - { "seispoc", { NULL }, 2254, "udp" }, - { "vrtp", { NULL }, 2255, "tcp" }, - { "vrtp", { NULL }, 2255, "udp" }, - { "pcc-mfp", { NULL }, 2256, "tcp" }, - { "pcc-mfp", { NULL }, 2256, "udp" }, - { "simple-tx-rx", { NULL }, 2257, "tcp" }, - { "simple-tx-rx", { NULL }, 2257, "udp" }, - { "rcts", { NULL }, 2258, "tcp" }, - { "rcts", { NULL }, 2258, "udp" }, - { "acd-pm", { NULL }, 2259, "tcp" }, - { "acd-pm", { NULL }, 2259, "udp" }, - { "apc-2260", { NULL }, 2260, "tcp" }, - { "apc-2260", { NULL }, 2260, "udp" }, - { "comotionmaster", { NULL }, 2261, "tcp" }, - { "comotionmaster", { NULL }, 2261, "udp" }, - { "comotionback", { NULL }, 2262, "tcp" }, - { "comotionback", { NULL }, 2262, "udp" }, - { "ecwcfg", { NULL }, 2263, "tcp" }, - { "ecwcfg", { NULL }, 2263, "udp" }, - { "apx500api-1", { NULL }, 2264, "tcp" }, - { "apx500api-1", { NULL }, 2264, "udp" }, - { "apx500api-2", { NULL }, 2265, "tcp" }, - { "apx500api-2", { NULL }, 2265, "udp" }, - { "mfserver", { NULL }, 2266, "tcp" }, - { "mfserver", { NULL }, 2266, "udp" }, - { "ontobroker", { NULL }, 2267, "tcp" }, - { "ontobroker", { NULL }, 2267, "udp" }, - { "amt", { NULL }, 2268, "tcp" }, - { "amt", { NULL }, 2268, "udp" }, - { "mikey", { NULL }, 2269, "tcp" }, - { "mikey", { NULL }, 2269, "udp" }, - { "starschool", { NULL }, 2270, "tcp" }, - { "starschool", { NULL }, 2270, "udp" }, - { "mmcals", { NULL }, 2271, "tcp" }, - { "mmcals", { NULL }, 2271, "udp" }, - { "mmcal", { NULL }, 2272, "tcp" }, - { "mmcal", { NULL }, 2272, "udp" }, - { "mysql-im", { NULL }, 2273, "tcp" }, - { "mysql-im", { NULL }, 2273, "udp" }, - { "pcttunnell", { NULL }, 2274, "tcp" }, - { "pcttunnell", { NULL }, 2274, "udp" }, - { "ibridge-data", { NULL }, 2275, "tcp" }, - { "ibridge-data", { NULL }, 2275, "udp" }, - { "ibridge-mgmt", { NULL }, 2276, "tcp" }, - { "ibridge-mgmt", { NULL }, 2276, "udp" }, - { "bluectrlproxy", { NULL }, 2277, "tcp" }, - { "bluectrlproxy", { NULL }, 2277, "udp" }, - { "s3db", { NULL }, 2278, "tcp" }, - { "s3db", { NULL }, 2278, "udp" }, - { "xmquery", { NULL }, 2279, "tcp" }, - { "xmquery", { NULL }, 2279, "udp" }, - { "lnvpoller", { NULL }, 2280, "tcp" }, - { "lnvpoller", { NULL }, 2280, "udp" }, - { "lnvconsole", { NULL }, 2281, "tcp" }, - { "lnvconsole", { NULL }, 2281, "udp" }, - { "lnvalarm", { NULL }, 2282, "tcp" }, - { "lnvalarm", { NULL }, 2282, "udp" }, - { "lnvstatus", { NULL }, 2283, "tcp" }, - { "lnvstatus", { NULL }, 2283, "udp" }, - { "lnvmaps", { NULL }, 2284, "tcp" }, - { "lnvmaps", { NULL }, 2284, "udp" }, - { "lnvmailmon", { NULL }, 2285, "tcp" }, - { "lnvmailmon", { NULL }, 2285, "udp" }, - { "nas-metering", { NULL }, 2286, "tcp" }, - { "nas-metering", { NULL }, 2286, "udp" }, - { "dna", { NULL }, 2287, "tcp" }, - { "dna", { NULL }, 2287, "udp" }, - { "netml", { NULL }, 2288, "tcp" }, - { "netml", { NULL }, 2288, "udp" }, - { "dict-lookup", { NULL }, 2289, "tcp" }, - { "dict-lookup", { NULL }, 2289, "udp" }, - { "sonus-logging", { NULL }, 2290, "tcp" }, - { "sonus-logging", { NULL }, 2290, "udp" }, - { "eapsp", { NULL }, 2291, "tcp" }, - { "eapsp", { NULL }, 2291, "udp" }, - { "mib-streaming", { NULL }, 2292, "tcp" }, - { "mib-streaming", { NULL }, 2292, "udp" }, - { "npdbgmngr", { NULL }, 2293, "tcp" }, - { "npdbgmngr", { NULL }, 2293, "udp" }, - { "konshus-lm", { NULL }, 2294, "tcp" }, - { "konshus-lm", { NULL }, 2294, "udp" }, - { "advant-lm", { NULL }, 2295, "tcp" }, - { "advant-lm", { NULL }, 2295, "udp" }, - { "theta-lm", { NULL }, 2296, "tcp" }, - { "theta-lm", { NULL }, 2296, "udp" }, - { "d2k-datamover1", { NULL }, 2297, "tcp" }, - { "d2k-datamover1", { NULL }, 2297, "udp" }, - { "d2k-datamover2", { NULL }, 2298, "tcp" }, - { "d2k-datamover2", { NULL }, 2298, "udp" }, - { "pc-telecommute", { NULL }, 2299, "tcp" }, - { "pc-telecommute", { NULL }, 2299, "udp" }, - { "cvmmon", { NULL }, 2300, "tcp" }, - { "cvmmon", { NULL }, 2300, "udp" }, - { "cpq-wbem", { NULL }, 2301, "tcp" }, - { "cpq-wbem", { NULL }, 2301, "udp" }, - { "binderysupport", { NULL }, 2302, "tcp" }, - { "binderysupport", { NULL }, 2302, "udp" }, - { "proxy-gateway", { NULL }, 2303, "tcp" }, - { "proxy-gateway", { NULL }, 2303, "udp" }, - { "attachmate-uts", { NULL }, 2304, "tcp" }, - { "attachmate-uts", { NULL }, 2304, "udp" }, - { "mt-scaleserver", { NULL }, 2305, "tcp" }, - { "mt-scaleserver", { NULL }, 2305, "udp" }, - { "tappi-boxnet", { NULL }, 2306, "tcp" }, - { "tappi-boxnet", { NULL }, 2306, "udp" }, - { "pehelp", { NULL }, 2307, "tcp" }, - { "pehelp", { NULL }, 2307, "udp" }, - { "sdhelp", { NULL }, 2308, "tcp" }, - { "sdhelp", { NULL }, 2308, "udp" }, - { "sdserver", { NULL }, 2309, "tcp" }, - { "sdserver", { NULL }, 2309, "udp" }, - { "sdclient", { NULL }, 2310, "tcp" }, - { "sdclient", { NULL }, 2310, "udp" }, - { "messageservice", { NULL }, 2311, "tcp" }, - { "messageservice", { NULL }, 2311, "udp" }, - { "wanscaler", { NULL }, 2312, "tcp" }, - { "wanscaler", { NULL }, 2312, "udp" }, - { "iapp", { NULL }, 2313, "tcp" }, - { "iapp", { NULL }, 2313, "udp" }, - { "cr-websystems", { NULL }, 2314, "tcp" }, - { "cr-websystems", { NULL }, 2314, "udp" }, - { "precise-sft", { NULL }, 2315, "tcp" }, - { "precise-sft", { NULL }, 2315, "udp" }, - { "sent-lm", { NULL }, 2316, "tcp" }, - { "sent-lm", { NULL }, 2316, "udp" }, - { "attachmate-g32", { NULL }, 2317, "tcp" }, - { "attachmate-g32", { NULL }, 2317, "udp" }, - { "cadencecontrol", { NULL }, 2318, "tcp" }, - { "cadencecontrol", { NULL }, 2318, "udp" }, - { "infolibria", { NULL }, 2319, "tcp" }, - { "infolibria", { NULL }, 2319, "udp" }, - { "siebel-ns", { NULL }, 2320, "tcp" }, - { "siebel-ns", { NULL }, 2320, "udp" }, - { "rdlap", { NULL }, 2321, "tcp" }, - { "rdlap", { NULL }, 2321, "udp" }, - { "ofsd", { NULL }, 2322, "tcp" }, - { "ofsd", { NULL }, 2322, "udp" }, - { "3d-nfsd", { NULL }, 2323, "tcp" }, - { "3d-nfsd", { NULL }, 2323, "udp" }, - { "cosmocall", { NULL }, 2324, "tcp" }, - { "cosmocall", { NULL }, 2324, "udp" }, - { "ansysli", { NULL }, 2325, "tcp" }, - { "ansysli", { NULL }, 2325, "udp" }, - { "idcp", { NULL }, 2326, "tcp" }, - { "idcp", { NULL }, 2326, "udp" }, - { "xingcsm", { NULL }, 2327, "tcp" }, - { "xingcsm", { NULL }, 2327, "udp" }, - { "netrix-sftm", { NULL }, 2328, "tcp" }, - { "netrix-sftm", { NULL }, 2328, "udp" }, - { "nvd", { NULL }, 2329, "tcp" }, - { "nvd", { NULL }, 2329, "udp" }, - { "tscchat", { NULL }, 2330, "tcp" }, - { "tscchat", { NULL }, 2330, "udp" }, - { "agentview", { NULL }, 2331, "tcp" }, - { "agentview", { NULL }, 2331, "udp" }, - { "rcc-host", { NULL }, 2332, "tcp" }, - { "rcc-host", { NULL }, 2332, "udp" }, - { "snapp", { NULL }, 2333, "tcp" }, - { "snapp", { NULL }, 2333, "udp" }, - { "ace-client", { NULL }, 2334, "tcp" }, - { "ace-client", { NULL }, 2334, "udp" }, - { "ace-proxy", { NULL }, 2335, "tcp" }, - { "ace-proxy", { NULL }, 2335, "udp" }, - { "appleugcontrol", { NULL }, 2336, "tcp" }, - { "appleugcontrol", { NULL }, 2336, "udp" }, - { "ideesrv", { NULL }, 2337, "tcp" }, - { "ideesrv", { NULL }, 2337, "udp" }, - { "norton-lambert", { NULL }, 2338, "tcp" }, - { "norton-lambert", { NULL }, 2338, "udp" }, - { "3com-webview", { NULL }, 2339, "tcp" }, - { "3com-webview", { NULL }, 2339, "udp" }, - { "wrs_registry", { NULL }, 2340, "tcp" }, - { "wrs_registry", { NULL }, 2340, "udp" }, - { "xiostatus", { NULL }, 2341, "tcp" }, - { "xiostatus", { NULL }, 2341, "udp" }, - { "manage-exec", { NULL }, 2342, "tcp" }, - { "manage-exec", { NULL }, 2342, "udp" }, - { "nati-logos", { NULL }, 2343, "tcp" }, - { "nati-logos", { NULL }, 2343, "udp" }, - { "fcmsys", { NULL }, 2344, "tcp" }, - { "fcmsys", { NULL }, 2344, "udp" }, - { "dbm", { NULL }, 2345, "tcp" }, - { "dbm", { NULL }, 2345, "udp" }, - { "redstorm_join", { NULL }, 2346, "tcp" }, - { "redstorm_join", { NULL }, 2346, "udp" }, - { "redstorm_find", { NULL }, 2347, "tcp" }, - { "redstorm_find", { NULL }, 2347, "udp" }, - { "redstorm_info", { NULL }, 2348, "tcp" }, - { "redstorm_info", { NULL }, 2348, "udp" }, - { "redstorm_diag", { NULL }, 2349, "tcp" }, - { "redstorm_diag", { NULL }, 2349, "udp" }, - { "psbserver", { NULL }, 2350, "tcp" }, - { "psbserver", { NULL }, 2350, "udp" }, - { "psrserver", { NULL }, 2351, "tcp" }, - { "psrserver", { NULL }, 2351, "udp" }, - { "pslserver", { NULL }, 2352, "tcp" }, - { "pslserver", { NULL }, 2352, "udp" }, - { "pspserver", { NULL }, 2353, "tcp" }, - { "pspserver", { NULL }, 2353, "udp" }, - { "psprserver", { NULL }, 2354, "tcp" }, - { "psprserver", { NULL }, 2354, "udp" }, - { "psdbserver", { NULL }, 2355, "tcp" }, - { "psdbserver", { NULL }, 2355, "udp" }, - { "gxtelmd", { NULL }, 2356, "tcp" }, - { "gxtelmd", { NULL }, 2356, "udp" }, - { "unihub-server", { NULL }, 2357, "tcp" }, - { "unihub-server", { NULL }, 2357, "udp" }, - { "futrix", { NULL }, 2358, "tcp" }, - { "futrix", { NULL }, 2358, "udp" }, - { "flukeserver", { NULL }, 2359, "tcp" }, - { "flukeserver", { NULL }, 2359, "udp" }, - { "nexstorindltd", { NULL }, 2360, "tcp" }, - { "nexstorindltd", { NULL }, 2360, "udp" }, - { "tl1", { NULL }, 2361, "tcp" }, - { "tl1", { NULL }, 2361, "udp" }, - { "digiman", { NULL }, 2362, "tcp" }, - { "digiman", { NULL }, 2362, "udp" }, - { "mediacntrlnfsd", { NULL }, 2363, "tcp" }, - { "mediacntrlnfsd", { NULL }, 2363, "udp" }, - { "oi-2000", { NULL }, 2364, "tcp" }, - { "oi-2000", { NULL }, 2364, "udp" }, - { "dbref", { NULL }, 2365, "tcp" }, - { "dbref", { NULL }, 2365, "udp" }, - { "qip-login", { NULL }, 2366, "tcp" }, - { "qip-login", { NULL }, 2366, "udp" }, - { "service-ctrl", { NULL }, 2367, "tcp" }, - { "service-ctrl", { NULL }, 2367, "udp" }, - { "opentable", { NULL }, 2368, "tcp" }, - { "opentable", { NULL }, 2368, "udp" }, - { "l3-hbmon", { NULL }, 2370, "tcp" }, - { "l3-hbmon", { NULL }, 2370, "udp" }, - { "worldwire", { NULL }, 2371, "tcp" }, - { "worldwire", { NULL }, 2371, "udp" }, - { "lanmessenger", { NULL }, 2372, "tcp" }, - { "lanmessenger", { NULL }, 2372, "udp" }, - { "remographlm", { NULL }, 2373, "tcp" }, - { "hydra", { NULL }, 2374, "tcp" }, - { "compaq-https", { NULL }, 2381, "tcp" }, - { "compaq-https", { NULL }, 2381, "udp" }, - { "ms-olap3", { NULL }, 2382, "tcp" }, - { "ms-olap3", { NULL }, 2382, "udp" }, - { "ms-olap4", { NULL }, 2383, "tcp" }, - { "ms-olap4", { NULL }, 2383, "udp" }, - { "sd-request", { NULL }, 2384, "tcp" }, - { "sd-capacity", { NULL }, 2384, "udp" }, - { "sd-data", { NULL }, 2385, "tcp" }, - { "sd-data", { NULL }, 2385, "udp" }, - { "virtualtape", { NULL }, 2386, "tcp" }, - { "virtualtape", { NULL }, 2386, "udp" }, - { "vsamredirector", { NULL }, 2387, "tcp" }, - { "vsamredirector", { NULL }, 2387, "udp" }, - { "mynahautostart", { NULL }, 2388, "tcp" }, - { "mynahautostart", { NULL }, 2388, "udp" }, - { "ovsessionmgr", { NULL }, 2389, "tcp" }, - { "ovsessionmgr", { NULL }, 2389, "udp" }, - { "rsmtp", { NULL }, 2390, "tcp" }, - { "rsmtp", { NULL }, 2390, "udp" }, - { "3com-net-mgmt", { NULL }, 2391, "tcp" }, - { "3com-net-mgmt", { NULL }, 2391, "udp" }, - { "tacticalauth", { NULL }, 2392, "tcp" }, - { "tacticalauth", { NULL }, 2392, "udp" }, - { "ms-olap1", { NULL }, 2393, "tcp" }, - { "ms-olap1", { NULL }, 2393, "udp" }, - { "ms-olap2", { NULL }, 2394, "tcp" }, - { "ms-olap2", { NULL }, 2394, "udp" }, - { "lan900_remote", { NULL }, 2395, "tcp" }, - { "lan900_remote", { NULL }, 2395, "udp" }, - { "wusage", { NULL }, 2396, "tcp" }, - { "wusage", { NULL }, 2396, "udp" }, - { "ncl", { NULL }, 2397, "tcp" }, - { "ncl", { NULL }, 2397, "udp" }, - { "orbiter", { NULL }, 2398, "tcp" }, - { "orbiter", { NULL }, 2398, "udp" }, - { "fmpro-fdal", { NULL }, 2399, "tcp" }, - { "fmpro-fdal", { NULL }, 2399, "udp" }, - { "opequus-server", { NULL }, 2400, "tcp" }, - { "opequus-server", { NULL }, 2400, "udp" }, - { "cvspserver", { NULL }, 2401, "tcp" }, - { "cvspserver", { NULL }, 2401, "udp" }, - { "taskmaster2000", { NULL }, 2402, "tcp" }, - { "taskmaster2000", { NULL }, 2402, "udp" }, - { "taskmaster2000", { NULL }, 2403, "tcp" }, - { "taskmaster2000", { NULL }, 2403, "udp" }, - { "iec-104", { NULL }, 2404, "tcp" }, - { "iec-104", { NULL }, 2404, "udp" }, - { "trc-netpoll", { NULL }, 2405, "tcp" }, - { "trc-netpoll", { NULL }, 2405, "udp" }, - { "jediserver", { NULL }, 2406, "tcp" }, - { "jediserver", { NULL }, 2406, "udp" }, - { "orion", { NULL }, 2407, "tcp" }, - { "orion", { NULL }, 2407, "udp" }, - { "optimanet", { NULL }, 2408, "tcp" }, - { "optimanet", { NULL }, 2408, "udp" }, - { "sns-protocol", { NULL }, 2409, "tcp" }, - { "sns-protocol", { NULL }, 2409, "udp" }, - { "vrts-registry", { NULL }, 2410, "tcp" }, - { "vrts-registry", { NULL }, 2410, "udp" }, - { "netwave-ap-mgmt", { NULL }, 2411, "tcp" }, - { "netwave-ap-mgmt", { NULL }, 2411, "udp" }, - { "cdn", { NULL }, 2412, "tcp" }, - { "cdn", { NULL }, 2412, "udp" }, - { "orion-rmi-reg", { NULL }, 2413, "tcp" }, - { "orion-rmi-reg", { NULL }, 2413, "udp" }, - { "beeyond", { NULL }, 2414, "tcp" }, - { "beeyond", { NULL }, 2414, "udp" }, - { "codima-rtp", { NULL }, 2415, "tcp" }, - { "codima-rtp", { NULL }, 2415, "udp" }, - { "rmtserver", { NULL }, 2416, "tcp" }, - { "rmtserver", { NULL }, 2416, "udp" }, - { "composit-server", { NULL }, 2417, "tcp" }, - { "composit-server", { NULL }, 2417, "udp" }, - { "cas", { NULL }, 2418, "tcp" }, - { "cas", { NULL }, 2418, "udp" }, - { "attachmate-s2s", { NULL }, 2419, "tcp" }, - { "attachmate-s2s", { NULL }, 2419, "udp" }, - { "dslremote-mgmt", { NULL }, 2420, "tcp" }, - { "dslremote-mgmt", { NULL }, 2420, "udp" }, - { "g-talk", { NULL }, 2421, "tcp" }, - { "g-talk", { NULL }, 2421, "udp" }, - { "crmsbits", { NULL }, 2422, "tcp" }, - { "crmsbits", { NULL }, 2422, "udp" }, - { "rnrp", { NULL }, 2423, "tcp" }, - { "rnrp", { NULL }, 2423, "udp" }, - { "kofax-svr", { NULL }, 2424, "tcp" }, - { "kofax-svr", { NULL }, 2424, "udp" }, - { "fjitsuappmgr", { NULL }, 2425, "tcp" }, - { "fjitsuappmgr", { NULL }, 2425, "udp" }, - { "mgcp-gateway", { NULL }, 2427, "tcp" }, - { "mgcp-gateway", { NULL }, 2427, "udp" }, - { "ott", { NULL }, 2428, "tcp" }, - { "ott", { NULL }, 2428, "udp" }, - { "ft-role", { NULL }, 2429, "tcp" }, - { "ft-role", { NULL }, 2429, "udp" }, - { "venus", { NULL }, 2430, "tcp" }, - { "venus", { NULL }, 2430, "udp" }, - { "venus-se", { NULL }, 2431, "tcp" }, - { "venus-se", { NULL }, 2431, "udp" }, - { "codasrv", { NULL }, 2432, "tcp" }, - { "codasrv", { NULL }, 2432, "udp" }, - { "codasrv-se", { NULL }, 2433, "tcp" }, - { "codasrv-se", { NULL }, 2433, "udp" }, - { "pxc-epmap", { NULL }, 2434, "tcp" }, - { "pxc-epmap", { NULL }, 2434, "udp" }, - { "optilogic", { NULL }, 2435, "tcp" }, - { "optilogic", { NULL }, 2435, "udp" }, - { "topx", { NULL }, 2436, "tcp" }, - { "topx", { NULL }, 2436, "udp" }, - { "unicontrol", { NULL }, 2437, "tcp" }, - { "unicontrol", { NULL }, 2437, "udp" }, - { "msp", { NULL }, 2438, "tcp" }, - { "msp", { NULL }, 2438, "udp" }, - { "sybasedbsynch", { NULL }, 2439, "tcp" }, - { "sybasedbsynch", { NULL }, 2439, "udp" }, - { "spearway", { NULL }, 2440, "tcp" }, - { "spearway", { NULL }, 2440, "udp" }, - { "pvsw-inet", { NULL }, 2441, "tcp" }, - { "pvsw-inet", { NULL }, 2441, "udp" }, - { "netangel", { NULL }, 2442, "tcp" }, - { "netangel", { NULL }, 2442, "udp" }, - { "powerclientcsf", { NULL }, 2443, "tcp" }, - { "powerclientcsf", { NULL }, 2443, "udp" }, - { "btpp2sectrans", { NULL }, 2444, "tcp" }, - { "btpp2sectrans", { NULL }, 2444, "udp" }, - { "dtn1", { NULL }, 2445, "tcp" }, - { "dtn1", { NULL }, 2445, "udp" }, - { "bues_service", { NULL }, 2446, "tcp" }, - { "bues_service", { NULL }, 2446, "udp" }, - { "ovwdb", { NULL }, 2447, "tcp" }, - { "ovwdb", { NULL }, 2447, "udp" }, - { "hpppssvr", { NULL }, 2448, "tcp" }, - { "hpppssvr", { NULL }, 2448, "udp" }, - { "ratl", { NULL }, 2449, "tcp" }, - { "ratl", { NULL }, 2449, "udp" }, - { "netadmin", { NULL }, 2450, "tcp" }, - { "netadmin", { NULL }, 2450, "udp" }, - { "netchat", { NULL }, 2451, "tcp" }, - { "netchat", { NULL }, 2451, "udp" }, - { "snifferclient", { NULL }, 2452, "tcp" }, - { "snifferclient", { NULL }, 2452, "udp" }, - { "madge-ltd", { NULL }, 2453, "tcp" }, - { "madge-ltd", { NULL }, 2453, "udp" }, - { "indx-dds", { NULL }, 2454, "tcp" }, - { "indx-dds", { NULL }, 2454, "udp" }, - { "wago-io-system", { NULL }, 2455, "tcp" }, - { "wago-io-system", { NULL }, 2455, "udp" }, - { "altav-remmgt", { NULL }, 2456, "tcp" }, - { "altav-remmgt", { NULL }, 2456, "udp" }, - { "rapido-ip", { NULL }, 2457, "tcp" }, - { "rapido-ip", { NULL }, 2457, "udp" }, - { "griffin", { NULL }, 2458, "tcp" }, - { "griffin", { NULL }, 2458, "udp" }, - { "community", { NULL }, 2459, "tcp" }, - { "community", { NULL }, 2459, "udp" }, - { "ms-theater", { NULL }, 2460, "tcp" }, - { "ms-theater", { NULL }, 2460, "udp" }, - { "qadmifoper", { NULL }, 2461, "tcp" }, - { "qadmifoper", { NULL }, 2461, "udp" }, - { "qadmifevent", { NULL }, 2462, "tcp" }, - { "qadmifevent", { NULL }, 2462, "udp" }, - { "lsi-raid-mgmt", { NULL }, 2463, "tcp" }, - { "lsi-raid-mgmt", { NULL }, 2463, "udp" }, - { "direcpc-si", { NULL }, 2464, "tcp" }, - { "direcpc-si", { NULL }, 2464, "udp" }, - { "lbm", { NULL }, 2465, "tcp" }, - { "lbm", { NULL }, 2465, "udp" }, - { "lbf", { NULL }, 2466, "tcp" }, - { "lbf", { NULL }, 2466, "udp" }, - { "high-criteria", { NULL }, 2467, "tcp" }, - { "high-criteria", { NULL }, 2467, "udp" }, - { "qip-msgd", { NULL }, 2468, "tcp" }, - { "qip-msgd", { NULL }, 2468, "udp" }, - { "mti-tcs-comm", { NULL }, 2469, "tcp" }, - { "mti-tcs-comm", { NULL }, 2469, "udp" }, - { "taskman-port", { NULL }, 2470, "tcp" }, - { "taskman-port", { NULL }, 2470, "udp" }, - { "seaodbc", { NULL }, 2471, "tcp" }, - { "seaodbc", { NULL }, 2471, "udp" }, - { "c3", { NULL }, 2472, "tcp" }, - { "c3", { NULL }, 2472, "udp" }, - { "aker-cdp", { NULL }, 2473, "tcp" }, - { "aker-cdp", { NULL }, 2473, "udp" }, - { "vitalanalysis", { NULL }, 2474, "tcp" }, - { "vitalanalysis", { NULL }, 2474, "udp" }, - { "ace-server", { NULL }, 2475, "tcp" }, - { "ace-server", { NULL }, 2475, "udp" }, - { "ace-svr-prop", { NULL }, 2476, "tcp" }, - { "ace-svr-prop", { NULL }, 2476, "udp" }, - { "ssm-cvs", { NULL }, 2477, "tcp" }, - { "ssm-cvs", { NULL }, 2477, "udp" }, - { "ssm-cssps", { NULL }, 2478, "tcp" }, - { "ssm-cssps", { NULL }, 2478, "udp" }, - { "ssm-els", { NULL }, 2479, "tcp" }, - { "ssm-els", { NULL }, 2479, "udp" }, - { "powerexchange", { NULL }, 2480, "tcp" }, - { "powerexchange", { NULL }, 2480, "udp" }, - { "giop", { NULL }, 2481, "tcp" }, - { "giop", { NULL }, 2481, "udp" }, - { "giop-ssl", { NULL }, 2482, "tcp" }, - { "giop-ssl", { NULL }, 2482, "udp" }, - { "ttc", { NULL }, 2483, "tcp" }, - { "ttc", { NULL }, 2483, "udp" }, - { "ttc-ssl", { NULL }, 2484, "tcp" }, - { "ttc-ssl", { NULL }, 2484, "udp" }, - { "netobjects1", { NULL }, 2485, "tcp" }, - { "netobjects1", { NULL }, 2485, "udp" }, - { "netobjects2", { NULL }, 2486, "tcp" }, - { "netobjects2", { NULL }, 2486, "udp" }, - { "pns", { NULL }, 2487, "tcp" }, - { "pns", { NULL }, 2487, "udp" }, - { "moy-corp", { NULL }, 2488, "tcp" }, - { "moy-corp", { NULL }, 2488, "udp" }, - { "tsilb", { NULL }, 2489, "tcp" }, - { "tsilb", { NULL }, 2489, "udp" }, - { "qip-qdhcp", { NULL }, 2490, "tcp" }, - { "qip-qdhcp", { NULL }, 2490, "udp" }, - { "conclave-cpp", { NULL }, 2491, "tcp" }, - { "conclave-cpp", { NULL }, 2491, "udp" }, - { "groove", { NULL }, 2492, "tcp" }, - { "groove", { NULL }, 2492, "udp" }, - { "talarian-mqs", { NULL }, 2493, "tcp" }, - { "talarian-mqs", { NULL }, 2493, "udp" }, - { "bmc-ar", { NULL }, 2494, "tcp" }, - { "bmc-ar", { NULL }, 2494, "udp" }, - { "fast-rem-serv", { NULL }, 2495, "tcp" }, - { "fast-rem-serv", { NULL }, 2495, "udp" }, - { "dirgis", { NULL }, 2496, "tcp" }, - { "dirgis", { NULL }, 2496, "udp" }, - { "quaddb", { NULL }, 2497, "tcp" }, - { "quaddb", { NULL }, 2497, "udp" }, - { "odn-castraq", { NULL }, 2498, "tcp" }, - { "odn-castraq", { NULL }, 2498, "udp" }, - { "unicontrol", { NULL }, 2499, "tcp" }, - { "unicontrol", { NULL }, 2499, "udp" }, - { "rtsserv", { NULL }, 2500, "tcp" }, - { "rtsserv", { NULL }, 2500, "udp" }, - { "rtsclient", { NULL }, 2501, "tcp" }, - { "rtsclient", { NULL }, 2501, "udp" }, - { "kentrox-prot", { NULL }, 2502, "tcp" }, - { "kentrox-prot", { NULL }, 2502, "udp" }, - { "nms-dpnss", { NULL }, 2503, "tcp" }, - { "nms-dpnss", { NULL }, 2503, "udp" }, - { "wlbs", { NULL }, 2504, "tcp" }, - { "wlbs", { NULL }, 2504, "udp" }, - { "ppcontrol", { NULL }, 2505, "tcp" }, - { "ppcontrol", { NULL }, 2505, "udp" }, - { "jbroker", { NULL }, 2506, "tcp" }, - { "jbroker", { NULL }, 2506, "udp" }, - { "spock", { NULL }, 2507, "tcp" }, - { "spock", { NULL }, 2507, "udp" }, - { "jdatastore", { NULL }, 2508, "tcp" }, - { "jdatastore", { NULL }, 2508, "udp" }, - { "fjmpss", { NULL }, 2509, "tcp" }, - { "fjmpss", { NULL }, 2509, "udp" }, - { "fjappmgrbulk", { NULL }, 2510, "tcp" }, - { "fjappmgrbulk", { NULL }, 2510, "udp" }, - { "metastorm", { NULL }, 2511, "tcp" }, - { "metastorm", { NULL }, 2511, "udp" }, - { "citrixima", { NULL }, 2512, "tcp" }, - { "citrixima", { NULL }, 2512, "udp" }, - { "citrixadmin", { NULL }, 2513, "tcp" }, - { "citrixadmin", { NULL }, 2513, "udp" }, - { "facsys-ntp", { NULL }, 2514, "tcp" }, - { "facsys-ntp", { NULL }, 2514, "udp" }, - { "facsys-router", { NULL }, 2515, "tcp" }, - { "facsys-router", { NULL }, 2515, "udp" }, - { "maincontrol", { NULL }, 2516, "tcp" }, - { "maincontrol", { NULL }, 2516, "udp" }, - { "call-sig-trans", { NULL }, 2517, "tcp" }, - { "call-sig-trans", { NULL }, 2517, "udp" }, - { "willy", { NULL }, 2518, "tcp" }, - { "willy", { NULL }, 2518, "udp" }, - { "globmsgsvc", { NULL }, 2519, "tcp" }, - { "globmsgsvc", { NULL }, 2519, "udp" }, - { "pvsw", { NULL }, 2520, "tcp" }, - { "pvsw", { NULL }, 2520, "udp" }, - { "adaptecmgr", { NULL }, 2521, "tcp" }, - { "adaptecmgr", { NULL }, 2521, "udp" }, - { "windb", { NULL }, 2522, "tcp" }, - { "windb", { NULL }, 2522, "udp" }, - { "qke-llc-v3", { NULL }, 2523, "tcp" }, - { "qke-llc-v3", { NULL }, 2523, "udp" }, - { "optiwave-lm", { NULL }, 2524, "tcp" }, - { "optiwave-lm", { NULL }, 2524, "udp" }, - { "ms-v-worlds", { NULL }, 2525, "tcp" }, - { "ms-v-worlds", { NULL }, 2525, "udp" }, - { "ema-sent-lm", { NULL }, 2526, "tcp" }, - { "ema-sent-lm", { NULL }, 2526, "udp" }, - { "iqserver", { NULL }, 2527, "tcp" }, - { "iqserver", { NULL }, 2527, "udp" }, - { "ncr_ccl", { NULL }, 2528, "tcp" }, - { "ncr_ccl", { NULL }, 2528, "udp" }, - { "utsftp", { NULL }, 2529, "tcp" }, - { "utsftp", { NULL }, 2529, "udp" }, - { "vrcommerce", { NULL }, 2530, "tcp" }, - { "vrcommerce", { NULL }, 2530, "udp" }, - { "ito-e-gui", { NULL }, 2531, "tcp" }, - { "ito-e-gui", { NULL }, 2531, "udp" }, - { "ovtopmd", { NULL }, 2532, "tcp" }, - { "ovtopmd", { NULL }, 2532, "udp" }, - { "snifferserver", { NULL }, 2533, "tcp" }, - { "snifferserver", { NULL }, 2533, "udp" }, - { "combox-web-acc", { NULL }, 2534, "tcp" }, - { "combox-web-acc", { NULL }, 2534, "udp" }, - { "madcap", { NULL }, 2535, "tcp" }, - { "madcap", { NULL }, 2535, "udp" }, - { "btpp2audctr1", { NULL }, 2536, "tcp" }, - { "btpp2audctr1", { NULL }, 2536, "udp" }, - { "upgrade", { NULL }, 2537, "tcp" }, - { "upgrade", { NULL }, 2537, "udp" }, - { "vnwk-prapi", { NULL }, 2538, "tcp" }, - { "vnwk-prapi", { NULL }, 2538, "udp" }, - { "vsiadmin", { NULL }, 2539, "tcp" }, - { "vsiadmin", { NULL }, 2539, "udp" }, - { "lonworks", { NULL }, 2540, "tcp" }, - { "lonworks", { NULL }, 2540, "udp" }, - { "lonworks2", { NULL }, 2541, "tcp" }, - { "lonworks2", { NULL }, 2541, "udp" }, - { "udrawgraph", { NULL }, 2542, "tcp" }, - { "udrawgraph", { NULL }, 2542, "udp" }, - { "reftek", { NULL }, 2543, "tcp" }, - { "reftek", { NULL }, 2543, "udp" }, - { "novell-zen", { NULL }, 2544, "tcp" }, - { "novell-zen", { NULL }, 2544, "udp" }, - { "sis-emt", { NULL }, 2545, "tcp" }, - { "sis-emt", { NULL }, 2545, "udp" }, - { "vytalvaultbrtp", { NULL }, 2546, "tcp" }, - { "vytalvaultbrtp", { NULL }, 2546, "udp" }, - { "vytalvaultvsmp", { NULL }, 2547, "tcp" }, - { "vytalvaultvsmp", { NULL }, 2547, "udp" }, - { "vytalvaultpipe", { NULL }, 2548, "tcp" }, - { "vytalvaultpipe", { NULL }, 2548, "udp" }, - { "ipass", { NULL }, 2549, "tcp" }, - { "ipass", { NULL }, 2549, "udp" }, - { "ads", { NULL }, 2550, "tcp" }, - { "ads", { NULL }, 2550, "udp" }, - { "isg-uda-server", { NULL }, 2551, "tcp" }, - { "isg-uda-server", { NULL }, 2551, "udp" }, - { "call-logging", { NULL }, 2552, "tcp" }, - { "call-logging", { NULL }, 2552, "udp" }, - { "efidiningport", { NULL }, 2553, "tcp" }, - { "efidiningport", { NULL }, 2553, "udp" }, - { "vcnet-link-v10", { NULL }, 2554, "tcp" }, - { "vcnet-link-v10", { NULL }, 2554, "udp" }, - { "compaq-wcp", { NULL }, 2555, "tcp" }, - { "compaq-wcp", { NULL }, 2555, "udp" }, - { "nicetec-nmsvc", { NULL }, 2556, "tcp" }, - { "nicetec-nmsvc", { NULL }, 2556, "udp" }, - { "nicetec-mgmt", { NULL }, 2557, "tcp" }, - { "nicetec-mgmt", { NULL }, 2557, "udp" }, - { "pclemultimedia", { NULL }, 2558, "tcp" }, - { "pclemultimedia", { NULL }, 2558, "udp" }, - { "lstp", { NULL }, 2559, "tcp" }, - { "lstp", { NULL }, 2559, "udp" }, - { "labrat", { NULL }, 2560, "tcp" }, - { "labrat", { NULL }, 2560, "udp" }, - { "mosaixcc", { NULL }, 2561, "tcp" }, - { "mosaixcc", { NULL }, 2561, "udp" }, - { "delibo", { NULL }, 2562, "tcp" }, - { "delibo", { NULL }, 2562, "udp" }, - { "cti-redwood", { NULL }, 2563, "tcp" }, - { "cti-redwood", { NULL }, 2563, "udp" }, - { "hp-3000-telnet", { NULL }, 2564, "tcp" }, - { "coord-svr", { NULL }, 2565, "tcp" }, - { "coord-svr", { NULL }, 2565, "udp" }, - { "pcs-pcw", { NULL }, 2566, "tcp" }, - { "pcs-pcw", { NULL }, 2566, "udp" }, - { "clp", { NULL }, 2567, "tcp" }, - { "clp", { NULL }, 2567, "udp" }, - { "spamtrap", { NULL }, 2568, "tcp" }, - { "spamtrap", { NULL }, 2568, "udp" }, - { "sonuscallsig", { NULL }, 2569, "tcp" }, - { "sonuscallsig", { NULL }, 2569, "udp" }, - { "hs-port", { NULL }, 2570, "tcp" }, - { "hs-port", { NULL }, 2570, "udp" }, - { "cecsvc", { NULL }, 2571, "tcp" }, - { "cecsvc", { NULL }, 2571, "udp" }, - { "ibp", { NULL }, 2572, "tcp" }, - { "ibp", { NULL }, 2572, "udp" }, - { "trustestablish", { NULL }, 2573, "tcp" }, - { "trustestablish", { NULL }, 2573, "udp" }, - { "blockade-bpsp", { NULL }, 2574, "tcp" }, - { "blockade-bpsp", { NULL }, 2574, "udp" }, - { "hl7", { NULL }, 2575, "tcp" }, - { "hl7", { NULL }, 2575, "udp" }, - { "tclprodebugger", { NULL }, 2576, "tcp" }, - { "tclprodebugger", { NULL }, 2576, "udp" }, - { "scipticslsrvr", { NULL }, 2577, "tcp" }, - { "scipticslsrvr", { NULL }, 2577, "udp" }, - { "rvs-isdn-dcp", { NULL }, 2578, "tcp" }, - { "rvs-isdn-dcp", { NULL }, 2578, "udp" }, - { "mpfoncl", { NULL }, 2579, "tcp" }, - { "mpfoncl", { NULL }, 2579, "udp" }, - { "tributary", { NULL }, 2580, "tcp" }, - { "tributary", { NULL }, 2580, "udp" }, - { "argis-te", { NULL }, 2581, "tcp" }, - { "argis-te", { NULL }, 2581, "udp" }, - { "argis-ds", { NULL }, 2582, "tcp" }, - { "argis-ds", { NULL }, 2582, "udp" }, - { "mon", { NULL }, 2583, "tcp" }, - { "mon", { NULL }, 2583, "udp" }, - { "cyaserv", { NULL }, 2584, "tcp" }, - { "cyaserv", { NULL }, 2584, "udp" }, - { "netx-server", { NULL }, 2585, "tcp" }, - { "netx-server", { NULL }, 2585, "udp" }, - { "netx-agent", { NULL }, 2586, "tcp" }, - { "netx-agent", { NULL }, 2586, "udp" }, - { "masc", { NULL }, 2587, "tcp" }, - { "masc", { NULL }, 2587, "udp" }, - { "privilege", { NULL }, 2588, "tcp" }, - { "privilege", { NULL }, 2588, "udp" }, - { "quartus-tcl", { NULL }, 2589, "tcp" }, - { "quartus-tcl", { NULL }, 2589, "udp" }, - { "idotdist", { NULL }, 2590, "tcp" }, - { "idotdist", { NULL }, 2590, "udp" }, - { "maytagshuffle", { NULL }, 2591, "tcp" }, - { "maytagshuffle", { NULL }, 2591, "udp" }, - { "netrek", { NULL }, 2592, "tcp" }, - { "netrek", { NULL }, 2592, "udp" }, - { "mns-mail", { NULL }, 2593, "tcp" }, - { "mns-mail", { NULL }, 2593, "udp" }, - { "dts", { NULL }, 2594, "tcp" }, - { "dts", { NULL }, 2594, "udp" }, - { "worldfusion1", { NULL }, 2595, "tcp" }, - { "worldfusion1", { NULL }, 2595, "udp" }, - { "worldfusion2", { NULL }, 2596, "tcp" }, - { "worldfusion2", { NULL }, 2596, "udp" }, - { "homesteadglory", { NULL }, 2597, "tcp" }, - { "homesteadglory", { NULL }, 2597, "udp" }, - { "citriximaclient", { NULL }, 2598, "tcp" }, - { "citriximaclient", { NULL }, 2598, "udp" }, - { "snapd", { NULL }, 2599, "tcp" }, - { "snapd", { NULL }, 2599, "udp" }, - { "hpstgmgr", { NULL }, 2600, "tcp" }, - { "hpstgmgr", { NULL }, 2600, "udp" }, - { "discp-client", { NULL }, 2601, "tcp" }, - { "discp-client", { NULL }, 2601, "udp" }, - { "discp-server", { NULL }, 2602, "tcp" }, - { "discp-server", { NULL }, 2602, "udp" }, - { "servicemeter", { NULL }, 2603, "tcp" }, - { "servicemeter", { NULL }, 2603, "udp" }, - { "nsc-ccs", { NULL }, 2604, "tcp" }, - { "nsc-ccs", { NULL }, 2604, "udp" }, - { "nsc-posa", { NULL }, 2605, "tcp" }, - { "nsc-posa", { NULL }, 2605, "udp" }, - { "netmon", { NULL }, 2606, "tcp" }, - { "netmon", { NULL }, 2606, "udp" }, - { "connection", { NULL }, 2607, "tcp" }, - { "connection", { NULL }, 2607, "udp" }, - { "wag-service", { NULL }, 2608, "tcp" }, - { "wag-service", { NULL }, 2608, "udp" }, - { "system-monitor", { NULL }, 2609, "tcp" }, - { "system-monitor", { NULL }, 2609, "udp" }, - { "versa-tek", { NULL }, 2610, "tcp" }, - { "versa-tek", { NULL }, 2610, "udp" }, - { "lionhead", { NULL }, 2611, "tcp" }, - { "lionhead", { NULL }, 2611, "udp" }, - { "qpasa-agent", { NULL }, 2612, "tcp" }, - { "qpasa-agent", { NULL }, 2612, "udp" }, - { "smntubootstrap", { NULL }, 2613, "tcp" }, - { "smntubootstrap", { NULL }, 2613, "udp" }, - { "neveroffline", { NULL }, 2614, "tcp" }, - { "neveroffline", { NULL }, 2614, "udp" }, - { "firepower", { NULL }, 2615, "tcp" }, - { "firepower", { NULL }, 2615, "udp" }, - { "appswitch-emp", { NULL }, 2616, "tcp" }, - { "appswitch-emp", { NULL }, 2616, "udp" }, - { "cmadmin", { NULL }, 2617, "tcp" }, - { "cmadmin", { NULL }, 2617, "udp" }, - { "priority-e-com", { NULL }, 2618, "tcp" }, - { "priority-e-com", { NULL }, 2618, "udp" }, - { "bruce", { NULL }, 2619, "tcp" }, - { "bruce", { NULL }, 2619, "udp" }, - { "lpsrecommender", { NULL }, 2620, "tcp" }, - { "lpsrecommender", { NULL }, 2620, "udp" }, - { "miles-apart", { NULL }, 2621, "tcp" }, - { "miles-apart", { NULL }, 2621, "udp" }, - { "metricadbc", { NULL }, 2622, "tcp" }, - { "metricadbc", { NULL }, 2622, "udp" }, - { "lmdp", { NULL }, 2623, "tcp" }, - { "lmdp", { NULL }, 2623, "udp" }, - { "aria", { NULL }, 2624, "tcp" }, - { "aria", { NULL }, 2624, "udp" }, - { "blwnkl-port", { NULL }, 2625, "tcp" }, - { "blwnkl-port", { NULL }, 2625, "udp" }, - { "gbjd816", { NULL }, 2626, "tcp" }, - { "gbjd816", { NULL }, 2626, "udp" }, - { "moshebeeri", { NULL }, 2627, "tcp" }, - { "moshebeeri", { NULL }, 2627, "udp" }, - { "dict", { NULL }, 2628, "tcp" }, - { "dict", { NULL }, 2628, "udp" }, - { "sitaraserver", { NULL }, 2629, "tcp" }, - { "sitaraserver", { NULL }, 2629, "udp" }, - { "sitaramgmt", { NULL }, 2630, "tcp" }, - { "sitaramgmt", { NULL }, 2630, "udp" }, - { "sitaradir", { NULL }, 2631, "tcp" }, - { "sitaradir", { NULL }, 2631, "udp" }, - { "irdg-post", { NULL }, 2632, "tcp" }, - { "irdg-post", { NULL }, 2632, "udp" }, - { "interintelli", { NULL }, 2633, "tcp" }, - { "interintelli", { NULL }, 2633, "udp" }, - { "pk-electronics", { NULL }, 2634, "tcp" }, - { "pk-electronics", { NULL }, 2634, "udp" }, - { "backburner", { NULL }, 2635, "tcp" }, - { "backburner", { NULL }, 2635, "udp" }, - { "solve", { NULL }, 2636, "tcp" }, - { "solve", { NULL }, 2636, "udp" }, - { "imdocsvc", { NULL }, 2637, "tcp" }, - { "imdocsvc", { NULL }, 2637, "udp" }, - { "sybaseanywhere", { NULL }, 2638, "tcp" }, - { "sybaseanywhere", { NULL }, 2638, "udp" }, - { "aminet", { NULL }, 2639, "tcp" }, - { "aminet", { NULL }, 2639, "udp" }, - { "sai_sentlm", { NULL }, 2640, "tcp" }, - { "sai_sentlm", { NULL }, 2640, "udp" }, - { "hdl-srv", { NULL }, 2641, "tcp" }, - { "hdl-srv", { NULL }, 2641, "udp" }, - { "tragic", { NULL }, 2642, "tcp" }, - { "tragic", { NULL }, 2642, "udp" }, - { "gte-samp", { NULL }, 2643, "tcp" }, - { "gte-samp", { NULL }, 2643, "udp" }, - { "travsoft-ipx-t", { NULL }, 2644, "tcp" }, - { "travsoft-ipx-t", { NULL }, 2644, "udp" }, - { "novell-ipx-cmd", { NULL }, 2645, "tcp" }, - { "novell-ipx-cmd", { NULL }, 2645, "udp" }, - { "and-lm", { NULL }, 2646, "tcp" }, - { "and-lm", { NULL }, 2646, "udp" }, - { "syncserver", { NULL }, 2647, "tcp" }, - { "syncserver", { NULL }, 2647, "udp" }, - { "upsnotifyprot", { NULL }, 2648, "tcp" }, - { "upsnotifyprot", { NULL }, 2648, "udp" }, - { "vpsipport", { NULL }, 2649, "tcp" }, - { "vpsipport", { NULL }, 2649, "udp" }, - { "eristwoguns", { NULL }, 2650, "tcp" }, - { "eristwoguns", { NULL }, 2650, "udp" }, - { "ebinsite", { NULL }, 2651, "tcp" }, - { "ebinsite", { NULL }, 2651, "udp" }, - { "interpathpanel", { NULL }, 2652, "tcp" }, - { "interpathpanel", { NULL }, 2652, "udp" }, - { "sonus", { NULL }, 2653, "tcp" }, - { "sonus", { NULL }, 2653, "udp" }, - { "corel_vncadmin", { NULL }, 2654, "tcp" }, - { "corel_vncadmin", { NULL }, 2654, "udp" }, - { "unglue", { NULL }, 2655, "tcp" }, - { "unglue", { NULL }, 2655, "udp" }, - { "kana", { NULL }, 2656, "tcp" }, - { "kana", { NULL }, 2656, "udp" }, - { "sns-dispatcher", { NULL }, 2657, "tcp" }, - { "sns-dispatcher", { NULL }, 2657, "udp" }, - { "sns-admin", { NULL }, 2658, "tcp" }, - { "sns-admin", { NULL }, 2658, "udp" }, - { "sns-query", { NULL }, 2659, "tcp" }, - { "sns-query", { NULL }, 2659, "udp" }, - { "gcmonitor", { NULL }, 2660, "tcp" }, - { "gcmonitor", { NULL }, 2660, "udp" }, - { "olhost", { NULL }, 2661, "tcp" }, - { "olhost", { NULL }, 2661, "udp" }, - { "bintec-capi", { NULL }, 2662, "tcp" }, - { "bintec-capi", { NULL }, 2662, "udp" }, - { "bintec-tapi", { NULL }, 2663, "tcp" }, - { "bintec-tapi", { NULL }, 2663, "udp" }, - { "patrol-mq-gm", { NULL }, 2664, "tcp" }, - { "patrol-mq-gm", { NULL }, 2664, "udp" }, - { "patrol-mq-nm", { NULL }, 2665, "tcp" }, - { "patrol-mq-nm", { NULL }, 2665, "udp" }, - { "extensis", { NULL }, 2666, "tcp" }, - { "extensis", { NULL }, 2666, "udp" }, - { "alarm-clock-s", { NULL }, 2667, "tcp" }, - { "alarm-clock-s", { NULL }, 2667, "udp" }, - { "alarm-clock-c", { NULL }, 2668, "tcp" }, - { "alarm-clock-c", { NULL }, 2668, "udp" }, - { "toad", { NULL }, 2669, "tcp" }, - { "toad", { NULL }, 2669, "udp" }, - { "tve-announce", { NULL }, 2670, "tcp" }, - { "tve-announce", { NULL }, 2670, "udp" }, - { "newlixreg", { NULL }, 2671, "tcp" }, - { "newlixreg", { NULL }, 2671, "udp" }, - { "nhserver", { NULL }, 2672, "tcp" }, - { "nhserver", { NULL }, 2672, "udp" }, - { "firstcall42", { NULL }, 2673, "tcp" }, - { "firstcall42", { NULL }, 2673, "udp" }, - { "ewnn", { NULL }, 2674, "tcp" }, - { "ewnn", { NULL }, 2674, "udp" }, - { "ttc-etap", { NULL }, 2675, "tcp" }, - { "ttc-etap", { NULL }, 2675, "udp" }, - { "simslink", { NULL }, 2676, "tcp" }, - { "simslink", { NULL }, 2676, "udp" }, - { "gadgetgate1way", { NULL }, 2677, "tcp" }, - { "gadgetgate1way", { NULL }, 2677, "udp" }, - { "gadgetgate2way", { NULL }, 2678, "tcp" }, - { "gadgetgate2way", { NULL }, 2678, "udp" }, - { "syncserverssl", { NULL }, 2679, "tcp" }, - { "syncserverssl", { NULL }, 2679, "udp" }, - { "pxc-sapxom", { NULL }, 2680, "tcp" }, - { "pxc-sapxom", { NULL }, 2680, "udp" }, - { "mpnjsomb", { NULL }, 2681, "tcp" }, - { "mpnjsomb", { NULL }, 2681, "udp" }, - { "ncdloadbalance", { NULL }, 2683, "tcp" }, - { "ncdloadbalance", { NULL }, 2683, "udp" }, - { "mpnjsosv", { NULL }, 2684, "tcp" }, - { "mpnjsosv", { NULL }, 2684, "udp" }, - { "mpnjsocl", { NULL }, 2685, "tcp" }, - { "mpnjsocl", { NULL }, 2685, "udp" }, - { "mpnjsomg", { NULL }, 2686, "tcp" }, - { "mpnjsomg", { NULL }, 2686, "udp" }, - { "pq-lic-mgmt", { NULL }, 2687, "tcp" }, - { "pq-lic-mgmt", { NULL }, 2687, "udp" }, - { "md-cg-http", { NULL }, 2688, "tcp" }, - { "md-cg-http", { NULL }, 2688, "udp" }, - { "fastlynx", { NULL }, 2689, "tcp" }, - { "fastlynx", { NULL }, 2689, "udp" }, - { "hp-nnm-data", { NULL }, 2690, "tcp" }, - { "hp-nnm-data", { NULL }, 2690, "udp" }, - { "itinternet", { NULL }, 2691, "tcp" }, - { "itinternet", { NULL }, 2691, "udp" }, - { "admins-lms", { NULL }, 2692, "tcp" }, - { "admins-lms", { NULL }, 2692, "udp" }, - { "pwrsevent", { NULL }, 2694, "tcp" }, - { "pwrsevent", { NULL }, 2694, "udp" }, - { "vspread", { NULL }, 2695, "tcp" }, - { "vspread", { NULL }, 2695, "udp" }, - { "unifyadmin", { NULL }, 2696, "tcp" }, - { "unifyadmin", { NULL }, 2696, "udp" }, - { "oce-snmp-trap", { NULL }, 2697, "tcp" }, - { "oce-snmp-trap", { NULL }, 2697, "udp" }, - { "mck-ivpip", { NULL }, 2698, "tcp" }, - { "mck-ivpip", { NULL }, 2698, "udp" }, - { "csoft-plusclnt", { NULL }, 2699, "tcp" }, - { "csoft-plusclnt", { NULL }, 2699, "udp" }, - { "tqdata", { NULL }, 2700, "tcp" }, - { "tqdata", { NULL }, 2700, "udp" }, - { "sms-rcinfo", { NULL }, 2701, "tcp" }, - { "sms-rcinfo", { NULL }, 2701, "udp" }, - { "sms-xfer", { NULL }, 2702, "tcp" }, - { "sms-xfer", { NULL }, 2702, "udp" }, - { "sms-chat", { NULL }, 2703, "tcp" }, - { "sms-chat", { NULL }, 2703, "udp" }, - { "sms-remctrl", { NULL }, 2704, "tcp" }, - { "sms-remctrl", { NULL }, 2704, "udp" }, - { "sds-admin", { NULL }, 2705, "tcp" }, - { "sds-admin", { NULL }, 2705, "udp" }, - { "ncdmirroring", { NULL }, 2706, "tcp" }, - { "ncdmirroring", { NULL }, 2706, "udp" }, - { "emcsymapiport", { NULL }, 2707, "tcp" }, - { "emcsymapiport", { NULL }, 2707, "udp" }, - { "banyan-net", { NULL }, 2708, "tcp" }, - { "banyan-net", { NULL }, 2708, "udp" }, - { "supermon", { NULL }, 2709, "tcp" }, - { "supermon", { NULL }, 2709, "udp" }, - { "sso-service", { NULL }, 2710, "tcp" }, - { "sso-service", { NULL }, 2710, "udp" }, - { "sso-control", { NULL }, 2711, "tcp" }, - { "sso-control", { NULL }, 2711, "udp" }, - { "aocp", { NULL }, 2712, "tcp" }, - { "aocp", { NULL }, 2712, "udp" }, - { "raventbs", { NULL }, 2713, "tcp" }, - { "raventbs", { NULL }, 2713, "udp" }, - { "raventdm", { NULL }, 2714, "tcp" }, - { "raventdm", { NULL }, 2714, "udp" }, - { "hpstgmgr2", { NULL }, 2715, "tcp" }, - { "hpstgmgr2", { NULL }, 2715, "udp" }, - { "inova-ip-disco", { NULL }, 2716, "tcp" }, - { "inova-ip-disco", { NULL }, 2716, "udp" }, - { "pn-requester", { NULL }, 2717, "tcp" }, - { "pn-requester", { NULL }, 2717, "udp" }, - { "pn-requester2", { NULL }, 2718, "tcp" }, - { "pn-requester2", { NULL }, 2718, "udp" }, - { "scan-change", { NULL }, 2719, "tcp" }, - { "scan-change", { NULL }, 2719, "udp" }, - { "wkars", { NULL }, 2720, "tcp" }, - { "wkars", { NULL }, 2720, "udp" }, - { "smart-diagnose", { NULL }, 2721, "tcp" }, - { "smart-diagnose", { NULL }, 2721, "udp" }, - { "proactivesrvr", { NULL }, 2722, "tcp" }, - { "proactivesrvr", { NULL }, 2722, "udp" }, - { "watchdog-nt", { NULL }, 2723, "tcp" }, - { "watchdog-nt", { NULL }, 2723, "udp" }, - { "qotps", { NULL }, 2724, "tcp" }, - { "qotps", { NULL }, 2724, "udp" }, - { "msolap-ptp2", { NULL }, 2725, "tcp" }, - { "msolap-ptp2", { NULL }, 2725, "udp" }, - { "tams", { NULL }, 2726, "tcp" }, - { "tams", { NULL }, 2726, "udp" }, - { "mgcp-callagent", { NULL }, 2727, "tcp" }, - { "mgcp-callagent", { NULL }, 2727, "udp" }, - { "sqdr", { NULL }, 2728, "tcp" }, - { "sqdr", { NULL }, 2728, "udp" }, - { "tcim-control", { NULL }, 2729, "tcp" }, - { "tcim-control", { NULL }, 2729, "udp" }, - { "nec-raidplus", { NULL }, 2730, "tcp" }, - { "nec-raidplus", { NULL }, 2730, "udp" }, - { "fyre-messanger", { NULL }, 2731, "tcp" }, - { "fyre-messanger", { NULL }, 2731, "udp" }, - { "g5m", { NULL }, 2732, "tcp" }, - { "g5m", { NULL }, 2732, "udp" }, - { "signet-ctf", { NULL }, 2733, "tcp" }, - { "signet-ctf", { NULL }, 2733, "udp" }, - { "ccs-software", { NULL }, 2734, "tcp" }, - { "ccs-software", { NULL }, 2734, "udp" }, - { "netiq-mc", { NULL }, 2735, "tcp" }, - { "netiq-mc", { NULL }, 2735, "udp" }, - { "radwiz-nms-srv", { NULL }, 2736, "tcp" }, - { "radwiz-nms-srv", { NULL }, 2736, "udp" }, - { "srp-feedback", { NULL }, 2737, "tcp" }, - { "srp-feedback", { NULL }, 2737, "udp" }, - { "ndl-tcp-ois-gw", { NULL }, 2738, "tcp" }, - { "ndl-tcp-ois-gw", { NULL }, 2738, "udp" }, - { "tn-timing", { NULL }, 2739, "tcp" }, - { "tn-timing", { NULL }, 2739, "udp" }, - { "alarm", { NULL }, 2740, "tcp" }, - { "alarm", { NULL }, 2740, "udp" }, - { "tsb", { NULL }, 2741, "tcp" }, - { "tsb", { NULL }, 2741, "udp" }, - { "tsb2", { NULL }, 2742, "tcp" }, - { "tsb2", { NULL }, 2742, "udp" }, - { "murx", { NULL }, 2743, "tcp" }, - { "murx", { NULL }, 2743, "udp" }, - { "honyaku", { NULL }, 2744, "tcp" }, - { "honyaku", { NULL }, 2744, "udp" }, - { "urbisnet", { NULL }, 2745, "tcp" }, - { "urbisnet", { NULL }, 2745, "udp" }, - { "cpudpencap", { NULL }, 2746, "tcp" }, - { "cpudpencap", { NULL }, 2746, "udp" }, - { "fjippol-swrly", { NULL }, 2747, "tcp" }, - { "fjippol-swrly", { NULL }, 2747, "udp" }, - { "fjippol-polsvr", { NULL }, 2748, "tcp" }, - { "fjippol-polsvr", { NULL }, 2748, "udp" }, - { "fjippol-cnsl", { NULL }, 2749, "tcp" }, - { "fjippol-cnsl", { NULL }, 2749, "udp" }, - { "fjippol-port1", { NULL }, 2750, "tcp" }, - { "fjippol-port1", { NULL }, 2750, "udp" }, - { "fjippol-port2", { NULL }, 2751, "tcp" }, - { "fjippol-port2", { NULL }, 2751, "udp" }, - { "rsisysaccess", { NULL }, 2752, "tcp" }, - { "rsisysaccess", { NULL }, 2752, "udp" }, - { "de-spot", { NULL }, 2753, "tcp" }, - { "de-spot", { NULL }, 2753, "udp" }, - { "apollo-cc", { NULL }, 2754, "tcp" }, - { "apollo-cc", { NULL }, 2754, "udp" }, - { "expresspay", { NULL }, 2755, "tcp" }, - { "expresspay", { NULL }, 2755, "udp" }, - { "simplement-tie", { NULL }, 2756, "tcp" }, - { "simplement-tie", { NULL }, 2756, "udp" }, - { "cnrp", { NULL }, 2757, "tcp" }, - { "cnrp", { NULL }, 2757, "udp" }, - { "apollo-status", { NULL }, 2758, "tcp" }, - { "apollo-status", { NULL }, 2758, "udp" }, - { "apollo-gms", { NULL }, 2759, "tcp" }, - { "apollo-gms", { NULL }, 2759, "udp" }, - { "sabams", { NULL }, 2760, "tcp" }, - { "sabams", { NULL }, 2760, "udp" }, - { "dicom-iscl", { NULL }, 2761, "tcp" }, - { "dicom-iscl", { NULL }, 2761, "udp" }, - { "dicom-tls", { NULL }, 2762, "tcp" }, - { "dicom-tls", { NULL }, 2762, "udp" }, - { "desktop-dna", { NULL }, 2763, "tcp" }, - { "desktop-dna", { NULL }, 2763, "udp" }, - { "data-insurance", { NULL }, 2764, "tcp" }, - { "data-insurance", { NULL }, 2764, "udp" }, - { "qip-audup", { NULL }, 2765, "tcp" }, - { "qip-audup", { NULL }, 2765, "udp" }, - { "compaq-scp", { NULL }, 2766, "tcp" }, - { "compaq-scp", { NULL }, 2766, "udp" }, - { "uadtc", { NULL }, 2767, "tcp" }, - { "uadtc", { NULL }, 2767, "udp" }, - { "uacs", { NULL }, 2768, "tcp" }, - { "uacs", { NULL }, 2768, "udp" }, - { "exce", { NULL }, 2769, "tcp" }, - { "exce", { NULL }, 2769, "udp" }, - { "veronica", { NULL }, 2770, "tcp" }, - { "veronica", { NULL }, 2770, "udp" }, - { "vergencecm", { NULL }, 2771, "tcp" }, - { "vergencecm", { NULL }, 2771, "udp" }, - { "auris", { NULL }, 2772, "tcp" }, - { "auris", { NULL }, 2772, "udp" }, - { "rbakcup1", { NULL }, 2773, "tcp" }, - { "rbakcup1", { NULL }, 2773, "udp" }, - { "rbakcup2", { NULL }, 2774, "tcp" }, - { "rbakcup2", { NULL }, 2774, "udp" }, - { "smpp", { NULL }, 2775, "tcp" }, - { "smpp", { NULL }, 2775, "udp" }, - { "ridgeway1", { NULL }, 2776, "tcp" }, - { "ridgeway1", { NULL }, 2776, "udp" }, - { "ridgeway2", { NULL }, 2777, "tcp" }, - { "ridgeway2", { NULL }, 2777, "udp" }, - { "gwen-sonya", { NULL }, 2778, "tcp" }, - { "gwen-sonya", { NULL }, 2778, "udp" }, - { "lbc-sync", { NULL }, 2779, "tcp" }, - { "lbc-sync", { NULL }, 2779, "udp" }, - { "lbc-control", { NULL }, 2780, "tcp" }, - { "lbc-control", { NULL }, 2780, "udp" }, - { "whosells", { NULL }, 2781, "tcp" }, - { "whosells", { NULL }, 2781, "udp" }, - { "everydayrc", { NULL }, 2782, "tcp" }, - { "everydayrc", { NULL }, 2782, "udp" }, - { "aises", { NULL }, 2783, "tcp" }, - { "aises", { NULL }, 2783, "udp" }, - { "www-dev", { NULL }, 2784, "tcp" }, - { "www-dev", { NULL }, 2784, "udp" }, - { "aic-np", { NULL }, 2785, "tcp" }, - { "aic-np", { NULL }, 2785, "udp" }, - { "aic-oncrpc", { NULL }, 2786, "tcp" }, - { "aic-oncrpc", { NULL }, 2786, "udp" }, - { "piccolo", { NULL }, 2787, "tcp" }, - { "piccolo", { NULL }, 2787, "udp" }, - { "fryeserv", { NULL }, 2788, "tcp" }, - { "fryeserv", { NULL }, 2788, "udp" }, - { "media-agent", { NULL }, 2789, "tcp" }, - { "media-agent", { NULL }, 2789, "udp" }, - { "plgproxy", { NULL }, 2790, "tcp" }, - { "plgproxy", { NULL }, 2790, "udp" }, - { "mtport-regist", { NULL }, 2791, "tcp" }, - { "mtport-regist", { NULL }, 2791, "udp" }, - { "f5-globalsite", { NULL }, 2792, "tcp" }, - { "f5-globalsite", { NULL }, 2792, "udp" }, - { "initlsmsad", { NULL }, 2793, "tcp" }, - { "initlsmsad", { NULL }, 2793, "udp" }, - { "livestats", { NULL }, 2795, "tcp" }, - { "livestats", { NULL }, 2795, "udp" }, - { "ac-tech", { NULL }, 2796, "tcp" }, - { "ac-tech", { NULL }, 2796, "udp" }, - { "esp-encap", { NULL }, 2797, "tcp" }, - { "esp-encap", { NULL }, 2797, "udp" }, - { "tmesis-upshot", { NULL }, 2798, "tcp" }, - { "tmesis-upshot", { NULL }, 2798, "udp" }, - { "icon-discover", { NULL }, 2799, "tcp" }, - { "icon-discover", { NULL }, 2799, "udp" }, - { "acc-raid", { NULL }, 2800, "tcp" }, - { "acc-raid", { NULL }, 2800, "udp" }, - { "igcp", { NULL }, 2801, "tcp" }, - { "igcp", { NULL }, 2801, "udp" }, - { "veritas-tcp1", { NULL }, 2802, "tcp" }, - { "veritas-udp1", { NULL }, 2802, "udp" }, - { "btprjctrl", { NULL }, 2803, "tcp" }, - { "btprjctrl", { NULL }, 2803, "udp" }, - { "dvr-esm", { NULL }, 2804, "tcp" }, - { "dvr-esm", { NULL }, 2804, "udp" }, - { "wta-wsp-s", { NULL }, 2805, "tcp" }, - { "wta-wsp-s", { NULL }, 2805, "udp" }, - { "cspuni", { NULL }, 2806, "tcp" }, - { "cspuni", { NULL }, 2806, "udp" }, - { "cspmulti", { NULL }, 2807, "tcp" }, - { "cspmulti", { NULL }, 2807, "udp" }, - { "j-lan-p", { NULL }, 2808, "tcp" }, - { "j-lan-p", { NULL }, 2808, "udp" }, - { "corbaloc", { NULL }, 2809, "tcp" }, - { "corbaloc", { NULL }, 2809, "udp" }, - { "netsteward", { NULL }, 2810, "tcp" }, - { "netsteward", { NULL }, 2810, "udp" }, - { "gsiftp", { NULL }, 2811, "tcp" }, - { "gsiftp", { NULL }, 2811, "udp" }, - { "atmtcp", { NULL }, 2812, "tcp" }, - { "atmtcp", { NULL }, 2812, "udp" }, - { "llm-pass", { NULL }, 2813, "tcp" }, - { "llm-pass", { NULL }, 2813, "udp" }, - { "llm-csv", { NULL }, 2814, "tcp" }, - { "llm-csv", { NULL }, 2814, "udp" }, - { "lbc-measure", { NULL }, 2815, "tcp" }, - { "lbc-measure", { NULL }, 2815, "udp" }, - { "lbc-watchdog", { NULL }, 2816, "tcp" }, - { "lbc-watchdog", { NULL }, 2816, "udp" }, - { "nmsigport", { NULL }, 2817, "tcp" }, - { "nmsigport", { NULL }, 2817, "udp" }, - { "rmlnk", { NULL }, 2818, "tcp" }, - { "rmlnk", { NULL }, 2818, "udp" }, - { "fc-faultnotify", { NULL }, 2819, "tcp" }, - { "fc-faultnotify", { NULL }, 2819, "udp" }, - { "univision", { NULL }, 2820, "tcp" }, - { "univision", { NULL }, 2820, "udp" }, - { "vrts-at-port", { NULL }, 2821, "tcp" }, - { "vrts-at-port", { NULL }, 2821, "udp" }, - { "ka0wuc", { NULL }, 2822, "tcp" }, - { "ka0wuc", { NULL }, 2822, "udp" }, - { "cqg-netlan", { NULL }, 2823, "tcp" }, - { "cqg-netlan", { NULL }, 2823, "udp" }, - { "cqg-netlan-1", { NULL }, 2824, "tcp" }, - { "cqg-netlan-1", { NULL }, 2824, "udp" }, - { "slc-systemlog", { NULL }, 2826, "tcp" }, - { "slc-systemlog", { NULL }, 2826, "udp" }, - { "slc-ctrlrloops", { NULL }, 2827, "tcp" }, - { "slc-ctrlrloops", { NULL }, 2827, "udp" }, - { "itm-lm", { NULL }, 2828, "tcp" }, - { "itm-lm", { NULL }, 2828, "udp" }, - { "silkp1", { NULL }, 2829, "tcp" }, - { "silkp1", { NULL }, 2829, "udp" }, - { "silkp2", { NULL }, 2830, "tcp" }, - { "silkp2", { NULL }, 2830, "udp" }, - { "silkp3", { NULL }, 2831, "tcp" }, - { "silkp3", { NULL }, 2831, "udp" }, - { "silkp4", { NULL }, 2832, "tcp" }, - { "silkp4", { NULL }, 2832, "udp" }, - { "glishd", { NULL }, 2833, "tcp" }, - { "glishd", { NULL }, 2833, "udp" }, - { "evtp", { NULL }, 2834, "tcp" }, - { "evtp", { NULL }, 2834, "udp" }, - { "evtp-data", { NULL }, 2835, "tcp" }, - { "evtp-data", { NULL }, 2835, "udp" }, - { "catalyst", { NULL }, 2836, "tcp" }, - { "catalyst", { NULL }, 2836, "udp" }, - { "repliweb", { NULL }, 2837, "tcp" }, - { "repliweb", { NULL }, 2837, "udp" }, - { "starbot", { NULL }, 2838, "tcp" }, - { "starbot", { NULL }, 2838, "udp" }, - { "nmsigport", { NULL }, 2839, "tcp" }, - { "nmsigport", { NULL }, 2839, "udp" }, - { "l3-exprt", { NULL }, 2840, "tcp" }, - { "l3-exprt", { NULL }, 2840, "udp" }, - { "l3-ranger", { NULL }, 2841, "tcp" }, - { "l3-ranger", { NULL }, 2841, "udp" }, - { "l3-hawk", { NULL }, 2842, "tcp" }, - { "l3-hawk", { NULL }, 2842, "udp" }, - { "pdnet", { NULL }, 2843, "tcp" }, - { "pdnet", { NULL }, 2843, "udp" }, - { "bpcp-poll", { NULL }, 2844, "tcp" }, - { "bpcp-poll", { NULL }, 2844, "udp" }, - { "bpcp-trap", { NULL }, 2845, "tcp" }, - { "bpcp-trap", { NULL }, 2845, "udp" }, - { "aimpp-hello", { NULL }, 2846, "tcp" }, - { "aimpp-hello", { NULL }, 2846, "udp" }, - { "aimpp-port-req", { NULL }, 2847, "tcp" }, - { "aimpp-port-req", { NULL }, 2847, "udp" }, - { "amt-blc-port", { NULL }, 2848, "tcp" }, - { "amt-blc-port", { NULL }, 2848, "udp" }, - { "fxp", { NULL }, 2849, "tcp" }, - { "fxp", { NULL }, 2849, "udp" }, - { "metaconsole", { NULL }, 2850, "tcp" }, - { "metaconsole", { NULL }, 2850, "udp" }, - { "webemshttp", { NULL }, 2851, "tcp" }, - { "webemshttp", { NULL }, 2851, "udp" }, - { "bears-01", { NULL }, 2852, "tcp" }, - { "bears-01", { NULL }, 2852, "udp" }, - { "ispipes", { NULL }, 2853, "tcp" }, - { "ispipes", { NULL }, 2853, "udp" }, - { "infomover", { NULL }, 2854, "tcp" }, - { "infomover", { NULL }, 2854, "udp" }, - { "msrp", { NULL }, 2855, "tcp" }, - { "msrp", { NULL }, 2855, "udp" }, - { "cesdinv", { NULL }, 2856, "tcp" }, - { "cesdinv", { NULL }, 2856, "udp" }, - { "simctlp", { NULL }, 2857, "tcp" }, - { "simctlp", { NULL }, 2857, "udp" }, - { "ecnp", { NULL }, 2858, "tcp" }, - { "ecnp", { NULL }, 2858, "udp" }, - { "activememory", { NULL }, 2859, "tcp" }, - { "activememory", { NULL }, 2859, "udp" }, - { "dialpad-voice1", { NULL }, 2860, "tcp" }, - { "dialpad-voice1", { NULL }, 2860, "udp" }, - { "dialpad-voice2", { NULL }, 2861, "tcp" }, - { "dialpad-voice2", { NULL }, 2861, "udp" }, - { "ttg-protocol", { NULL }, 2862, "tcp" }, - { "ttg-protocol", { NULL }, 2862, "udp" }, - { "sonardata", { NULL }, 2863, "tcp" }, - { "sonardata", { NULL }, 2863, "udp" }, - { "astromed-main", { NULL }, 2864, "tcp" }, - { "astromed-main", { NULL }, 2864, "udp" }, - { "pit-vpn", { NULL }, 2865, "tcp" }, - { "pit-vpn", { NULL }, 2865, "udp" }, - { "iwlistener", { NULL }, 2866, "tcp" }, - { "iwlistener", { NULL }, 2866, "udp" }, - { "esps-portal", { NULL }, 2867, "tcp" }, - { "esps-portal", { NULL }, 2867, "udp" }, - { "npep-messaging", { NULL }, 2868, "tcp" }, - { "npep-messaging", { NULL }, 2868, "udp" }, - { "icslap", { NULL }, 2869, "tcp" }, - { "icslap", { NULL }, 2869, "udp" }, - { "daishi", { NULL }, 2870, "tcp" }, - { "daishi", { NULL }, 2870, "udp" }, - { "msi-selectplay", { NULL }, 2871, "tcp" }, - { "msi-selectplay", { NULL }, 2871, "udp" }, - { "radix", { NULL }, 2872, "tcp" }, - { "radix", { NULL }, 2872, "udp" }, - { "dxmessagebase1", { NULL }, 2874, "tcp" }, - { "dxmessagebase1", { NULL }, 2874, "udp" }, - { "dxmessagebase2", { NULL }, 2875, "tcp" }, - { "dxmessagebase2", { NULL }, 2875, "udp" }, - { "sps-tunnel", { NULL }, 2876, "tcp" }, - { "sps-tunnel", { NULL }, 2876, "udp" }, - { "bluelance", { NULL }, 2877, "tcp" }, - { "bluelance", { NULL }, 2877, "udp" }, - { "aap", { NULL }, 2878, "tcp" }, - { "aap", { NULL }, 2878, "udp" }, - { "ucentric-ds", { NULL }, 2879, "tcp" }, - { "ucentric-ds", { NULL }, 2879, "udp" }, - { "synapse", { NULL }, 2880, "tcp" }, - { "synapse", { NULL }, 2880, "udp" }, - { "ndsp", { NULL }, 2881, "tcp" }, - { "ndsp", { NULL }, 2881, "udp" }, - { "ndtp", { NULL }, 2882, "tcp" }, - { "ndtp", { NULL }, 2882, "udp" }, - { "ndnp", { NULL }, 2883, "tcp" }, - { "ndnp", { NULL }, 2883, "udp" }, - { "flashmsg", { NULL }, 2884, "tcp" }, - { "flashmsg", { NULL }, 2884, "udp" }, - { "topflow", { NULL }, 2885, "tcp" }, - { "topflow", { NULL }, 2885, "udp" }, - { "responselogic", { NULL }, 2886, "tcp" }, - { "responselogic", { NULL }, 2886, "udp" }, - { "aironetddp", { NULL }, 2887, "tcp" }, - { "aironetddp", { NULL }, 2887, "udp" }, - { "spcsdlobby", { NULL }, 2888, "tcp" }, - { "spcsdlobby", { NULL }, 2888, "udp" }, - { "rsom", { NULL }, 2889, "tcp" }, - { "rsom", { NULL }, 2889, "udp" }, - { "cspclmulti", { NULL }, 2890, "tcp" }, - { "cspclmulti", { NULL }, 2890, "udp" }, - { "cinegrfx-elmd", { NULL }, 2891, "tcp" }, - { "cinegrfx-elmd", { NULL }, 2891, "udp" }, - { "snifferdata", { NULL }, 2892, "tcp" }, - { "snifferdata", { NULL }, 2892, "udp" }, - { "vseconnector", { NULL }, 2893, "tcp" }, - { "vseconnector", { NULL }, 2893, "udp" }, - { "abacus-remote", { NULL }, 2894, "tcp" }, - { "abacus-remote", { NULL }, 2894, "udp" }, - { "natuslink", { NULL }, 2895, "tcp" }, - { "natuslink", { NULL }, 2895, "udp" }, - { "ecovisiong6-1", { NULL }, 2896, "tcp" }, - { "ecovisiong6-1", { NULL }, 2896, "udp" }, - { "citrix-rtmp", { NULL }, 2897, "tcp" }, - { "citrix-rtmp", { NULL }, 2897, "udp" }, - { "appliance-cfg", { NULL }, 2898, "tcp" }, - { "appliance-cfg", { NULL }, 2898, "udp" }, - { "powergemplus", { NULL }, 2899, "tcp" }, - { "powergemplus", { NULL }, 2899, "udp" }, - { "quicksuite", { NULL }, 2900, "tcp" }, - { "quicksuite", { NULL }, 2900, "udp" }, - { "allstorcns", { NULL }, 2901, "tcp" }, - { "allstorcns", { NULL }, 2901, "udp" }, - { "netaspi", { NULL }, 2902, "tcp" }, - { "netaspi", { NULL }, 2902, "udp" }, - { "suitcase", { NULL }, 2903, "tcp" }, - { "suitcase", { NULL }, 2903, "udp" }, - { "m2ua", { NULL }, 2904, "tcp" }, - { "m2ua", { NULL }, 2904, "udp" }, - { "m2ua", { NULL }, 2904, "sctp" }, - { "m3ua", { NULL }, 2905, "tcp" }, - { "m3ua", { NULL }, 2905, "sctp" }, - { "caller9", { NULL }, 2906, "tcp" }, - { "caller9", { NULL }, 2906, "udp" }, - { "webmethods-b2b", { NULL }, 2907, "tcp" }, - { "webmethods-b2b", { NULL }, 2907, "udp" }, - { "mao", { NULL }, 2908, "tcp" }, - { "mao", { NULL }, 2908, "udp" }, - { "funk-dialout", { NULL }, 2909, "tcp" }, - { "funk-dialout", { NULL }, 2909, "udp" }, - { "tdaccess", { NULL }, 2910, "tcp" }, - { "tdaccess", { NULL }, 2910, "udp" }, - { "blockade", { NULL }, 2911, "tcp" }, - { "blockade", { NULL }, 2911, "udp" }, - { "epicon", { NULL }, 2912, "tcp" }, - { "epicon", { NULL }, 2912, "udp" }, - { "boosterware", { NULL }, 2913, "tcp" }, - { "boosterware", { NULL }, 2913, "udp" }, - { "gamelobby", { NULL }, 2914, "tcp" }, - { "gamelobby", { NULL }, 2914, "udp" }, - { "tksocket", { NULL }, 2915, "tcp" }, - { "tksocket", { NULL }, 2915, "udp" }, - { "elvin_server", { NULL }, 2916, "tcp" }, - { "elvin_server", { NULL }, 2916, "udp" }, - { "elvin_client", { NULL }, 2917, "tcp" }, - { "elvin_client", { NULL }, 2917, "udp" }, - { "kastenchasepad", { NULL }, 2918, "tcp" }, - { "kastenchasepad", { NULL }, 2918, "udp" }, - { "roboer", { NULL }, 2919, "tcp" }, - { "roboer", { NULL }, 2919, "udp" }, - { "roboeda", { NULL }, 2920, "tcp" }, - { "roboeda", { NULL }, 2920, "udp" }, - { "cesdcdman", { NULL }, 2921, "tcp" }, - { "cesdcdman", { NULL }, 2921, "udp" }, - { "cesdcdtrn", { NULL }, 2922, "tcp" }, - { "cesdcdtrn", { NULL }, 2922, "udp" }, - { "wta-wsp-wtp-s", { NULL }, 2923, "tcp" }, - { "wta-wsp-wtp-s", { NULL }, 2923, "udp" }, - { "precise-vip", { NULL }, 2924, "tcp" }, - { "precise-vip", { NULL }, 2924, "udp" }, - { "mobile-file-dl", { NULL }, 2926, "tcp" }, - { "mobile-file-dl", { NULL }, 2926, "udp" }, - { "unimobilectrl", { NULL }, 2927, "tcp" }, - { "unimobilectrl", { NULL }, 2927, "udp" }, - { "redstone-cpss", { NULL }, 2928, "tcp" }, - { "redstone-cpss", { NULL }, 2928, "udp" }, - { "amx-webadmin", { NULL }, 2929, "tcp" }, - { "amx-webadmin", { NULL }, 2929, "udp" }, - { "amx-weblinx", { NULL }, 2930, "tcp" }, - { "amx-weblinx", { NULL }, 2930, "udp" }, - { "circle-x", { NULL }, 2931, "tcp" }, - { "circle-x", { NULL }, 2931, "udp" }, - { "incp", { NULL }, 2932, "tcp" }, - { "incp", { NULL }, 2932, "udp" }, - { "4-tieropmgw", { NULL }, 2933, "tcp" }, - { "4-tieropmgw", { NULL }, 2933, "udp" }, - { "4-tieropmcli", { NULL }, 2934, "tcp" }, - { "4-tieropmcli", { NULL }, 2934, "udp" }, - { "qtp", { NULL }, 2935, "tcp" }, - { "qtp", { NULL }, 2935, "udp" }, - { "otpatch", { NULL }, 2936, "tcp" }, - { "otpatch", { NULL }, 2936, "udp" }, - { "pnaconsult-lm", { NULL }, 2937, "tcp" }, - { "pnaconsult-lm", { NULL }, 2937, "udp" }, - { "sm-pas-1", { NULL }, 2938, "tcp" }, - { "sm-pas-1", { NULL }, 2938, "udp" }, - { "sm-pas-2", { NULL }, 2939, "tcp" }, - { "sm-pas-2", { NULL }, 2939, "udp" }, - { "sm-pas-3", { NULL }, 2940, "tcp" }, - { "sm-pas-3", { NULL }, 2940, "udp" }, - { "sm-pas-4", { NULL }, 2941, "tcp" }, - { "sm-pas-4", { NULL }, 2941, "udp" }, - { "sm-pas-5", { NULL }, 2942, "tcp" }, - { "sm-pas-5", { NULL }, 2942, "udp" }, - { "ttnrepository", { NULL }, 2943, "tcp" }, - { "ttnrepository", { NULL }, 2943, "udp" }, - { "megaco-h248", { NULL }, 2944, "tcp" }, - { "megaco-h248", { NULL }, 2944, "udp" }, - { "megaco-h248", { NULL }, 2944, "sctp" }, - { "h248-binary", { NULL }, 2945, "tcp" }, - { "h248-binary", { NULL }, 2945, "udp" }, - { "h248-binary", { NULL }, 2945, "sctp" }, - { "fjsvmpor", { NULL }, 2946, "tcp" }, - { "fjsvmpor", { NULL }, 2946, "udp" }, - { "gpsd", { NULL }, 2947, "tcp" }, - { "gpsd", { NULL }, 2947, "udp" }, - { "wap-push", { NULL }, 2948, "tcp" }, - { "wap-push", { NULL }, 2948, "udp" }, - { "wap-pushsecure", { NULL }, 2949, "tcp" }, - { "wap-pushsecure", { NULL }, 2949, "udp" }, - { "esip", { NULL }, 2950, "tcp" }, - { "esip", { NULL }, 2950, "udp" }, - { "ottp", { NULL }, 2951, "tcp" }, - { "ottp", { NULL }, 2951, "udp" }, - { "mpfwsas", { NULL }, 2952, "tcp" }, - { "mpfwsas", { NULL }, 2952, "udp" }, - { "ovalarmsrv", { NULL }, 2953, "tcp" }, - { "ovalarmsrv", { NULL }, 2953, "udp" }, - { "ovalarmsrv-cmd", { NULL }, 2954, "tcp" }, - { "ovalarmsrv-cmd", { NULL }, 2954, "udp" }, - { "csnotify", { NULL }, 2955, "tcp" }, - { "csnotify", { NULL }, 2955, "udp" }, - { "ovrimosdbman", { NULL }, 2956, "tcp" }, - { "ovrimosdbman", { NULL }, 2956, "udp" }, - { "jmact5", { NULL }, 2957, "tcp" }, - { "jmact5", { NULL }, 2957, "udp" }, - { "jmact6", { NULL }, 2958, "tcp" }, - { "jmact6", { NULL }, 2958, "udp" }, - { "rmopagt", { NULL }, 2959, "tcp" }, - { "rmopagt", { NULL }, 2959, "udp" }, - { "dfoxserver", { NULL }, 2960, "tcp" }, - { "dfoxserver", { NULL }, 2960, "udp" }, - { "boldsoft-lm", { NULL }, 2961, "tcp" }, - { "boldsoft-lm", { NULL }, 2961, "udp" }, - { "iph-policy-cli", { NULL }, 2962, "tcp" }, - { "iph-policy-cli", { NULL }, 2962, "udp" }, - { "iph-policy-adm", { NULL }, 2963, "tcp" }, - { "iph-policy-adm", { NULL }, 2963, "udp" }, - { "bullant-srap", { NULL }, 2964, "tcp" }, - { "bullant-srap", { NULL }, 2964, "udp" }, - { "bullant-rap", { NULL }, 2965, "tcp" }, - { "bullant-rap", { NULL }, 2965, "udp" }, - { "idp-infotrieve", { NULL }, 2966, "tcp" }, - { "idp-infotrieve", { NULL }, 2966, "udp" }, - { "ssc-agent", { NULL }, 2967, "tcp" }, - { "ssc-agent", { NULL }, 2967, "udp" }, - { "enpp", { NULL }, 2968, "tcp" }, - { "enpp", { NULL }, 2968, "udp" }, - { "essp", { NULL }, 2969, "tcp" }, - { "essp", { NULL }, 2969, "udp" }, - { "index-net", { NULL }, 2970, "tcp" }, - { "index-net", { NULL }, 2970, "udp" }, - { "netclip", { NULL }, 2971, "tcp" }, - { "netclip", { NULL }, 2971, "udp" }, - { "pmsm-webrctl", { NULL }, 2972, "tcp" }, - { "pmsm-webrctl", { NULL }, 2972, "udp" }, - { "svnetworks", { NULL }, 2973, "tcp" }, - { "svnetworks", { NULL }, 2973, "udp" }, - { "signal", { NULL }, 2974, "tcp" }, - { "signal", { NULL }, 2974, "udp" }, - { "fjmpcm", { NULL }, 2975, "tcp" }, - { "fjmpcm", { NULL }, 2975, "udp" }, - { "cns-srv-port", { NULL }, 2976, "tcp" }, - { "cns-srv-port", { NULL }, 2976, "udp" }, - { "ttc-etap-ns", { NULL }, 2977, "tcp" }, - { "ttc-etap-ns", { NULL }, 2977, "udp" }, - { "ttc-etap-ds", { NULL }, 2978, "tcp" }, - { "ttc-etap-ds", { NULL }, 2978, "udp" }, - { "h263-video", { NULL }, 2979, "tcp" }, - { "h263-video", { NULL }, 2979, "udp" }, - { "wimd", { NULL }, 2980, "tcp" }, - { "wimd", { NULL }, 2980, "udp" }, - { "mylxamport", { NULL }, 2981, "tcp" }, - { "mylxamport", { NULL }, 2981, "udp" }, - { "iwb-whiteboard", { NULL }, 2982, "tcp" }, - { "iwb-whiteboard", { NULL }, 2982, "udp" }, - { "netplan", { NULL }, 2983, "tcp" }, - { "netplan", { NULL }, 2983, "udp" }, - { "hpidsadmin", { NULL }, 2984, "tcp" }, - { "hpidsadmin", { NULL }, 2984, "udp" }, - { "hpidsagent", { NULL }, 2985, "tcp" }, - { "hpidsagent", { NULL }, 2985, "udp" }, - { "stonefalls", { NULL }, 2986, "tcp" }, - { "stonefalls", { NULL }, 2986, "udp" }, - { "identify", { NULL }, 2987, "tcp" }, - { "identify", { NULL }, 2987, "udp" }, - { "hippad", { NULL }, 2988, "tcp" }, - { "hippad", { NULL }, 2988, "udp" }, - { "zarkov", { NULL }, 2989, "tcp" }, - { "zarkov", { NULL }, 2989, "udp" }, - { "boscap", { NULL }, 2990, "tcp" }, - { "boscap", { NULL }, 2990, "udp" }, - { "wkstn-mon", { NULL }, 2991, "tcp" }, - { "wkstn-mon", { NULL }, 2991, "udp" }, - { "avenyo", { NULL }, 2992, "tcp" }, - { "avenyo", { NULL }, 2992, "udp" }, - { "veritas-vis1", { NULL }, 2993, "tcp" }, - { "veritas-vis1", { NULL }, 2993, "udp" }, - { "veritas-vis2", { NULL }, 2994, "tcp" }, - { "veritas-vis2", { NULL }, 2994, "udp" }, - { "idrs", { NULL }, 2995, "tcp" }, - { "idrs", { NULL }, 2995, "udp" }, - { "vsixml", { NULL }, 2996, "tcp" }, - { "vsixml", { NULL }, 2996, "udp" }, - { "rebol", { NULL }, 2997, "tcp" }, - { "rebol", { NULL }, 2997, "udp" }, - { "realsecure", { NULL }, 2998, "tcp" }, - { "realsecure", { NULL }, 2998, "udp" }, - { "remoteware-un", { NULL }, 2999, "tcp" }, - { "remoteware-un", { NULL }, 2999, "udp" }, - { "hbci", { NULL }, 3000, "tcp" }, - { "hbci", { NULL }, 3000, "udp" }, - { "remoteware-cl", { NULL }, 3000, "tcp" }, - { "remoteware-cl", { NULL }, 3000, "udp" }, - { "exlm-agent", { NULL }, 3002, "tcp" }, - { "exlm-agent", { NULL }, 3002, "udp" }, - { "remoteware-srv", { NULL }, 3002, "tcp" }, - { "remoteware-srv", { NULL }, 3002, "udp" }, - { "cgms", { NULL }, 3003, "tcp" }, - { "cgms", { NULL }, 3003, "udp" }, - { "csoftragent", { NULL }, 3004, "tcp" }, - { "csoftragent", { NULL }, 3004, "udp" }, - { "geniuslm", { NULL }, 3005, "tcp" }, - { "geniuslm", { NULL }, 3005, "udp" }, - { "ii-admin", { NULL }, 3006, "tcp" }, - { "ii-admin", { NULL }, 3006, "udp" }, - { "lotusmtap", { NULL }, 3007, "tcp" }, - { "lotusmtap", { NULL }, 3007, "udp" }, - { "midnight-tech", { NULL }, 3008, "tcp" }, - { "midnight-tech", { NULL }, 3008, "udp" }, - { "pxc-ntfy", { NULL }, 3009, "tcp" }, - { "pxc-ntfy", { NULL }, 3009, "udp" }, - { "gw", { NULL }, 3010, "tcp" }, - { "ping-pong", { NULL }, 3010, "udp" }, - { "trusted-web", { NULL }, 3011, "tcp" }, - { "trusted-web", { NULL }, 3011, "udp" }, - { "twsdss", { NULL }, 3012, "tcp" }, - { "twsdss", { NULL }, 3012, "udp" }, - { "gilatskysurfer", { NULL }, 3013, "tcp" }, - { "gilatskysurfer", { NULL }, 3013, "udp" }, - { "broker_service", { NULL }, 3014, "tcp" }, - { "broker_service", { NULL }, 3014, "udp" }, - { "nati-dstp", { NULL }, 3015, "tcp" }, - { "nati-dstp", { NULL }, 3015, "udp" }, - { "notify_srvr", { NULL }, 3016, "tcp" }, - { "notify_srvr", { NULL }, 3016, "udp" }, - { "event_listener", { NULL }, 3017, "tcp" }, - { "event_listener", { NULL }, 3017, "udp" }, - { "srvc_registry", { NULL }, 3018, "tcp" }, - { "srvc_registry", { NULL }, 3018, "udp" }, - { "resource_mgr", { NULL }, 3019, "tcp" }, - { "resource_mgr", { NULL }, 3019, "udp" }, - { "cifs", { NULL }, 3020, "tcp" }, - { "cifs", { NULL }, 3020, "udp" }, - { "agriserver", { NULL }, 3021, "tcp" }, - { "agriserver", { NULL }, 3021, "udp" }, - { "csregagent", { NULL }, 3022, "tcp" }, - { "csregagent", { NULL }, 3022, "udp" }, - { "magicnotes", { NULL }, 3023, "tcp" }, - { "magicnotes", { NULL }, 3023, "udp" }, - { "nds_sso", { NULL }, 3024, "tcp" }, - { "nds_sso", { NULL }, 3024, "udp" }, - { "arepa-raft", { NULL }, 3025, "tcp" }, - { "arepa-raft", { NULL }, 3025, "udp" }, - { "agri-gateway", { NULL }, 3026, "tcp" }, - { "agri-gateway", { NULL }, 3026, "udp" }, - { "LiebDevMgmt_C", { NULL }, 3027, "tcp" }, - { "LiebDevMgmt_C", { NULL }, 3027, "udp" }, - { "LiebDevMgmt_DM", { NULL }, 3028, "tcp" }, - { "LiebDevMgmt_DM", { NULL }, 3028, "udp" }, - { "LiebDevMgmt_A", { NULL }, 3029, "tcp" }, - { "LiebDevMgmt_A", { NULL }, 3029, "udp" }, - { "arepa-cas", { NULL }, 3030, "tcp" }, - { "arepa-cas", { NULL }, 3030, "udp" }, - { "eppc", { NULL }, 3031, "tcp" }, - { "eppc", { NULL }, 3031, "udp" }, - { "redwood-chat", { NULL }, 3032, "tcp" }, - { "redwood-chat", { NULL }, 3032, "udp" }, - { "pdb", { NULL }, 3033, "tcp" }, - { "pdb", { NULL }, 3033, "udp" }, - { "osmosis-aeea", { NULL }, 3034, "tcp" }, - { "osmosis-aeea", { NULL }, 3034, "udp" }, - { "fjsv-gssagt", { NULL }, 3035, "tcp" }, - { "fjsv-gssagt", { NULL }, 3035, "udp" }, - { "hagel-dump", { NULL }, 3036, "tcp" }, - { "hagel-dump", { NULL }, 3036, "udp" }, - { "hp-san-mgmt", { NULL }, 3037, "tcp" }, - { "hp-san-mgmt", { NULL }, 3037, "udp" }, - { "santak-ups", { NULL }, 3038, "tcp" }, - { "santak-ups", { NULL }, 3038, "udp" }, - { "cogitate", { NULL }, 3039, "tcp" }, - { "cogitate", { NULL }, 3039, "udp" }, - { "tomato-springs", { NULL }, 3040, "tcp" }, - { "tomato-springs", { NULL }, 3040, "udp" }, - { "di-traceware", { NULL }, 3041, "tcp" }, - { "di-traceware", { NULL }, 3041, "udp" }, - { "journee", { NULL }, 3042, "tcp" }, - { "journee", { NULL }, 3042, "udp" }, - { "brp", { NULL }, 3043, "tcp" }, - { "brp", { NULL }, 3043, "udp" }, - { "epp", { NULL }, 3044, "tcp" }, - { "epp", { NULL }, 3044, "udp" }, - { "responsenet", { NULL }, 3045, "tcp" }, - { "responsenet", { NULL }, 3045, "udp" }, - { "di-ase", { NULL }, 3046, "tcp" }, - { "di-ase", { NULL }, 3046, "udp" }, - { "hlserver", { NULL }, 3047, "tcp" }, - { "hlserver", { NULL }, 3047, "udp" }, - { "pctrader", { NULL }, 3048, "tcp" }, - { "pctrader", { NULL }, 3048, "udp" }, - { "nsws", { NULL }, 3049, "tcp" }, - { "nsws", { NULL }, 3049, "udp" }, - { "gds_db", { NULL }, 3050, "tcp" }, - { "gds_db", { NULL }, 3050, "udp" }, - { "galaxy-server", { NULL }, 3051, "tcp" }, - { "galaxy-server", { NULL }, 3051, "udp" }, - { "apc-3052", { NULL }, 3052, "tcp" }, - { "apc-3052", { NULL }, 3052, "udp" }, - { "dsom-server", { NULL }, 3053, "tcp" }, - { "dsom-server", { NULL }, 3053, "udp" }, - { "amt-cnf-prot", { NULL }, 3054, "tcp" }, - { "amt-cnf-prot", { NULL }, 3054, "udp" }, - { "policyserver", { NULL }, 3055, "tcp" }, - { "policyserver", { NULL }, 3055, "udp" }, - { "cdl-server", { NULL }, 3056, "tcp" }, - { "cdl-server", { NULL }, 3056, "udp" }, - { "goahead-fldup", { NULL }, 3057, "tcp" }, - { "goahead-fldup", { NULL }, 3057, "udp" }, - { "videobeans", { NULL }, 3058, "tcp" }, - { "videobeans", { NULL }, 3058, "udp" }, - { "qsoft", { NULL }, 3059, "tcp" }, - { "qsoft", { NULL }, 3059, "udp" }, - { "interserver", { NULL }, 3060, "tcp" }, - { "interserver", { NULL }, 3060, "udp" }, - { "cautcpd", { NULL }, 3061, "tcp" }, - { "cautcpd", { NULL }, 3061, "udp" }, - { "ncacn-ip-tcp", { NULL }, 3062, "tcp" }, - { "ncacn-ip-tcp", { NULL }, 3062, "udp" }, - { "ncadg-ip-udp", { NULL }, 3063, "tcp" }, - { "ncadg-ip-udp", { NULL }, 3063, "udp" }, - { "rprt", { NULL }, 3064, "tcp" }, - { "rprt", { NULL }, 3064, "udp" }, - { "slinterbase", { NULL }, 3065, "tcp" }, - { "slinterbase", { NULL }, 3065, "udp" }, - { "netattachsdmp", { NULL }, 3066, "tcp" }, - { "netattachsdmp", { NULL }, 3066, "udp" }, - { "fjhpjp", { NULL }, 3067, "tcp" }, - { "fjhpjp", { NULL }, 3067, "udp" }, - { "ls3bcast", { NULL }, 3068, "tcp" }, - { "ls3bcast", { NULL }, 3068, "udp" }, - { "ls3", { NULL }, 3069, "tcp" }, - { "ls3", { NULL }, 3069, "udp" }, - { "mgxswitch", { NULL }, 3070, "tcp" }, - { "mgxswitch", { NULL }, 3070, "udp" }, - { "csd-mgmt-port", { NULL }, 3071, "tcp" }, - { "csd-mgmt-port", { NULL }, 3071, "udp" }, - { "csd-monitor", { NULL }, 3072, "tcp" }, - { "csd-monitor", { NULL }, 3072, "udp" }, - { "vcrp", { NULL }, 3073, "tcp" }, - { "vcrp", { NULL }, 3073, "udp" }, - { "xbox", { NULL }, 3074, "tcp" }, - { "xbox", { NULL }, 3074, "udp" }, - { "orbix-locator", { NULL }, 3075, "tcp" }, - { "orbix-locator", { NULL }, 3075, "udp" }, - { "orbix-config", { NULL }, 3076, "tcp" }, - { "orbix-config", { NULL }, 3076, "udp" }, - { "orbix-loc-ssl", { NULL }, 3077, "tcp" }, - { "orbix-loc-ssl", { NULL }, 3077, "udp" }, - { "orbix-cfg-ssl", { NULL }, 3078, "tcp" }, - { "orbix-cfg-ssl", { NULL }, 3078, "udp" }, - { "lv-frontpanel", { NULL }, 3079, "tcp" }, - { "lv-frontpanel", { NULL }, 3079, "udp" }, - { "stm_pproc", { NULL }, 3080, "tcp" }, - { "stm_pproc", { NULL }, 3080, "udp" }, - { "tl1-lv", { NULL }, 3081, "tcp" }, - { "tl1-lv", { NULL }, 3081, "udp" }, - { "tl1-raw", { NULL }, 3082, "tcp" }, - { "tl1-raw", { NULL }, 3082, "udp" }, - { "tl1-telnet", { NULL }, 3083, "tcp" }, - { "tl1-telnet", { NULL }, 3083, "udp" }, - { "itm-mccs", { NULL }, 3084, "tcp" }, - { "itm-mccs", { NULL }, 3084, "udp" }, - { "pcihreq", { NULL }, 3085, "tcp" }, - { "pcihreq", { NULL }, 3085, "udp" }, - { "jdl-dbkitchen", { NULL }, 3086, "tcp" }, - { "jdl-dbkitchen", { NULL }, 3086, "udp" }, - { "asoki-sma", { NULL }, 3087, "tcp" }, - { "asoki-sma", { NULL }, 3087, "udp" }, - { "xdtp", { NULL }, 3088, "tcp" }, - { "xdtp", { NULL }, 3088, "udp" }, - { "ptk-alink", { NULL }, 3089, "tcp" }, - { "ptk-alink", { NULL }, 3089, "udp" }, - { "stss", { NULL }, 3090, "tcp" }, - { "stss", { NULL }, 3090, "udp" }, - { "1ci-smcs", { NULL }, 3091, "tcp" }, - { "1ci-smcs", { NULL }, 3091, "udp" }, - { "rapidmq-center", { NULL }, 3093, "tcp" }, - { "rapidmq-center", { NULL }, 3093, "udp" }, - { "rapidmq-reg", { NULL }, 3094, "tcp" }, - { "rapidmq-reg", { NULL }, 3094, "udp" }, - { "panasas", { NULL }, 3095, "tcp" }, - { "panasas", { NULL }, 3095, "udp" }, - { "ndl-aps", { NULL }, 3096, "tcp" }, - { "ndl-aps", { NULL }, 3096, "udp" }, - { "itu-bicc-stc", { NULL }, 3097, "sctp" }, - { "umm-port", { NULL }, 3098, "tcp" }, - { "umm-port", { NULL }, 3098, "udp" }, - { "chmd", { NULL }, 3099, "tcp" }, - { "chmd", { NULL }, 3099, "udp" }, - { "opcon-xps", { NULL }, 3100, "tcp" }, - { "opcon-xps", { NULL }, 3100, "udp" }, - { "hp-pxpib", { NULL }, 3101, "tcp" }, - { "hp-pxpib", { NULL }, 3101, "udp" }, - { "slslavemon", { NULL }, 3102, "tcp" }, - { "slslavemon", { NULL }, 3102, "udp" }, - { "autocuesmi", { NULL }, 3103, "tcp" }, - { "autocuesmi", { NULL }, 3103, "udp" }, - { "autocuelog", { NULL }, 3104, "tcp" }, - { "autocuetime", { NULL }, 3104, "udp" }, - { "cardbox", { NULL }, 3105, "tcp" }, - { "cardbox", { NULL }, 3105, "udp" }, - { "cardbox-http", { NULL }, 3106, "tcp" }, - { "cardbox-http", { NULL }, 3106, "udp" }, - { "business", { NULL }, 3107, "tcp" }, - { "business", { NULL }, 3107, "udp" }, - { "geolocate", { NULL }, 3108, "tcp" }, - { "geolocate", { NULL }, 3108, "udp" }, - { "personnel", { NULL }, 3109, "tcp" }, - { "personnel", { NULL }, 3109, "udp" }, - { "sim-control", { NULL }, 3110, "tcp" }, - { "sim-control", { NULL }, 3110, "udp" }, - { "wsynch", { NULL }, 3111, "tcp" }, - { "wsynch", { NULL }, 3111, "udp" }, - { "ksysguard", { NULL }, 3112, "tcp" }, - { "ksysguard", { NULL }, 3112, "udp" }, - { "cs-auth-svr", { NULL }, 3113, "tcp" }, - { "cs-auth-svr", { NULL }, 3113, "udp" }, - { "ccmad", { NULL }, 3114, "tcp" }, - { "ccmad", { NULL }, 3114, "udp" }, - { "mctet-master", { NULL }, 3115, "tcp" }, - { "mctet-master", { NULL }, 3115, "udp" }, - { "mctet-gateway", { NULL }, 3116, "tcp" }, - { "mctet-gateway", { NULL }, 3116, "udp" }, - { "mctet-jserv", { NULL }, 3117, "tcp" }, - { "mctet-jserv", { NULL }, 3117, "udp" }, - { "pkagent", { NULL }, 3118, "tcp" }, - { "pkagent", { NULL }, 3118, "udp" }, - { "d2000kernel", { NULL }, 3119, "tcp" }, - { "d2000kernel", { NULL }, 3119, "udp" }, - { "d2000webserver", { NULL }, 3120, "tcp" }, - { "d2000webserver", { NULL }, 3120, "udp" }, - { "vtr-emulator", { NULL }, 3122, "tcp" }, - { "vtr-emulator", { NULL }, 3122, "udp" }, - { "edix", { NULL }, 3123, "tcp" }, - { "edix", { NULL }, 3123, "udp" }, - { "beacon-port", { NULL }, 3124, "tcp" }, - { "beacon-port", { NULL }, 3124, "udp" }, - { "a13-an", { NULL }, 3125, "tcp" }, - { "a13-an", { NULL }, 3125, "udp" }, - { "ctx-bridge", { NULL }, 3127, "tcp" }, - { "ctx-bridge", { NULL }, 3127, "udp" }, - { "ndl-aas", { NULL }, 3128, "tcp" }, - { "ndl-aas", { NULL }, 3128, "udp" }, - { "netport-id", { NULL }, 3129, "tcp" }, - { "netport-id", { NULL }, 3129, "udp" }, - { "icpv2", { NULL }, 3130, "tcp" }, - { "icpv2", { NULL }, 3130, "udp" }, - { "netbookmark", { NULL }, 3131, "tcp" }, - { "netbookmark", { NULL }, 3131, "udp" }, - { "ms-rule-engine", { NULL }, 3132, "tcp" }, - { "ms-rule-engine", { NULL }, 3132, "udp" }, - { "prism-deploy", { NULL }, 3133, "tcp" }, - { "prism-deploy", { NULL }, 3133, "udp" }, - { "ecp", { NULL }, 3134, "tcp" }, - { "ecp", { NULL }, 3134, "udp" }, - { "peerbook-port", { NULL }, 3135, "tcp" }, - { "peerbook-port", { NULL }, 3135, "udp" }, - { "grubd", { NULL }, 3136, "tcp" }, - { "grubd", { NULL }, 3136, "udp" }, - { "rtnt-1", { NULL }, 3137, "tcp" }, - { "rtnt-1", { NULL }, 3137, "udp" }, - { "rtnt-2", { NULL }, 3138, "tcp" }, - { "rtnt-2", { NULL }, 3138, "udp" }, - { "incognitorv", { NULL }, 3139, "tcp" }, - { "incognitorv", { NULL }, 3139, "udp" }, - { "ariliamulti", { NULL }, 3140, "tcp" }, - { "ariliamulti", { NULL }, 3140, "udp" }, - { "vmodem", { NULL }, 3141, "tcp" }, - { "vmodem", { NULL }, 3141, "udp" }, - { "rdc-wh-eos", { NULL }, 3142, "tcp" }, - { "rdc-wh-eos", { NULL }, 3142, "udp" }, - { "seaview", { NULL }, 3143, "tcp" }, - { "seaview", { NULL }, 3143, "udp" }, - { "tarantella", { NULL }, 3144, "tcp" }, - { "tarantella", { NULL }, 3144, "udp" }, - { "csi-lfap", { NULL }, 3145, "tcp" }, - { "csi-lfap", { NULL }, 3145, "udp" }, - { "bears-02", { NULL }, 3146, "tcp" }, - { "bears-02", { NULL }, 3146, "udp" }, - { "rfio", { NULL }, 3147, "tcp" }, - { "rfio", { NULL }, 3147, "udp" }, - { "nm-game-admin", { NULL }, 3148, "tcp" }, - { "nm-game-admin", { NULL }, 3148, "udp" }, - { "nm-game-server", { NULL }, 3149, "tcp" }, - { "nm-game-server", { NULL }, 3149, "udp" }, - { "nm-asses-admin", { NULL }, 3150, "tcp" }, - { "nm-asses-admin", { NULL }, 3150, "udp" }, - { "nm-assessor", { NULL }, 3151, "tcp" }, - { "nm-assessor", { NULL }, 3151, "udp" }, - { "feitianrockey", { NULL }, 3152, "tcp" }, - { "feitianrockey", { NULL }, 3152, "udp" }, - { "s8-client-port", { NULL }, 3153, "tcp" }, - { "s8-client-port", { NULL }, 3153, "udp" }, - { "ccmrmi", { NULL }, 3154, "tcp" }, - { "ccmrmi", { NULL }, 3154, "udp" }, - { "jpegmpeg", { NULL }, 3155, "tcp" }, - { "jpegmpeg", { NULL }, 3155, "udp" }, - { "indura", { NULL }, 3156, "tcp" }, - { "indura", { NULL }, 3156, "udp" }, - { "e3consultants", { NULL }, 3157, "tcp" }, - { "e3consultants", { NULL }, 3157, "udp" }, - { "stvp", { NULL }, 3158, "tcp" }, - { "stvp", { NULL }, 3158, "udp" }, - { "navegaweb-port", { NULL }, 3159, "tcp" }, - { "navegaweb-port", { NULL }, 3159, "udp" }, - { "tip-app-server", { NULL }, 3160, "tcp" }, - { "tip-app-server", { NULL }, 3160, "udp" }, - { "doc1lm", { NULL }, 3161, "tcp" }, - { "doc1lm", { NULL }, 3161, "udp" }, - { "sflm", { NULL }, 3162, "tcp" }, - { "sflm", { NULL }, 3162, "udp" }, - { "res-sap", { NULL }, 3163, "tcp" }, - { "res-sap", { NULL }, 3163, "udp" }, - { "imprs", { NULL }, 3164, "tcp" }, - { "imprs", { NULL }, 3164, "udp" }, - { "newgenpay", { NULL }, 3165, "tcp" }, - { "newgenpay", { NULL }, 3165, "udp" }, - { "sossecollector", { NULL }, 3166, "tcp" }, - { "sossecollector", { NULL }, 3166, "udp" }, - { "nowcontact", { NULL }, 3167, "tcp" }, - { "nowcontact", { NULL }, 3167, "udp" }, - { "poweronnud", { NULL }, 3168, "tcp" }, - { "poweronnud", { NULL }, 3168, "udp" }, - { "serverview-as", { NULL }, 3169, "tcp" }, - { "serverview-as", { NULL }, 3169, "udp" }, - { "serverview-asn", { NULL }, 3170, "tcp" }, - { "serverview-asn", { NULL }, 3170, "udp" }, - { "serverview-gf", { NULL }, 3171, "tcp" }, - { "serverview-gf", { NULL }, 3171, "udp" }, - { "serverview-rm", { NULL }, 3172, "tcp" }, - { "serverview-rm", { NULL }, 3172, "udp" }, - { "serverview-icc", { NULL }, 3173, "tcp" }, - { "serverview-icc", { NULL }, 3173, "udp" }, - { "armi-server", { NULL }, 3174, "tcp" }, - { "armi-server", { NULL }, 3174, "udp" }, - { "t1-e1-over-ip", { NULL }, 3175, "tcp" }, - { "t1-e1-over-ip", { NULL }, 3175, "udp" }, - { "ars-master", { NULL }, 3176, "tcp" }, - { "ars-master", { NULL }, 3176, "udp" }, - { "phonex-port", { NULL }, 3177, "tcp" }, - { "phonex-port", { NULL }, 3177, "udp" }, - { "radclientport", { NULL }, 3178, "tcp" }, - { "radclientport", { NULL }, 3178, "udp" }, - { "h2gf-w-2m", { NULL }, 3179, "tcp" }, - { "h2gf-w-2m", { NULL }, 3179, "udp" }, - { "mc-brk-srv", { NULL }, 3180, "tcp" }, - { "mc-brk-srv", { NULL }, 3180, "udp" }, - { "bmcpatrolagent", { NULL }, 3181, "tcp" }, - { "bmcpatrolagent", { NULL }, 3181, "udp" }, - { "bmcpatrolrnvu", { NULL }, 3182, "tcp" }, - { "bmcpatrolrnvu", { NULL }, 3182, "udp" }, - { "cops-tls", { NULL }, 3183, "tcp" }, - { "cops-tls", { NULL }, 3183, "udp" }, - { "apogeex-port", { NULL }, 3184, "tcp" }, - { "apogeex-port", { NULL }, 3184, "udp" }, - { "smpppd", { NULL }, 3185, "tcp" }, - { "smpppd", { NULL }, 3185, "udp" }, - { "iiw-port", { NULL }, 3186, "tcp" }, - { "iiw-port", { NULL }, 3186, "udp" }, - { "odi-port", { NULL }, 3187, "tcp" }, - { "odi-port", { NULL }, 3187, "udp" }, - { "brcm-comm-port", { NULL }, 3188, "tcp" }, - { "brcm-comm-port", { NULL }, 3188, "udp" }, - { "pcle-infex", { NULL }, 3189, "tcp" }, - { "pcle-infex", { NULL }, 3189, "udp" }, - { "csvr-proxy", { NULL }, 3190, "tcp" }, - { "csvr-proxy", { NULL }, 3190, "udp" }, - { "csvr-sslproxy", { NULL }, 3191, "tcp" }, - { "csvr-sslproxy", { NULL }, 3191, "udp" }, - { "firemonrcc", { NULL }, 3192, "tcp" }, - { "firemonrcc", { NULL }, 3192, "udp" }, - { "spandataport", { NULL }, 3193, "tcp" }, - { "spandataport", { NULL }, 3193, "udp" }, - { "magbind", { NULL }, 3194, "tcp" }, - { "magbind", { NULL }, 3194, "udp" }, - { "ncu-1", { NULL }, 3195, "tcp" }, - { "ncu-1", { NULL }, 3195, "udp" }, - { "ncu-2", { NULL }, 3196, "tcp" }, - { "ncu-2", { NULL }, 3196, "udp" }, - { "embrace-dp-s", { NULL }, 3197, "tcp" }, - { "embrace-dp-s", { NULL }, 3197, "udp" }, - { "embrace-dp-c", { NULL }, 3198, "tcp" }, - { "embrace-dp-c", { NULL }, 3198, "udp" }, - { "dmod-workspace", { NULL }, 3199, "tcp" }, - { "dmod-workspace", { NULL }, 3199, "udp" }, - { "tick-port", { NULL }, 3200, "tcp" }, - { "tick-port", { NULL }, 3200, "udp" }, - { "cpq-tasksmart", { NULL }, 3201, "tcp" }, - { "cpq-tasksmart", { NULL }, 3201, "udp" }, - { "intraintra", { NULL }, 3202, "tcp" }, - { "intraintra", { NULL }, 3202, "udp" }, - { "netwatcher-mon", { NULL }, 3203, "tcp" }, - { "netwatcher-mon", { NULL }, 3203, "udp" }, - { "netwatcher-db", { NULL }, 3204, "tcp" }, - { "netwatcher-db", { NULL }, 3204, "udp" }, - { "isns", { NULL }, 3205, "tcp" }, - { "isns", { NULL }, 3205, "udp" }, - { "ironmail", { NULL }, 3206, "tcp" }, - { "ironmail", { NULL }, 3206, "udp" }, - { "vx-auth-port", { NULL }, 3207, "tcp" }, - { "vx-auth-port", { NULL }, 3207, "udp" }, - { "pfu-prcallback", { NULL }, 3208, "tcp" }, - { "pfu-prcallback", { NULL }, 3208, "udp" }, - { "netwkpathengine", { NULL }, 3209, "tcp" }, - { "netwkpathengine", { NULL }, 3209, "udp" }, - { "flamenco-proxy", { NULL }, 3210, "tcp" }, - { "flamenco-proxy", { NULL }, 3210, "udp" }, - { "avsecuremgmt", { NULL }, 3211, "tcp" }, - { "avsecuremgmt", { NULL }, 3211, "udp" }, - { "surveyinst", { NULL }, 3212, "tcp" }, - { "surveyinst", { NULL }, 3212, "udp" }, - { "neon24x7", { NULL }, 3213, "tcp" }, - { "neon24x7", { NULL }, 3213, "udp" }, - { "jmq-daemon-1", { NULL }, 3214, "tcp" }, - { "jmq-daemon-1", { NULL }, 3214, "udp" }, - { "jmq-daemon-2", { NULL }, 3215, "tcp" }, - { "jmq-daemon-2", { NULL }, 3215, "udp" }, - { "ferrari-foam", { NULL }, 3216, "tcp" }, - { "ferrari-foam", { NULL }, 3216, "udp" }, - { "unite", { NULL }, 3217, "tcp" }, - { "unite", { NULL }, 3217, "udp" }, - { "smartpackets", { NULL }, 3218, "tcp" }, - { "smartpackets", { NULL }, 3218, "udp" }, - { "wms-messenger", { NULL }, 3219, "tcp" }, - { "wms-messenger", { NULL }, 3219, "udp" }, - { "xnm-ssl", { NULL }, 3220, "tcp" }, - { "xnm-ssl", { NULL }, 3220, "udp" }, - { "xnm-clear-text", { NULL }, 3221, "tcp" }, - { "xnm-clear-text", { NULL }, 3221, "udp" }, - { "glbp", { NULL }, 3222, "tcp" }, - { "glbp", { NULL }, 3222, "udp" }, - { "digivote", { NULL }, 3223, "tcp" }, - { "digivote", { NULL }, 3223, "udp" }, - { "aes-discovery", { NULL }, 3224, "tcp" }, - { "aes-discovery", { NULL }, 3224, "udp" }, - { "fcip-port", { NULL }, 3225, "tcp" }, - { "fcip-port", { NULL }, 3225, "udp" }, - { "isi-irp", { NULL }, 3226, "tcp" }, - { "isi-irp", { NULL }, 3226, "udp" }, - { "dwnmshttp", { NULL }, 3227, "tcp" }, - { "dwnmshttp", { NULL }, 3227, "udp" }, - { "dwmsgserver", { NULL }, 3228, "tcp" }, - { "dwmsgserver", { NULL }, 3228, "udp" }, - { "global-cd-port", { NULL }, 3229, "tcp" }, - { "global-cd-port", { NULL }, 3229, "udp" }, - { "sftdst-port", { NULL }, 3230, "tcp" }, - { "sftdst-port", { NULL }, 3230, "udp" }, - { "vidigo", { NULL }, 3231, "tcp" }, - { "vidigo", { NULL }, 3231, "udp" }, - { "mdtp", { NULL }, 3232, "tcp" }, - { "mdtp", { NULL }, 3232, "udp" }, - { "whisker", { NULL }, 3233, "tcp" }, - { "whisker", { NULL }, 3233, "udp" }, - { "alchemy", { NULL }, 3234, "tcp" }, - { "alchemy", { NULL }, 3234, "udp" }, - { "mdap-port", { NULL }, 3235, "tcp" }, - { "mdap-port", { NULL }, 3235, "udp" }, - { "apparenet-ts", { NULL }, 3236, "tcp" }, - { "apparenet-ts", { NULL }, 3236, "udp" }, - { "apparenet-tps", { NULL }, 3237, "tcp" }, - { "apparenet-tps", { NULL }, 3237, "udp" }, - { "apparenet-as", { NULL }, 3238, "tcp" }, - { "apparenet-as", { NULL }, 3238, "udp" }, - { "apparenet-ui", { NULL }, 3239, "tcp" }, - { "apparenet-ui", { NULL }, 3239, "udp" }, - { "triomotion", { NULL }, 3240, "tcp" }, - { "triomotion", { NULL }, 3240, "udp" }, - { "sysorb", { NULL }, 3241, "tcp" }, - { "sysorb", { NULL }, 3241, "udp" }, - { "sdp-id-port", { NULL }, 3242, "tcp" }, - { "sdp-id-port", { NULL }, 3242, "udp" }, - { "timelot", { NULL }, 3243, "tcp" }, - { "timelot", { NULL }, 3243, "udp" }, - { "onesaf", { NULL }, 3244, "tcp" }, - { "onesaf", { NULL }, 3244, "udp" }, - { "vieo-fe", { NULL }, 3245, "tcp" }, - { "vieo-fe", { NULL }, 3245, "udp" }, - { "dvt-system", { NULL }, 3246, "tcp" }, - { "dvt-system", { NULL }, 3246, "udp" }, - { "dvt-data", { NULL }, 3247, "tcp" }, - { "dvt-data", { NULL }, 3247, "udp" }, - { "procos-lm", { NULL }, 3248, "tcp" }, - { "procos-lm", { NULL }, 3248, "udp" }, - { "ssp", { NULL }, 3249, "tcp" }, - { "ssp", { NULL }, 3249, "udp" }, - { "hicp", { NULL }, 3250, "tcp" }, - { "hicp", { NULL }, 3250, "udp" }, - { "sysscanner", { NULL }, 3251, "tcp" }, - { "sysscanner", { NULL }, 3251, "udp" }, - { "dhe", { NULL }, 3252, "tcp" }, - { "dhe", { NULL }, 3252, "udp" }, - { "pda-data", { NULL }, 3253, "tcp" }, - { "pda-data", { NULL }, 3253, "udp" }, - { "pda-sys", { NULL }, 3254, "tcp" }, - { "pda-sys", { NULL }, 3254, "udp" }, - { "semaphore", { NULL }, 3255, "tcp" }, - { "semaphore", { NULL }, 3255, "udp" }, - { "cpqrpm-agent", { NULL }, 3256, "tcp" }, - { "cpqrpm-agent", { NULL }, 3256, "udp" }, - { "cpqrpm-server", { NULL }, 3257, "tcp" }, - { "cpqrpm-server", { NULL }, 3257, "udp" }, - { "ivecon-port", { NULL }, 3258, "tcp" }, - { "ivecon-port", { NULL }, 3258, "udp" }, - { "epncdp2", { NULL }, 3259, "tcp" }, - { "epncdp2", { NULL }, 3259, "udp" }, - { "iscsi-target", { NULL }, 3260, "tcp" }, - { "iscsi-target", { NULL }, 3260, "udp" }, - { "winshadow", { NULL }, 3261, "tcp" }, - { "winshadow", { NULL }, 3261, "udp" }, - { "necp", { NULL }, 3262, "tcp" }, - { "necp", { NULL }, 3262, "udp" }, - { "ecolor-imager", { NULL }, 3263, "tcp" }, - { "ecolor-imager", { NULL }, 3263, "udp" }, - { "ccmail", { NULL }, 3264, "tcp" }, - { "ccmail", { NULL }, 3264, "udp" }, - { "altav-tunnel", { NULL }, 3265, "tcp" }, - { "altav-tunnel", { NULL }, 3265, "udp" }, - { "ns-cfg-server", { NULL }, 3266, "tcp" }, - { "ns-cfg-server", { NULL }, 3266, "udp" }, - { "ibm-dial-out", { NULL }, 3267, "tcp" }, - { "ibm-dial-out", { NULL }, 3267, "udp" }, - { "msft-gc", { NULL }, 3268, "tcp" }, - { "msft-gc", { NULL }, 3268, "udp" }, - { "msft-gc-ssl", { NULL }, 3269, "tcp" }, - { "msft-gc-ssl", { NULL }, 3269, "udp" }, - { "verismart", { NULL }, 3270, "tcp" }, - { "verismart", { NULL }, 3270, "udp" }, - { "csoft-prev", { NULL }, 3271, "tcp" }, - { "csoft-prev", { NULL }, 3271, "udp" }, - { "user-manager", { NULL }, 3272, "tcp" }, - { "user-manager", { NULL }, 3272, "udp" }, - { "sxmp", { NULL }, 3273, "tcp" }, - { "sxmp", { NULL }, 3273, "udp" }, - { "ordinox-server", { NULL }, 3274, "tcp" }, - { "ordinox-server", { NULL }, 3274, "udp" }, - { "samd", { NULL }, 3275, "tcp" }, - { "samd", { NULL }, 3275, "udp" }, - { "maxim-asics", { NULL }, 3276, "tcp" }, - { "maxim-asics", { NULL }, 3276, "udp" }, - { "awg-proxy", { NULL }, 3277, "tcp" }, - { "awg-proxy", { NULL }, 3277, "udp" }, - { "lkcmserver", { NULL }, 3278, "tcp" }, - { "lkcmserver", { NULL }, 3278, "udp" }, - { "admind", { NULL }, 3279, "tcp" }, - { "admind", { NULL }, 3279, "udp" }, - { "vs-server", { NULL }, 3280, "tcp" }, - { "vs-server", { NULL }, 3280, "udp" }, - { "sysopt", { NULL }, 3281, "tcp" }, - { "sysopt", { NULL }, 3281, "udp" }, - { "datusorb", { NULL }, 3282, "tcp" }, - { "datusorb", { NULL }, 3282, "udp" }, - { "net-assistant", { NULL }, 3283, "tcp" }, - { "net-assistant", { NULL }, 3283, "udp" }, - { "4talk", { NULL }, 3284, "tcp" }, - { "4talk", { NULL }, 3284, "udp" }, - { "plato", { NULL }, 3285, "tcp" }, - { "plato", { NULL }, 3285, "udp" }, - { "e-net", { NULL }, 3286, "tcp" }, - { "e-net", { NULL }, 3286, "udp" }, - { "directvdata", { NULL }, 3287, "tcp" }, - { "directvdata", { NULL }, 3287, "udp" }, - { "cops", { NULL }, 3288, "tcp" }, - { "cops", { NULL }, 3288, "udp" }, - { "enpc", { NULL }, 3289, "tcp" }, - { "enpc", { NULL }, 3289, "udp" }, - { "caps-lm", { NULL }, 3290, "tcp" }, - { "caps-lm", { NULL }, 3290, "udp" }, - { "sah-lm", { NULL }, 3291, "tcp" }, - { "sah-lm", { NULL }, 3291, "udp" }, - { "cart-o-rama", { NULL }, 3292, "tcp" }, - { "cart-o-rama", { NULL }, 3292, "udp" }, - { "fg-fps", { NULL }, 3293, "tcp" }, - { "fg-fps", { NULL }, 3293, "udp" }, - { "fg-gip", { NULL }, 3294, "tcp" }, - { "fg-gip", { NULL }, 3294, "udp" }, - { "dyniplookup", { NULL }, 3295, "tcp" }, - { "dyniplookup", { NULL }, 3295, "udp" }, - { "rib-slm", { NULL }, 3296, "tcp" }, - { "rib-slm", { NULL }, 3296, "udp" }, - { "cytel-lm", { NULL }, 3297, "tcp" }, - { "cytel-lm", { NULL }, 3297, "udp" }, - { "deskview", { NULL }, 3298, "tcp" }, - { "deskview", { NULL }, 3298, "udp" }, - { "pdrncs", { NULL }, 3299, "tcp" }, - { "pdrncs", { NULL }, 3299, "udp" }, - { "mcs-fastmail", { NULL }, 3302, "tcp" }, - { "mcs-fastmail", { NULL }, 3302, "udp" }, - { "opsession-clnt", { NULL }, 3303, "tcp" }, - { "opsession-clnt", { NULL }, 3303, "udp" }, - { "opsession-srvr", { NULL }, 3304, "tcp" }, - { "opsession-srvr", { NULL }, 3304, "udp" }, - { "odette-ftp", { NULL }, 3305, "tcp" }, - { "odette-ftp", { NULL }, 3305, "udp" }, - { "mysql", { NULL }, 3306, "tcp" }, - { "mysql", { NULL }, 3306, "udp" }, - { "opsession-prxy", { NULL }, 3307, "tcp" }, - { "opsession-prxy", { NULL }, 3307, "udp" }, - { "tns-server", { NULL }, 3308, "tcp" }, - { "tns-server", { NULL }, 3308, "udp" }, - { "tns-adv", { NULL }, 3309, "tcp" }, - { "tns-adv", { NULL }, 3309, "udp" }, - { "dyna-access", { NULL }, 3310, "tcp" }, - { "dyna-access", { NULL }, 3310, "udp" }, - { "mcns-tel-ret", { NULL }, 3311, "tcp" }, - { "mcns-tel-ret", { NULL }, 3311, "udp" }, - { "appman-server", { NULL }, 3312, "tcp" }, - { "appman-server", { NULL }, 3312, "udp" }, - { "uorb", { NULL }, 3313, "tcp" }, - { "uorb", { NULL }, 3313, "udp" }, - { "uohost", { NULL }, 3314, "tcp" }, - { "uohost", { NULL }, 3314, "udp" }, - { "cdid", { NULL }, 3315, "tcp" }, - { "cdid", { NULL }, 3315, "udp" }, - { "aicc-cmi", { NULL }, 3316, "tcp" }, - { "aicc-cmi", { NULL }, 3316, "udp" }, - { "vsaiport", { NULL }, 3317, "tcp" }, - { "vsaiport", { NULL }, 3317, "udp" }, - { "ssrip", { NULL }, 3318, "tcp" }, - { "ssrip", { NULL }, 3318, "udp" }, - { "sdt-lmd", { NULL }, 3319, "tcp" }, - { "sdt-lmd", { NULL }, 3319, "udp" }, - { "officelink2000", { NULL }, 3320, "tcp" }, - { "officelink2000", { NULL }, 3320, "udp" }, - { "vnsstr", { NULL }, 3321, "tcp" }, - { "vnsstr", { NULL }, 3321, "udp" }, - { "sftu", { NULL }, 3326, "tcp" }, - { "sftu", { NULL }, 3326, "udp" }, - { "bbars", { NULL }, 3327, "tcp" }, - { "bbars", { NULL }, 3327, "udp" }, - { "egptlm", { NULL }, 3328, "tcp" }, - { "egptlm", { NULL }, 3328, "udp" }, - { "hp-device-disc", { NULL }, 3329, "tcp" }, - { "hp-device-disc", { NULL }, 3329, "udp" }, - { "mcs-calypsoicf", { NULL }, 3330, "tcp" }, - { "mcs-calypsoicf", { NULL }, 3330, "udp" }, - { "mcs-messaging", { NULL }, 3331, "tcp" }, - { "mcs-messaging", { NULL }, 3331, "udp" }, - { "mcs-mailsvr", { NULL }, 3332, "tcp" }, - { "mcs-mailsvr", { NULL }, 3332, "udp" }, - { "dec-notes", { NULL }, 3333, "tcp" }, - { "dec-notes", { NULL }, 3333, "udp" }, - { "directv-web", { NULL }, 3334, "tcp" }, - { "directv-web", { NULL }, 3334, "udp" }, - { "directv-soft", { NULL }, 3335, "tcp" }, - { "directv-soft", { NULL }, 3335, "udp" }, - { "directv-tick", { NULL }, 3336, "tcp" }, - { "directv-tick", { NULL }, 3336, "udp" }, - { "directv-catlg", { NULL }, 3337, "tcp" }, - { "directv-catlg", { NULL }, 3337, "udp" }, - { "anet-b", { NULL }, 3338, "tcp" }, - { "anet-b", { NULL }, 3338, "udp" }, - { "anet-l", { NULL }, 3339, "tcp" }, - { "anet-l", { NULL }, 3339, "udp" }, - { "anet-m", { NULL }, 3340, "tcp" }, - { "anet-m", { NULL }, 3340, "udp" }, - { "anet-h", { NULL }, 3341, "tcp" }, - { "anet-h", { NULL }, 3341, "udp" }, - { "webtie", { NULL }, 3342, "tcp" }, - { "webtie", { NULL }, 3342, "udp" }, - { "ms-cluster-net", { NULL }, 3343, "tcp" }, - { "ms-cluster-net", { NULL }, 3343, "udp" }, - { "bnt-manager", { NULL }, 3344, "tcp" }, - { "bnt-manager", { NULL }, 3344, "udp" }, - { "influence", { NULL }, 3345, "tcp" }, - { "influence", { NULL }, 3345, "udp" }, - { "trnsprntproxy", { NULL }, 3346, "tcp" }, - { "trnsprntproxy", { NULL }, 3346, "udp" }, - { "phoenix-rpc", { NULL }, 3347, "tcp" }, - { "phoenix-rpc", { NULL }, 3347, "udp" }, - { "pangolin-laser", { NULL }, 3348, "tcp" }, - { "pangolin-laser", { NULL }, 3348, "udp" }, - { "chevinservices", { NULL }, 3349, "tcp" }, - { "chevinservices", { NULL }, 3349, "udp" }, - { "findviatv", { NULL }, 3350, "tcp" }, - { "findviatv", { NULL }, 3350, "udp" }, - { "btrieve", { NULL }, 3351, "tcp" }, - { "btrieve", { NULL }, 3351, "udp" }, - { "ssql", { NULL }, 3352, "tcp" }, - { "ssql", { NULL }, 3352, "udp" }, - { "fatpipe", { NULL }, 3353, "tcp" }, - { "fatpipe", { NULL }, 3353, "udp" }, - { "suitjd", { NULL }, 3354, "tcp" }, - { "suitjd", { NULL }, 3354, "udp" }, - { "ordinox-dbase", { NULL }, 3355, "tcp" }, - { "ordinox-dbase", { NULL }, 3355, "udp" }, - { "upnotifyps", { NULL }, 3356, "tcp" }, - { "upnotifyps", { NULL }, 3356, "udp" }, - { "adtech-test", { NULL }, 3357, "tcp" }, - { "adtech-test", { NULL }, 3357, "udp" }, - { "mpsysrmsvr", { NULL }, 3358, "tcp" }, - { "mpsysrmsvr", { NULL }, 3358, "udp" }, - { "wg-netforce", { NULL }, 3359, "tcp" }, - { "wg-netforce", { NULL }, 3359, "udp" }, - { "kv-server", { NULL }, 3360, "tcp" }, - { "kv-server", { NULL }, 3360, "udp" }, - { "kv-agent", { NULL }, 3361, "tcp" }, - { "kv-agent", { NULL }, 3361, "udp" }, - { "dj-ilm", { NULL }, 3362, "tcp" }, - { "dj-ilm", { NULL }, 3362, "udp" }, - { "nati-vi-server", { NULL }, 3363, "tcp" }, - { "nati-vi-server", { NULL }, 3363, "udp" }, - { "creativeserver", { NULL }, 3364, "tcp" }, - { "creativeserver", { NULL }, 3364, "udp" }, - { "contentserver", { NULL }, 3365, "tcp" }, - { "contentserver", { NULL }, 3365, "udp" }, - { "creativepartnr", { NULL }, 3366, "tcp" }, - { "creativepartnr", { NULL }, 3366, "udp" }, - { "tip2", { NULL }, 3372, "tcp" }, - { "tip2", { NULL }, 3372, "udp" }, - { "lavenir-lm", { NULL }, 3373, "tcp" }, - { "lavenir-lm", { NULL }, 3373, "udp" }, - { "cluster-disc", { NULL }, 3374, "tcp" }, - { "cluster-disc", { NULL }, 3374, "udp" }, - { "vsnm-agent", { NULL }, 3375, "tcp" }, - { "vsnm-agent", { NULL }, 3375, "udp" }, - { "cdbroker", { NULL }, 3376, "tcp" }, - { "cdbroker", { NULL }, 3376, "udp" }, - { "cogsys-lm", { NULL }, 3377, "tcp" }, - { "cogsys-lm", { NULL }, 3377, "udp" }, - { "wsicopy", { NULL }, 3378, "tcp" }, - { "wsicopy", { NULL }, 3378, "udp" }, - { "socorfs", { NULL }, 3379, "tcp" }, - { "socorfs", { NULL }, 3379, "udp" }, - { "sns-channels", { NULL }, 3380, "tcp" }, - { "sns-channels", { NULL }, 3380, "udp" }, - { "geneous", { NULL }, 3381, "tcp" }, - { "geneous", { NULL }, 3381, "udp" }, - { "fujitsu-neat", { NULL }, 3382, "tcp" }, - { "fujitsu-neat", { NULL }, 3382, "udp" }, - { "esp-lm", { NULL }, 3383, "tcp" }, - { "esp-lm", { NULL }, 3383, "udp" }, - { "hp-clic", { NULL }, 3384, "tcp" }, - { "hp-clic", { NULL }, 3384, "udp" }, - { "qnxnetman", { NULL }, 3385, "tcp" }, - { "qnxnetman", { NULL }, 3385, "udp" }, - { "gprs-data", { NULL }, 3386, "tcp" }, - { "gprs-sig", { NULL }, 3386, "udp" }, - { "backroomnet", { NULL }, 3387, "tcp" }, - { "backroomnet", { NULL }, 3387, "udp" }, - { "cbserver", { NULL }, 3388, "tcp" }, - { "cbserver", { NULL }, 3388, "udp" }, - { "ms-wbt-server", { NULL }, 3389, "tcp" }, - { "ms-wbt-server", { NULL }, 3389, "udp" }, - { "dsc", { NULL }, 3390, "tcp" }, - { "dsc", { NULL }, 3390, "udp" }, - { "savant", { NULL }, 3391, "tcp" }, - { "savant", { NULL }, 3391, "udp" }, - { "efi-lm", { NULL }, 3392, "tcp" }, - { "efi-lm", { NULL }, 3392, "udp" }, - { "d2k-tapestry1", { NULL }, 3393, "tcp" }, - { "d2k-tapestry1", { NULL }, 3393, "udp" }, - { "d2k-tapestry2", { NULL }, 3394, "tcp" }, - { "d2k-tapestry2", { NULL }, 3394, "udp" }, - { "dyna-lm", { NULL }, 3395, "tcp" }, - { "dyna-lm", { NULL }, 3395, "udp" }, - { "printer_agent", { NULL }, 3396, "tcp" }, - { "printer_agent", { NULL }, 3396, "udp" }, - { "cloanto-lm", { NULL }, 3397, "tcp" }, - { "cloanto-lm", { NULL }, 3397, "udp" }, - { "mercantile", { NULL }, 3398, "tcp" }, - { "mercantile", { NULL }, 3398, "udp" }, - { "csms", { NULL }, 3399, "tcp" }, - { "csms", { NULL }, 3399, "udp" }, - { "csms2", { NULL }, 3400, "tcp" }, - { "csms2", { NULL }, 3400, "udp" }, - { "filecast", { NULL }, 3401, "tcp" }, - { "filecast", { NULL }, 3401, "udp" }, - { "fxaengine-net", { NULL }, 3402, "tcp" }, - { "fxaengine-net", { NULL }, 3402, "udp" }, - { "nokia-ann-ch1", { NULL }, 3405, "tcp" }, - { "nokia-ann-ch1", { NULL }, 3405, "udp" }, - { "nokia-ann-ch2", { NULL }, 3406, "tcp" }, - { "nokia-ann-ch2", { NULL }, 3406, "udp" }, - { "ldap-admin", { NULL }, 3407, "tcp" }, - { "ldap-admin", { NULL }, 3407, "udp" }, - { "BESApi", { NULL }, 3408, "tcp" }, - { "BESApi", { NULL }, 3408, "udp" }, - { "networklens", { NULL }, 3409, "tcp" }, - { "networklens", { NULL }, 3409, "udp" }, - { "networklenss", { NULL }, 3410, "tcp" }, - { "networklenss", { NULL }, 3410, "udp" }, - { "biolink-auth", { NULL }, 3411, "tcp" }, - { "biolink-auth", { NULL }, 3411, "udp" }, - { "xmlblaster", { NULL }, 3412, "tcp" }, - { "xmlblaster", { NULL }, 3412, "udp" }, - { "svnet", { NULL }, 3413, "tcp" }, - { "svnet", { NULL }, 3413, "udp" }, - { "wip-port", { NULL }, 3414, "tcp" }, - { "wip-port", { NULL }, 3414, "udp" }, - { "bcinameservice", { NULL }, 3415, "tcp" }, - { "bcinameservice", { NULL }, 3415, "udp" }, - { "commandport", { NULL }, 3416, "tcp" }, - { "commandport", { NULL }, 3416, "udp" }, - { "csvr", { NULL }, 3417, "tcp" }, - { "csvr", { NULL }, 3417, "udp" }, - { "rnmap", { NULL }, 3418, "tcp" }, - { "rnmap", { NULL }, 3418, "udp" }, - { "softaudit", { NULL }, 3419, "tcp" }, - { "softaudit", { NULL }, 3419, "udp" }, - { "ifcp-port", { NULL }, 3420, "tcp" }, - { "ifcp-port", { NULL }, 3420, "udp" }, - { "bmap", { NULL }, 3421, "tcp" }, - { "bmap", { NULL }, 3421, "udp" }, - { "rusb-sys-port", { NULL }, 3422, "tcp" }, - { "rusb-sys-port", { NULL }, 3422, "udp" }, - { "xtrm", { NULL }, 3423, "tcp" }, - { "xtrm", { NULL }, 3423, "udp" }, - { "xtrms", { NULL }, 3424, "tcp" }, - { "xtrms", { NULL }, 3424, "udp" }, - { "agps-port", { NULL }, 3425, "tcp" }, - { "agps-port", { NULL }, 3425, "udp" }, - { "arkivio", { NULL }, 3426, "tcp" }, - { "arkivio", { NULL }, 3426, "udp" }, - { "websphere-snmp", { NULL }, 3427, "tcp" }, - { "websphere-snmp", { NULL }, 3427, "udp" }, - { "twcss", { NULL }, 3428, "tcp" }, - { "twcss", { NULL }, 3428, "udp" }, - { "gcsp", { NULL }, 3429, "tcp" }, - { "gcsp", { NULL }, 3429, "udp" }, - { "ssdispatch", { NULL }, 3430, "tcp" }, - { "ssdispatch", { NULL }, 3430, "udp" }, - { "ndl-als", { NULL }, 3431, "tcp" }, - { "ndl-als", { NULL }, 3431, "udp" }, - { "osdcp", { NULL }, 3432, "tcp" }, - { "osdcp", { NULL }, 3432, "udp" }, - { "alta-smp", { NULL }, 3433, "tcp" }, - { "alta-smp", { NULL }, 3433, "udp" }, - { "opencm", { NULL }, 3434, "tcp" }, - { "opencm", { NULL }, 3434, "udp" }, - { "pacom", { NULL }, 3435, "tcp" }, - { "pacom", { NULL }, 3435, "udp" }, - { "gc-config", { NULL }, 3436, "tcp" }, - { "gc-config", { NULL }, 3436, "udp" }, - { "autocueds", { NULL }, 3437, "tcp" }, - { "autocueds", { NULL }, 3437, "udp" }, - { "spiral-admin", { NULL }, 3438, "tcp" }, - { "spiral-admin", { NULL }, 3438, "udp" }, - { "hri-port", { NULL }, 3439, "tcp" }, - { "hri-port", { NULL }, 3439, "udp" }, - { "ans-console", { NULL }, 3440, "tcp" }, - { "ans-console", { NULL }, 3440, "udp" }, - { "connect-client", { NULL }, 3441, "tcp" }, - { "connect-client", { NULL }, 3441, "udp" }, - { "connect-server", { NULL }, 3442, "tcp" }, - { "connect-server", { NULL }, 3442, "udp" }, - { "ov-nnm-websrv", { NULL }, 3443, "tcp" }, - { "ov-nnm-websrv", { NULL }, 3443, "udp" }, - { "denali-server", { NULL }, 3444, "tcp" }, - { "denali-server", { NULL }, 3444, "udp" }, - { "monp", { NULL }, 3445, "tcp" }, - { "monp", { NULL }, 3445, "udp" }, - { "3comfaxrpc", { NULL }, 3446, "tcp" }, - { "3comfaxrpc", { NULL }, 3446, "udp" }, - { "directnet", { NULL }, 3447, "tcp" }, - { "directnet", { NULL }, 3447, "udp" }, - { "dnc-port", { NULL }, 3448, "tcp" }, - { "dnc-port", { NULL }, 3448, "udp" }, - { "hotu-chat", { NULL }, 3449, "tcp" }, - { "hotu-chat", { NULL }, 3449, "udp" }, - { "castorproxy", { NULL }, 3450, "tcp" }, - { "castorproxy", { NULL }, 3450, "udp" }, - { "asam", { NULL }, 3451, "tcp" }, - { "asam", { NULL }, 3451, "udp" }, - { "sabp-signal", { NULL }, 3452, "tcp" }, - { "sabp-signal", { NULL }, 3452, "udp" }, - { "pscupd", { NULL }, 3453, "tcp" }, - { "pscupd", { NULL }, 3453, "udp" }, - { "mira", { NULL }, 3454, "tcp" }, - { "prsvp", { NULL }, 3455, "tcp" }, - { "prsvp", { NULL }, 3455, "udp" }, - { "vat", { NULL }, 3456, "tcp" }, - { "vat", { NULL }, 3456, "udp" }, - { "vat-control", { NULL }, 3457, "tcp" }, - { "vat-control", { NULL }, 3457, "udp" }, - { "d3winosfi", { NULL }, 3458, "tcp" }, - { "d3winosfi", { NULL }, 3458, "udp" }, - { "integral", { NULL }, 3459, "tcp" }, - { "integral", { NULL }, 3459, "udp" }, - { "edm-manager", { NULL }, 3460, "tcp" }, - { "edm-manager", { NULL }, 3460, "udp" }, - { "edm-stager", { NULL }, 3461, "tcp" }, - { "edm-stager", { NULL }, 3461, "udp" }, - { "edm-std-notify", { NULL }, 3462, "tcp" }, - { "edm-std-notify", { NULL }, 3462, "udp" }, - { "edm-adm-notify", { NULL }, 3463, "tcp" }, - { "edm-adm-notify", { NULL }, 3463, "udp" }, - { "edm-mgr-sync", { NULL }, 3464, "tcp" }, - { "edm-mgr-sync", { NULL }, 3464, "udp" }, - { "edm-mgr-cntrl", { NULL }, 3465, "tcp" }, - { "edm-mgr-cntrl", { NULL }, 3465, "udp" }, - { "workflow", { NULL }, 3466, "tcp" }, - { "workflow", { NULL }, 3466, "udp" }, - { "rcst", { NULL }, 3467, "tcp" }, - { "rcst", { NULL }, 3467, "udp" }, - { "ttcmremotectrl", { NULL }, 3468, "tcp" }, - { "ttcmremotectrl", { NULL }, 3468, "udp" }, - { "pluribus", { NULL }, 3469, "tcp" }, - { "pluribus", { NULL }, 3469, "udp" }, - { "jt400", { NULL }, 3470, "tcp" }, - { "jt400", { NULL }, 3470, "udp" }, - { "jt400-ssl", { NULL }, 3471, "tcp" }, - { "jt400-ssl", { NULL }, 3471, "udp" }, - { "jaugsremotec-1", { NULL }, 3472, "tcp" }, - { "jaugsremotec-1", { NULL }, 3472, "udp" }, - { "jaugsremotec-2", { NULL }, 3473, "tcp" }, - { "jaugsremotec-2", { NULL }, 3473, "udp" }, - { "ttntspauto", { NULL }, 3474, "tcp" }, - { "ttntspauto", { NULL }, 3474, "udp" }, - { "genisar-port", { NULL }, 3475, "tcp" }, - { "genisar-port", { NULL }, 3475, "udp" }, - { "nppmp", { NULL }, 3476, "tcp" }, - { "nppmp", { NULL }, 3476, "udp" }, - { "ecomm", { NULL }, 3477, "tcp" }, - { "ecomm", { NULL }, 3477, "udp" }, - { "stun", { NULL }, 3478, "tcp" }, - { "stun", { NULL }, 3478, "udp" }, - { "turn", { NULL }, 3478, "tcp" }, - { "turn", { NULL }, 3478, "udp" }, - { "stun-behavior", { NULL }, 3478, "tcp" }, - { "stun-behavior", { NULL }, 3478, "udp" }, - { "twrpc", { NULL }, 3479, "tcp" }, - { "twrpc", { NULL }, 3479, "udp" }, - { "plethora", { NULL }, 3480, "tcp" }, - { "plethora", { NULL }, 3480, "udp" }, - { "cleanerliverc", { NULL }, 3481, "tcp" }, - { "cleanerliverc", { NULL }, 3481, "udp" }, - { "vulture", { NULL }, 3482, "tcp" }, - { "vulture", { NULL }, 3482, "udp" }, - { "slim-devices", { NULL }, 3483, "tcp" }, - { "slim-devices", { NULL }, 3483, "udp" }, - { "gbs-stp", { NULL }, 3484, "tcp" }, - { "gbs-stp", { NULL }, 3484, "udp" }, - { "celatalk", { NULL }, 3485, "tcp" }, - { "celatalk", { NULL }, 3485, "udp" }, - { "ifsf-hb-port", { NULL }, 3486, "tcp" }, - { "ifsf-hb-port", { NULL }, 3486, "udp" }, - { "ltctcp", { NULL }, 3487, "tcp" }, - { "ltcudp", { NULL }, 3487, "udp" }, - { "fs-rh-srv", { NULL }, 3488, "tcp" }, - { "fs-rh-srv", { NULL }, 3488, "udp" }, - { "dtp-dia", { NULL }, 3489, "tcp" }, - { "dtp-dia", { NULL }, 3489, "udp" }, - { "colubris", { NULL }, 3490, "tcp" }, - { "colubris", { NULL }, 3490, "udp" }, - { "swr-port", { NULL }, 3491, "tcp" }, - { "swr-port", { NULL }, 3491, "udp" }, - { "tvdumtray-port", { NULL }, 3492, "tcp" }, - { "tvdumtray-port", { NULL }, 3492, "udp" }, - { "nut", { NULL }, 3493, "tcp" }, - { "nut", { NULL }, 3493, "udp" }, - { "ibm3494", { NULL }, 3494, "tcp" }, - { "ibm3494", { NULL }, 3494, "udp" }, - { "seclayer-tcp", { NULL }, 3495, "tcp" }, - { "seclayer-tcp", { NULL }, 3495, "udp" }, - { "seclayer-tls", { NULL }, 3496, "tcp" }, - { "seclayer-tls", { NULL }, 3496, "udp" }, - { "ipether232port", { NULL }, 3497, "tcp" }, - { "ipether232port", { NULL }, 3497, "udp" }, - { "dashpas-port", { NULL }, 3498, "tcp" }, - { "dashpas-port", { NULL }, 3498, "udp" }, - { "sccip-media", { NULL }, 3499, "tcp" }, - { "sccip-media", { NULL }, 3499, "udp" }, - { "rtmp-port", { NULL }, 3500, "tcp" }, - { "rtmp-port", { NULL }, 3500, "udp" }, - { "isoft-p2p", { NULL }, 3501, "tcp" }, - { "isoft-p2p", { NULL }, 3501, "udp" }, - { "avinstalldisc", { NULL }, 3502, "tcp" }, - { "avinstalldisc", { NULL }, 3502, "udp" }, - { "lsp-ping", { NULL }, 3503, "tcp" }, - { "lsp-ping", { NULL }, 3503, "udp" }, - { "ironstorm", { NULL }, 3504, "tcp" }, - { "ironstorm", { NULL }, 3504, "udp" }, - { "ccmcomm", { NULL }, 3505, "tcp" }, - { "ccmcomm", { NULL }, 3505, "udp" }, - { "apc-3506", { NULL }, 3506, "tcp" }, - { "apc-3506", { NULL }, 3506, "udp" }, - { "nesh-broker", { NULL }, 3507, "tcp" }, - { "nesh-broker", { NULL }, 3507, "udp" }, - { "interactionweb", { NULL }, 3508, "tcp" }, - { "interactionweb", { NULL }, 3508, "udp" }, - { "vt-ssl", { NULL }, 3509, "tcp" }, - { "vt-ssl", { NULL }, 3509, "udp" }, - { "xss-port", { NULL }, 3510, "tcp" }, - { "xss-port", { NULL }, 3510, "udp" }, - { "webmail-2", { NULL }, 3511, "tcp" }, - { "webmail-2", { NULL }, 3511, "udp" }, - { "aztec", { NULL }, 3512, "tcp" }, - { "aztec", { NULL }, 3512, "udp" }, - { "arcpd", { NULL }, 3513, "tcp" }, - { "arcpd", { NULL }, 3513, "udp" }, - { "must-p2p", { NULL }, 3514, "tcp" }, - { "must-p2p", { NULL }, 3514, "udp" }, - { "must-backplane", { NULL }, 3515, "tcp" }, - { "must-backplane", { NULL }, 3515, "udp" }, - { "smartcard-port", { NULL }, 3516, "tcp" }, - { "smartcard-port", { NULL }, 3516, "udp" }, - { "802-11-iapp", { NULL }, 3517, "tcp" }, - { "802-11-iapp", { NULL }, 3517, "udp" }, - { "artifact-msg", { NULL }, 3518, "tcp" }, - { "artifact-msg", { NULL }, 3518, "udp" }, - { "nvmsgd", { NULL }, 3519, "tcp" }, - { "galileo", { NULL }, 3519, "udp" }, - { "galileolog", { NULL }, 3520, "tcp" }, - { "galileolog", { NULL }, 3520, "udp" }, - { "mc3ss", { NULL }, 3521, "tcp" }, - { "mc3ss", { NULL }, 3521, "udp" }, - { "nssocketport", { NULL }, 3522, "tcp" }, - { "nssocketport", { NULL }, 3522, "udp" }, - { "odeumservlink", { NULL }, 3523, "tcp" }, - { "odeumservlink", { NULL }, 3523, "udp" }, - { "ecmport", { NULL }, 3524, "tcp" }, - { "ecmport", { NULL }, 3524, "udp" }, - { "eisport", { NULL }, 3525, "tcp" }, - { "eisport", { NULL }, 3525, "udp" }, - { "starquiz-port", { NULL }, 3526, "tcp" }, - { "starquiz-port", { NULL }, 3526, "udp" }, - { "beserver-msg-q", { NULL }, 3527, "tcp" }, - { "beserver-msg-q", { NULL }, 3527, "udp" }, - { "jboss-iiop", { NULL }, 3528, "tcp" }, - { "jboss-iiop", { NULL }, 3528, "udp" }, - { "jboss-iiop-ssl", { NULL }, 3529, "tcp" }, - { "jboss-iiop-ssl", { NULL }, 3529, "udp" }, - { "gf", { NULL }, 3530, "tcp" }, - { "gf", { NULL }, 3530, "udp" }, - { "joltid", { NULL }, 3531, "tcp" }, - { "joltid", { NULL }, 3531, "udp" }, - { "raven-rmp", { NULL }, 3532, "tcp" }, - { "raven-rmp", { NULL }, 3532, "udp" }, - { "raven-rdp", { NULL }, 3533, "tcp" }, - { "raven-rdp", { NULL }, 3533, "udp" }, - { "urld-port", { NULL }, 3534, "tcp" }, - { "urld-port", { NULL }, 3534, "udp" }, - { "ms-la", { NULL }, 3535, "tcp" }, - { "ms-la", { NULL }, 3535, "udp" }, - { "snac", { NULL }, 3536, "tcp" }, - { "snac", { NULL }, 3536, "udp" }, - { "ni-visa-remote", { NULL }, 3537, "tcp" }, - { "ni-visa-remote", { NULL }, 3537, "udp" }, - { "ibm-diradm", { NULL }, 3538, "tcp" }, - { "ibm-diradm", { NULL }, 3538, "udp" }, - { "ibm-diradm-ssl", { NULL }, 3539, "tcp" }, - { "ibm-diradm-ssl", { NULL }, 3539, "udp" }, - { "pnrp-port", { NULL }, 3540, "tcp" }, - { "pnrp-port", { NULL }, 3540, "udp" }, - { "voispeed-port", { NULL }, 3541, "tcp" }, - { "voispeed-port", { NULL }, 3541, "udp" }, - { "hacl-monitor", { NULL }, 3542, "tcp" }, - { "hacl-monitor", { NULL }, 3542, "udp" }, - { "qftest-lookup", { NULL }, 3543, "tcp" }, - { "qftest-lookup", { NULL }, 3543, "udp" }, - { "teredo", { NULL }, 3544, "tcp" }, - { "teredo", { NULL }, 3544, "udp" }, - { "camac", { NULL }, 3545, "tcp" }, - { "camac", { NULL }, 3545, "udp" }, - { "symantec-sim", { NULL }, 3547, "tcp" }, - { "symantec-sim", { NULL }, 3547, "udp" }, - { "interworld", { NULL }, 3548, "tcp" }, - { "interworld", { NULL }, 3548, "udp" }, - { "tellumat-nms", { NULL }, 3549, "tcp" }, - { "tellumat-nms", { NULL }, 3549, "udp" }, - { "ssmpp", { NULL }, 3550, "tcp" }, - { "ssmpp", { NULL }, 3550, "udp" }, - { "apcupsd", { NULL }, 3551, "tcp" }, - { "apcupsd", { NULL }, 3551, "udp" }, - { "taserver", { NULL }, 3552, "tcp" }, - { "taserver", { NULL }, 3552, "udp" }, - { "rbr-discovery", { NULL }, 3553, "tcp" }, - { "rbr-discovery", { NULL }, 3553, "udp" }, - { "questnotify", { NULL }, 3554, "tcp" }, - { "questnotify", { NULL }, 3554, "udp" }, - { "razor", { NULL }, 3555, "tcp" }, - { "razor", { NULL }, 3555, "udp" }, - { "sky-transport", { NULL }, 3556, "tcp" }, - { "sky-transport", { NULL }, 3556, "udp" }, - { "personalos-001", { NULL }, 3557, "tcp" }, - { "personalos-001", { NULL }, 3557, "udp" }, - { "mcp-port", { NULL }, 3558, "tcp" }, - { "mcp-port", { NULL }, 3558, "udp" }, - { "cctv-port", { NULL }, 3559, "tcp" }, - { "cctv-port", { NULL }, 3559, "udp" }, - { "iniserve-port", { NULL }, 3560, "tcp" }, - { "iniserve-port", { NULL }, 3560, "udp" }, - { "bmc-onekey", { NULL }, 3561, "tcp" }, - { "bmc-onekey", { NULL }, 3561, "udp" }, - { "sdbproxy", { NULL }, 3562, "tcp" }, - { "sdbproxy", { NULL }, 3562, "udp" }, - { "watcomdebug", { NULL }, 3563, "tcp" }, - { "watcomdebug", { NULL }, 3563, "udp" }, - { "esimport", { NULL }, 3564, "tcp" }, - { "esimport", { NULL }, 3564, "udp" }, - { "m2pa", { NULL }, 3565, "tcp" }, - { "m2pa", { NULL }, 3565, "sctp" }, - { "quest-data-hub", { NULL }, 3566, "tcp" }, - { "oap", { NULL }, 3567, "tcp" }, - { "oap", { NULL }, 3567, "udp" }, - { "oap-s", { NULL }, 3568, "tcp" }, - { "oap-s", { NULL }, 3568, "udp" }, - { "mbg-ctrl", { NULL }, 3569, "tcp" }, - { "mbg-ctrl", { NULL }, 3569, "udp" }, - { "mccwebsvr-port", { NULL }, 3570, "tcp" }, - { "mccwebsvr-port", { NULL }, 3570, "udp" }, - { "megardsvr-port", { NULL }, 3571, "tcp" }, - { "megardsvr-port", { NULL }, 3571, "udp" }, - { "megaregsvrport", { NULL }, 3572, "tcp" }, - { "megaregsvrport", { NULL }, 3572, "udp" }, - { "tag-ups-1", { NULL }, 3573, "tcp" }, - { "tag-ups-1", { NULL }, 3573, "udp" }, - { "dmaf-server", { NULL }, 3574, "tcp" }, - { "dmaf-caster", { NULL }, 3574, "udp" }, - { "ccm-port", { NULL }, 3575, "tcp" }, - { "ccm-port", { NULL }, 3575, "udp" }, - { "cmc-port", { NULL }, 3576, "tcp" }, - { "cmc-port", { NULL }, 3576, "udp" }, - { "config-port", { NULL }, 3577, "tcp" }, - { "config-port", { NULL }, 3577, "udp" }, - { "data-port", { NULL }, 3578, "tcp" }, - { "data-port", { NULL }, 3578, "udp" }, - { "ttat3lb", { NULL }, 3579, "tcp" }, - { "ttat3lb", { NULL }, 3579, "udp" }, - { "nati-svrloc", { NULL }, 3580, "tcp" }, - { "nati-svrloc", { NULL }, 3580, "udp" }, - { "kfxaclicensing", { NULL }, 3581, "tcp" }, - { "kfxaclicensing", { NULL }, 3581, "udp" }, - { "press", { NULL }, 3582, "tcp" }, - { "press", { NULL }, 3582, "udp" }, - { "canex-watch", { NULL }, 3583, "tcp" }, - { "canex-watch", { NULL }, 3583, "udp" }, - { "u-dbap", { NULL }, 3584, "tcp" }, - { "u-dbap", { NULL }, 3584, "udp" }, - { "emprise-lls", { NULL }, 3585, "tcp" }, - { "emprise-lls", { NULL }, 3585, "udp" }, - { "emprise-lsc", { NULL }, 3586, "tcp" }, - { "emprise-lsc", { NULL }, 3586, "udp" }, - { "p2pgroup", { NULL }, 3587, "tcp" }, - { "p2pgroup", { NULL }, 3587, "udp" }, - { "sentinel", { NULL }, 3588, "tcp" }, - { "sentinel", { NULL }, 3588, "udp" }, - { "isomair", { NULL }, 3589, "tcp" }, - { "isomair", { NULL }, 3589, "udp" }, - { "wv-csp-sms", { NULL }, 3590, "tcp" }, - { "wv-csp-sms", { NULL }, 3590, "udp" }, - { "gtrack-server", { NULL }, 3591, "tcp" }, - { "gtrack-server", { NULL }, 3591, "udp" }, - { "gtrack-ne", { NULL }, 3592, "tcp" }, - { "gtrack-ne", { NULL }, 3592, "udp" }, - { "bpmd", { NULL }, 3593, "tcp" }, - { "bpmd", { NULL }, 3593, "udp" }, - { "mediaspace", { NULL }, 3594, "tcp" }, - { "mediaspace", { NULL }, 3594, "udp" }, - { "shareapp", { NULL }, 3595, "tcp" }, - { "shareapp", { NULL }, 3595, "udp" }, - { "iw-mmogame", { NULL }, 3596, "tcp" }, - { "iw-mmogame", { NULL }, 3596, "udp" }, - { "a14", { NULL }, 3597, "tcp" }, - { "a14", { NULL }, 3597, "udp" }, - { "a15", { NULL }, 3598, "tcp" }, - { "a15", { NULL }, 3598, "udp" }, - { "quasar-server", { NULL }, 3599, "tcp" }, - { "quasar-server", { NULL }, 3599, "udp" }, - { "trap-daemon", { NULL }, 3600, "tcp" }, - { "trap-daemon", { NULL }, 3600, "udp" }, - { "visinet-gui", { NULL }, 3601, "tcp" }, - { "visinet-gui", { NULL }, 3601, "udp" }, - { "infiniswitchcl", { NULL }, 3602, "tcp" }, - { "infiniswitchcl", { NULL }, 3602, "udp" }, - { "int-rcv-cntrl", { NULL }, 3603, "tcp" }, - { "int-rcv-cntrl", { NULL }, 3603, "udp" }, - { "bmc-jmx-port", { NULL }, 3604, "tcp" }, - { "bmc-jmx-port", { NULL }, 3604, "udp" }, - { "comcam-io", { NULL }, 3605, "tcp" }, - { "comcam-io", { NULL }, 3605, "udp" }, - { "splitlock", { NULL }, 3606, "tcp" }, - { "splitlock", { NULL }, 3606, "udp" }, - { "precise-i3", { NULL }, 3607, "tcp" }, - { "precise-i3", { NULL }, 3607, "udp" }, - { "trendchip-dcp", { NULL }, 3608, "tcp" }, - { "trendchip-dcp", { NULL }, 3608, "udp" }, - { "cpdi-pidas-cm", { NULL }, 3609, "tcp" }, - { "cpdi-pidas-cm", { NULL }, 3609, "udp" }, - { "echonet", { NULL }, 3610, "tcp" }, - { "echonet", { NULL }, 3610, "udp" }, - { "six-degrees", { NULL }, 3611, "tcp" }, - { "six-degrees", { NULL }, 3611, "udp" }, - { "hp-dataprotect", { NULL }, 3612, "tcp" }, - { "hp-dataprotect", { NULL }, 3612, "udp" }, - { "alaris-disc", { NULL }, 3613, "tcp" }, - { "alaris-disc", { NULL }, 3613, "udp" }, - { "sigma-port", { NULL }, 3614, "tcp" }, - { "sigma-port", { NULL }, 3614, "udp" }, - { "start-network", { NULL }, 3615, "tcp" }, - { "start-network", { NULL }, 3615, "udp" }, - { "cd3o-protocol", { NULL }, 3616, "tcp" }, - { "cd3o-protocol", { NULL }, 3616, "udp" }, - { "sharp-server", { NULL }, 3617, "tcp" }, - { "sharp-server", { NULL }, 3617, "udp" }, - { "aairnet-1", { NULL }, 3618, "tcp" }, - { "aairnet-1", { NULL }, 3618, "udp" }, - { "aairnet-2", { NULL }, 3619, "tcp" }, - { "aairnet-2", { NULL }, 3619, "udp" }, - { "ep-pcp", { NULL }, 3620, "tcp" }, - { "ep-pcp", { NULL }, 3620, "udp" }, - { "ep-nsp", { NULL }, 3621, "tcp" }, - { "ep-nsp", { NULL }, 3621, "udp" }, - { "ff-lr-port", { NULL }, 3622, "tcp" }, - { "ff-lr-port", { NULL }, 3622, "udp" }, - { "haipe-discover", { NULL }, 3623, "tcp" }, - { "haipe-discover", { NULL }, 3623, "udp" }, - { "dist-upgrade", { NULL }, 3624, "tcp" }, - { "dist-upgrade", { NULL }, 3624, "udp" }, - { "volley", { NULL }, 3625, "tcp" }, - { "volley", { NULL }, 3625, "udp" }, - { "bvcdaemon-port", { NULL }, 3626, "tcp" }, - { "bvcdaemon-port", { NULL }, 3626, "udp" }, - { "jamserverport", { NULL }, 3627, "tcp" }, - { "jamserverport", { NULL }, 3627, "udp" }, - { "ept-machine", { NULL }, 3628, "tcp" }, - { "ept-machine", { NULL }, 3628, "udp" }, - { "escvpnet", { NULL }, 3629, "tcp" }, - { "escvpnet", { NULL }, 3629, "udp" }, - { "cs-remote-db", { NULL }, 3630, "tcp" }, - { "cs-remote-db", { NULL }, 3630, "udp" }, - { "cs-services", { NULL }, 3631, "tcp" }, - { "cs-services", { NULL }, 3631, "udp" }, - { "distcc", { NULL }, 3632, "tcp" }, - { "distcc", { NULL }, 3632, "udp" }, - { "wacp", { NULL }, 3633, "tcp" }, - { "wacp", { NULL }, 3633, "udp" }, - { "hlibmgr", { NULL }, 3634, "tcp" }, - { "hlibmgr", { NULL }, 3634, "udp" }, - { "sdo", { NULL }, 3635, "tcp" }, - { "sdo", { NULL }, 3635, "udp" }, - { "servistaitsm", { NULL }, 3636, "tcp" }, - { "servistaitsm", { NULL }, 3636, "udp" }, - { "scservp", { NULL }, 3637, "tcp" }, - { "scservp", { NULL }, 3637, "udp" }, - { "ehp-backup", { NULL }, 3638, "tcp" }, - { "ehp-backup", { NULL }, 3638, "udp" }, - { "xap-ha", { NULL }, 3639, "tcp" }, - { "xap-ha", { NULL }, 3639, "udp" }, - { "netplay-port1", { NULL }, 3640, "tcp" }, - { "netplay-port1", { NULL }, 3640, "udp" }, - { "netplay-port2", { NULL }, 3641, "tcp" }, - { "netplay-port2", { NULL }, 3641, "udp" }, - { "juxml-port", { NULL }, 3642, "tcp" }, - { "juxml-port", { NULL }, 3642, "udp" }, - { "audiojuggler", { NULL }, 3643, "tcp" }, - { "audiojuggler", { NULL }, 3643, "udp" }, - { "ssowatch", { NULL }, 3644, "tcp" }, - { "ssowatch", { NULL }, 3644, "udp" }, - { "cyc", { NULL }, 3645, "tcp" }, - { "cyc", { NULL }, 3645, "udp" }, - { "xss-srv-port", { NULL }, 3646, "tcp" }, - { "xss-srv-port", { NULL }, 3646, "udp" }, - { "splitlock-gw", { NULL }, 3647, "tcp" }, - { "splitlock-gw", { NULL }, 3647, "udp" }, - { "fjcp", { NULL }, 3648, "tcp" }, - { "fjcp", { NULL }, 3648, "udp" }, - { "nmmp", { NULL }, 3649, "tcp" }, - { "nmmp", { NULL }, 3649, "udp" }, - { "prismiq-plugin", { NULL }, 3650, "tcp" }, - { "prismiq-plugin", { NULL }, 3650, "udp" }, - { "xrpc-registry", { NULL }, 3651, "tcp" }, - { "xrpc-registry", { NULL }, 3651, "udp" }, - { "vxcrnbuport", { NULL }, 3652, "tcp" }, - { "vxcrnbuport", { NULL }, 3652, "udp" }, - { "tsp", { NULL }, 3653, "tcp" }, - { "tsp", { NULL }, 3653, "udp" }, - { "vaprtm", { NULL }, 3654, "tcp" }, - { "vaprtm", { NULL }, 3654, "udp" }, - { "abatemgr", { NULL }, 3655, "tcp" }, - { "abatemgr", { NULL }, 3655, "udp" }, - { "abatjss", { NULL }, 3656, "tcp" }, - { "abatjss", { NULL }, 3656, "udp" }, - { "immedianet-bcn", { NULL }, 3657, "tcp" }, - { "immedianet-bcn", { NULL }, 3657, "udp" }, - { "ps-ams", { NULL }, 3658, "tcp" }, - { "ps-ams", { NULL }, 3658, "udp" }, - { "apple-sasl", { NULL }, 3659, "tcp" }, - { "apple-sasl", { NULL }, 3659, "udp" }, - { "can-nds-ssl", { NULL }, 3660, "tcp" }, - { "can-nds-ssl", { NULL }, 3660, "udp" }, - { "can-ferret-ssl", { NULL }, 3661, "tcp" }, - { "can-ferret-ssl", { NULL }, 3661, "udp" }, - { "pserver", { NULL }, 3662, "tcp" }, - { "pserver", { NULL }, 3662, "udp" }, - { "dtp", { NULL }, 3663, "tcp" }, - { "dtp", { NULL }, 3663, "udp" }, - { "ups-engine", { NULL }, 3664, "tcp" }, - { "ups-engine", { NULL }, 3664, "udp" }, - { "ent-engine", { NULL }, 3665, "tcp" }, - { "ent-engine", { NULL }, 3665, "udp" }, - { "eserver-pap", { NULL }, 3666, "tcp" }, - { "eserver-pap", { NULL }, 3666, "udp" }, - { "infoexch", { NULL }, 3667, "tcp" }, - { "infoexch", { NULL }, 3667, "udp" }, - { "dell-rm-port", { NULL }, 3668, "tcp" }, - { "dell-rm-port", { NULL }, 3668, "udp" }, - { "casanswmgmt", { NULL }, 3669, "tcp" }, - { "casanswmgmt", { NULL }, 3669, "udp" }, - { "smile", { NULL }, 3670, "tcp" }, - { "smile", { NULL }, 3670, "udp" }, - { "efcp", { NULL }, 3671, "tcp" }, - { "efcp", { NULL }, 3671, "udp" }, - { "lispworks-orb", { NULL }, 3672, "tcp" }, - { "lispworks-orb", { NULL }, 3672, "udp" }, - { "mediavault-gui", { NULL }, 3673, "tcp" }, - { "mediavault-gui", { NULL }, 3673, "udp" }, - { "wininstall-ipc", { NULL }, 3674, "tcp" }, - { "wininstall-ipc", { NULL }, 3674, "udp" }, - { "calltrax", { NULL }, 3675, "tcp" }, - { "calltrax", { NULL }, 3675, "udp" }, - { "va-pacbase", { NULL }, 3676, "tcp" }, - { "va-pacbase", { NULL }, 3676, "udp" }, - { "roverlog", { NULL }, 3677, "tcp" }, - { "roverlog", { NULL }, 3677, "udp" }, - { "ipr-dglt", { NULL }, 3678, "tcp" }, - { "ipr-dglt", { NULL }, 3678, "udp" }, - { "newton-dock", { NULL }, 3679, "tcp" }, - { "newton-dock", { NULL }, 3679, "udp" }, - { "npds-tracker", { NULL }, 3680, "tcp" }, - { "npds-tracker", { NULL }, 3680, "udp" }, - { "bts-x73", { NULL }, 3681, "tcp" }, - { "bts-x73", { NULL }, 3681, "udp" }, - { "cas-mapi", { NULL }, 3682, "tcp" }, - { "cas-mapi", { NULL }, 3682, "udp" }, - { "bmc-ea", { NULL }, 3683, "tcp" }, - { "bmc-ea", { NULL }, 3683, "udp" }, - { "faxstfx-port", { NULL }, 3684, "tcp" }, - { "faxstfx-port", { NULL }, 3684, "udp" }, - { "dsx-agent", { NULL }, 3685, "tcp" }, - { "dsx-agent", { NULL }, 3685, "udp" }, - { "tnmpv2", { NULL }, 3686, "tcp" }, - { "tnmpv2", { NULL }, 3686, "udp" }, - { "simple-push", { NULL }, 3687, "tcp" }, - { "simple-push", { NULL }, 3687, "udp" }, - { "simple-push-s", { NULL }, 3688, "tcp" }, - { "simple-push-s", { NULL }, 3688, "udp" }, - { "daap", { NULL }, 3689, "tcp" }, - { "daap", { NULL }, 3689, "udp" }, - { "svn", { NULL }, 3690, "tcp" }, - { "svn", { NULL }, 3690, "udp" }, - { "magaya-network", { NULL }, 3691, "tcp" }, - { "magaya-network", { NULL }, 3691, "udp" }, - { "intelsync", { NULL }, 3692, "tcp" }, - { "intelsync", { NULL }, 3692, "udp" }, - { "bmc-data-coll", { NULL }, 3695, "tcp" }, - { "bmc-data-coll", { NULL }, 3695, "udp" }, - { "telnetcpcd", { NULL }, 3696, "tcp" }, - { "telnetcpcd", { NULL }, 3696, "udp" }, - { "nw-license", { NULL }, 3697, "tcp" }, - { "nw-license", { NULL }, 3697, "udp" }, - { "sagectlpanel", { NULL }, 3698, "tcp" }, - { "sagectlpanel", { NULL }, 3698, "udp" }, - { "kpn-icw", { NULL }, 3699, "tcp" }, - { "kpn-icw", { NULL }, 3699, "udp" }, - { "lrs-paging", { NULL }, 3700, "tcp" }, - { "lrs-paging", { NULL }, 3700, "udp" }, - { "netcelera", { NULL }, 3701, "tcp" }, - { "netcelera", { NULL }, 3701, "udp" }, - { "ws-discovery", { NULL }, 3702, "tcp" }, - { "ws-discovery", { NULL }, 3702, "udp" }, - { "adobeserver-3", { NULL }, 3703, "tcp" }, - { "adobeserver-3", { NULL }, 3703, "udp" }, - { "adobeserver-4", { NULL }, 3704, "tcp" }, - { "adobeserver-4", { NULL }, 3704, "udp" }, - { "adobeserver-5", { NULL }, 3705, "tcp" }, - { "adobeserver-5", { NULL }, 3705, "udp" }, - { "rt-event", { NULL }, 3706, "tcp" }, - { "rt-event", { NULL }, 3706, "udp" }, - { "rt-event-s", { NULL }, 3707, "tcp" }, - { "rt-event-s", { NULL }, 3707, "udp" }, - { "sun-as-iiops", { NULL }, 3708, "tcp" }, - { "sun-as-iiops", { NULL }, 3708, "udp" }, - { "ca-idms", { NULL }, 3709, "tcp" }, - { "ca-idms", { NULL }, 3709, "udp" }, - { "portgate-auth", { NULL }, 3710, "tcp" }, - { "portgate-auth", { NULL }, 3710, "udp" }, - { "edb-server2", { NULL }, 3711, "tcp" }, - { "edb-server2", { NULL }, 3711, "udp" }, - { "sentinel-ent", { NULL }, 3712, "tcp" }, - { "sentinel-ent", { NULL }, 3712, "udp" }, - { "tftps", { NULL }, 3713, "tcp" }, - { "tftps", { NULL }, 3713, "udp" }, - { "delos-dms", { NULL }, 3714, "tcp" }, - { "delos-dms", { NULL }, 3714, "udp" }, - { "anoto-rendezv", { NULL }, 3715, "tcp" }, - { "anoto-rendezv", { NULL }, 3715, "udp" }, - { "wv-csp-sms-cir", { NULL }, 3716, "tcp" }, - { "wv-csp-sms-cir", { NULL }, 3716, "udp" }, - { "wv-csp-udp-cir", { NULL }, 3717, "tcp" }, - { "wv-csp-udp-cir", { NULL }, 3717, "udp" }, - { "opus-services", { NULL }, 3718, "tcp" }, - { "opus-services", { NULL }, 3718, "udp" }, - { "itelserverport", { NULL }, 3719, "tcp" }, - { "itelserverport", { NULL }, 3719, "udp" }, - { "ufastro-instr", { NULL }, 3720, "tcp" }, - { "ufastro-instr", { NULL }, 3720, "udp" }, - { "xsync", { NULL }, 3721, "tcp" }, - { "xsync", { NULL }, 3721, "udp" }, - { "xserveraid", { NULL }, 3722, "tcp" }, - { "xserveraid", { NULL }, 3722, "udp" }, - { "sychrond", { NULL }, 3723, "tcp" }, - { "sychrond", { NULL }, 3723, "udp" }, - { "blizwow", { NULL }, 3724, "tcp" }, - { "blizwow", { NULL }, 3724, "udp" }, - { "na-er-tip", { NULL }, 3725, "tcp" }, - { "na-er-tip", { NULL }, 3725, "udp" }, - { "array-manager", { NULL }, 3726, "tcp" }, - { "array-manager", { NULL }, 3726, "udp" }, - { "e-mdu", { NULL }, 3727, "tcp" }, - { "e-mdu", { NULL }, 3727, "udp" }, - { "e-woa", { NULL }, 3728, "tcp" }, - { "e-woa", { NULL }, 3728, "udp" }, - { "fksp-audit", { NULL }, 3729, "tcp" }, - { "fksp-audit", { NULL }, 3729, "udp" }, - { "client-ctrl", { NULL }, 3730, "tcp" }, - { "client-ctrl", { NULL }, 3730, "udp" }, - { "smap", { NULL }, 3731, "tcp" }, - { "smap", { NULL }, 3731, "udp" }, - { "m-wnn", { NULL }, 3732, "tcp" }, - { "m-wnn", { NULL }, 3732, "udp" }, - { "multip-msg", { NULL }, 3733, "tcp" }, - { "multip-msg", { NULL }, 3733, "udp" }, - { "synel-data", { NULL }, 3734, "tcp" }, - { "synel-data", { NULL }, 3734, "udp" }, - { "pwdis", { NULL }, 3735, "tcp" }, - { "pwdis", { NULL }, 3735, "udp" }, - { "rs-rmi", { NULL }, 3736, "tcp" }, - { "rs-rmi", { NULL }, 3736, "udp" }, - { "xpanel", { NULL }, 3737, "tcp" }, - { "versatalk", { NULL }, 3738, "tcp" }, - { "versatalk", { NULL }, 3738, "udp" }, - { "launchbird-lm", { NULL }, 3739, "tcp" }, - { "launchbird-lm", { NULL }, 3739, "udp" }, - { "heartbeat", { NULL }, 3740, "tcp" }, - { "heartbeat", { NULL }, 3740, "udp" }, - { "wysdma", { NULL }, 3741, "tcp" }, - { "wysdma", { NULL }, 3741, "udp" }, - { "cst-port", { NULL }, 3742, "tcp" }, - { "cst-port", { NULL }, 3742, "udp" }, - { "ipcs-command", { NULL }, 3743, "tcp" }, - { "ipcs-command", { NULL }, 3743, "udp" }, - { "sasg", { NULL }, 3744, "tcp" }, - { "sasg", { NULL }, 3744, "udp" }, - { "gw-call-port", { NULL }, 3745, "tcp" }, - { "gw-call-port", { NULL }, 3745, "udp" }, - { "linktest", { NULL }, 3746, "tcp" }, - { "linktest", { NULL }, 3746, "udp" }, - { "linktest-s", { NULL }, 3747, "tcp" }, - { "linktest-s", { NULL }, 3747, "udp" }, - { "webdata", { NULL }, 3748, "tcp" }, - { "webdata", { NULL }, 3748, "udp" }, - { "cimtrak", { NULL }, 3749, "tcp" }, - { "cimtrak", { NULL }, 3749, "udp" }, - { "cbos-ip-port", { NULL }, 3750, "tcp" }, - { "cbos-ip-port", { NULL }, 3750, "udp" }, - { "gprs-cube", { NULL }, 3751, "tcp" }, - { "gprs-cube", { NULL }, 3751, "udp" }, - { "vipremoteagent", { NULL }, 3752, "tcp" }, - { "vipremoteagent", { NULL }, 3752, "udp" }, - { "nattyserver", { NULL }, 3753, "tcp" }, - { "nattyserver", { NULL }, 3753, "udp" }, - { "timestenbroker", { NULL }, 3754, "tcp" }, - { "timestenbroker", { NULL }, 3754, "udp" }, - { "sas-remote-hlp", { NULL }, 3755, "tcp" }, - { "sas-remote-hlp", { NULL }, 3755, "udp" }, - { "canon-capt", { NULL }, 3756, "tcp" }, - { "canon-capt", { NULL }, 3756, "udp" }, - { "grf-port", { NULL }, 3757, "tcp" }, - { "grf-port", { NULL }, 3757, "udp" }, - { "apw-registry", { NULL }, 3758, "tcp" }, - { "apw-registry", { NULL }, 3758, "udp" }, - { "exapt-lmgr", { NULL }, 3759, "tcp" }, - { "exapt-lmgr", { NULL }, 3759, "udp" }, - { "adtempusclient", { NULL }, 3760, "tcp" }, - { "adtempusclient", { NULL }, 3760, "udp" }, - { "gsakmp", { NULL }, 3761, "tcp" }, - { "gsakmp", { NULL }, 3761, "udp" }, - { "gbs-smp", { NULL }, 3762, "tcp" }, - { "gbs-smp", { NULL }, 3762, "udp" }, - { "xo-wave", { NULL }, 3763, "tcp" }, - { "xo-wave", { NULL }, 3763, "udp" }, - { "mni-prot-rout", { NULL }, 3764, "tcp" }, - { "mni-prot-rout", { NULL }, 3764, "udp" }, - { "rtraceroute", { NULL }, 3765, "tcp" }, - { "rtraceroute", { NULL }, 3765, "udp" }, - { "listmgr-port", { NULL }, 3767, "tcp" }, - { "listmgr-port", { NULL }, 3767, "udp" }, - { "rblcheckd", { NULL }, 3768, "tcp" }, - { "rblcheckd", { NULL }, 3768, "udp" }, - { "haipe-otnk", { NULL }, 3769, "tcp" }, - { "haipe-otnk", { NULL }, 3769, "udp" }, - { "cindycollab", { NULL }, 3770, "tcp" }, - { "cindycollab", { NULL }, 3770, "udp" }, - { "paging-port", { NULL }, 3771, "tcp" }, - { "paging-port", { NULL }, 3771, "udp" }, - { "ctp", { NULL }, 3772, "tcp" }, - { "ctp", { NULL }, 3772, "udp" }, - { "ctdhercules", { NULL }, 3773, "tcp" }, - { "ctdhercules", { NULL }, 3773, "udp" }, - { "zicom", { NULL }, 3774, "tcp" }, - { "zicom", { NULL }, 3774, "udp" }, - { "ispmmgr", { NULL }, 3775, "tcp" }, - { "ispmmgr", { NULL }, 3775, "udp" }, - { "dvcprov-port", { NULL }, 3776, "tcp" }, - { "dvcprov-port", { NULL }, 3776, "udp" }, - { "jibe-eb", { NULL }, 3777, "tcp" }, - { "jibe-eb", { NULL }, 3777, "udp" }, - { "c-h-it-port", { NULL }, 3778, "tcp" }, - { "c-h-it-port", { NULL }, 3778, "udp" }, - { "cognima", { NULL }, 3779, "tcp" }, - { "cognima", { NULL }, 3779, "udp" }, - { "nnp", { NULL }, 3780, "tcp" }, - { "nnp", { NULL }, 3780, "udp" }, - { "abcvoice-port", { NULL }, 3781, "tcp" }, - { "abcvoice-port", { NULL }, 3781, "udp" }, - { "iso-tp0s", { NULL }, 3782, "tcp" }, - { "iso-tp0s", { NULL }, 3782, "udp" }, - { "bim-pem", { NULL }, 3783, "tcp" }, - { "bim-pem", { NULL }, 3783, "udp" }, - { "bfd-control", { NULL }, 3784, "tcp" }, - { "bfd-control", { NULL }, 3784, "udp" }, - { "bfd-echo", { NULL }, 3785, "tcp" }, - { "bfd-echo", { NULL }, 3785, "udp" }, - { "upstriggervsw", { NULL }, 3786, "tcp" }, - { "upstriggervsw", { NULL }, 3786, "udp" }, - { "fintrx", { NULL }, 3787, "tcp" }, - { "fintrx", { NULL }, 3787, "udp" }, - { "isrp-port", { NULL }, 3788, "tcp" }, - { "isrp-port", { NULL }, 3788, "udp" }, - { "remotedeploy", { NULL }, 3789, "tcp" }, - { "remotedeploy", { NULL }, 3789, "udp" }, - { "quickbooksrds", { NULL }, 3790, "tcp" }, - { "quickbooksrds", { NULL }, 3790, "udp" }, - { "tvnetworkvideo", { NULL }, 3791, "tcp" }, - { "tvnetworkvideo", { NULL }, 3791, "udp" }, - { "sitewatch", { NULL }, 3792, "tcp" }, - { "sitewatch", { NULL }, 3792, "udp" }, - { "dcsoftware", { NULL }, 3793, "tcp" }, - { "dcsoftware", { NULL }, 3793, "udp" }, - { "jaus", { NULL }, 3794, "tcp" }, - { "jaus", { NULL }, 3794, "udp" }, - { "myblast", { NULL }, 3795, "tcp" }, - { "myblast", { NULL }, 3795, "udp" }, - { "spw-dialer", { NULL }, 3796, "tcp" }, - { "spw-dialer", { NULL }, 3796, "udp" }, - { "idps", { NULL }, 3797, "tcp" }, - { "idps", { NULL }, 3797, "udp" }, - { "minilock", { NULL }, 3798, "tcp" }, - { "minilock", { NULL }, 3798, "udp" }, - { "radius-dynauth", { NULL }, 3799, "tcp" }, - { "radius-dynauth", { NULL }, 3799, "udp" }, - { "pwgpsi", { NULL }, 3800, "tcp" }, - { "pwgpsi", { NULL }, 3800, "udp" }, - { "ibm-mgr", { NULL }, 3801, "tcp" }, - { "ibm-mgr", { NULL }, 3801, "udp" }, - { "vhd", { NULL }, 3802, "tcp" }, - { "vhd", { NULL }, 3802, "udp" }, - { "soniqsync", { NULL }, 3803, "tcp" }, - { "soniqsync", { NULL }, 3803, "udp" }, - { "iqnet-port", { NULL }, 3804, "tcp" }, - { "iqnet-port", { NULL }, 3804, "udp" }, - { "tcpdataserver", { NULL }, 3805, "tcp" }, - { "tcpdataserver", { NULL }, 3805, "udp" }, - { "wsmlb", { NULL }, 3806, "tcp" }, - { "wsmlb", { NULL }, 3806, "udp" }, - { "spugna", { NULL }, 3807, "tcp" }, - { "spugna", { NULL }, 3807, "udp" }, - { "sun-as-iiops-ca", { NULL }, 3808, "tcp" }, - { "sun-as-iiops-ca", { NULL }, 3808, "udp" }, - { "apocd", { NULL }, 3809, "tcp" }, - { "apocd", { NULL }, 3809, "udp" }, - { "wlanauth", { NULL }, 3810, "tcp" }, - { "wlanauth", { NULL }, 3810, "udp" }, - { "amp", { NULL }, 3811, "tcp" }, - { "amp", { NULL }, 3811, "udp" }, - { "neto-wol-server", { NULL }, 3812, "tcp" }, - { "neto-wol-server", { NULL }, 3812, "udp" }, - { "rap-ip", { NULL }, 3813, "tcp" }, - { "rap-ip", { NULL }, 3813, "udp" }, - { "neto-dcs", { NULL }, 3814, "tcp" }, - { "neto-dcs", { NULL }, 3814, "udp" }, - { "lansurveyorxml", { NULL }, 3815, "tcp" }, - { "lansurveyorxml", { NULL }, 3815, "udp" }, - { "sunlps-http", { NULL }, 3816, "tcp" }, - { "sunlps-http", { NULL }, 3816, "udp" }, - { "tapeware", { NULL }, 3817, "tcp" }, - { "tapeware", { NULL }, 3817, "udp" }, - { "crinis-hb", { NULL }, 3818, "tcp" }, - { "crinis-hb", { NULL }, 3818, "udp" }, - { "epl-slp", { NULL }, 3819, "tcp" }, - { "epl-slp", { NULL }, 3819, "udp" }, - { "scp", { NULL }, 3820, "tcp" }, - { "scp", { NULL }, 3820, "udp" }, - { "pmcp", { NULL }, 3821, "tcp" }, - { "pmcp", { NULL }, 3821, "udp" }, - { "acp-discovery", { NULL }, 3822, "tcp" }, - { "acp-discovery", { NULL }, 3822, "udp" }, - { "acp-conduit", { NULL }, 3823, "tcp" }, - { "acp-conduit", { NULL }, 3823, "udp" }, - { "acp-policy", { NULL }, 3824, "tcp" }, - { "acp-policy", { NULL }, 3824, "udp" }, - { "ffserver", { NULL }, 3825, "tcp" }, - { "ffserver", { NULL }, 3825, "udp" }, - { "wormux", { NULL }, 3826, "tcp" }, - { "wormux", { NULL }, 3826, "udp" }, - { "netmpi", { NULL }, 3827, "tcp" }, - { "netmpi", { NULL }, 3827, "udp" }, - { "neteh", { NULL }, 3828, "tcp" }, - { "neteh", { NULL }, 3828, "udp" }, - { "neteh-ext", { NULL }, 3829, "tcp" }, - { "neteh-ext", { NULL }, 3829, "udp" }, - { "cernsysmgmtagt", { NULL }, 3830, "tcp" }, - { "cernsysmgmtagt", { NULL }, 3830, "udp" }, - { "dvapps", { NULL }, 3831, "tcp" }, - { "dvapps", { NULL }, 3831, "udp" }, - { "xxnetserver", { NULL }, 3832, "tcp" }, - { "xxnetserver", { NULL }, 3832, "udp" }, - { "aipn-auth", { NULL }, 3833, "tcp" }, - { "aipn-auth", { NULL }, 3833, "udp" }, - { "spectardata", { NULL }, 3834, "tcp" }, - { "spectardata", { NULL }, 3834, "udp" }, - { "spectardb", { NULL }, 3835, "tcp" }, - { "spectardb", { NULL }, 3835, "udp" }, - { "markem-dcp", { NULL }, 3836, "tcp" }, - { "markem-dcp", { NULL }, 3836, "udp" }, - { "mkm-discovery", { NULL }, 3837, "tcp" }, - { "mkm-discovery", { NULL }, 3837, "udp" }, - { "sos", { NULL }, 3838, "tcp" }, - { "sos", { NULL }, 3838, "udp" }, - { "amx-rms", { NULL }, 3839, "tcp" }, - { "amx-rms", { NULL }, 3839, "udp" }, - { "flirtmitmir", { NULL }, 3840, "tcp" }, - { "flirtmitmir", { NULL }, 3840, "udp" }, - { "zfirm-shiprush3", { NULL }, 3841, "tcp" }, - { "zfirm-shiprush3", { NULL }, 3841, "udp" }, - { "nhci", { NULL }, 3842, "tcp" }, - { "nhci", { NULL }, 3842, "udp" }, - { "quest-agent", { NULL }, 3843, "tcp" }, - { "quest-agent", { NULL }, 3843, "udp" }, - { "rnm", { NULL }, 3844, "tcp" }, - { "rnm", { NULL }, 3844, "udp" }, - { "v-one-spp", { NULL }, 3845, "tcp" }, - { "v-one-spp", { NULL }, 3845, "udp" }, - { "an-pcp", { NULL }, 3846, "tcp" }, - { "an-pcp", { NULL }, 3846, "udp" }, - { "msfw-control", { NULL }, 3847, "tcp" }, - { "msfw-control", { NULL }, 3847, "udp" }, - { "item", { NULL }, 3848, "tcp" }, - { "item", { NULL }, 3848, "udp" }, - { "spw-dnspreload", { NULL }, 3849, "tcp" }, - { "spw-dnspreload", { NULL }, 3849, "udp" }, - { "qtms-bootstrap", { NULL }, 3850, "tcp" }, - { "qtms-bootstrap", { NULL }, 3850, "udp" }, - { "spectraport", { NULL }, 3851, "tcp" }, - { "spectraport", { NULL }, 3851, "udp" }, - { "sse-app-config", { NULL }, 3852, "tcp" }, - { "sse-app-config", { NULL }, 3852, "udp" }, - { "sscan", { NULL }, 3853, "tcp" }, - { "sscan", { NULL }, 3853, "udp" }, - { "stryker-com", { NULL }, 3854, "tcp" }, - { "stryker-com", { NULL }, 3854, "udp" }, - { "opentrac", { NULL }, 3855, "tcp" }, - { "opentrac", { NULL }, 3855, "udp" }, - { "informer", { NULL }, 3856, "tcp" }, - { "informer", { NULL }, 3856, "udp" }, - { "trap-port", { NULL }, 3857, "tcp" }, - { "trap-port", { NULL }, 3857, "udp" }, - { "trap-port-mom", { NULL }, 3858, "tcp" }, - { "trap-port-mom", { NULL }, 3858, "udp" }, - { "nav-port", { NULL }, 3859, "tcp" }, - { "nav-port", { NULL }, 3859, "udp" }, - { "sasp", { NULL }, 3860, "tcp" }, - { "sasp", { NULL }, 3860, "udp" }, - { "winshadow-hd", { NULL }, 3861, "tcp" }, - { "winshadow-hd", { NULL }, 3861, "udp" }, - { "giga-pocket", { NULL }, 3862, "tcp" }, - { "giga-pocket", { NULL }, 3862, "udp" }, - { "asap-tcp", { NULL }, 3863, "tcp" }, - { "asap-udp", { NULL }, 3863, "udp" }, - { "asap-sctp", { NULL }, 3863, "sctp" }, - { "asap-tcp-tls", { NULL }, 3864, "tcp" }, - { "asap-sctp-tls", { NULL }, 3864, "sctp" }, - { "xpl", { NULL }, 3865, "tcp" }, - { "xpl", { NULL }, 3865, "udp" }, - { "dzdaemon", { NULL }, 3866, "tcp" }, - { "dzdaemon", { NULL }, 3866, "udp" }, - { "dzoglserver", { NULL }, 3867, "tcp" }, - { "dzoglserver", { NULL }, 3867, "udp" }, - { "diameter", { NULL }, 3868, "tcp" }, - { "diameter", { NULL }, 3868, "sctp" }, - { "ovsam-mgmt", { NULL }, 3869, "tcp" }, - { "ovsam-mgmt", { NULL }, 3869, "udp" }, - { "ovsam-d-agent", { NULL }, 3870, "tcp" }, - { "ovsam-d-agent", { NULL }, 3870, "udp" }, - { "avocent-adsap", { NULL }, 3871, "tcp" }, - { "avocent-adsap", { NULL }, 3871, "udp" }, - { "oem-agent", { NULL }, 3872, "tcp" }, - { "oem-agent", { NULL }, 3872, "udp" }, - { "fagordnc", { NULL }, 3873, "tcp" }, - { "fagordnc", { NULL }, 3873, "udp" }, - { "sixxsconfig", { NULL }, 3874, "tcp" }, - { "sixxsconfig", { NULL }, 3874, "udp" }, - { "pnbscada", { NULL }, 3875, "tcp" }, - { "pnbscada", { NULL }, 3875, "udp" }, - { "dl_agent", { NULL }, 3876, "tcp" }, - { "dl_agent", { NULL }, 3876, "udp" }, - { "xmpcr-interface", { NULL }, 3877, "tcp" }, - { "xmpcr-interface", { NULL }, 3877, "udp" }, - { "fotogcad", { NULL }, 3878, "tcp" }, - { "fotogcad", { NULL }, 3878, "udp" }, - { "appss-lm", { NULL }, 3879, "tcp" }, - { "appss-lm", { NULL }, 3879, "udp" }, - { "igrs", { NULL }, 3880, "tcp" }, - { "igrs", { NULL }, 3880, "udp" }, - { "idac", { NULL }, 3881, "tcp" }, - { "idac", { NULL }, 3881, "udp" }, - { "msdts1", { NULL }, 3882, "tcp" }, - { "msdts1", { NULL }, 3882, "udp" }, - { "vrpn", { NULL }, 3883, "tcp" }, - { "vrpn", { NULL }, 3883, "udp" }, - { "softrack-meter", { NULL }, 3884, "tcp" }, - { "softrack-meter", { NULL }, 3884, "udp" }, - { "topflow-ssl", { NULL }, 3885, "tcp" }, - { "topflow-ssl", { NULL }, 3885, "udp" }, - { "nei-management", { NULL }, 3886, "tcp" }, - { "nei-management", { NULL }, 3886, "udp" }, - { "ciphire-data", { NULL }, 3887, "tcp" }, - { "ciphire-data", { NULL }, 3887, "udp" }, - { "ciphire-serv", { NULL }, 3888, "tcp" }, - { "ciphire-serv", { NULL }, 3888, "udp" }, - { "dandv-tester", { NULL }, 3889, "tcp" }, - { "dandv-tester", { NULL }, 3889, "udp" }, - { "ndsconnect", { NULL }, 3890, "tcp" }, - { "ndsconnect", { NULL }, 3890, "udp" }, - { "rtc-pm-port", { NULL }, 3891, "tcp" }, - { "rtc-pm-port", { NULL }, 3891, "udp" }, - { "pcc-image-port", { NULL }, 3892, "tcp" }, - { "pcc-image-port", { NULL }, 3892, "udp" }, - { "cgi-starapi", { NULL }, 3893, "tcp" }, - { "cgi-starapi", { NULL }, 3893, "udp" }, - { "syam-agent", { NULL }, 3894, "tcp" }, - { "syam-agent", { NULL }, 3894, "udp" }, - { "syam-smc", { NULL }, 3895, "tcp" }, - { "syam-smc", { NULL }, 3895, "udp" }, - { "sdo-tls", { NULL }, 3896, "tcp" }, - { "sdo-tls", { NULL }, 3896, "udp" }, - { "sdo-ssh", { NULL }, 3897, "tcp" }, - { "sdo-ssh", { NULL }, 3897, "udp" }, - { "senip", { NULL }, 3898, "tcp" }, - { "senip", { NULL }, 3898, "udp" }, - { "itv-control", { NULL }, 3899, "tcp" }, - { "itv-control", { NULL }, 3899, "udp" }, - { "udt_os", { NULL }, 3900, "tcp" }, - { "udt_os", { NULL }, 3900, "udp" }, - { "nimsh", { NULL }, 3901, "tcp" }, - { "nimsh", { NULL }, 3901, "udp" }, - { "nimaux", { NULL }, 3902, "tcp" }, - { "nimaux", { NULL }, 3902, "udp" }, - { "charsetmgr", { NULL }, 3903, "tcp" }, - { "charsetmgr", { NULL }, 3903, "udp" }, - { "omnilink-port", { NULL }, 3904, "tcp" }, - { "omnilink-port", { NULL }, 3904, "udp" }, - { "mupdate", { NULL }, 3905, "tcp" }, - { "mupdate", { NULL }, 3905, "udp" }, - { "topovista-data", { NULL }, 3906, "tcp" }, - { "topovista-data", { NULL }, 3906, "udp" }, - { "imoguia-port", { NULL }, 3907, "tcp" }, - { "imoguia-port", { NULL }, 3907, "udp" }, - { "hppronetman", { NULL }, 3908, "tcp" }, - { "hppronetman", { NULL }, 3908, "udp" }, - { "surfcontrolcpa", { NULL }, 3909, "tcp" }, - { "surfcontrolcpa", { NULL }, 3909, "udp" }, - { "prnrequest", { NULL }, 3910, "tcp" }, - { "prnrequest", { NULL }, 3910, "udp" }, - { "prnstatus", { NULL }, 3911, "tcp" }, - { "prnstatus", { NULL }, 3911, "udp" }, - { "gbmt-stars", { NULL }, 3912, "tcp" }, - { "gbmt-stars", { NULL }, 3912, "udp" }, - { "listcrt-port", { NULL }, 3913, "tcp" }, - { "listcrt-port", { NULL }, 3913, "udp" }, - { "listcrt-port-2", { NULL }, 3914, "tcp" }, - { "listcrt-port-2", { NULL }, 3914, "udp" }, - { "agcat", { NULL }, 3915, "tcp" }, - { "agcat", { NULL }, 3915, "udp" }, - { "wysdmc", { NULL }, 3916, "tcp" }, - { "wysdmc", { NULL }, 3916, "udp" }, - { "aftmux", { NULL }, 3917, "tcp" }, - { "aftmux", { NULL }, 3917, "udp" }, - { "pktcablemmcops", { NULL }, 3918, "tcp" }, - { "pktcablemmcops", { NULL }, 3918, "udp" }, - { "hyperip", { NULL }, 3919, "tcp" }, - { "hyperip", { NULL }, 3919, "udp" }, - { "exasoftport1", { NULL }, 3920, "tcp" }, - { "exasoftport1", { NULL }, 3920, "udp" }, - { "herodotus-net", { NULL }, 3921, "tcp" }, - { "herodotus-net", { NULL }, 3921, "udp" }, - { "sor-update", { NULL }, 3922, "tcp" }, - { "sor-update", { NULL }, 3922, "udp" }, - { "symb-sb-port", { NULL }, 3923, "tcp" }, - { "symb-sb-port", { NULL }, 3923, "udp" }, - { "mpl-gprs-port", { NULL }, 3924, "tcp" }, - { "mpl-gprs-port", { NULL }, 3924, "udp" }, - { "zmp", { NULL }, 3925, "tcp" }, - { "zmp", { NULL }, 3925, "udp" }, - { "winport", { NULL }, 3926, "tcp" }, - { "winport", { NULL }, 3926, "udp" }, - { "natdataservice", { NULL }, 3927, "tcp" }, - { "natdataservice", { NULL }, 3927, "udp" }, - { "netboot-pxe", { NULL }, 3928, "tcp" }, - { "netboot-pxe", { NULL }, 3928, "udp" }, - { "smauth-port", { NULL }, 3929, "tcp" }, - { "smauth-port", { NULL }, 3929, "udp" }, - { "syam-webserver", { NULL }, 3930, "tcp" }, - { "syam-webserver", { NULL }, 3930, "udp" }, - { "msr-plugin-port", { NULL }, 3931, "tcp" }, - { "msr-plugin-port", { NULL }, 3931, "udp" }, - { "dyn-site", { NULL }, 3932, "tcp" }, - { "dyn-site", { NULL }, 3932, "udp" }, - { "plbserve-port", { NULL }, 3933, "tcp" }, - { "plbserve-port", { NULL }, 3933, "udp" }, - { "sunfm-port", { NULL }, 3934, "tcp" }, - { "sunfm-port", { NULL }, 3934, "udp" }, - { "sdp-portmapper", { NULL }, 3935, "tcp" }, - { "sdp-portmapper", { NULL }, 3935, "udp" }, - { "mailprox", { NULL }, 3936, "tcp" }, - { "mailprox", { NULL }, 3936, "udp" }, - { "dvbservdsc", { NULL }, 3937, "tcp" }, - { "dvbservdsc", { NULL }, 3937, "udp" }, - { "dbcontrol_agent", { NULL }, 3938, "tcp" }, - { "dbcontrol_agent", { NULL }, 3938, "udp" }, - { "aamp", { NULL }, 3939, "tcp" }, - { "aamp", { NULL }, 3939, "udp" }, - { "xecp-node", { NULL }, 3940, "tcp" }, - { "xecp-node", { NULL }, 3940, "udp" }, - { "homeportal-web", { NULL }, 3941, "tcp" }, - { "homeportal-web", { NULL }, 3941, "udp" }, - { "srdp", { NULL }, 3942, "tcp" }, - { "srdp", { NULL }, 3942, "udp" }, - { "tig", { NULL }, 3943, "tcp" }, - { "tig", { NULL }, 3943, "udp" }, - { "sops", { NULL }, 3944, "tcp" }, - { "sops", { NULL }, 3944, "udp" }, - { "emcads", { NULL }, 3945, "tcp" }, - { "emcads", { NULL }, 3945, "udp" }, - { "backupedge", { NULL }, 3946, "tcp" }, - { "backupedge", { NULL }, 3946, "udp" }, - { "ccp", { NULL }, 3947, "tcp" }, - { "ccp", { NULL }, 3947, "udp" }, - { "apdap", { NULL }, 3948, "tcp" }, - { "apdap", { NULL }, 3948, "udp" }, - { "drip", { NULL }, 3949, "tcp" }, - { "drip", { NULL }, 3949, "udp" }, - { "namemunge", { NULL }, 3950, "tcp" }, - { "namemunge", { NULL }, 3950, "udp" }, - { "pwgippfax", { NULL }, 3951, "tcp" }, - { "pwgippfax", { NULL }, 3951, "udp" }, - { "i3-sessionmgr", { NULL }, 3952, "tcp" }, - { "i3-sessionmgr", { NULL }, 3952, "udp" }, - { "xmlink-connect", { NULL }, 3953, "tcp" }, - { "xmlink-connect", { NULL }, 3953, "udp" }, - { "adrep", { NULL }, 3954, "tcp" }, - { "adrep", { NULL }, 3954, "udp" }, - { "p2pcommunity", { NULL }, 3955, "tcp" }, - { "p2pcommunity", { NULL }, 3955, "udp" }, - { "gvcp", { NULL }, 3956, "tcp" }, - { "gvcp", { NULL }, 3956, "udp" }, - { "mqe-broker", { NULL }, 3957, "tcp" }, - { "mqe-broker", { NULL }, 3957, "udp" }, - { "mqe-agent", { NULL }, 3958, "tcp" }, - { "mqe-agent", { NULL }, 3958, "udp" }, - { "treehopper", { NULL }, 3959, "tcp" }, - { "treehopper", { NULL }, 3959, "udp" }, - { "bess", { NULL }, 3960, "tcp" }, - { "bess", { NULL }, 3960, "udp" }, - { "proaxess", { NULL }, 3961, "tcp" }, - { "proaxess", { NULL }, 3961, "udp" }, - { "sbi-agent", { NULL }, 3962, "tcp" }, - { "sbi-agent", { NULL }, 3962, "udp" }, - { "thrp", { NULL }, 3963, "tcp" }, - { "thrp", { NULL }, 3963, "udp" }, - { "sasggprs", { NULL }, 3964, "tcp" }, - { "sasggprs", { NULL }, 3964, "udp" }, - { "ati-ip-to-ncpe", { NULL }, 3965, "tcp" }, - { "ati-ip-to-ncpe", { NULL }, 3965, "udp" }, - { "bflckmgr", { NULL }, 3966, "tcp" }, - { "bflckmgr", { NULL }, 3966, "udp" }, - { "ppsms", { NULL }, 3967, "tcp" }, - { "ppsms", { NULL }, 3967, "udp" }, - { "ianywhere-dbns", { NULL }, 3968, "tcp" }, - { "ianywhere-dbns", { NULL }, 3968, "udp" }, - { "landmarks", { NULL }, 3969, "tcp" }, - { "landmarks", { NULL }, 3969, "udp" }, - { "lanrevagent", { NULL }, 3970, "tcp" }, - { "lanrevagent", { NULL }, 3970, "udp" }, - { "lanrevserver", { NULL }, 3971, "tcp" }, - { "lanrevserver", { NULL }, 3971, "udp" }, - { "iconp", { NULL }, 3972, "tcp" }, - { "iconp", { NULL }, 3972, "udp" }, - { "progistics", { NULL }, 3973, "tcp" }, - { "progistics", { NULL }, 3973, "udp" }, - { "citysearch", { NULL }, 3974, "tcp" }, - { "citysearch", { NULL }, 3974, "udp" }, - { "airshot", { NULL }, 3975, "tcp" }, - { "airshot", { NULL }, 3975, "udp" }, - { "opswagent", { NULL }, 3976, "tcp" }, - { "opswagent", { NULL }, 3976, "udp" }, - { "opswmanager", { NULL }, 3977, "tcp" }, - { "opswmanager", { NULL }, 3977, "udp" }, - { "secure-cfg-svr", { NULL }, 3978, "tcp" }, - { "secure-cfg-svr", { NULL }, 3978, "udp" }, - { "smwan", { NULL }, 3979, "tcp" }, - { "smwan", { NULL }, 3979, "udp" }, - { "acms", { NULL }, 3980, "tcp" }, - { "acms", { NULL }, 3980, "udp" }, - { "starfish", { NULL }, 3981, "tcp" }, - { "starfish", { NULL }, 3981, "udp" }, - { "eis", { NULL }, 3982, "tcp" }, - { "eis", { NULL }, 3982, "udp" }, - { "eisp", { NULL }, 3983, "tcp" }, - { "eisp", { NULL }, 3983, "udp" }, - { "mapper-nodemgr", { NULL }, 3984, "tcp" }, - { "mapper-nodemgr", { NULL }, 3984, "udp" }, - { "mapper-mapethd", { NULL }, 3985, "tcp" }, - { "mapper-mapethd", { NULL }, 3985, "udp" }, - { "mapper-ws_ethd", { NULL }, 3986, "tcp" }, - { "mapper-ws_ethd", { NULL }, 3986, "udp" }, - { "centerline", { NULL }, 3987, "tcp" }, - { "centerline", { NULL }, 3987, "udp" }, - { "dcs-config", { NULL }, 3988, "tcp" }, - { "dcs-config", { NULL }, 3988, "udp" }, - { "bv-queryengine", { NULL }, 3989, "tcp" }, - { "bv-queryengine", { NULL }, 3989, "udp" }, - { "bv-is", { NULL }, 3990, "tcp" }, - { "bv-is", { NULL }, 3990, "udp" }, - { "bv-smcsrv", { NULL }, 3991, "tcp" }, - { "bv-smcsrv", { NULL }, 3991, "udp" }, - { "bv-ds", { NULL }, 3992, "tcp" }, - { "bv-ds", { NULL }, 3992, "udp" }, - { "bv-agent", { NULL }, 3993, "tcp" }, - { "bv-agent", { NULL }, 3993, "udp" }, - { "iss-mgmt-ssl", { NULL }, 3995, "tcp" }, - { "iss-mgmt-ssl", { NULL }, 3995, "udp" }, - { "abcsoftware", { NULL }, 3996, "tcp" }, - { "abcsoftware", { NULL }, 3996, "udp" }, - { "agentsease-db", { NULL }, 3997, "tcp" }, - { "agentsease-db", { NULL }, 3997, "udp" }, - { "dnx", { NULL }, 3998, "tcp" }, - { "dnx", { NULL }, 3998, "udp" }, - { "nvcnet", { NULL }, 3999, "tcp" }, - { "nvcnet", { NULL }, 3999, "udp" }, - { "terabase", { NULL }, 4000, "tcp" }, - { "terabase", { NULL }, 4000, "udp" }, - { "newoak", { NULL }, 4001, "tcp" }, - { "newoak", { NULL }, 4001, "udp" }, - { "pxc-spvr-ft", { NULL }, 4002, "tcp" }, - { "pxc-spvr-ft", { NULL }, 4002, "udp" }, - { "pxc-splr-ft", { NULL }, 4003, "tcp" }, - { "pxc-splr-ft", { NULL }, 4003, "udp" }, - { "pxc-roid", { NULL }, 4004, "tcp" }, - { "pxc-roid", { NULL }, 4004, "udp" }, - { "pxc-pin", { NULL }, 4005, "tcp" }, - { "pxc-pin", { NULL }, 4005, "udp" }, - { "pxc-spvr", { NULL }, 4006, "tcp" }, - { "pxc-spvr", { NULL }, 4006, "udp" }, - { "pxc-splr", { NULL }, 4007, "tcp" }, - { "pxc-splr", { NULL }, 4007, "udp" }, - { "netcheque", { NULL }, 4008, "tcp" }, - { "netcheque", { NULL }, 4008, "udp" }, - { "chimera-hwm", { NULL }, 4009, "tcp" }, - { "chimera-hwm", { NULL }, 4009, "udp" }, - { "samsung-unidex", { NULL }, 4010, "tcp" }, - { "samsung-unidex", { NULL }, 4010, "udp" }, - { "altserviceboot", { NULL }, 4011, "tcp" }, - { "altserviceboot", { NULL }, 4011, "udp" }, - { "pda-gate", { NULL }, 4012, "tcp" }, - { "pda-gate", { NULL }, 4012, "udp" }, - { "acl-manager", { NULL }, 4013, "tcp" }, - { "acl-manager", { NULL }, 4013, "udp" }, - { "taiclock", { NULL }, 4014, "tcp" }, - { "taiclock", { NULL }, 4014, "udp" }, - { "talarian-mcast1", { NULL }, 4015, "tcp" }, - { "talarian-mcast1", { NULL }, 4015, "udp" }, - { "talarian-mcast2", { NULL }, 4016, "tcp" }, - { "talarian-mcast2", { NULL }, 4016, "udp" }, - { "talarian-mcast3", { NULL }, 4017, "tcp" }, - { "talarian-mcast3", { NULL }, 4017, "udp" }, - { "talarian-mcast4", { NULL }, 4018, "tcp" }, - { "talarian-mcast4", { NULL }, 4018, "udp" }, - { "talarian-mcast5", { NULL }, 4019, "tcp" }, - { "talarian-mcast5", { NULL }, 4019, "udp" }, - { "trap", { NULL }, 4020, "tcp" }, - { "trap", { NULL }, 4020, "udp" }, - { "nexus-portal", { NULL }, 4021, "tcp" }, - { "nexus-portal", { NULL }, 4021, "udp" }, - { "dnox", { NULL }, 4022, "tcp" }, - { "dnox", { NULL }, 4022, "udp" }, - { "esnm-zoning", { NULL }, 4023, "tcp" }, - { "esnm-zoning", { NULL }, 4023, "udp" }, - { "tnp1-port", { NULL }, 4024, "tcp" }, - { "tnp1-port", { NULL }, 4024, "udp" }, - { "partimage", { NULL }, 4025, "tcp" }, - { "partimage", { NULL }, 4025, "udp" }, - { "as-debug", { NULL }, 4026, "tcp" }, - { "as-debug", { NULL }, 4026, "udp" }, - { "bxp", { NULL }, 4027, "tcp" }, - { "bxp", { NULL }, 4027, "udp" }, - { "dtserver-port", { NULL }, 4028, "tcp" }, - { "dtserver-port", { NULL }, 4028, "udp" }, - { "ip-qsig", { NULL }, 4029, "tcp" }, - { "ip-qsig", { NULL }, 4029, "udp" }, - { "jdmn-port", { NULL }, 4030, "tcp" }, - { "jdmn-port", { NULL }, 4030, "udp" }, - { "suucp", { NULL }, 4031, "tcp" }, - { "suucp", { NULL }, 4031, "udp" }, - { "vrts-auth-port", { NULL }, 4032, "tcp" }, - { "vrts-auth-port", { NULL }, 4032, "udp" }, - { "sanavigator", { NULL }, 4033, "tcp" }, - { "sanavigator", { NULL }, 4033, "udp" }, - { "ubxd", { NULL }, 4034, "tcp" }, - { "ubxd", { NULL }, 4034, "udp" }, - { "wap-push-http", { NULL }, 4035, "tcp" }, - { "wap-push-http", { NULL }, 4035, "udp" }, - { "wap-push-https", { NULL }, 4036, "tcp" }, - { "wap-push-https", { NULL }, 4036, "udp" }, - { "ravehd", { NULL }, 4037, "tcp" }, - { "ravehd", { NULL }, 4037, "udp" }, - { "fazzt-ptp", { NULL }, 4038, "tcp" }, - { "fazzt-ptp", { NULL }, 4038, "udp" }, - { "fazzt-admin", { NULL }, 4039, "tcp" }, - { "fazzt-admin", { NULL }, 4039, "udp" }, - { "yo-main", { NULL }, 4040, "tcp" }, - { "yo-main", { NULL }, 4040, "udp" }, - { "houston", { NULL }, 4041, "tcp" }, - { "houston", { NULL }, 4041, "udp" }, - { "ldxp", { NULL }, 4042, "tcp" }, - { "ldxp", { NULL }, 4042, "udp" }, - { "nirp", { NULL }, 4043, "tcp" }, - { "nirp", { NULL }, 4043, "udp" }, - { "ltp", { NULL }, 4044, "tcp" }, - { "ltp", { NULL }, 4044, "udp" }, - { "npp", { NULL }, 4045, "tcp" }, - { "npp", { NULL }, 4045, "udp" }, - { "acp-proto", { NULL }, 4046, "tcp" }, - { "acp-proto", { NULL }, 4046, "udp" }, - { "ctp-state", { NULL }, 4047, "tcp" }, - { "ctp-state", { NULL }, 4047, "udp" }, - { "wafs", { NULL }, 4049, "tcp" }, - { "wafs", { NULL }, 4049, "udp" }, - { "cisco-wafs", { NULL }, 4050, "tcp" }, - { "cisco-wafs", { NULL }, 4050, "udp" }, - { "cppdp", { NULL }, 4051, "tcp" }, - { "cppdp", { NULL }, 4051, "udp" }, - { "interact", { NULL }, 4052, "tcp" }, - { "interact", { NULL }, 4052, "udp" }, - { "ccu-comm-1", { NULL }, 4053, "tcp" }, - { "ccu-comm-1", { NULL }, 4053, "udp" }, - { "ccu-comm-2", { NULL }, 4054, "tcp" }, - { "ccu-comm-2", { NULL }, 4054, "udp" }, - { "ccu-comm-3", { NULL }, 4055, "tcp" }, - { "ccu-comm-3", { NULL }, 4055, "udp" }, - { "lms", { NULL }, 4056, "tcp" }, - { "lms", { NULL }, 4056, "udp" }, - { "wfm", { NULL }, 4057, "tcp" }, - { "wfm", { NULL }, 4057, "udp" }, - { "kingfisher", { NULL }, 4058, "tcp" }, - { "kingfisher", { NULL }, 4058, "udp" }, - { "dlms-cosem", { NULL }, 4059, "tcp" }, - { "dlms-cosem", { NULL }, 4059, "udp" }, - { "dsmeter_iatc", { NULL }, 4060, "tcp" }, - { "dsmeter_iatc", { NULL }, 4060, "udp" }, - { "ice-location", { NULL }, 4061, "tcp" }, - { "ice-location", { NULL }, 4061, "udp" }, - { "ice-slocation", { NULL }, 4062, "tcp" }, - { "ice-slocation", { NULL }, 4062, "udp" }, - { "ice-router", { NULL }, 4063, "tcp" }, - { "ice-router", { NULL }, 4063, "udp" }, - { "ice-srouter", { NULL }, 4064, "tcp" }, - { "ice-srouter", { NULL }, 4064, "udp" }, - { "avanti_cdp", { NULL }, 4065, "tcp" }, - { "avanti_cdp", { NULL }, 4065, "udp" }, - { "pmas", { NULL }, 4066, "tcp" }, - { "pmas", { NULL }, 4066, "udp" }, - { "idp", { NULL }, 4067, "tcp" }, - { "idp", { NULL }, 4067, "udp" }, - { "ipfltbcst", { NULL }, 4068, "tcp" }, - { "ipfltbcst", { NULL }, 4068, "udp" }, - { "minger", { NULL }, 4069, "tcp" }, - { "minger", { NULL }, 4069, "udp" }, - { "tripe", { NULL }, 4070, "tcp" }, - { "tripe", { NULL }, 4070, "udp" }, - { "aibkup", { NULL }, 4071, "tcp" }, - { "aibkup", { NULL }, 4071, "udp" }, - { "zieto-sock", { NULL }, 4072, "tcp" }, - { "zieto-sock", { NULL }, 4072, "udp" }, - { "iRAPP", { NULL }, 4073, "tcp" }, - { "iRAPP", { NULL }, 4073, "udp" }, - { "cequint-cityid", { NULL }, 4074, "tcp" }, - { "cequint-cityid", { NULL }, 4074, "udp" }, - { "perimlan", { NULL }, 4075, "tcp" }, - { "perimlan", { NULL }, 4075, "udp" }, - { "seraph", { NULL }, 4076, "tcp" }, - { "seraph", { NULL }, 4076, "udp" }, - { "ascomalarm", { NULL }, 4077, "udp" }, - { "cssp", { NULL }, 4078, "tcp" }, - { "santools", { NULL }, 4079, "tcp" }, - { "santools", { NULL }, 4079, "udp" }, - { "lorica-in", { NULL }, 4080, "tcp" }, - { "lorica-in", { NULL }, 4080, "udp" }, - { "lorica-in-sec", { NULL }, 4081, "tcp" }, - { "lorica-in-sec", { NULL }, 4081, "udp" }, - { "lorica-out", { NULL }, 4082, "tcp" }, - { "lorica-out", { NULL }, 4082, "udp" }, - { "lorica-out-sec", { NULL }, 4083, "tcp" }, - { "lorica-out-sec", { NULL }, 4083, "udp" }, - { "fortisphere-vm", { NULL }, 4084, "udp" }, - { "ezmessagesrv", { NULL }, 4085, "tcp" }, - { "ftsync", { NULL }, 4086, "udp" }, - { "applusservice", { NULL }, 4087, "tcp" }, - { "npsp", { NULL }, 4088, "tcp" }, - { "opencore", { NULL }, 4089, "tcp" }, - { "opencore", { NULL }, 4089, "udp" }, - { "omasgport", { NULL }, 4090, "tcp" }, - { "omasgport", { NULL }, 4090, "udp" }, - { "ewinstaller", { NULL }, 4091, "tcp" }, - { "ewinstaller", { NULL }, 4091, "udp" }, - { "ewdgs", { NULL }, 4092, "tcp" }, - { "ewdgs", { NULL }, 4092, "udp" }, - { "pvxpluscs", { NULL }, 4093, "tcp" }, - { "pvxpluscs", { NULL }, 4093, "udp" }, - { "sysrqd", { NULL }, 4094, "tcp" }, - { "sysrqd", { NULL }, 4094, "udp" }, - { "xtgui", { NULL }, 4095, "tcp" }, - { "xtgui", { NULL }, 4095, "udp" }, - { "bre", { NULL }, 4096, "tcp" }, - { "bre", { NULL }, 4096, "udp" }, - { "patrolview", { NULL }, 4097, "tcp" }, - { "patrolview", { NULL }, 4097, "udp" }, - { "drmsfsd", { NULL }, 4098, "tcp" }, - { "drmsfsd", { NULL }, 4098, "udp" }, - { "dpcp", { NULL }, 4099, "tcp" }, - { "dpcp", { NULL }, 4099, "udp" }, - { "igo-incognito", { NULL }, 4100, "tcp" }, - { "igo-incognito", { NULL }, 4100, "udp" }, - { "brlp-0", { NULL }, 4101, "tcp" }, - { "brlp-0", { NULL }, 4101, "udp" }, - { "brlp-1", { NULL }, 4102, "tcp" }, - { "brlp-1", { NULL }, 4102, "udp" }, - { "brlp-2", { NULL }, 4103, "tcp" }, - { "brlp-2", { NULL }, 4103, "udp" }, - { "brlp-3", { NULL }, 4104, "tcp" }, - { "brlp-3", { NULL }, 4104, "udp" }, - { "shofarplayer", { NULL }, 4105, "tcp" }, - { "shofarplayer", { NULL }, 4105, "udp" }, - { "synchronite", { NULL }, 4106, "tcp" }, - { "synchronite", { NULL }, 4106, "udp" }, - { "j-ac", { NULL }, 4107, "tcp" }, - { "j-ac", { NULL }, 4107, "udp" }, - { "accel", { NULL }, 4108, "tcp" }, - { "accel", { NULL }, 4108, "udp" }, - { "izm", { NULL }, 4109, "tcp" }, - { "izm", { NULL }, 4109, "udp" }, - { "g2tag", { NULL }, 4110, "tcp" }, - { "g2tag", { NULL }, 4110, "udp" }, - { "xgrid", { NULL }, 4111, "tcp" }, - { "xgrid", { NULL }, 4111, "udp" }, - { "apple-vpns-rp", { NULL }, 4112, "tcp" }, - { "apple-vpns-rp", { NULL }, 4112, "udp" }, - { "aipn-reg", { NULL }, 4113, "tcp" }, - { "aipn-reg", { NULL }, 4113, "udp" }, - { "jomamqmonitor", { NULL }, 4114, "tcp" }, - { "jomamqmonitor", { NULL }, 4114, "udp" }, - { "cds", { NULL }, 4115, "tcp" }, - { "cds", { NULL }, 4115, "udp" }, - { "smartcard-tls", { NULL }, 4116, "tcp" }, - { "smartcard-tls", { NULL }, 4116, "udp" }, - { "hillrserv", { NULL }, 4117, "tcp" }, - { "hillrserv", { NULL }, 4117, "udp" }, - { "netscript", { NULL }, 4118, "tcp" }, - { "netscript", { NULL }, 4118, "udp" }, - { "assuria-slm", { NULL }, 4119, "tcp" }, - { "assuria-slm", { NULL }, 4119, "udp" }, - { "e-builder", { NULL }, 4121, "tcp" }, - { "e-builder", { NULL }, 4121, "udp" }, - { "fprams", { NULL }, 4122, "tcp" }, - { "fprams", { NULL }, 4122, "udp" }, - { "z-wave", { NULL }, 4123, "tcp" }, - { "z-wave", { NULL }, 4123, "udp" }, - { "tigv2", { NULL }, 4124, "tcp" }, - { "tigv2", { NULL }, 4124, "udp" }, - { "opsview-envoy", { NULL }, 4125, "tcp" }, - { "opsview-envoy", { NULL }, 4125, "udp" }, - { "ddrepl", { NULL }, 4126, "tcp" }, - { "ddrepl", { NULL }, 4126, "udp" }, - { "unikeypro", { NULL }, 4127, "tcp" }, - { "unikeypro", { NULL }, 4127, "udp" }, - { "nufw", { NULL }, 4128, "tcp" }, - { "nufw", { NULL }, 4128, "udp" }, - { "nuauth", { NULL }, 4129, "tcp" }, - { "nuauth", { NULL }, 4129, "udp" }, - { "fronet", { NULL }, 4130, "tcp" }, - { "fronet", { NULL }, 4130, "udp" }, - { "stars", { NULL }, 4131, "tcp" }, - { "stars", { NULL }, 4131, "udp" }, - { "nuts_dem", { NULL }, 4132, "tcp" }, - { "nuts_dem", { NULL }, 4132, "udp" }, - { "nuts_bootp", { NULL }, 4133, "tcp" }, - { "nuts_bootp", { NULL }, 4133, "udp" }, - { "nifty-hmi", { NULL }, 4134, "tcp" }, - { "nifty-hmi", { NULL }, 4134, "udp" }, - { "cl-db-attach", { NULL }, 4135, "tcp" }, - { "cl-db-attach", { NULL }, 4135, "udp" }, - { "cl-db-request", { NULL }, 4136, "tcp" }, - { "cl-db-request", { NULL }, 4136, "udp" }, - { "cl-db-remote", { NULL }, 4137, "tcp" }, - { "cl-db-remote", { NULL }, 4137, "udp" }, - { "nettest", { NULL }, 4138, "tcp" }, - { "nettest", { NULL }, 4138, "udp" }, - { "thrtx", { NULL }, 4139, "tcp" }, - { "thrtx", { NULL }, 4139, "udp" }, - { "cedros_fds", { NULL }, 4140, "tcp" }, - { "cedros_fds", { NULL }, 4140, "udp" }, - { "oirtgsvc", { NULL }, 4141, "tcp" }, - { "oirtgsvc", { NULL }, 4141, "udp" }, - { "oidocsvc", { NULL }, 4142, "tcp" }, - { "oidocsvc", { NULL }, 4142, "udp" }, - { "oidsr", { NULL }, 4143, "tcp" }, - { "oidsr", { NULL }, 4143, "udp" }, - { "vvr-control", { NULL }, 4145, "tcp" }, - { "vvr-control", { NULL }, 4145, "udp" }, - { "tgcconnect", { NULL }, 4146, "tcp" }, - { "tgcconnect", { NULL }, 4146, "udp" }, - { "vrxpservman", { NULL }, 4147, "tcp" }, - { "vrxpservman", { NULL }, 4147, "udp" }, - { "hhb-handheld", { NULL }, 4148, "tcp" }, - { "hhb-handheld", { NULL }, 4148, "udp" }, - { "agslb", { NULL }, 4149, "tcp" }, - { "agslb", { NULL }, 4149, "udp" }, - { "PowerAlert-nsa", { NULL }, 4150, "tcp" }, - { "PowerAlert-nsa", { NULL }, 4150, "udp" }, - { "menandmice_noh", { NULL }, 4151, "tcp" }, - { "menandmice_noh", { NULL }, 4151, "udp" }, - { "idig_mux", { NULL }, 4152, "tcp" }, - { "idig_mux", { NULL }, 4152, "udp" }, - { "mbl-battd", { NULL }, 4153, "tcp" }, - { "mbl-battd", { NULL }, 4153, "udp" }, - { "atlinks", { NULL }, 4154, "tcp" }, - { "atlinks", { NULL }, 4154, "udp" }, - { "bzr", { NULL }, 4155, "tcp" }, - { "bzr", { NULL }, 4155, "udp" }, - { "stat-results", { NULL }, 4156, "tcp" }, - { "stat-results", { NULL }, 4156, "udp" }, - { "stat-scanner", { NULL }, 4157, "tcp" }, - { "stat-scanner", { NULL }, 4157, "udp" }, - { "stat-cc", { NULL }, 4158, "tcp" }, - { "stat-cc", { NULL }, 4158, "udp" }, - { "nss", { NULL }, 4159, "tcp" }, - { "nss", { NULL }, 4159, "udp" }, - { "jini-discovery", { NULL }, 4160, "tcp" }, - { "jini-discovery", { NULL }, 4160, "udp" }, - { "omscontact", { NULL }, 4161, "tcp" }, - { "omscontact", { NULL }, 4161, "udp" }, - { "omstopology", { NULL }, 4162, "tcp" }, - { "omstopology", { NULL }, 4162, "udp" }, - { "silverpeakpeer", { NULL }, 4163, "tcp" }, - { "silverpeakpeer", { NULL }, 4163, "udp" }, - { "silverpeakcomm", { NULL }, 4164, "tcp" }, - { "silverpeakcomm", { NULL }, 4164, "udp" }, - { "altcp", { NULL }, 4165, "tcp" }, - { "altcp", { NULL }, 4165, "udp" }, - { "joost", { NULL }, 4166, "tcp" }, - { "joost", { NULL }, 4166, "udp" }, - { "ddgn", { NULL }, 4167, "tcp" }, - { "ddgn", { NULL }, 4167, "udp" }, - { "pslicser", { NULL }, 4168, "tcp" }, - { "pslicser", { NULL }, 4168, "udp" }, - { "iadt", { NULL }, 4169, "tcp" }, - { "iadt-disc", { NULL }, 4169, "udp" }, - { "d-cinema-csp", { NULL }, 4170, "tcp" }, - { "ml-svnet", { NULL }, 4171, "tcp" }, - { "pcoip", { NULL }, 4172, "tcp" }, - { "pcoip", { NULL }, 4172, "udp" }, - { "smcluster", { NULL }, 4174, "tcp" }, - { "bccp", { NULL }, 4175, "tcp" }, - { "tl-ipcproxy", { NULL }, 4176, "tcp" }, - { "wello", { NULL }, 4177, "tcp" }, - { "wello", { NULL }, 4177, "udp" }, - { "storman", { NULL }, 4178, "tcp" }, - { "storman", { NULL }, 4178, "udp" }, - { "MaxumSP", { NULL }, 4179, "tcp" }, - { "MaxumSP", { NULL }, 4179, "udp" }, - { "httpx", { NULL }, 4180, "tcp" }, - { "httpx", { NULL }, 4180, "udp" }, - { "macbak", { NULL }, 4181, "tcp" }, - { "macbak", { NULL }, 4181, "udp" }, - { "pcptcpservice", { NULL }, 4182, "tcp" }, - { "pcptcpservice", { NULL }, 4182, "udp" }, - { "gmmp", { NULL }, 4183, "tcp" }, - { "gmmp", { NULL }, 4183, "udp" }, - { "universe_suite", { NULL }, 4184, "tcp" }, - { "universe_suite", { NULL }, 4184, "udp" }, - { "wcpp", { NULL }, 4185, "tcp" }, - { "wcpp", { NULL }, 4185, "udp" }, - { "boxbackupstore", { NULL }, 4186, "tcp" }, - { "csc_proxy", { NULL }, 4187, "tcp" }, - { "vatata", { NULL }, 4188, "tcp" }, - { "vatata", { NULL }, 4188, "udp" }, - { "pcep", { NULL }, 4189, "tcp" }, - { "sieve", { NULL }, 4190, "tcp" }, - { "dsmipv6", { NULL }, 4191, "udp" }, - { "azeti", { NULL }, 4192, "tcp" }, - { "azeti-bd", { NULL }, 4192, "udp" }, - { "pvxplusio", { NULL }, 4193, "tcp" }, - { "eims-admin", { NULL }, 4199, "tcp" }, - { "eims-admin", { NULL }, 4199, "udp" }, - { "corelccam", { NULL }, 4300, "tcp" }, - { "corelccam", { NULL }, 4300, "udp" }, - { "d-data", { NULL }, 4301, "tcp" }, - { "d-data", { NULL }, 4301, "udp" }, - { "d-data-control", { NULL }, 4302, "tcp" }, - { "d-data-control", { NULL }, 4302, "udp" }, - { "srcp", { NULL }, 4303, "tcp" }, - { "srcp", { NULL }, 4303, "udp" }, - { "owserver", { NULL }, 4304, "tcp" }, - { "owserver", { NULL }, 4304, "udp" }, - { "batman", { NULL }, 4305, "tcp" }, - { "batman", { NULL }, 4305, "udp" }, - { "pinghgl", { NULL }, 4306, "tcp" }, - { "pinghgl", { NULL }, 4306, "udp" }, - { "visicron-vs", { NULL }, 4307, "tcp" }, - { "visicron-vs", { NULL }, 4307, "udp" }, - { "compx-lockview", { NULL }, 4308, "tcp" }, - { "compx-lockview", { NULL }, 4308, "udp" }, - { "dserver", { NULL }, 4309, "tcp" }, - { "dserver", { NULL }, 4309, "udp" }, - { "mirrtex", { NULL }, 4310, "tcp" }, - { "mirrtex", { NULL }, 4310, "udp" }, - { "p6ssmc", { NULL }, 4311, "tcp" }, - { "pscl-mgt", { NULL }, 4312, "tcp" }, - { "perrla", { NULL }, 4313, "tcp" }, - { "fdt-rcatp", { NULL }, 4320, "tcp" }, - { "fdt-rcatp", { NULL }, 4320, "udp" }, - { "rwhois", { NULL }, 4321, "tcp" }, - { "rwhois", { NULL }, 4321, "udp" }, - { "trim-event", { NULL }, 4322, "tcp" }, - { "trim-event", { NULL }, 4322, "udp" }, - { "trim-ice", { NULL }, 4323, "tcp" }, - { "trim-ice", { NULL }, 4323, "udp" }, - { "balour", { NULL }, 4324, "tcp" }, - { "balour", { NULL }, 4324, "udp" }, - { "geognosisman", { NULL }, 4325, "tcp" }, - { "geognosisman", { NULL }, 4325, "udp" }, - { "geognosis", { NULL }, 4326, "tcp" }, - { "geognosis", { NULL }, 4326, "udp" }, - { "jaxer-web", { NULL }, 4327, "tcp" }, - { "jaxer-web", { NULL }, 4327, "udp" }, - { "jaxer-manager", { NULL }, 4328, "tcp" }, - { "jaxer-manager", { NULL }, 4328, "udp" }, - { "publiqare-sync", { NULL }, 4329, "tcp" }, - { "gaia", { NULL }, 4340, "tcp" }, - { "gaia", { NULL }, 4340, "udp" }, - { "lisp-data", { NULL }, 4341, "tcp" }, - { "lisp-data", { NULL }, 4341, "udp" }, - { "lisp-cons", { NULL }, 4342, "tcp" }, - { "lisp-control", { NULL }, 4342, "udp" }, - { "unicall", { NULL }, 4343, "tcp" }, - { "unicall", { NULL }, 4343, "udp" }, - { "vinainstall", { NULL }, 4344, "tcp" }, - { "vinainstall", { NULL }, 4344, "udp" }, - { "m4-network-as", { NULL }, 4345, "tcp" }, - { "m4-network-as", { NULL }, 4345, "udp" }, - { "elanlm", { NULL }, 4346, "tcp" }, - { "elanlm", { NULL }, 4346, "udp" }, - { "lansurveyor", { NULL }, 4347, "tcp" }, - { "lansurveyor", { NULL }, 4347, "udp" }, - { "itose", { NULL }, 4348, "tcp" }, - { "itose", { NULL }, 4348, "udp" }, - { "fsportmap", { NULL }, 4349, "tcp" }, - { "fsportmap", { NULL }, 4349, "udp" }, - { "net-device", { NULL }, 4350, "tcp" }, - { "net-device", { NULL }, 4350, "udp" }, - { "plcy-net-svcs", { NULL }, 4351, "tcp" }, - { "plcy-net-svcs", { NULL }, 4351, "udp" }, - { "pjlink", { NULL }, 4352, "tcp" }, - { "pjlink", { NULL }, 4352, "udp" }, - { "f5-iquery", { NULL }, 4353, "tcp" }, - { "f5-iquery", { NULL }, 4353, "udp" }, - { "qsnet-trans", { NULL }, 4354, "tcp" }, - { "qsnet-trans", { NULL }, 4354, "udp" }, - { "qsnet-workst", { NULL }, 4355, "tcp" }, - { "qsnet-workst", { NULL }, 4355, "udp" }, - { "qsnet-assist", { NULL }, 4356, "tcp" }, - { "qsnet-assist", { NULL }, 4356, "udp" }, - { "qsnet-cond", { NULL }, 4357, "tcp" }, - { "qsnet-cond", { NULL }, 4357, "udp" }, - { "qsnet-nucl", { NULL }, 4358, "tcp" }, - { "qsnet-nucl", { NULL }, 4358, "udp" }, - { "omabcastltkm", { NULL }, 4359, "tcp" }, - { "omabcastltkm", { NULL }, 4359, "udp" }, - { "matrix_vnet", { NULL }, 4360, "tcp" }, - { "nacnl", { NULL }, 4361, "udp" }, - { "afore-vdp-disc", { NULL }, 4362, "udp" }, - { "wxbrief", { NULL }, 4368, "tcp" }, - { "wxbrief", { NULL }, 4368, "udp" }, - { "epmd", { NULL }, 4369, "tcp" }, - { "epmd", { NULL }, 4369, "udp" }, - { "elpro_tunnel", { NULL }, 4370, "tcp" }, - { "elpro_tunnel", { NULL }, 4370, "udp" }, - { "l2c-control", { NULL }, 4371, "tcp" }, - { "l2c-disc", { NULL }, 4371, "udp" }, - { "l2c-data", { NULL }, 4372, "tcp" }, - { "l2c-data", { NULL }, 4372, "udp" }, - { "remctl", { NULL }, 4373, "tcp" }, - { "remctl", { NULL }, 4373, "udp" }, - { "psi-ptt", { NULL }, 4374, "tcp" }, - { "tolteces", { NULL }, 4375, "tcp" }, - { "tolteces", { NULL }, 4375, "udp" }, - { "bip", { NULL }, 4376, "tcp" }, - { "bip", { NULL }, 4376, "udp" }, - { "cp-spxsvr", { NULL }, 4377, "tcp" }, - { "cp-spxsvr", { NULL }, 4377, "udp" }, - { "cp-spxdpy", { NULL }, 4378, "tcp" }, - { "cp-spxdpy", { NULL }, 4378, "udp" }, - { "ctdb", { NULL }, 4379, "tcp" }, - { "ctdb", { NULL }, 4379, "udp" }, - { "xandros-cms", { NULL }, 4389, "tcp" }, - { "xandros-cms", { NULL }, 4389, "udp" }, - { "wiegand", { NULL }, 4390, "tcp" }, - { "wiegand", { NULL }, 4390, "udp" }, - { "apwi-imserver", { NULL }, 4391, "tcp" }, - { "apwi-rxserver", { NULL }, 4392, "tcp" }, - { "apwi-rxspooler", { NULL }, 4393, "tcp" }, - { "apwi-disc", { NULL }, 4394, "udp" }, - { "omnivisionesx", { NULL }, 4395, "tcp" }, - { "omnivisionesx", { NULL }, 4395, "udp" }, - { "fly", { NULL }, 4396, "tcp" }, - { "ds-srv", { NULL }, 4400, "tcp" }, - { "ds-srv", { NULL }, 4400, "udp" }, - { "ds-srvr", { NULL }, 4401, "tcp" }, - { "ds-srvr", { NULL }, 4401, "udp" }, - { "ds-clnt", { NULL }, 4402, "tcp" }, - { "ds-clnt", { NULL }, 4402, "udp" }, - { "ds-user", { NULL }, 4403, "tcp" }, - { "ds-user", { NULL }, 4403, "udp" }, - { "ds-admin", { NULL }, 4404, "tcp" }, - { "ds-admin", { NULL }, 4404, "udp" }, - { "ds-mail", { NULL }, 4405, "tcp" }, - { "ds-mail", { NULL }, 4405, "udp" }, - { "ds-slp", { NULL }, 4406, "tcp" }, - { "ds-slp", { NULL }, 4406, "udp" }, - { "nacagent", { NULL }, 4407, "tcp" }, - { "slscc", { NULL }, 4408, "tcp" }, - { "netcabinet-com", { NULL }, 4409, "tcp" }, - { "itwo-server", { NULL }, 4410, "tcp" }, - { "netrockey6", { NULL }, 4425, "tcp" }, - { "netrockey6", { NULL }, 4425, "udp" }, - { "beacon-port-2", { NULL }, 4426, "tcp" }, - { "beacon-port-2", { NULL }, 4426, "udp" }, - { "drizzle", { NULL }, 4427, "tcp" }, - { "omviserver", { NULL }, 4428, "tcp" }, - { "omviagent", { NULL }, 4429, "tcp" }, - { "rsqlserver", { NULL }, 4430, "tcp" }, - { "rsqlserver", { NULL }, 4430, "udp" }, - { "wspipe", { NULL }, 4431, "tcp" }, - { "netblox", { NULL }, 4441, "udp" }, - { "saris", { NULL }, 4442, "tcp" }, - { "saris", { NULL }, 4442, "udp" }, - { "pharos", { NULL }, 4443, "tcp" }, - { "pharos", { NULL }, 4443, "udp" }, - { "krb524", { NULL }, 4444, "tcp" }, - { "krb524", { NULL }, 4444, "udp" }, - { "nv-video", { NULL }, 4444, "tcp" }, - { "nv-video", { NULL }, 4444, "udp" }, - { "upnotifyp", { NULL }, 4445, "tcp" }, - { "upnotifyp", { NULL }, 4445, "udp" }, - { "n1-fwp", { NULL }, 4446, "tcp" }, - { "n1-fwp", { NULL }, 4446, "udp" }, - { "n1-rmgmt", { NULL }, 4447, "tcp" }, - { "n1-rmgmt", { NULL }, 4447, "udp" }, - { "asc-slmd", { NULL }, 4448, "tcp" }, - { "asc-slmd", { NULL }, 4448, "udp" }, - { "privatewire", { NULL }, 4449, "tcp" }, - { "privatewire", { NULL }, 4449, "udp" }, - { "camp", { NULL }, 4450, "tcp" }, - { "camp", { NULL }, 4450, "udp" }, - { "ctisystemmsg", { NULL }, 4451, "tcp" }, - { "ctisystemmsg", { NULL }, 4451, "udp" }, - { "ctiprogramload", { NULL }, 4452, "tcp" }, - { "ctiprogramload", { NULL }, 4452, "udp" }, - { "nssalertmgr", { NULL }, 4453, "tcp" }, - { "nssalertmgr", { NULL }, 4453, "udp" }, - { "nssagentmgr", { NULL }, 4454, "tcp" }, - { "nssagentmgr", { NULL }, 4454, "udp" }, - { "prchat-user", { NULL }, 4455, "tcp" }, - { "prchat-user", { NULL }, 4455, "udp" }, - { "prchat-server", { NULL }, 4456, "tcp" }, - { "prchat-server", { NULL }, 4456, "udp" }, - { "prRegister", { NULL }, 4457, "tcp" }, - { "prRegister", { NULL }, 4457, "udp" }, - { "mcp", { NULL }, 4458, "tcp" }, - { "mcp", { NULL }, 4458, "udp" }, - { "hpssmgmt", { NULL }, 4484, "tcp" }, - { "hpssmgmt", { NULL }, 4484, "udp" }, - { "assyst-dr", { NULL }, 4485, "tcp" }, - { "icms", { NULL }, 4486, "tcp" }, - { "icms", { NULL }, 4486, "udp" }, - { "prex-tcp", { NULL }, 4487, "tcp" }, - { "awacs-ice", { NULL }, 4488, "tcp" }, - { "awacs-ice", { NULL }, 4488, "udp" }, - { "ipsec-nat-t", { NULL }, 4500, "tcp" }, - { "ipsec-nat-t", { NULL }, 4500, "udp" }, - { "ehs", { NULL }, 4535, "tcp" }, - { "ehs", { NULL }, 4535, "udp" }, - { "ehs-ssl", { NULL }, 4536, "tcp" }, - { "ehs-ssl", { NULL }, 4536, "udp" }, - { "wssauthsvc", { NULL }, 4537, "tcp" }, - { "wssauthsvc", { NULL }, 4537, "udp" }, - { "swx-gate", { NULL }, 4538, "tcp" }, - { "swx-gate", { NULL }, 4538, "udp" }, - { "worldscores", { NULL }, 4545, "tcp" }, - { "worldscores", { NULL }, 4545, "udp" }, - { "sf-lm", { NULL }, 4546, "tcp" }, - { "sf-lm", { NULL }, 4546, "udp" }, - { "lanner-lm", { NULL }, 4547, "tcp" }, - { "lanner-lm", { NULL }, 4547, "udp" }, - { "synchromesh", { NULL }, 4548, "tcp" }, - { "synchromesh", { NULL }, 4548, "udp" }, - { "aegate", { NULL }, 4549, "tcp" }, - { "aegate", { NULL }, 4549, "udp" }, - { "gds-adppiw-db", { NULL }, 4550, "tcp" }, - { "gds-adppiw-db", { NULL }, 4550, "udp" }, - { "ieee-mih", { NULL }, 4551, "tcp" }, - { "ieee-mih", { NULL }, 4551, "udp" }, - { "menandmice-mon", { NULL }, 4552, "tcp" }, - { "menandmice-mon", { NULL }, 4552, "udp" }, - { "icshostsvc", { NULL }, 4553, "tcp" }, - { "msfrs", { NULL }, 4554, "tcp" }, - { "msfrs", { NULL }, 4554, "udp" }, - { "rsip", { NULL }, 4555, "tcp" }, - { "rsip", { NULL }, 4555, "udp" }, - { "dtn-bundle-tcp", { NULL }, 4556, "tcp" }, - { "dtn-bundle-udp", { NULL }, 4556, "udp" }, - { "mtcevrunqss", { NULL }, 4557, "udp" }, - { "mtcevrunqman", { NULL }, 4558, "udp" }, - { "hylafax", { NULL }, 4559, "tcp" }, - { "hylafax", { NULL }, 4559, "udp" }, - { "kwtc", { NULL }, 4566, "tcp" }, - { "kwtc", { NULL }, 4566, "udp" }, - { "tram", { NULL }, 4567, "tcp" }, - { "tram", { NULL }, 4567, "udp" }, - { "bmc-reporting", { NULL }, 4568, "tcp" }, - { "bmc-reporting", { NULL }, 4568, "udp" }, - { "iax", { NULL }, 4569, "tcp" }, - { "iax", { NULL }, 4569, "udp" }, - { "rid", { NULL }, 4590, "tcp" }, - { "l3t-at-an", { NULL }, 4591, "tcp" }, - { "l3t-at-an", { NULL }, 4591, "udp" }, - { "hrpd-ith-at-an", { NULL }, 4592, "udp" }, - { "ipt-anri-anri", { NULL }, 4593, "tcp" }, - { "ipt-anri-anri", { NULL }, 4593, "udp" }, - { "ias-session", { NULL }, 4594, "tcp" }, - { "ias-session", { NULL }, 4594, "udp" }, - { "ias-paging", { NULL }, 4595, "tcp" }, - { "ias-paging", { NULL }, 4595, "udp" }, - { "ias-neighbor", { NULL }, 4596, "tcp" }, - { "ias-neighbor", { NULL }, 4596, "udp" }, - { "a21-an-1xbs", { NULL }, 4597, "tcp" }, - { "a21-an-1xbs", { NULL }, 4597, "udp" }, - { "a16-an-an", { NULL }, 4598, "tcp" }, - { "a16-an-an", { NULL }, 4598, "udp" }, - { "a17-an-an", { NULL }, 4599, "tcp" }, - { "a17-an-an", { NULL }, 4599, "udp" }, - { "piranha1", { NULL }, 4600, "tcp" }, - { "piranha1", { NULL }, 4600, "udp" }, - { "piranha2", { NULL }, 4601, "tcp" }, - { "piranha2", { NULL }, 4601, "udp" }, - { "mtsserver", { NULL }, 4602, "tcp" }, - { "menandmice-upg", { NULL }, 4603, "tcp" }, - { "playsta2-app", { NULL }, 4658, "tcp" }, - { "playsta2-app", { NULL }, 4658, "udp" }, - { "playsta2-lob", { NULL }, 4659, "tcp" }, - { "playsta2-lob", { NULL }, 4659, "udp" }, - { "smaclmgr", { NULL }, 4660, "tcp" }, - { "smaclmgr", { NULL }, 4660, "udp" }, - { "kar2ouche", { NULL }, 4661, "tcp" }, - { "kar2ouche", { NULL }, 4661, "udp" }, - { "oms", { NULL }, 4662, "tcp" }, - { "oms", { NULL }, 4662, "udp" }, - { "noteit", { NULL }, 4663, "tcp" }, - { "noteit", { NULL }, 4663, "udp" }, - { "ems", { NULL }, 4664, "tcp" }, - { "ems", { NULL }, 4664, "udp" }, - { "contclientms", { NULL }, 4665, "tcp" }, - { "contclientms", { NULL }, 4665, "udp" }, - { "eportcomm", { NULL }, 4666, "tcp" }, - { "eportcomm", { NULL }, 4666, "udp" }, - { "mmacomm", { NULL }, 4667, "tcp" }, - { "mmacomm", { NULL }, 4667, "udp" }, - { "mmaeds", { NULL }, 4668, "tcp" }, - { "mmaeds", { NULL }, 4668, "udp" }, - { "eportcommdata", { NULL }, 4669, "tcp" }, - { "eportcommdata", { NULL }, 4669, "udp" }, - { "light", { NULL }, 4670, "tcp" }, - { "light", { NULL }, 4670, "udp" }, - { "acter", { NULL }, 4671, "tcp" }, - { "acter", { NULL }, 4671, "udp" }, - { "rfa", { NULL }, 4672, "tcp" }, - { "rfa", { NULL }, 4672, "udp" }, - { "cxws", { NULL }, 4673, "tcp" }, - { "cxws", { NULL }, 4673, "udp" }, - { "appiq-mgmt", { NULL }, 4674, "tcp" }, - { "appiq-mgmt", { NULL }, 4674, "udp" }, - { "dhct-status", { NULL }, 4675, "tcp" }, - { "dhct-status", { NULL }, 4675, "udp" }, - { "dhct-alerts", { NULL }, 4676, "tcp" }, - { "dhct-alerts", { NULL }, 4676, "udp" }, - { "bcs", { NULL }, 4677, "tcp" }, - { "bcs", { NULL }, 4677, "udp" }, - { "traversal", { NULL }, 4678, "tcp" }, - { "traversal", { NULL }, 4678, "udp" }, - { "mgesupervision", { NULL }, 4679, "tcp" }, - { "mgesupervision", { NULL }, 4679, "udp" }, - { "mgemanagement", { NULL }, 4680, "tcp" }, - { "mgemanagement", { NULL }, 4680, "udp" }, - { "parliant", { NULL }, 4681, "tcp" }, - { "parliant", { NULL }, 4681, "udp" }, - { "finisar", { NULL }, 4682, "tcp" }, - { "finisar", { NULL }, 4682, "udp" }, - { "spike", { NULL }, 4683, "tcp" }, - { "spike", { NULL }, 4683, "udp" }, - { "rfid-rp1", { NULL }, 4684, "tcp" }, - { "rfid-rp1", { NULL }, 4684, "udp" }, - { "autopac", { NULL }, 4685, "tcp" }, - { "autopac", { NULL }, 4685, "udp" }, - { "msp-os", { NULL }, 4686, "tcp" }, - { "msp-os", { NULL }, 4686, "udp" }, - { "nst", { NULL }, 4687, "tcp" }, - { "nst", { NULL }, 4687, "udp" }, - { "mobile-p2p", { NULL }, 4688, "tcp" }, - { "mobile-p2p", { NULL }, 4688, "udp" }, - { "altovacentral", { NULL }, 4689, "tcp" }, - { "altovacentral", { NULL }, 4689, "udp" }, - { "prelude", { NULL }, 4690, "tcp" }, - { "prelude", { NULL }, 4690, "udp" }, - { "mtn", { NULL }, 4691, "tcp" }, - { "mtn", { NULL }, 4691, "udp" }, - { "conspiracy", { NULL }, 4692, "tcp" }, - { "conspiracy", { NULL }, 4692, "udp" }, - { "netxms-agent", { NULL }, 4700, "tcp" }, - { "netxms-agent", { NULL }, 4700, "udp" }, - { "netxms-mgmt", { NULL }, 4701, "tcp" }, - { "netxms-mgmt", { NULL }, 4701, "udp" }, - { "netxms-sync", { NULL }, 4702, "tcp" }, - { "netxms-sync", { NULL }, 4702, "udp" }, - { "npqes-test", { NULL }, 4703, "tcp" }, - { "assuria-ins", { NULL }, 4704, "tcp" }, - { "truckstar", { NULL }, 4725, "tcp" }, - { "truckstar", { NULL }, 4725, "udp" }, - { "a26-fap-fgw", { NULL }, 4726, "udp" }, - { "fcis", { NULL }, 4727, "tcp" }, - { "fcis-disc", { NULL }, 4727, "udp" }, - { "capmux", { NULL }, 4728, "tcp" }, - { "capmux", { NULL }, 4728, "udp" }, - { "gsmtap", { NULL }, 4729, "udp" }, - { "gearman", { NULL }, 4730, "tcp" }, - { "gearman", { NULL }, 4730, "udp" }, - { "remcap", { NULL }, 4731, "tcp" }, - { "ohmtrigger", { NULL }, 4732, "udp" }, - { "resorcs", { NULL }, 4733, "tcp" }, - { "ipdr-sp", { NULL }, 4737, "tcp" }, - { "ipdr-sp", { NULL }, 4737, "udp" }, - { "solera-lpn", { NULL }, 4738, "tcp" }, - { "solera-lpn", { NULL }, 4738, "udp" }, - { "ipfix", { NULL }, 4739, "tcp" }, - { "ipfix", { NULL }, 4739, "udp" }, - { "ipfix", { NULL }, 4739, "sctp" }, - { "ipfixs", { NULL }, 4740, "tcp" }, - { "ipfixs", { NULL }, 4740, "sctp" }, - { "ipfixs", { NULL }, 4740, "udp" }, - { "lumimgrd", { NULL }, 4741, "tcp" }, - { "lumimgrd", { NULL }, 4741, "udp" }, - { "sicct", { NULL }, 4742, "tcp" }, - { "sicct-sdp", { NULL }, 4742, "udp" }, - { "openhpid", { NULL }, 4743, "tcp" }, - { "openhpid", { NULL }, 4743, "udp" }, - { "ifsp", { NULL }, 4744, "tcp" }, - { "ifsp", { NULL }, 4744, "udp" }, - { "fmp", { NULL }, 4745, "tcp" }, - { "fmp", { NULL }, 4745, "udp" }, - { "profilemac", { NULL }, 4749, "tcp" }, - { "profilemac", { NULL }, 4749, "udp" }, - { "ssad", { NULL }, 4750, "tcp" }, - { "ssad", { NULL }, 4750, "udp" }, - { "spocp", { NULL }, 4751, "tcp" }, - { "spocp", { NULL }, 4751, "udp" }, - { "snap", { NULL }, 4752, "tcp" }, - { "snap", { NULL }, 4752, "udp" }, - { "bfd-multi-ctl", { NULL }, 4784, "tcp" }, - { "bfd-multi-ctl", { NULL }, 4784, "udp" }, - { "cncp", { NULL }, 4785, "udp" }, - { "smart-install", { NULL }, 4786, "tcp" }, - { "sia-ctrl-plane", { NULL }, 4787, "tcp" }, - { "iims", { NULL }, 4800, "tcp" }, - { "iims", { NULL }, 4800, "udp" }, - { "iwec", { NULL }, 4801, "tcp" }, - { "iwec", { NULL }, 4801, "udp" }, - { "ilss", { NULL }, 4802, "tcp" }, - { "ilss", { NULL }, 4802, "udp" }, - { "notateit", { NULL }, 4803, "tcp" }, - { "notateit-disc", { NULL }, 4803, "udp" }, - { "aja-ntv4-disc", { NULL }, 4804, "udp" }, - { "htcp", { NULL }, 4827, "tcp" }, - { "htcp", { NULL }, 4827, "udp" }, - { "varadero-0", { NULL }, 4837, "tcp" }, - { "varadero-0", { NULL }, 4837, "udp" }, - { "varadero-1", { NULL }, 4838, "tcp" }, - { "varadero-1", { NULL }, 4838, "udp" }, - { "varadero-2", { NULL }, 4839, "tcp" }, - { "varadero-2", { NULL }, 4839, "udp" }, - { "opcua-tcp", { NULL }, 4840, "tcp" }, - { "opcua-udp", { NULL }, 4840, "udp" }, - { "quosa", { NULL }, 4841, "tcp" }, - { "quosa", { NULL }, 4841, "udp" }, - { "gw-asv", { NULL }, 4842, "tcp" }, - { "gw-asv", { NULL }, 4842, "udp" }, - { "opcua-tls", { NULL }, 4843, "tcp" }, - { "opcua-tls", { NULL }, 4843, "udp" }, - { "gw-log", { NULL }, 4844, "tcp" }, - { "gw-log", { NULL }, 4844, "udp" }, - { "wcr-remlib", { NULL }, 4845, "tcp" }, - { "wcr-remlib", { NULL }, 4845, "udp" }, - { "contamac_icm", { NULL }, 4846, "tcp" }, - { "contamac_icm", { NULL }, 4846, "udp" }, - { "wfc", { NULL }, 4847, "tcp" }, - { "wfc", { NULL }, 4847, "udp" }, - { "appserv-http", { NULL }, 4848, "tcp" }, - { "appserv-http", { NULL }, 4848, "udp" }, - { "appserv-https", { NULL }, 4849, "tcp" }, - { "appserv-https", { NULL }, 4849, "udp" }, - { "sun-as-nodeagt", { NULL }, 4850, "tcp" }, - { "sun-as-nodeagt", { NULL }, 4850, "udp" }, - { "derby-repli", { NULL }, 4851, "tcp" }, - { "derby-repli", { NULL }, 4851, "udp" }, - { "unify-debug", { NULL }, 4867, "tcp" }, - { "unify-debug", { NULL }, 4867, "udp" }, - { "phrelay", { NULL }, 4868, "tcp" }, - { "phrelay", { NULL }, 4868, "udp" }, - { "phrelaydbg", { NULL }, 4869, "tcp" }, - { "phrelaydbg", { NULL }, 4869, "udp" }, - { "cc-tracking", { NULL }, 4870, "tcp" }, - { "cc-tracking", { NULL }, 4870, "udp" }, - { "wired", { NULL }, 4871, "tcp" }, - { "wired", { NULL }, 4871, "udp" }, - { "tritium-can", { NULL }, 4876, "tcp" }, - { "tritium-can", { NULL }, 4876, "udp" }, - { "lmcs", { NULL }, 4877, "tcp" }, - { "lmcs", { NULL }, 4877, "udp" }, - { "inst-discovery", { NULL }, 4878, "udp" }, - { "wsdl-event", { NULL }, 4879, "tcp" }, - { "hislip", { NULL }, 4880, "tcp" }, - { "socp-t", { NULL }, 4881, "udp" }, - { "socp-c", { NULL }, 4882, "udp" }, - { "wmlserver", { NULL }, 4883, "tcp" }, - { "hivestor", { NULL }, 4884, "tcp" }, - { "hivestor", { NULL }, 4884, "udp" }, - { "abbs", { NULL }, 4885, "tcp" }, - { "abbs", { NULL }, 4885, "udp" }, - { "lyskom", { NULL }, 4894, "tcp" }, - { "lyskom", { NULL }, 4894, "udp" }, - { "radmin-port", { NULL }, 4899, "tcp" }, - { "radmin-port", { NULL }, 4899, "udp" }, - { "hfcs", { NULL }, 4900, "tcp" }, - { "hfcs", { NULL }, 4900, "udp" }, - { "flr_agent", { NULL }, 4901, "tcp" }, - { "magiccontrol", { NULL }, 4902, "tcp" }, - { "lutap", { NULL }, 4912, "tcp" }, - { "lutcp", { NULL }, 4913, "tcp" }, - { "bones", { NULL }, 4914, "tcp" }, - { "bones", { NULL }, 4914, "udp" }, - { "frcs", { NULL }, 4915, "tcp" }, - { "atsc-mh-ssc", { NULL }, 4937, "udp" }, - { "eq-office-4940", { NULL }, 4940, "tcp" }, - { "eq-office-4940", { NULL }, 4940, "udp" }, - { "eq-office-4941", { NULL }, 4941, "tcp" }, - { "eq-office-4941", { NULL }, 4941, "udp" }, - { "eq-office-4942", { NULL }, 4942, "tcp" }, - { "eq-office-4942", { NULL }, 4942, "udp" }, - { "munin", { NULL }, 4949, "tcp" }, - { "munin", { NULL }, 4949, "udp" }, - { "sybasesrvmon", { NULL }, 4950, "tcp" }, - { "sybasesrvmon", { NULL }, 4950, "udp" }, - { "pwgwims", { NULL }, 4951, "tcp" }, - { "pwgwims", { NULL }, 4951, "udp" }, - { "sagxtsds", { NULL }, 4952, "tcp" }, - { "sagxtsds", { NULL }, 4952, "udp" }, - { "dbsyncarbiter", { NULL }, 4953, "tcp" }, - { "ccss-qmm", { NULL }, 4969, "tcp" }, - { "ccss-qmm", { NULL }, 4969, "udp" }, - { "ccss-qsm", { NULL }, 4970, "tcp" }, - { "ccss-qsm", { NULL }, 4970, "udp" }, - { "webyast", { NULL }, 4984, "tcp" }, - { "gerhcs", { NULL }, 4985, "tcp" }, - { "mrip", { NULL }, 4986, "tcp" }, - { "mrip", { NULL }, 4986, "udp" }, - { "smar-se-port1", { NULL }, 4987, "tcp" }, - { "smar-se-port1", { NULL }, 4987, "udp" }, - { "smar-se-port2", { NULL }, 4988, "tcp" }, - { "smar-se-port2", { NULL }, 4988, "udp" }, - { "parallel", { NULL }, 4989, "tcp" }, - { "parallel", { NULL }, 4989, "udp" }, - { "busycal", { NULL }, 4990, "tcp" }, - { "busycal", { NULL }, 4990, "udp" }, - { "vrt", { NULL }, 4991, "tcp" }, - { "vrt", { NULL }, 4991, "udp" }, - { "hfcs-manager", { NULL }, 4999, "tcp" }, - { "hfcs-manager", { NULL }, 4999, "udp" }, - { "commplex-main", { NULL }, 5000, "tcp" }, - { "commplex-main", { NULL }, 5000, "udp" }, - { "commplex-link", { NULL }, 5001, "tcp" }, - { "commplex-link", { NULL }, 5001, "udp" }, - { "rfe", { NULL }, 5002, "tcp" }, - { "rfe", { NULL }, 5002, "udp" }, - { "fmpro-internal", { NULL }, 5003, "tcp" }, - { "fmpro-internal", { NULL }, 5003, "udp" }, - { "avt-profile-1", { NULL }, 5004, "tcp" }, - { "avt-profile-1", { NULL }, 5004, "udp" }, - { "avt-profile-1", { NULL }, 5004, "dccp" }, - { "avt-profile-2", { NULL }, 5005, "tcp" }, - { "avt-profile-2", { NULL }, 5005, "udp" }, - { "avt-profile-2", { NULL }, 5005, "dccp" }, - { "wsm-server", { NULL }, 5006, "tcp" }, - { "wsm-server", { NULL }, 5006, "udp" }, - { "wsm-server-ssl", { NULL }, 5007, "tcp" }, - { "wsm-server-ssl", { NULL }, 5007, "udp" }, - { "synapsis-edge", { NULL }, 5008, "tcp" }, - { "synapsis-edge", { NULL }, 5008, "udp" }, - { "winfs", { NULL }, 5009, "tcp" }, - { "winfs", { NULL }, 5009, "udp" }, - { "telelpathstart", { NULL }, 5010, "tcp" }, - { "telelpathstart", { NULL }, 5010, "udp" }, - { "telelpathattack", { NULL }, 5011, "tcp" }, - { "telelpathattack", { NULL }, 5011, "udp" }, - { "nsp", { NULL }, 5012, "tcp" }, - { "nsp", { NULL }, 5012, "udp" }, - { "fmpro-v6", { NULL }, 5013, "tcp" }, - { "fmpro-v6", { NULL }, 5013, "udp" }, - { "onpsocket", { NULL }, 5014, "udp" }, - { "fmwp", { NULL }, 5015, "tcp" }, - { "zenginkyo-1", { NULL }, 5020, "tcp" }, - { "zenginkyo-1", { NULL }, 5020, "udp" }, - { "zenginkyo-2", { NULL }, 5021, "tcp" }, - { "zenginkyo-2", { NULL }, 5021, "udp" }, - { "mice", { NULL }, 5022, "tcp" }, - { "mice", { NULL }, 5022, "udp" }, - { "htuilsrv", { NULL }, 5023, "tcp" }, - { "htuilsrv", { NULL }, 5023, "udp" }, - { "scpi-telnet", { NULL }, 5024, "tcp" }, - { "scpi-telnet", { NULL }, 5024, "udp" }, - { "scpi-raw", { NULL }, 5025, "tcp" }, - { "scpi-raw", { NULL }, 5025, "udp" }, - { "strexec-d", { NULL }, 5026, "tcp" }, - { "strexec-d", { NULL }, 5026, "udp" }, - { "strexec-s", { NULL }, 5027, "tcp" }, - { "strexec-s", { NULL }, 5027, "udp" }, - { "qvr", { NULL }, 5028, "tcp" }, - { "infobright", { NULL }, 5029, "tcp" }, - { "infobright", { NULL }, 5029, "udp" }, - { "surfpass", { NULL }, 5030, "tcp" }, - { "surfpass", { NULL }, 5030, "udp" }, - { "dmp", { NULL }, 5031, "udp" }, - { "asnaacceler8db", { NULL }, 5042, "tcp" }, - { "asnaacceler8db", { NULL }, 5042, "udp" }, - { "swxadmin", { NULL }, 5043, "tcp" }, - { "swxadmin", { NULL }, 5043, "udp" }, - { "lxi-evntsvc", { NULL }, 5044, "tcp" }, - { "lxi-evntsvc", { NULL }, 5044, "udp" }, - { "osp", { NULL }, 5045, "tcp" }, - { "vpm-udp", { NULL }, 5046, "udp" }, - { "iscape", { NULL }, 5047, "udp" }, - { "texai", { NULL }, 5048, "tcp" }, - { "ivocalize", { NULL }, 5049, "tcp" }, - { "ivocalize", { NULL }, 5049, "udp" }, - { "mmcc", { NULL }, 5050, "tcp" }, - { "mmcc", { NULL }, 5050, "udp" }, - { "ita-agent", { NULL }, 5051, "tcp" }, - { "ita-agent", { NULL }, 5051, "udp" }, - { "ita-manager", { NULL }, 5052, "tcp" }, - { "ita-manager", { NULL }, 5052, "udp" }, - { "rlm", { NULL }, 5053, "tcp" }, - { "rlm-admin", { NULL }, 5054, "tcp" }, - { "unot", { NULL }, 5055, "tcp" }, - { "unot", { NULL }, 5055, "udp" }, - { "intecom-ps1", { NULL }, 5056, "tcp" }, - { "intecom-ps1", { NULL }, 5056, "udp" }, - { "intecom-ps2", { NULL }, 5057, "tcp" }, - { "intecom-ps2", { NULL }, 5057, "udp" }, - { "locus-disc", { NULL }, 5058, "udp" }, - { "sds", { NULL }, 5059, "tcp" }, - { "sds", { NULL }, 5059, "udp" }, - { "sip", { NULL }, 5060, "tcp" }, - { "sip", { NULL }, 5060, "udp" }, - { "sip-tls", { NULL }, 5061, "tcp" }, - { "sip-tls", { NULL }, 5061, "udp" }, - { "na-localise", { NULL }, 5062, "tcp" }, - { "na-localise", { NULL }, 5062, "udp" }, - { "csrpc", { NULL }, 5063, "tcp" }, - { "ca-1", { NULL }, 5064, "tcp" }, - { "ca-1", { NULL }, 5064, "udp" }, - { "ca-2", { NULL }, 5065, "tcp" }, - { "ca-2", { NULL }, 5065, "udp" }, - { "stanag-5066", { NULL }, 5066, "tcp" }, - { "stanag-5066", { NULL }, 5066, "udp" }, - { "authentx", { NULL }, 5067, "tcp" }, - { "authentx", { NULL }, 5067, "udp" }, - { "bitforestsrv", { NULL }, 5068, "tcp" }, - { "i-net-2000-npr", { NULL }, 5069, "tcp" }, - { "i-net-2000-npr", { NULL }, 5069, "udp" }, - { "vtsas", { NULL }, 5070, "tcp" }, - { "vtsas", { NULL }, 5070, "udp" }, - { "powerschool", { NULL }, 5071, "tcp" }, - { "powerschool", { NULL }, 5071, "udp" }, - { "ayiya", { NULL }, 5072, "tcp" }, - { "ayiya", { NULL }, 5072, "udp" }, - { "tag-pm", { NULL }, 5073, "tcp" }, - { "tag-pm", { NULL }, 5073, "udp" }, - { "alesquery", { NULL }, 5074, "tcp" }, - { "alesquery", { NULL }, 5074, "udp" }, - { "cp-spxrpts", { NULL }, 5079, "udp" }, - { "onscreen", { NULL }, 5080, "tcp" }, - { "onscreen", { NULL }, 5080, "udp" }, - { "sdl-ets", { NULL }, 5081, "tcp" }, - { "sdl-ets", { NULL }, 5081, "udp" }, - { "qcp", { NULL }, 5082, "tcp" }, - { "qcp", { NULL }, 5082, "udp" }, - { "qfp", { NULL }, 5083, "tcp" }, - { "qfp", { NULL }, 5083, "udp" }, - { "llrp", { NULL }, 5084, "tcp" }, - { "llrp", { NULL }, 5084, "udp" }, - { "encrypted-llrp", { NULL }, 5085, "tcp" }, - { "encrypted-llrp", { NULL }, 5085, "udp" }, - { "aprigo-cs", { NULL }, 5086, "tcp" }, - { "car", { NULL }, 5090, "sctp" }, - { "cxtp", { NULL }, 5091, "sctp" }, - { "magpie", { NULL }, 5092, "udp" }, - { "sentinel-lm", { NULL }, 5093, "tcp" }, - { "sentinel-lm", { NULL }, 5093, "udp" }, - { "hart-ip", { NULL }, 5094, "tcp" }, - { "hart-ip", { NULL }, 5094, "udp" }, - { "sentlm-srv2srv", { NULL }, 5099, "tcp" }, - { "sentlm-srv2srv", { NULL }, 5099, "udp" }, - { "socalia", { NULL }, 5100, "tcp" }, - { "socalia", { NULL }, 5100, "udp" }, - { "talarian-tcp", { NULL }, 5101, "tcp" }, - { "talarian-udp", { NULL }, 5101, "udp" }, - { "oms-nonsecure", { NULL }, 5102, "tcp" }, - { "oms-nonsecure", { NULL }, 5102, "udp" }, - { "actifio-c2c", { NULL }, 5103, "tcp" }, - { "tinymessage", { NULL }, 5104, "udp" }, - { "hughes-ap", { NULL }, 5105, "udp" }, - { "taep-as-svc", { NULL }, 5111, "tcp" }, - { "taep-as-svc", { NULL }, 5111, "udp" }, - { "pm-cmdsvr", { NULL }, 5112, "tcp" }, - { "pm-cmdsvr", { NULL }, 5112, "udp" }, - { "ev-services", { NULL }, 5114, "tcp" }, - { "autobuild", { NULL }, 5115, "tcp" }, - { "emb-proj-cmd", { NULL }, 5116, "udp" }, - { "gradecam", { NULL }, 5117, "tcp" }, - { "nbt-pc", { NULL }, 5133, "tcp" }, - { "nbt-pc", { NULL }, 5133, "udp" }, - { "ppactivation", { NULL }, 5134, "tcp" }, - { "erp-scale", { NULL }, 5135, "tcp" }, - { "minotaur-sa", { NULL }, 5136, "udp" }, - { "ctsd", { NULL }, 5137, "tcp" }, - { "ctsd", { NULL }, 5137, "udp" }, - { "rmonitor_secure", { NULL }, 5145, "tcp" }, - { "rmonitor_secure", { NULL }, 5145, "udp" }, - { "social-alarm", { NULL }, 5146, "tcp" }, - { "atmp", { NULL }, 5150, "tcp" }, - { "atmp", { NULL }, 5150, "udp" }, - { "esri_sde", { NULL }, 5151, "tcp" }, - { "esri_sde", { NULL }, 5151, "udp" }, - { "sde-discovery", { NULL }, 5152, "tcp" }, - { "sde-discovery", { NULL }, 5152, "udp" }, - { "toruxserver", { NULL }, 5153, "tcp" }, - { "bzflag", { NULL }, 5154, "tcp" }, - { "bzflag", { NULL }, 5154, "udp" }, - { "asctrl-agent", { NULL }, 5155, "tcp" }, - { "asctrl-agent", { NULL }, 5155, "udp" }, - { "rugameonline", { NULL }, 5156, "tcp" }, - { "mediat", { NULL }, 5157, "tcp" }, - { "snmpssh", { NULL }, 5161, "tcp" }, - { "snmpssh-trap", { NULL }, 5162, "tcp" }, - { "sbackup", { NULL }, 5163, "tcp" }, - { "vpa", { NULL }, 5164, "tcp" }, - { "vpa-disc", { NULL }, 5164, "udp" }, - { "ife_icorp", { NULL }, 5165, "tcp" }, - { "ife_icorp", { NULL }, 5165, "udp" }, - { "winpcs", { NULL }, 5166, "tcp" }, - { "winpcs", { NULL }, 5166, "udp" }, - { "scte104", { NULL }, 5167, "tcp" }, - { "scte104", { NULL }, 5167, "udp" }, - { "scte30", { NULL }, 5168, "tcp" }, - { "scte30", { NULL }, 5168, "udp" }, - { "aol", { NULL }, 5190, "tcp" }, - { "aol", { NULL }, 5190, "udp" }, - { "aol-1", { NULL }, 5191, "tcp" }, - { "aol-1", { NULL }, 5191, "udp" }, - { "aol-2", { NULL }, 5192, "tcp" }, - { "aol-2", { NULL }, 5192, "udp" }, - { "aol-3", { NULL }, 5193, "tcp" }, - { "aol-3", { NULL }, 5193, "udp" }, - { "cpscomm", { NULL }, 5194, "tcp" }, - { "targus-getdata", { NULL }, 5200, "tcp" }, - { "targus-getdata", { NULL }, 5200, "udp" }, - { "targus-getdata1", { NULL }, 5201, "tcp" }, - { "targus-getdata1", { NULL }, 5201, "udp" }, - { "targus-getdata2", { NULL }, 5202, "tcp" }, - { "targus-getdata2", { NULL }, 5202, "udp" }, - { "targus-getdata3", { NULL }, 5203, "tcp" }, - { "targus-getdata3", { NULL }, 5203, "udp" }, - { "3exmp", { NULL }, 5221, "tcp" }, - { "xmpp-client", { NULL }, 5222, "tcp" }, - { "hpvirtgrp", { NULL }, 5223, "tcp" }, - { "hpvirtgrp", { NULL }, 5223, "udp" }, - { "hpvirtctrl", { NULL }, 5224, "tcp" }, - { "hpvirtctrl", { NULL }, 5224, "udp" }, - { "hp-server", { NULL }, 5225, "tcp" }, - { "hp-server", { NULL }, 5225, "udp" }, - { "hp-status", { NULL }, 5226, "tcp" }, - { "hp-status", { NULL }, 5226, "udp" }, - { "perfd", { NULL }, 5227, "tcp" }, - { "perfd", { NULL }, 5227, "udp" }, - { "hpvroom", { NULL }, 5228, "tcp" }, - { "csedaemon", { NULL }, 5232, "tcp" }, - { "enfs", { NULL }, 5233, "tcp" }, - { "eenet", { NULL }, 5234, "tcp" }, - { "eenet", { NULL }, 5234, "udp" }, - { "galaxy-network", { NULL }, 5235, "tcp" }, - { "galaxy-network", { NULL }, 5235, "udp" }, - { "padl2sim", { NULL }, 5236, "tcp" }, - { "padl2sim", { NULL }, 5236, "udp" }, - { "mnet-discovery", { NULL }, 5237, "tcp" }, - { "mnet-discovery", { NULL }, 5237, "udp" }, - { "downtools", { NULL }, 5245, "tcp" }, - { "downtools-disc", { NULL }, 5245, "udp" }, - { "capwap-control", { NULL }, 5246, "udp" }, - { "capwap-data", { NULL }, 5247, "udp" }, - { "caacws", { NULL }, 5248, "tcp" }, - { "caacws", { NULL }, 5248, "udp" }, - { "caaclang2", { NULL }, 5249, "tcp" }, - { "caaclang2", { NULL }, 5249, "udp" }, - { "soagateway", { NULL }, 5250, "tcp" }, - { "soagateway", { NULL }, 5250, "udp" }, - { "caevms", { NULL }, 5251, "tcp" }, - { "caevms", { NULL }, 5251, "udp" }, - { "movaz-ssc", { NULL }, 5252, "tcp" }, - { "movaz-ssc", { NULL }, 5252, "udp" }, - { "kpdp", { NULL }, 5253, "tcp" }, - { "3com-njack-1", { NULL }, 5264, "tcp" }, - { "3com-njack-1", { NULL }, 5264, "udp" }, - { "3com-njack-2", { NULL }, 5265, "tcp" }, - { "3com-njack-2", { NULL }, 5265, "udp" }, - { "xmpp-server", { NULL }, 5269, "tcp" }, - { "xmp", { NULL }, 5270, "tcp" }, - { "xmp", { NULL }, 5270, "udp" }, - { "cuelink", { NULL }, 5271, "tcp" }, - { "cuelink-disc", { NULL }, 5271, "udp" }, - { "pk", { NULL }, 5272, "tcp" }, - { "pk", { NULL }, 5272, "udp" }, - { "xmpp-bosh", { NULL }, 5280, "tcp" }, - { "undo-lm", { NULL }, 5281, "tcp" }, - { "transmit-port", { NULL }, 5282, "tcp" }, - { "transmit-port", { NULL }, 5282, "udp" }, - { "presence", { NULL }, 5298, "tcp" }, - { "presence", { NULL }, 5298, "udp" }, - { "nlg-data", { NULL }, 5299, "tcp" }, - { "nlg-data", { NULL }, 5299, "udp" }, - { "hacl-hb", { NULL }, 5300, "tcp" }, - { "hacl-hb", { NULL }, 5300, "udp" }, - { "hacl-gs", { NULL }, 5301, "tcp" }, - { "hacl-gs", { NULL }, 5301, "udp" }, - { "hacl-cfg", { NULL }, 5302, "tcp" }, - { "hacl-cfg", { NULL }, 5302, "udp" }, - { "hacl-probe", { NULL }, 5303, "tcp" }, - { "hacl-probe", { NULL }, 5303, "udp" }, - { "hacl-local", { NULL }, 5304, "tcp" }, - { "hacl-local", { NULL }, 5304, "udp" }, - { "hacl-test", { NULL }, 5305, "tcp" }, - { "hacl-test", { NULL }, 5305, "udp" }, - { "sun-mc-grp", { NULL }, 5306, "tcp" }, - { "sun-mc-grp", { NULL }, 5306, "udp" }, - { "sco-aip", { NULL }, 5307, "tcp" }, - { "sco-aip", { NULL }, 5307, "udp" }, - { "cfengine", { NULL }, 5308, "tcp" }, - { "cfengine", { NULL }, 5308, "udp" }, - { "jprinter", { NULL }, 5309, "tcp" }, - { "jprinter", { NULL }, 5309, "udp" }, - { "outlaws", { NULL }, 5310, "tcp" }, - { "outlaws", { NULL }, 5310, "udp" }, - { "permabit-cs", { NULL }, 5312, "tcp" }, - { "permabit-cs", { NULL }, 5312, "udp" }, - { "rrdp", { NULL }, 5313, "tcp" }, - { "rrdp", { NULL }, 5313, "udp" }, - { "opalis-rbt-ipc", { NULL }, 5314, "tcp" }, - { "opalis-rbt-ipc", { NULL }, 5314, "udp" }, - { "hacl-poll", { NULL }, 5315, "tcp" }, - { "hacl-poll", { NULL }, 5315, "udp" }, - { "hpdevms", { NULL }, 5316, "tcp" }, - { "hpdevms", { NULL }, 5316, "udp" }, - { "bsfserver-zn", { NULL }, 5320, "tcp" }, - { "bsfsvr-zn-ssl", { NULL }, 5321, "tcp" }, - { "kfserver", { NULL }, 5343, "tcp" }, - { "kfserver", { NULL }, 5343, "udp" }, - { "xkotodrcp", { NULL }, 5344, "tcp" }, - { "xkotodrcp", { NULL }, 5344, "udp" }, - { "stuns", { NULL }, 5349, "tcp" }, - { "stuns", { NULL }, 5349, "udp" }, - { "turns", { NULL }, 5349, "tcp" }, - { "turns", { NULL }, 5349, "udp" }, - { "stun-behaviors", { NULL }, 5349, "tcp" }, - { "stun-behaviors", { NULL }, 5349, "udp" }, - { "nat-pmp-status", { NULL }, 5350, "tcp" }, - { "nat-pmp-status", { NULL }, 5350, "udp" }, - { "nat-pmp", { NULL }, 5351, "tcp" }, - { "nat-pmp", { NULL }, 5351, "udp" }, - { "dns-llq", { NULL }, 5352, "tcp" }, - { "dns-llq", { NULL }, 5352, "udp" }, - { "mdns", { NULL }, 5353, "tcp" }, - { "mdns", { NULL }, 5353, "udp" }, - { "mdnsresponder", { NULL }, 5354, "tcp" }, - { "mdnsresponder", { NULL }, 5354, "udp" }, - { "llmnr", { NULL }, 5355, "tcp" }, - { "llmnr", { NULL }, 5355, "udp" }, - { "ms-smlbiz", { NULL }, 5356, "tcp" }, - { "ms-smlbiz", { NULL }, 5356, "udp" }, - { "wsdapi", { NULL }, 5357, "tcp" }, - { "wsdapi", { NULL }, 5357, "udp" }, - { "wsdapi-s", { NULL }, 5358, "tcp" }, - { "wsdapi-s", { NULL }, 5358, "udp" }, - { "ms-alerter", { NULL }, 5359, "tcp" }, - { "ms-alerter", { NULL }, 5359, "udp" }, - { "ms-sideshow", { NULL }, 5360, "tcp" }, - { "ms-sideshow", { NULL }, 5360, "udp" }, - { "ms-s-sideshow", { NULL }, 5361, "tcp" }, - { "ms-s-sideshow", { NULL }, 5361, "udp" }, - { "serverwsd2", { NULL }, 5362, "tcp" }, - { "serverwsd2", { NULL }, 5362, "udp" }, - { "net-projection", { NULL }, 5363, "tcp" }, - { "net-projection", { NULL }, 5363, "udp" }, - { "stresstester", { NULL }, 5397, "tcp" }, - { "stresstester", { NULL }, 5397, "udp" }, - { "elektron-admin", { NULL }, 5398, "tcp" }, - { "elektron-admin", { NULL }, 5398, "udp" }, - { "securitychase", { NULL }, 5399, "tcp" }, - { "securitychase", { NULL }, 5399, "udp" }, - { "excerpt", { NULL }, 5400, "tcp" }, - { "excerpt", { NULL }, 5400, "udp" }, - { "excerpts", { NULL }, 5401, "tcp" }, - { "excerpts", { NULL }, 5401, "udp" }, - { "mftp", { NULL }, 5402, "tcp" }, - { "mftp", { NULL }, 5402, "udp" }, - { "hpoms-ci-lstn", { NULL }, 5403, "tcp" }, - { "hpoms-ci-lstn", { NULL }, 5403, "udp" }, - { "hpoms-dps-lstn", { NULL }, 5404, "tcp" }, - { "hpoms-dps-lstn", { NULL }, 5404, "udp" }, - { "netsupport", { NULL }, 5405, "tcp" }, - { "netsupport", { NULL }, 5405, "udp" }, - { "systemics-sox", { NULL }, 5406, "tcp" }, - { "systemics-sox", { NULL }, 5406, "udp" }, - { "foresyte-clear", { NULL }, 5407, "tcp" }, - { "foresyte-clear", { NULL }, 5407, "udp" }, - { "foresyte-sec", { NULL }, 5408, "tcp" }, - { "foresyte-sec", { NULL }, 5408, "udp" }, - { "salient-dtasrv", { NULL }, 5409, "tcp" }, - { "salient-dtasrv", { NULL }, 5409, "udp" }, - { "salient-usrmgr", { NULL }, 5410, "tcp" }, - { "salient-usrmgr", { NULL }, 5410, "udp" }, - { "actnet", { NULL }, 5411, "tcp" }, - { "actnet", { NULL }, 5411, "udp" }, - { "continuus", { NULL }, 5412, "tcp" }, - { "continuus", { NULL }, 5412, "udp" }, - { "wwiotalk", { NULL }, 5413, "tcp" }, - { "wwiotalk", { NULL }, 5413, "udp" }, - { "statusd", { NULL }, 5414, "tcp" }, - { "statusd", { NULL }, 5414, "udp" }, - { "ns-server", { NULL }, 5415, "tcp" }, - { "ns-server", { NULL }, 5415, "udp" }, - { "sns-gateway", { NULL }, 5416, "tcp" }, - { "sns-gateway", { NULL }, 5416, "udp" }, - { "sns-agent", { NULL }, 5417, "tcp" }, - { "sns-agent", { NULL }, 5417, "udp" }, - { "mcntp", { NULL }, 5418, "tcp" }, - { "mcntp", { NULL }, 5418, "udp" }, - { "dj-ice", { NULL }, 5419, "tcp" }, - { "dj-ice", { NULL }, 5419, "udp" }, - { "cylink-c", { NULL }, 5420, "tcp" }, - { "cylink-c", { NULL }, 5420, "udp" }, - { "netsupport2", { NULL }, 5421, "tcp" }, - { "netsupport2", { NULL }, 5421, "udp" }, - { "salient-mux", { NULL }, 5422, "tcp" }, - { "salient-mux", { NULL }, 5422, "udp" }, - { "virtualuser", { NULL }, 5423, "tcp" }, - { "virtualuser", { NULL }, 5423, "udp" }, - { "beyond-remote", { NULL }, 5424, "tcp" }, - { "beyond-remote", { NULL }, 5424, "udp" }, - { "br-channel", { NULL }, 5425, "tcp" }, - { "br-channel", { NULL }, 5425, "udp" }, - { "devbasic", { NULL }, 5426, "tcp" }, - { "devbasic", { NULL }, 5426, "udp" }, - { "sco-peer-tta", { NULL }, 5427, "tcp" }, - { "sco-peer-tta", { NULL }, 5427, "udp" }, - { "telaconsole", { NULL }, 5428, "tcp" }, - { "telaconsole", { NULL }, 5428, "udp" }, - { "base", { NULL }, 5429, "tcp" }, - { "base", { NULL }, 5429, "udp" }, - { "radec-corp", { NULL }, 5430, "tcp" }, - { "radec-corp", { NULL }, 5430, "udp" }, - { "park-agent", { NULL }, 5431, "tcp" }, - { "park-agent", { NULL }, 5431, "udp" }, - { "postgresql", { NULL }, 5432, "tcp" }, - { "postgresql", { NULL }, 5432, "udp" }, - { "pyrrho", { NULL }, 5433, "tcp" }, - { "pyrrho", { NULL }, 5433, "udp" }, - { "sgi-arrayd", { NULL }, 5434, "tcp" }, - { "sgi-arrayd", { NULL }, 5434, "udp" }, - { "sceanics", { NULL }, 5435, "tcp" }, - { "sceanics", { NULL }, 5435, "udp" }, - { "pmip6-cntl", { NULL }, 5436, "udp" }, - { "pmip6-data", { NULL }, 5437, "udp" }, - { "spss", { NULL }, 5443, "tcp" }, - { "spss", { NULL }, 5443, "udp" }, - { "surebox", { NULL }, 5453, "tcp" }, - { "surebox", { NULL }, 5453, "udp" }, - { "apc-5454", { NULL }, 5454, "tcp" }, - { "apc-5454", { NULL }, 5454, "udp" }, - { "apc-5455", { NULL }, 5455, "tcp" }, - { "apc-5455", { NULL }, 5455, "udp" }, - { "apc-5456", { NULL }, 5456, "tcp" }, - { "apc-5456", { NULL }, 5456, "udp" }, - { "silkmeter", { NULL }, 5461, "tcp" }, - { "silkmeter", { NULL }, 5461, "udp" }, - { "ttl-publisher", { NULL }, 5462, "tcp" }, - { "ttl-publisher", { NULL }, 5462, "udp" }, - { "ttlpriceproxy", { NULL }, 5463, "tcp" }, - { "ttlpriceproxy", { NULL }, 5463, "udp" }, - { "quailnet", { NULL }, 5464, "tcp" }, - { "quailnet", { NULL }, 5464, "udp" }, - { "netops-broker", { NULL }, 5465, "tcp" }, - { "netops-broker", { NULL }, 5465, "udp" }, - { "fcp-addr-srvr1", { NULL }, 5500, "tcp" }, - { "fcp-addr-srvr1", { NULL }, 5500, "udp" }, - { "fcp-addr-srvr2", { NULL }, 5501, "tcp" }, - { "fcp-addr-srvr2", { NULL }, 5501, "udp" }, - { "fcp-srvr-inst1", { NULL }, 5502, "tcp" }, - { "fcp-srvr-inst1", { NULL }, 5502, "udp" }, - { "fcp-srvr-inst2", { NULL }, 5503, "tcp" }, - { "fcp-srvr-inst2", { NULL }, 5503, "udp" }, - { "fcp-cics-gw1", { NULL }, 5504, "tcp" }, - { "fcp-cics-gw1", { NULL }, 5504, "udp" }, - { "checkoutdb", { NULL }, 5505, "tcp" }, - { "checkoutdb", { NULL }, 5505, "udp" }, - { "amc", { NULL }, 5506, "tcp" }, - { "amc", { NULL }, 5506, "udp" }, - { "sgi-eventmond", { NULL }, 5553, "tcp" }, - { "sgi-eventmond", { NULL }, 5553, "udp" }, - { "sgi-esphttp", { NULL }, 5554, "tcp" }, - { "sgi-esphttp", { NULL }, 5554, "udp" }, - { "personal-agent", { NULL }, 5555, "tcp" }, - { "personal-agent", { NULL }, 5555, "udp" }, - { "freeciv", { NULL }, 5556, "tcp" }, - { "freeciv", { NULL }, 5556, "udp" }, - { "farenet", { NULL }, 5557, "tcp" }, - { "westec-connect", { NULL }, 5566, "tcp" }, - { "m-oap", { NULL }, 5567, "tcp" }, - { "m-oap", { NULL }, 5567, "udp" }, - { "sdt", { NULL }, 5568, "tcp" }, - { "sdt", { NULL }, 5568, "udp" }, - { "sdmmp", { NULL }, 5573, "tcp" }, - { "sdmmp", { NULL }, 5573, "udp" }, - { "lsi-bobcat", { NULL }, 5574, "tcp" }, - { "ora-oap", { NULL }, 5575, "tcp" }, - { "fdtracks", { NULL }, 5579, "tcp" }, - { "tmosms0", { NULL }, 5580, "tcp" }, - { "tmosms0", { NULL }, 5580, "udp" }, - { "tmosms1", { NULL }, 5581, "tcp" }, - { "tmosms1", { NULL }, 5581, "udp" }, - { "fac-restore", { NULL }, 5582, "tcp" }, - { "fac-restore", { NULL }, 5582, "udp" }, - { "tmo-icon-sync", { NULL }, 5583, "tcp" }, - { "tmo-icon-sync", { NULL }, 5583, "udp" }, - { "bis-web", { NULL }, 5584, "tcp" }, - { "bis-web", { NULL }, 5584, "udp" }, - { "bis-sync", { NULL }, 5585, "tcp" }, - { "bis-sync", { NULL }, 5585, "udp" }, - { "ininmessaging", { NULL }, 5597, "tcp" }, - { "ininmessaging", { NULL }, 5597, "udp" }, - { "mctfeed", { NULL }, 5598, "tcp" }, - { "mctfeed", { NULL }, 5598, "udp" }, - { "esinstall", { NULL }, 5599, "tcp" }, - { "esinstall", { NULL }, 5599, "udp" }, - { "esmmanager", { NULL }, 5600, "tcp" }, - { "esmmanager", { NULL }, 5600, "udp" }, - { "esmagent", { NULL }, 5601, "tcp" }, - { "esmagent", { NULL }, 5601, "udp" }, - { "a1-msc", { NULL }, 5602, "tcp" }, - { "a1-msc", { NULL }, 5602, "udp" }, - { "a1-bs", { NULL }, 5603, "tcp" }, - { "a1-bs", { NULL }, 5603, "udp" }, - { "a3-sdunode", { NULL }, 5604, "tcp" }, - { "a3-sdunode", { NULL }, 5604, "udp" }, - { "a4-sdunode", { NULL }, 5605, "tcp" }, - { "a4-sdunode", { NULL }, 5605, "udp" }, - { "ninaf", { NULL }, 5627, "tcp" }, - { "ninaf", { NULL }, 5627, "udp" }, - { "htrust", { NULL }, 5628, "tcp" }, - { "htrust", { NULL }, 5628, "udp" }, - { "symantec-sfdb", { NULL }, 5629, "tcp" }, - { "symantec-sfdb", { NULL }, 5629, "udp" }, - { "precise-comm", { NULL }, 5630, "tcp" }, - { "precise-comm", { NULL }, 5630, "udp" }, - { "pcanywheredata", { NULL }, 5631, "tcp" }, - { "pcanywheredata", { NULL }, 5631, "udp" }, - { "pcanywherestat", { NULL }, 5632, "tcp" }, - { "pcanywherestat", { NULL }, 5632, "udp" }, - { "beorl", { NULL }, 5633, "tcp" }, - { "beorl", { NULL }, 5633, "udp" }, - { "xprtld", { NULL }, 5634, "tcp" }, - { "xprtld", { NULL }, 5634, "udp" }, - { "sfmsso", { NULL }, 5635, "tcp" }, - { "sfm-db-server", { NULL }, 5636, "tcp" }, - { "cssc", { NULL }, 5637, "tcp" }, - { "amqps", { NULL }, 5671, "tcp" }, - { "amqps", { NULL }, 5671, "udp" }, - { "amqp", { NULL }, 5672, "tcp" }, - { "amqp", { NULL }, 5672, "udp" }, - { "amqp", { NULL }, 5672, "sctp" }, - { "jms", { NULL }, 5673, "tcp" }, - { "jms", { NULL }, 5673, "udp" }, - { "hyperscsi-port", { NULL }, 5674, "tcp" }, - { "hyperscsi-port", { NULL }, 5674, "udp" }, - { "v5ua", { NULL }, 5675, "tcp" }, - { "v5ua", { NULL }, 5675, "udp" }, - { "v5ua", { NULL }, 5675, "sctp" }, - { "raadmin", { NULL }, 5676, "tcp" }, - { "raadmin", { NULL }, 5676, "udp" }, - { "questdb2-lnchr", { NULL }, 5677, "tcp" }, - { "questdb2-lnchr", { NULL }, 5677, "udp" }, - { "rrac", { NULL }, 5678, "tcp" }, - { "rrac", { NULL }, 5678, "udp" }, - { "dccm", { NULL }, 5679, "tcp" }, - { "dccm", { NULL }, 5679, "udp" }, - { "auriga-router", { NULL }, 5680, "tcp" }, - { "auriga-router", { NULL }, 5680, "udp" }, - { "ncxcp", { NULL }, 5681, "tcp" }, - { "ncxcp", { NULL }, 5681, "udp" }, - { "brightcore", { NULL }, 5682, "udp" }, - { "ggz", { NULL }, 5688, "tcp" }, - { "ggz", { NULL }, 5688, "udp" }, - { "qmvideo", { NULL }, 5689, "tcp" }, - { "qmvideo", { NULL }, 5689, "udp" }, - { "proshareaudio", { NULL }, 5713, "tcp" }, - { "proshareaudio", { NULL }, 5713, "udp" }, - { "prosharevideo", { NULL }, 5714, "tcp" }, - { "prosharevideo", { NULL }, 5714, "udp" }, - { "prosharedata", { NULL }, 5715, "tcp" }, - { "prosharedata", { NULL }, 5715, "udp" }, - { "prosharerequest", { NULL }, 5716, "tcp" }, - { "prosharerequest", { NULL }, 5716, "udp" }, - { "prosharenotify", { NULL }, 5717, "tcp" }, - { "prosharenotify", { NULL }, 5717, "udp" }, - { "dpm", { NULL }, 5718, "tcp" }, - { "dpm", { NULL }, 5718, "udp" }, - { "dpm-agent", { NULL }, 5719, "tcp" }, - { "dpm-agent", { NULL }, 5719, "udp" }, - { "ms-licensing", { NULL }, 5720, "tcp" }, - { "ms-licensing", { NULL }, 5720, "udp" }, - { "dtpt", { NULL }, 5721, "tcp" }, - { "dtpt", { NULL }, 5721, "udp" }, - { "msdfsr", { NULL }, 5722, "tcp" }, - { "msdfsr", { NULL }, 5722, "udp" }, - { "omhs", { NULL }, 5723, "tcp" }, - { "omhs", { NULL }, 5723, "udp" }, - { "omsdk", { NULL }, 5724, "tcp" }, - { "omsdk", { NULL }, 5724, "udp" }, - { "ms-ilm", { NULL }, 5725, "tcp" }, - { "ms-ilm-sts", { NULL }, 5726, "tcp" }, - { "asgenf", { NULL }, 5727, "tcp" }, - { "io-dist-data", { NULL }, 5728, "tcp" }, - { "io-dist-group", { NULL }, 5728, "udp" }, - { "openmail", { NULL }, 5729, "tcp" }, - { "openmail", { NULL }, 5729, "udp" }, - { "unieng", { NULL }, 5730, "tcp" }, - { "unieng", { NULL }, 5730, "udp" }, - { "ida-discover1", { NULL }, 5741, "tcp" }, - { "ida-discover1", { NULL }, 5741, "udp" }, - { "ida-discover2", { NULL }, 5742, "tcp" }, - { "ida-discover2", { NULL }, 5742, "udp" }, - { "watchdoc-pod", { NULL }, 5743, "tcp" }, - { "watchdoc-pod", { NULL }, 5743, "udp" }, - { "watchdoc", { NULL }, 5744, "tcp" }, - { "watchdoc", { NULL }, 5744, "udp" }, - { "fcopy-server", { NULL }, 5745, "tcp" }, - { "fcopy-server", { NULL }, 5745, "udp" }, - { "fcopys-server", { NULL }, 5746, "tcp" }, - { "fcopys-server", { NULL }, 5746, "udp" }, - { "tunatic", { NULL }, 5747, "tcp" }, - { "tunatic", { NULL }, 5747, "udp" }, - { "tunalyzer", { NULL }, 5748, "tcp" }, - { "tunalyzer", { NULL }, 5748, "udp" }, - { "rscd", { NULL }, 5750, "tcp" }, - { "rscd", { NULL }, 5750, "udp" }, - { "openmailg", { NULL }, 5755, "tcp" }, - { "openmailg", { NULL }, 5755, "udp" }, - { "x500ms", { NULL }, 5757, "tcp" }, - { "x500ms", { NULL }, 5757, "udp" }, - { "openmailns", { NULL }, 5766, "tcp" }, - { "openmailns", { NULL }, 5766, "udp" }, - { "s-openmail", { NULL }, 5767, "tcp" }, - { "s-openmail", { NULL }, 5767, "udp" }, - { "openmailpxy", { NULL }, 5768, "tcp" }, - { "openmailpxy", { NULL }, 5768, "udp" }, - { "spramsca", { NULL }, 5769, "tcp" }, - { "spramsca", { NULL }, 5769, "udp" }, - { "spramsd", { NULL }, 5770, "tcp" }, - { "spramsd", { NULL }, 5770, "udp" }, - { "netagent", { NULL }, 5771, "tcp" }, - { "netagent", { NULL }, 5771, "udp" }, - { "dali-port", { NULL }, 5777, "tcp" }, - { "dali-port", { NULL }, 5777, "udp" }, - { "vts-rpc", { NULL }, 5780, "tcp" }, - { "3par-evts", { NULL }, 5781, "tcp" }, - { "3par-evts", { NULL }, 5781, "udp" }, - { "3par-mgmt", { NULL }, 5782, "tcp" }, - { "3par-mgmt", { NULL }, 5782, "udp" }, - { "3par-mgmt-ssl", { NULL }, 5783, "tcp" }, - { "3par-mgmt-ssl", { NULL }, 5783, "udp" }, - { "ibar", { NULL }, 5784, "udp" }, - { "3par-rcopy", { NULL }, 5785, "tcp" }, - { "3par-rcopy", { NULL }, 5785, "udp" }, - { "cisco-redu", { NULL }, 5786, "udp" }, - { "waascluster", { NULL }, 5787, "udp" }, - { "xtreamx", { NULL }, 5793, "tcp" }, - { "xtreamx", { NULL }, 5793, "udp" }, - { "spdp", { NULL }, 5794, "udp" }, - { "icmpd", { NULL }, 5813, "tcp" }, - { "icmpd", { NULL }, 5813, "udp" }, - { "spt-automation", { NULL }, 5814, "tcp" }, - { "spt-automation", { NULL }, 5814, "udp" }, - { "wherehoo", { NULL }, 5859, "tcp" }, - { "wherehoo", { NULL }, 5859, "udp" }, - { "ppsuitemsg", { NULL }, 5863, "tcp" }, - { "ppsuitemsg", { NULL }, 5863, "udp" }, - { "rfb", { NULL }, 5900, "tcp" }, - { "rfb", { NULL }, 5900, "udp" }, - { "cm", { NULL }, 5910, "tcp" }, - { "cm", { NULL }, 5910, "udp" }, - { "cpdlc", { NULL }, 5911, "tcp" }, - { "cpdlc", { NULL }, 5911, "udp" }, - { "fis", { NULL }, 5912, "tcp" }, - { "fis", { NULL }, 5912, "udp" }, - { "ads-c", { NULL }, 5913, "tcp" }, - { "ads-c", { NULL }, 5913, "udp" }, - { "indy", { NULL }, 5963, "tcp" }, - { "indy", { NULL }, 5963, "udp" }, - { "mppolicy-v5", { NULL }, 5968, "tcp" }, - { "mppolicy-v5", { NULL }, 5968, "udp" }, - { "mppolicy-mgr", { NULL }, 5969, "tcp" }, - { "mppolicy-mgr", { NULL }, 5969, "udp" }, - { "couchdb", { NULL }, 5984, "tcp" }, - { "couchdb", { NULL }, 5984, "udp" }, - { "wsman", { NULL }, 5985, "tcp" }, - { "wsman", { NULL }, 5985, "udp" }, - { "wsmans", { NULL }, 5986, "tcp" }, - { "wsmans", { NULL }, 5986, "udp" }, - { "wbem-rmi", { NULL }, 5987, "tcp" }, - { "wbem-rmi", { NULL }, 5987, "udp" }, - { "wbem-http", { NULL }, 5988, "tcp" }, - { "wbem-http", { NULL }, 5988, "udp" }, - { "wbem-https", { NULL }, 5989, "tcp" }, - { "wbem-https", { NULL }, 5989, "udp" }, - { "wbem-exp-https", { NULL }, 5990, "tcp" }, - { "wbem-exp-https", { NULL }, 5990, "udp" }, - { "nuxsl", { NULL }, 5991, "tcp" }, - { "nuxsl", { NULL }, 5991, "udp" }, - { "consul-insight", { NULL }, 5992, "tcp" }, - { "consul-insight", { NULL }, 5992, "udp" }, - { "cvsup", { NULL }, 5999, "tcp" }, - { "cvsup", { NULL }, 5999, "udp" }, - { "ndl-ahp-svc", { NULL }, 6064, "tcp" }, - { "ndl-ahp-svc", { NULL }, 6064, "udp" }, - { "winpharaoh", { NULL }, 6065, "tcp" }, - { "winpharaoh", { NULL }, 6065, "udp" }, - { "ewctsp", { NULL }, 6066, "tcp" }, - { "ewctsp", { NULL }, 6066, "udp" }, - { "gsmp", { NULL }, 6068, "tcp" }, - { "gsmp", { NULL }, 6068, "udp" }, - { "trip", { NULL }, 6069, "tcp" }, - { "trip", { NULL }, 6069, "udp" }, - { "messageasap", { NULL }, 6070, "tcp" }, - { "messageasap", { NULL }, 6070, "udp" }, - { "ssdtp", { NULL }, 6071, "tcp" }, - { "ssdtp", { NULL }, 6071, "udp" }, - { "diagnose-proc", { NULL }, 6072, "tcp" }, - { "diagnose-proc", { NULL }, 6072, "udp" }, - { "directplay8", { NULL }, 6073, "tcp" }, - { "directplay8", { NULL }, 6073, "udp" }, - { "max", { NULL }, 6074, "tcp" }, - { "max", { NULL }, 6074, "udp" }, - { "dpm-acm", { NULL }, 6075, "tcp" }, - { "miami-bcast", { NULL }, 6083, "udp" }, - { "p2p-sip", { NULL }, 6084, "tcp" }, - { "konspire2b", { NULL }, 6085, "tcp" }, - { "konspire2b", { NULL }, 6085, "udp" }, - { "pdtp", { NULL }, 6086, "tcp" }, - { "pdtp", { NULL }, 6086, "udp" }, - { "ldss", { NULL }, 6087, "tcp" }, - { "ldss", { NULL }, 6087, "udp" }, - { "raxa-mgmt", { NULL }, 6099, "tcp" }, - { "synchronet-db", { NULL }, 6100, "tcp" }, - { "synchronet-db", { NULL }, 6100, "udp" }, - { "synchronet-rtc", { NULL }, 6101, "tcp" }, - { "synchronet-rtc", { NULL }, 6101, "udp" }, - { "synchronet-upd", { NULL }, 6102, "tcp" }, - { "synchronet-upd", { NULL }, 6102, "udp" }, - { "rets", { NULL }, 6103, "tcp" }, - { "rets", { NULL }, 6103, "udp" }, - { "dbdb", { NULL }, 6104, "tcp" }, - { "dbdb", { NULL }, 6104, "udp" }, - { "primaserver", { NULL }, 6105, "tcp" }, - { "primaserver", { NULL }, 6105, "udp" }, - { "mpsserver", { NULL }, 6106, "tcp" }, - { "mpsserver", { NULL }, 6106, "udp" }, - { "etc-control", { NULL }, 6107, "tcp" }, - { "etc-control", { NULL }, 6107, "udp" }, - { "sercomm-scadmin", { NULL }, 6108, "tcp" }, - { "sercomm-scadmin", { NULL }, 6108, "udp" }, - { "globecast-id", { NULL }, 6109, "tcp" }, - { "globecast-id", { NULL }, 6109, "udp" }, - { "softcm", { NULL }, 6110, "tcp" }, - { "softcm", { NULL }, 6110, "udp" }, - { "spc", { NULL }, 6111, "tcp" }, - { "spc", { NULL }, 6111, "udp" }, - { "dtspcd", { NULL }, 6112, "tcp" }, - { "dtspcd", { NULL }, 6112, "udp" }, - { "dayliteserver", { NULL }, 6113, "tcp" }, - { "wrspice", { NULL }, 6114, "tcp" }, - { "xic", { NULL }, 6115, "tcp" }, - { "xtlserv", { NULL }, 6116, "tcp" }, - { "daylitetouch", { NULL }, 6117, "tcp" }, - { "spdy", { NULL }, 6121, "tcp" }, - { "bex-webadmin", { NULL }, 6122, "tcp" }, - { "bex-webadmin", { NULL }, 6122, "udp" }, - { "backup-express", { NULL }, 6123, "tcp" }, - { "backup-express", { NULL }, 6123, "udp" }, - { "pnbs", { NULL }, 6124, "tcp" }, - { "pnbs", { NULL }, 6124, "udp" }, - { "nbt-wol", { NULL }, 6133, "tcp" }, - { "nbt-wol", { NULL }, 6133, "udp" }, - { "pulsonixnls", { NULL }, 6140, "tcp" }, - { "pulsonixnls", { NULL }, 6140, "udp" }, - { "meta-corp", { NULL }, 6141, "tcp" }, - { "meta-corp", { NULL }, 6141, "udp" }, - { "aspentec-lm", { NULL }, 6142, "tcp" }, - { "aspentec-lm", { NULL }, 6142, "udp" }, - { "watershed-lm", { NULL }, 6143, "tcp" }, - { "watershed-lm", { NULL }, 6143, "udp" }, - { "statsci1-lm", { NULL }, 6144, "tcp" }, - { "statsci1-lm", { NULL }, 6144, "udp" }, - { "statsci2-lm", { NULL }, 6145, "tcp" }, - { "statsci2-lm", { NULL }, 6145, "udp" }, - { "lonewolf-lm", { NULL }, 6146, "tcp" }, - { "lonewolf-lm", { NULL }, 6146, "udp" }, - { "montage-lm", { NULL }, 6147, "tcp" }, - { "montage-lm", { NULL }, 6147, "udp" }, - { "ricardo-lm", { NULL }, 6148, "tcp" }, - { "ricardo-lm", { NULL }, 6148, "udp" }, - { "tal-pod", { NULL }, 6149, "tcp" }, - { "tal-pod", { NULL }, 6149, "udp" }, - { "efb-aci", { NULL }, 6159, "tcp" }, - { "patrol-ism", { NULL }, 6161, "tcp" }, - { "patrol-ism", { NULL }, 6161, "udp" }, - { "patrol-coll", { NULL }, 6162, "tcp" }, - { "patrol-coll", { NULL }, 6162, "udp" }, - { "pscribe", { NULL }, 6163, "tcp" }, - { "pscribe", { NULL }, 6163, "udp" }, - { "lm-x", { NULL }, 6200, "tcp" }, - { "lm-x", { NULL }, 6200, "udp" }, - { "radmind", { NULL }, 6222, "tcp" }, - { "radmind", { NULL }, 6222, "udp" }, - { "jeol-nsdtp-1", { NULL }, 6241, "tcp" }, - { "jeol-nsddp-1", { NULL }, 6241, "udp" }, - { "jeol-nsdtp-2", { NULL }, 6242, "tcp" }, - { "jeol-nsddp-2", { NULL }, 6242, "udp" }, - { "jeol-nsdtp-3", { NULL }, 6243, "tcp" }, - { "jeol-nsddp-3", { NULL }, 6243, "udp" }, - { "jeol-nsdtp-4", { NULL }, 6244, "tcp" }, - { "jeol-nsddp-4", { NULL }, 6244, "udp" }, - { "tl1-raw-ssl", { NULL }, 6251, "tcp" }, - { "tl1-raw-ssl", { NULL }, 6251, "udp" }, - { "tl1-ssh", { NULL }, 6252, "tcp" }, - { "tl1-ssh", { NULL }, 6252, "udp" }, - { "crip", { NULL }, 6253, "tcp" }, - { "crip", { NULL }, 6253, "udp" }, - { "gld", { NULL }, 6267, "tcp" }, - { "grid", { NULL }, 6268, "tcp" }, - { "grid", { NULL }, 6268, "udp" }, - { "grid-alt", { NULL }, 6269, "tcp" }, - { "grid-alt", { NULL }, 6269, "udp" }, - { "bmc-grx", { NULL }, 6300, "tcp" }, - { "bmc-grx", { NULL }, 6300, "udp" }, - { "bmc_ctd_ldap", { NULL }, 6301, "tcp" }, - { "bmc_ctd_ldap", { NULL }, 6301, "udp" }, - { "ufmp", { NULL }, 6306, "tcp" }, - { "ufmp", { NULL }, 6306, "udp" }, - { "scup", { NULL }, 6315, "tcp" }, - { "scup-disc", { NULL }, 6315, "udp" }, - { "abb-escp", { NULL }, 6316, "tcp" }, - { "abb-escp", { NULL }, 6316, "udp" }, - { "repsvc", { NULL }, 6320, "tcp" }, - { "repsvc", { NULL }, 6320, "udp" }, - { "emp-server1", { NULL }, 6321, "tcp" }, - { "emp-server1", { NULL }, 6321, "udp" }, - { "emp-server2", { NULL }, 6322, "tcp" }, - { "emp-server2", { NULL }, 6322, "udp" }, - { "sflow", { NULL }, 6343, "tcp" }, - { "sflow", { NULL }, 6343, "udp" }, - { "gnutella-svc", { NULL }, 6346, "tcp" }, - { "gnutella-svc", { NULL }, 6346, "udp" }, - { "gnutella-rtr", { NULL }, 6347, "tcp" }, - { "gnutella-rtr", { NULL }, 6347, "udp" }, - { "adap", { NULL }, 6350, "tcp" }, - { "adap", { NULL }, 6350, "udp" }, - { "pmcs", { NULL }, 6355, "tcp" }, - { "pmcs", { NULL }, 6355, "udp" }, - { "metaedit-mu", { NULL }, 6360, "tcp" }, - { "metaedit-mu", { NULL }, 6360, "udp" }, - { "metaedit-se", { NULL }, 6370, "tcp" }, - { "metaedit-se", { NULL }, 6370, "udp" }, - { "metatude-mds", { NULL }, 6382, "tcp" }, - { "metatude-mds", { NULL }, 6382, "udp" }, - { "clariion-evr01", { NULL }, 6389, "tcp" }, - { "clariion-evr01", { NULL }, 6389, "udp" }, - { "metaedit-ws", { NULL }, 6390, "tcp" }, - { "metaedit-ws", { NULL }, 6390, "udp" }, - { "faxcomservice", { NULL }, 6417, "tcp" }, - { "faxcomservice", { NULL }, 6417, "udp" }, - { "syserverremote", { NULL }, 6418, "tcp" }, - { "svdrp", { NULL }, 6419, "tcp" }, - { "nim-vdrshell", { NULL }, 6420, "tcp" }, - { "nim-vdrshell", { NULL }, 6420, "udp" }, - { "nim-wan", { NULL }, 6421, "tcp" }, - { "nim-wan", { NULL }, 6421, "udp" }, - { "pgbouncer", { NULL }, 6432, "tcp" }, - { "sun-sr-https", { NULL }, 6443, "tcp" }, - { "sun-sr-https", { NULL }, 6443, "udp" }, - { "sge_qmaster", { NULL }, 6444, "tcp" }, - { "sge_qmaster", { NULL }, 6444, "udp" }, - { "sge_execd", { NULL }, 6445, "tcp" }, - { "sge_execd", { NULL }, 6445, "udp" }, - { "mysql-proxy", { NULL }, 6446, "tcp" }, - { "mysql-proxy", { NULL }, 6446, "udp" }, - { "skip-cert-recv", { NULL }, 6455, "tcp" }, - { "skip-cert-send", { NULL }, 6456, "udp" }, - { "lvision-lm", { NULL }, 6471, "tcp" }, - { "lvision-lm", { NULL }, 6471, "udp" }, - { "sun-sr-http", { NULL }, 6480, "tcp" }, - { "sun-sr-http", { NULL }, 6480, "udp" }, - { "servicetags", { NULL }, 6481, "tcp" }, - { "servicetags", { NULL }, 6481, "udp" }, - { "ldoms-mgmt", { NULL }, 6482, "tcp" }, - { "ldoms-mgmt", { NULL }, 6482, "udp" }, - { "SunVTS-RMI", { NULL }, 6483, "tcp" }, - { "SunVTS-RMI", { NULL }, 6483, "udp" }, - { "sun-sr-jms", { NULL }, 6484, "tcp" }, - { "sun-sr-jms", { NULL }, 6484, "udp" }, - { "sun-sr-iiop", { NULL }, 6485, "tcp" }, - { "sun-sr-iiop", { NULL }, 6485, "udp" }, - { "sun-sr-iiops", { NULL }, 6486, "tcp" }, - { "sun-sr-iiops", { NULL }, 6486, "udp" }, - { "sun-sr-iiop-aut", { NULL }, 6487, "tcp" }, - { "sun-sr-iiop-aut", { NULL }, 6487, "udp" }, - { "sun-sr-jmx", { NULL }, 6488, "tcp" }, - { "sun-sr-jmx", { NULL }, 6488, "udp" }, - { "sun-sr-admin", { NULL }, 6489, "tcp" }, - { "sun-sr-admin", { NULL }, 6489, "udp" }, - { "boks", { NULL }, 6500, "tcp" }, - { "boks", { NULL }, 6500, "udp" }, - { "boks_servc", { NULL }, 6501, "tcp" }, - { "boks_servc", { NULL }, 6501, "udp" }, - { "boks_servm", { NULL }, 6502, "tcp" }, - { "boks_servm", { NULL }, 6502, "udp" }, - { "boks_clntd", { NULL }, 6503, "tcp" }, - { "boks_clntd", { NULL }, 6503, "udp" }, - { "badm_priv", { NULL }, 6505, "tcp" }, - { "badm_priv", { NULL }, 6505, "udp" }, - { "badm_pub", { NULL }, 6506, "tcp" }, - { "badm_pub", { NULL }, 6506, "udp" }, - { "bdir_priv", { NULL }, 6507, "tcp" }, - { "bdir_priv", { NULL }, 6507, "udp" }, - { "bdir_pub", { NULL }, 6508, "tcp" }, - { "bdir_pub", { NULL }, 6508, "udp" }, - { "mgcs-mfp-port", { NULL }, 6509, "tcp" }, - { "mgcs-mfp-port", { NULL }, 6509, "udp" }, - { "mcer-port", { NULL }, 6510, "tcp" }, - { "mcer-port", { NULL }, 6510, "udp" }, - { "netconf-tls", { NULL }, 6513, "tcp" }, - { "syslog-tls", { NULL }, 6514, "tcp" }, - { "syslog-tls", { NULL }, 6514, "udp" }, - { "syslog-tls", { NULL }, 6514, "dccp" }, - { "elipse-rec", { NULL }, 6515, "tcp" }, - { "elipse-rec", { NULL }, 6515, "udp" }, - { "lds-distrib", { NULL }, 6543, "tcp" }, - { "lds-distrib", { NULL }, 6543, "udp" }, - { "lds-dump", { NULL }, 6544, "tcp" }, - { "lds-dump", { NULL }, 6544, "udp" }, - { "apc-6547", { NULL }, 6547, "tcp" }, - { "apc-6547", { NULL }, 6547, "udp" }, - { "apc-6548", { NULL }, 6548, "tcp" }, - { "apc-6548", { NULL }, 6548, "udp" }, - { "apc-6549", { NULL }, 6549, "tcp" }, - { "apc-6549", { NULL }, 6549, "udp" }, - { "fg-sysupdate", { NULL }, 6550, "tcp" }, - { "fg-sysupdate", { NULL }, 6550, "udp" }, - { "sum", { NULL }, 6551, "tcp" }, - { "sum", { NULL }, 6551, "udp" }, - { "xdsxdm", { NULL }, 6558, "tcp" }, - { "xdsxdm", { NULL }, 6558, "udp" }, - { "sane-port", { NULL }, 6566, "tcp" }, - { "sane-port", { NULL }, 6566, "udp" }, - { "esp", { NULL }, 6567, "tcp" }, - { "esp", { NULL }, 6567, "udp" }, - { "canit_store", { NULL }, 6568, "tcp" }, - { "rp-reputation", { NULL }, 6568, "udp" }, - { "affiliate", { NULL }, 6579, "tcp" }, - { "affiliate", { NULL }, 6579, "udp" }, - { "parsec-master", { NULL }, 6580, "tcp" }, - { "parsec-master", { NULL }, 6580, "udp" }, - { "parsec-peer", { NULL }, 6581, "tcp" }, - { "parsec-peer", { NULL }, 6581, "udp" }, - { "parsec-game", { NULL }, 6582, "tcp" }, - { "parsec-game", { NULL }, 6582, "udp" }, - { "joaJewelSuite", { NULL }, 6583, "tcp" }, - { "joaJewelSuite", { NULL }, 6583, "udp" }, - { "mshvlm", { NULL }, 6600, "tcp" }, - { "mstmg-sstp", { NULL }, 6601, "tcp" }, - { "wsscomfrmwk", { NULL }, 6602, "tcp" }, - { "odette-ftps", { NULL }, 6619, "tcp" }, - { "odette-ftps", { NULL }, 6619, "udp" }, - { "kftp-data", { NULL }, 6620, "tcp" }, - { "kftp-data", { NULL }, 6620, "udp" }, - { "kftp", { NULL }, 6621, "tcp" }, - { "kftp", { NULL }, 6621, "udp" }, - { "mcftp", { NULL }, 6622, "tcp" }, - { "mcftp", { NULL }, 6622, "udp" }, - { "ktelnet", { NULL }, 6623, "tcp" }, - { "ktelnet", { NULL }, 6623, "udp" }, - { "datascaler-db", { NULL }, 6624, "tcp" }, - { "datascaler-ctl", { NULL }, 6625, "tcp" }, - { "wago-service", { NULL }, 6626, "tcp" }, - { "wago-service", { NULL }, 6626, "udp" }, - { "nexgen", { NULL }, 6627, "tcp" }, - { "nexgen", { NULL }, 6627, "udp" }, - { "afesc-mc", { NULL }, 6628, "tcp" }, - { "afesc-mc", { NULL }, 6628, "udp" }, - { "mxodbc-connect", { NULL }, 6632, "tcp" }, - { "pcs-sf-ui-man", { NULL }, 6655, "tcp" }, - { "emgmsg", { NULL }, 6656, "tcp" }, - { "palcom-disc", { NULL }, 6657, "udp" }, - { "vocaltec-gold", { NULL }, 6670, "tcp" }, - { "vocaltec-gold", { NULL }, 6670, "udp" }, - { "p4p-portal", { NULL }, 6671, "tcp" }, - { "p4p-portal", { NULL }, 6671, "udp" }, - { "vision_server", { NULL }, 6672, "tcp" }, - { "vision_server", { NULL }, 6672, "udp" }, - { "vision_elmd", { NULL }, 6673, "tcp" }, - { "vision_elmd", { NULL }, 6673, "udp" }, - { "vfbp", { NULL }, 6678, "tcp" }, - { "vfbp-disc", { NULL }, 6678, "udp" }, - { "osaut", { NULL }, 6679, "tcp" }, - { "osaut", { NULL }, 6679, "udp" }, - { "clever-ctrace", { NULL }, 6687, "tcp" }, - { "clever-tcpip", { NULL }, 6688, "tcp" }, - { "tsa", { NULL }, 6689, "tcp" }, - { "tsa", { NULL }, 6689, "udp" }, - { "babel", { NULL }, 6697, "udp" }, - { "kti-icad-srvr", { NULL }, 6701, "tcp" }, - { "kti-icad-srvr", { NULL }, 6701, "udp" }, - { "e-design-net", { NULL }, 6702, "tcp" }, - { "e-design-net", { NULL }, 6702, "udp" }, - { "e-design-web", { NULL }, 6703, "tcp" }, - { "e-design-web", { NULL }, 6703, "udp" }, - { "frc-hp", { NULL }, 6704, "sctp" }, - { "frc-mp", { NULL }, 6705, "sctp" }, - { "frc-lp", { NULL }, 6706, "sctp" }, - { "ibprotocol", { NULL }, 6714, "tcp" }, - { "ibprotocol", { NULL }, 6714, "udp" }, - { "fibotrader-com", { NULL }, 6715, "tcp" }, - { "fibotrader-com", { NULL }, 6715, "udp" }, - { "bmc-perf-agent", { NULL }, 6767, "tcp" }, - { "bmc-perf-agent", { NULL }, 6767, "udp" }, - { "bmc-perf-mgrd", { NULL }, 6768, "tcp" }, - { "bmc-perf-mgrd", { NULL }, 6768, "udp" }, - { "adi-gxp-srvprt", { NULL }, 6769, "tcp" }, - { "adi-gxp-srvprt", { NULL }, 6769, "udp" }, - { "plysrv-http", { NULL }, 6770, "tcp" }, - { "plysrv-http", { NULL }, 6770, "udp" }, - { "plysrv-https", { NULL }, 6771, "tcp" }, - { "plysrv-https", { NULL }, 6771, "udp" }, - { "dgpf-exchg", { NULL }, 6785, "tcp" }, - { "dgpf-exchg", { NULL }, 6785, "udp" }, - { "smc-jmx", { NULL }, 6786, "tcp" }, - { "smc-jmx", { NULL }, 6786, "udp" }, - { "smc-admin", { NULL }, 6787, "tcp" }, - { "smc-admin", { NULL }, 6787, "udp" }, - { "smc-http", { NULL }, 6788, "tcp" }, - { "smc-http", { NULL }, 6788, "udp" }, - { "smc-https", { NULL }, 6789, "tcp" }, - { "smc-https", { NULL }, 6789, "udp" }, - { "hnmp", { NULL }, 6790, "tcp" }, - { "hnmp", { NULL }, 6790, "udp" }, - { "hnm", { NULL }, 6791, "tcp" }, - { "hnm", { NULL }, 6791, "udp" }, - { "acnet", { NULL }, 6801, "tcp" }, - { "acnet", { NULL }, 6801, "udp" }, - { "pentbox-sim", { NULL }, 6817, "tcp" }, - { "ambit-lm", { NULL }, 6831, "tcp" }, - { "ambit-lm", { NULL }, 6831, "udp" }, - { "netmo-default", { NULL }, 6841, "tcp" }, - { "netmo-default", { NULL }, 6841, "udp" }, - { "netmo-http", { NULL }, 6842, "tcp" }, - { "netmo-http", { NULL }, 6842, "udp" }, - { "iccrushmore", { NULL }, 6850, "tcp" }, - { "iccrushmore", { NULL }, 6850, "udp" }, - { "acctopus-cc", { NULL }, 6868, "tcp" }, - { "acctopus-st", { NULL }, 6868, "udp" }, - { "muse", { NULL }, 6888, "tcp" }, - { "muse", { NULL }, 6888, "udp" }, - { "jetstream", { NULL }, 6901, "tcp" }, - { "xsmsvc", { NULL }, 6936, "tcp" }, - { "xsmsvc", { NULL }, 6936, "udp" }, - { "bioserver", { NULL }, 6946, "tcp" }, - { "bioserver", { NULL }, 6946, "udp" }, - { "otlp", { NULL }, 6951, "tcp" }, - { "otlp", { NULL }, 6951, "udp" }, - { "jmact3", { NULL }, 6961, "tcp" }, - { "jmact3", { NULL }, 6961, "udp" }, - { "jmevt2", { NULL }, 6962, "tcp" }, - { "jmevt2", { NULL }, 6962, "udp" }, - { "swismgr1", { NULL }, 6963, "tcp" }, - { "swismgr1", { NULL }, 6963, "udp" }, - { "swismgr2", { NULL }, 6964, "tcp" }, - { "swismgr2", { NULL }, 6964, "udp" }, - { "swistrap", { NULL }, 6965, "tcp" }, - { "swistrap", { NULL }, 6965, "udp" }, - { "swispol", { NULL }, 6966, "tcp" }, - { "swispol", { NULL }, 6966, "udp" }, - { "acmsoda", { NULL }, 6969, "tcp" }, - { "acmsoda", { NULL }, 6969, "udp" }, - { "MobilitySrv", { NULL }, 6997, "tcp" }, - { "MobilitySrv", { NULL }, 6997, "udp" }, - { "iatp-highpri", { NULL }, 6998, "tcp" }, - { "iatp-highpri", { NULL }, 6998, "udp" }, - { "iatp-normalpri", { NULL }, 6999, "tcp" }, - { "iatp-normalpri", { NULL }, 6999, "udp" }, - { "afs3-fileserver", { NULL }, 7000, "tcp" }, - { "afs3-fileserver", { NULL }, 7000, "udp" }, - { "afs3-callback", { NULL }, 7001, "tcp" }, - { "afs3-callback", { NULL }, 7001, "udp" }, - { "afs3-prserver", { NULL }, 7002, "tcp" }, - { "afs3-prserver", { NULL }, 7002, "udp" }, - { "afs3-vlserver", { NULL }, 7003, "tcp" }, - { "afs3-vlserver", { NULL }, 7003, "udp" }, - { "afs3-kaserver", { NULL }, 7004, "tcp" }, - { "afs3-kaserver", { NULL }, 7004, "udp" }, - { "afs3-volser", { NULL }, 7005, "tcp" }, - { "afs3-volser", { NULL }, 7005, "udp" }, - { "afs3-errors", { NULL }, 7006, "tcp" }, - { "afs3-errors", { NULL }, 7006, "udp" }, - { "afs3-bos", { NULL }, 7007, "tcp" }, - { "afs3-bos", { NULL }, 7007, "udp" }, - { "afs3-update", { NULL }, 7008, "tcp" }, - { "afs3-update", { NULL }, 7008, "udp" }, - { "afs3-rmtsys", { NULL }, 7009, "tcp" }, - { "afs3-rmtsys", { NULL }, 7009, "udp" }, - { "ups-onlinet", { NULL }, 7010, "tcp" }, - { "ups-onlinet", { NULL }, 7010, "udp" }, - { "talon-disc", { NULL }, 7011, "tcp" }, - { "talon-disc", { NULL }, 7011, "udp" }, - { "talon-engine", { NULL }, 7012, "tcp" }, - { "talon-engine", { NULL }, 7012, "udp" }, - { "microtalon-dis", { NULL }, 7013, "tcp" }, - { "microtalon-dis", { NULL }, 7013, "udp" }, - { "microtalon-com", { NULL }, 7014, "tcp" }, - { "microtalon-com", { NULL }, 7014, "udp" }, - { "talon-webserver", { NULL }, 7015, "tcp" }, - { "talon-webserver", { NULL }, 7015, "udp" }, - { "dpserve", { NULL }, 7020, "tcp" }, - { "dpserve", { NULL }, 7020, "udp" }, - { "dpserveadmin", { NULL }, 7021, "tcp" }, - { "dpserveadmin", { NULL }, 7021, "udp" }, - { "ctdp", { NULL }, 7022, "tcp" }, - { "ctdp", { NULL }, 7022, "udp" }, - { "ct2nmcs", { NULL }, 7023, "tcp" }, - { "ct2nmcs", { NULL }, 7023, "udp" }, - { "vmsvc", { NULL }, 7024, "tcp" }, - { "vmsvc", { NULL }, 7024, "udp" }, - { "vmsvc-2", { NULL }, 7025, "tcp" }, - { "vmsvc-2", { NULL }, 7025, "udp" }, - { "op-probe", { NULL }, 7030, "tcp" }, - { "op-probe", { NULL }, 7030, "udp" }, - { "arcp", { NULL }, 7070, "tcp" }, - { "arcp", { NULL }, 7070, "udp" }, - { "iwg1", { NULL }, 7071, "tcp" }, - { "iwg1", { NULL }, 7071, "udp" }, - { "empowerid", { NULL }, 7080, "tcp" }, - { "empowerid", { NULL }, 7080, "udp" }, - { "lazy-ptop", { NULL }, 7099, "tcp" }, - { "lazy-ptop", { NULL }, 7099, "udp" }, - { "font-service", { NULL }, 7100, "tcp" }, - { "font-service", { NULL }, 7100, "udp" }, - { "elcn", { NULL }, 7101, "tcp" }, - { "elcn", { NULL }, 7101, "udp" }, - { "aes-x170", { NULL }, 7107, "udp" }, - { "virprot-lm", { NULL }, 7121, "tcp" }, - { "virprot-lm", { NULL }, 7121, "udp" }, - { "scenidm", { NULL }, 7128, "tcp" }, - { "scenidm", { NULL }, 7128, "udp" }, - { "scenccs", { NULL }, 7129, "tcp" }, - { "scenccs", { NULL }, 7129, "udp" }, - { "cabsm-comm", { NULL }, 7161, "tcp" }, - { "cabsm-comm", { NULL }, 7161, "udp" }, - { "caistoragemgr", { NULL }, 7162, "tcp" }, - { "caistoragemgr", { NULL }, 7162, "udp" }, - { "cacsambroker", { NULL }, 7163, "tcp" }, - { "cacsambroker", { NULL }, 7163, "udp" }, - { "fsr", { NULL }, 7164, "tcp" }, - { "fsr", { NULL }, 7164, "udp" }, - { "doc-server", { NULL }, 7165, "tcp" }, - { "doc-server", { NULL }, 7165, "udp" }, - { "aruba-server", { NULL }, 7166, "tcp" }, - { "aruba-server", { NULL }, 7166, "udp" }, - { "casrmagent", { NULL }, 7167, "tcp" }, - { "cnckadserver", { NULL }, 7168, "tcp" }, - { "ccag-pib", { NULL }, 7169, "tcp" }, - { "ccag-pib", { NULL }, 7169, "udp" }, - { "nsrp", { NULL }, 7170, "tcp" }, - { "nsrp", { NULL }, 7170, "udp" }, - { "drm-production", { NULL }, 7171, "tcp" }, - { "drm-production", { NULL }, 7171, "udp" }, - { "zsecure", { NULL }, 7173, "tcp" }, - { "clutild", { NULL }, 7174, "tcp" }, - { "clutild", { NULL }, 7174, "udp" }, - { "fodms", { NULL }, 7200, "tcp" }, - { "fodms", { NULL }, 7200, "udp" }, - { "dlip", { NULL }, 7201, "tcp" }, - { "dlip", { NULL }, 7201, "udp" }, - { "ramp", { NULL }, 7227, "tcp" }, - { "ramp", { NULL }, 7227, "udp" }, - { "citrixupp", { NULL }, 7228, "tcp" }, - { "citrixuppg", { NULL }, 7229, "tcp" }, - { "pads", { NULL }, 7237, "tcp" }, - { "cnap", { NULL }, 7262, "tcp" }, - { "cnap", { NULL }, 7262, "udp" }, - { "watchme-7272", { NULL }, 7272, "tcp" }, - { "watchme-7272", { NULL }, 7272, "udp" }, - { "oma-rlp", { NULL }, 7273, "tcp" }, - { "oma-rlp", { NULL }, 7273, "udp" }, - { "oma-rlp-s", { NULL }, 7274, "tcp" }, - { "oma-rlp-s", { NULL }, 7274, "udp" }, - { "oma-ulp", { NULL }, 7275, "tcp" }, - { "oma-ulp", { NULL }, 7275, "udp" }, - { "oma-ilp", { NULL }, 7276, "tcp" }, - { "oma-ilp", { NULL }, 7276, "udp" }, - { "oma-ilp-s", { NULL }, 7277, "tcp" }, - { "oma-ilp-s", { NULL }, 7277, "udp" }, - { "oma-dcdocbs", { NULL }, 7278, "tcp" }, - { "oma-dcdocbs", { NULL }, 7278, "udp" }, - { "ctxlic", { NULL }, 7279, "tcp" }, - { "ctxlic", { NULL }, 7279, "udp" }, - { "itactionserver1", { NULL }, 7280, "tcp" }, - { "itactionserver1", { NULL }, 7280, "udp" }, - { "itactionserver2", { NULL }, 7281, "tcp" }, - { "itactionserver2", { NULL }, 7281, "udp" }, - { "mzca-action", { NULL }, 7282, "tcp" }, - { "mzca-alert", { NULL }, 7282, "udp" }, - { "lcm-server", { NULL }, 7365, "tcp" }, - { "lcm-server", { NULL }, 7365, "udp" }, - { "mindfilesys", { NULL }, 7391, "tcp" }, - { "mindfilesys", { NULL }, 7391, "udp" }, - { "mrssrendezvous", { NULL }, 7392, "tcp" }, - { "mrssrendezvous", { NULL }, 7392, "udp" }, - { "nfoldman", { NULL }, 7393, "tcp" }, - { "nfoldman", { NULL }, 7393, "udp" }, - { "fse", { NULL }, 7394, "tcp" }, - { "fse", { NULL }, 7394, "udp" }, - { "winqedit", { NULL }, 7395, "tcp" }, - { "winqedit", { NULL }, 7395, "udp" }, - { "hexarc", { NULL }, 7397, "tcp" }, - { "hexarc", { NULL }, 7397, "udp" }, - { "rtps-discovery", { NULL }, 7400, "tcp" }, - { "rtps-discovery", { NULL }, 7400, "udp" }, - { "rtps-dd-ut", { NULL }, 7401, "tcp" }, - { "rtps-dd-ut", { NULL }, 7401, "udp" }, - { "rtps-dd-mt", { NULL }, 7402, "tcp" }, - { "rtps-dd-mt", { NULL }, 7402, "udp" }, - { "ionixnetmon", { NULL }, 7410, "tcp" }, - { "ionixnetmon", { NULL }, 7410, "udp" }, - { "mtportmon", { NULL }, 7421, "tcp" }, - { "mtportmon", { NULL }, 7421, "udp" }, - { "pmdmgr", { NULL }, 7426, "tcp" }, - { "pmdmgr", { NULL }, 7426, "udp" }, - { "oveadmgr", { NULL }, 7427, "tcp" }, - { "oveadmgr", { NULL }, 7427, "udp" }, - { "ovladmgr", { NULL }, 7428, "tcp" }, - { "ovladmgr", { NULL }, 7428, "udp" }, - { "opi-sock", { NULL }, 7429, "tcp" }, - { "opi-sock", { NULL }, 7429, "udp" }, - { "xmpv7", { NULL }, 7430, "tcp" }, - { "xmpv7", { NULL }, 7430, "udp" }, - { "pmd", { NULL }, 7431, "tcp" }, - { "pmd", { NULL }, 7431, "udp" }, - { "faximum", { NULL }, 7437, "tcp" }, - { "faximum", { NULL }, 7437, "udp" }, - { "oracleas-https", { NULL }, 7443, "tcp" }, - { "oracleas-https", { NULL }, 7443, "udp" }, - { "rise", { NULL }, 7473, "tcp" }, - { "rise", { NULL }, 7473, "udp" }, - { "telops-lmd", { NULL }, 7491, "tcp" }, - { "telops-lmd", { NULL }, 7491, "udp" }, - { "silhouette", { NULL }, 7500, "tcp" }, - { "silhouette", { NULL }, 7500, "udp" }, - { "ovbus", { NULL }, 7501, "tcp" }, - { "ovbus", { NULL }, 7501, "udp" }, - { "acplt", { NULL }, 7509, "tcp" }, - { "ovhpas", { NULL }, 7510, "tcp" }, - { "ovhpas", { NULL }, 7510, "udp" }, - { "pafec-lm", { NULL }, 7511, "tcp" }, - { "pafec-lm", { NULL }, 7511, "udp" }, - { "saratoga", { NULL }, 7542, "tcp" }, - { "saratoga", { NULL }, 7542, "udp" }, - { "atul", { NULL }, 7543, "tcp" }, - { "atul", { NULL }, 7543, "udp" }, - { "nta-ds", { NULL }, 7544, "tcp" }, - { "nta-ds", { NULL }, 7544, "udp" }, - { "nta-us", { NULL }, 7545, "tcp" }, - { "nta-us", { NULL }, 7545, "udp" }, - { "cfs", { NULL }, 7546, "tcp" }, - { "cfs", { NULL }, 7546, "udp" }, - { "cwmp", { NULL }, 7547, "tcp" }, - { "cwmp", { NULL }, 7547, "udp" }, - { "tidp", { NULL }, 7548, "tcp" }, - { "tidp", { NULL }, 7548, "udp" }, - { "nls-tl", { NULL }, 7549, "tcp" }, - { "nls-tl", { NULL }, 7549, "udp" }, - { "sncp", { NULL }, 7560, "tcp" }, - { "sncp", { NULL }, 7560, "udp" }, - { "cfw", { NULL }, 7563, "tcp" }, - { "vsi-omega", { NULL }, 7566, "tcp" }, - { "vsi-omega", { NULL }, 7566, "udp" }, - { "dell-eql-asm", { NULL }, 7569, "tcp" }, - { "aries-kfinder", { NULL }, 7570, "tcp" }, - { "aries-kfinder", { NULL }, 7570, "udp" }, - { "sun-lm", { NULL }, 7588, "tcp" }, - { "sun-lm", { NULL }, 7588, "udp" }, - { "indi", { NULL }, 7624, "tcp" }, - { "indi", { NULL }, 7624, "udp" }, - { "simco", { NULL }, 7626, "tcp" }, - { "simco", { NULL }, 7626, "sctp" }, - { "soap-http", { NULL }, 7627, "tcp" }, - { "soap-http", { NULL }, 7627, "udp" }, - { "zen-pawn", { NULL }, 7628, "tcp" }, - { "zen-pawn", { NULL }, 7628, "udp" }, - { "xdas", { NULL }, 7629, "tcp" }, - { "xdas", { NULL }, 7629, "udp" }, - { "hawk", { NULL }, 7630, "tcp" }, - { "tesla-sys-msg", { NULL }, 7631, "tcp" }, - { "pmdfmgt", { NULL }, 7633, "tcp" }, - { "pmdfmgt", { NULL }, 7633, "udp" }, - { "cuseeme", { NULL }, 7648, "tcp" }, - { "cuseeme", { NULL }, 7648, "udp" }, - { "imqstomp", { NULL }, 7672, "tcp" }, - { "imqstomps", { NULL }, 7673, "tcp" }, - { "imqtunnels", { NULL }, 7674, "tcp" }, - { "imqtunnels", { NULL }, 7674, "udp" }, - { "imqtunnel", { NULL }, 7675, "tcp" }, - { "imqtunnel", { NULL }, 7675, "udp" }, - { "imqbrokerd", { NULL }, 7676, "tcp" }, - { "imqbrokerd", { NULL }, 7676, "udp" }, - { "sun-user-https", { NULL }, 7677, "tcp" }, - { "sun-user-https", { NULL }, 7677, "udp" }, - { "pando-pub", { NULL }, 7680, "tcp" }, - { "pando-pub", { NULL }, 7680, "udp" }, - { "collaber", { NULL }, 7689, "tcp" }, - { "collaber", { NULL }, 7689, "udp" }, - { "klio", { NULL }, 7697, "tcp" }, - { "klio", { NULL }, 7697, "udp" }, - { "em7-secom", { NULL }, 7700, "tcp" }, - { "sync-em7", { NULL }, 7707, "tcp" }, - { "sync-em7", { NULL }, 7707, "udp" }, - { "scinet", { NULL }, 7708, "tcp" }, - { "scinet", { NULL }, 7708, "udp" }, - { "medimageportal", { NULL }, 7720, "tcp" }, - { "medimageportal", { NULL }, 7720, "udp" }, - { "nsdeepfreezectl", { NULL }, 7724, "tcp" }, - { "nsdeepfreezectl", { NULL }, 7724, "udp" }, - { "nitrogen", { NULL }, 7725, "tcp" }, - { "nitrogen", { NULL }, 7725, "udp" }, - { "freezexservice", { NULL }, 7726, "tcp" }, - { "freezexservice", { NULL }, 7726, "udp" }, - { "trident-data", { NULL }, 7727, "tcp" }, - { "trident-data", { NULL }, 7727, "udp" }, - { "smip", { NULL }, 7734, "tcp" }, - { "smip", { NULL }, 7734, "udp" }, - { "aiagent", { NULL }, 7738, "tcp" }, - { "aiagent", { NULL }, 7738, "udp" }, - { "scriptview", { NULL }, 7741, "tcp" }, - { "scriptview", { NULL }, 7741, "udp" }, - { "msss", { NULL }, 7742, "tcp" }, - { "sstp-1", { NULL }, 7743, "tcp" }, - { "sstp-1", { NULL }, 7743, "udp" }, - { "raqmon-pdu", { NULL }, 7744, "tcp" }, - { "raqmon-pdu", { NULL }, 7744, "udp" }, - { "prgp", { NULL }, 7747, "tcp" }, - { "prgp", { NULL }, 7747, "udp" }, - { "cbt", { NULL }, 7777, "tcp" }, - { "cbt", { NULL }, 7777, "udp" }, - { "interwise", { NULL }, 7778, "tcp" }, - { "interwise", { NULL }, 7778, "udp" }, - { "vstat", { NULL }, 7779, "tcp" }, - { "vstat", { NULL }, 7779, "udp" }, - { "accu-lmgr", { NULL }, 7781, "tcp" }, - { "accu-lmgr", { NULL }, 7781, "udp" }, - { "minivend", { NULL }, 7786, "tcp" }, - { "minivend", { NULL }, 7786, "udp" }, - { "popup-reminders", { NULL }, 7787, "tcp" }, - { "popup-reminders", { NULL }, 7787, "udp" }, - { "office-tools", { NULL }, 7789, "tcp" }, - { "office-tools", { NULL }, 7789, "udp" }, - { "q3ade", { NULL }, 7794, "tcp" }, - { "q3ade", { NULL }, 7794, "udp" }, - { "pnet-conn", { NULL }, 7797, "tcp" }, - { "pnet-conn", { NULL }, 7797, "udp" }, - { "pnet-enc", { NULL }, 7798, "tcp" }, - { "pnet-enc", { NULL }, 7798, "udp" }, - { "altbsdp", { NULL }, 7799, "tcp" }, - { "altbsdp", { NULL }, 7799, "udp" }, - { "asr", { NULL }, 7800, "tcp" }, - { "asr", { NULL }, 7800, "udp" }, - { "ssp-client", { NULL }, 7801, "tcp" }, - { "ssp-client", { NULL }, 7801, "udp" }, - { "rbt-wanopt", { NULL }, 7810, "tcp" }, - { "rbt-wanopt", { NULL }, 7810, "udp" }, - { "apc-7845", { NULL }, 7845, "tcp" }, - { "apc-7845", { NULL }, 7845, "udp" }, - { "apc-7846", { NULL }, 7846, "tcp" }, - { "apc-7846", { NULL }, 7846, "udp" }, - { "mobileanalyzer", { NULL }, 7869, "tcp" }, - { "rbt-smc", { NULL }, 7870, "tcp" }, - { "pss", { NULL }, 7880, "tcp" }, - { "pss", { NULL }, 7880, "udp" }, - { "ubroker", { NULL }, 7887, "tcp" }, - { "ubroker", { NULL }, 7887, "udp" }, - { "mevent", { NULL }, 7900, "tcp" }, - { "mevent", { NULL }, 7900, "udp" }, - { "tnos-sp", { NULL }, 7901, "tcp" }, - { "tnos-sp", { NULL }, 7901, "udp" }, - { "tnos-dp", { NULL }, 7902, "tcp" }, - { "tnos-dp", { NULL }, 7902, "udp" }, - { "tnos-dps", { NULL }, 7903, "tcp" }, - { "tnos-dps", { NULL }, 7903, "udp" }, - { "qo-secure", { NULL }, 7913, "tcp" }, - { "qo-secure", { NULL }, 7913, "udp" }, - { "t2-drm", { NULL }, 7932, "tcp" }, - { "t2-drm", { NULL }, 7932, "udp" }, - { "t2-brm", { NULL }, 7933, "tcp" }, - { "t2-brm", { NULL }, 7933, "udp" }, - { "supercell", { NULL }, 7967, "tcp" }, - { "supercell", { NULL }, 7967, "udp" }, - { "micromuse-ncps", { NULL }, 7979, "tcp" }, - { "micromuse-ncps", { NULL }, 7979, "udp" }, - { "quest-vista", { NULL }, 7980, "tcp" }, - { "quest-vista", { NULL }, 7980, "udp" }, - { "sossd-collect", { NULL }, 7981, "tcp" }, - { "sossd-agent", { NULL }, 7982, "tcp" }, - { "sossd-disc", { NULL }, 7982, "udp" }, - { "pushns", { NULL }, 7997, "tcp" }, - { "usicontentpush", { NULL }, 7998, "udp" }, - { "irdmi2", { NULL }, 7999, "tcp" }, - { "irdmi2", { NULL }, 7999, "udp" }, - { "irdmi", { NULL }, 8000, "tcp" }, - { "irdmi", { NULL }, 8000, "udp" }, - { "vcom-tunnel", { NULL }, 8001, "tcp" }, - { "vcom-tunnel", { NULL }, 8001, "udp" }, - { "teradataordbms", { NULL }, 8002, "tcp" }, - { "teradataordbms", { NULL }, 8002, "udp" }, - { "mcreport", { NULL }, 8003, "tcp" }, - { "mcreport", { NULL }, 8003, "udp" }, - { "mxi", { NULL }, 8005, "tcp" }, - { "mxi", { NULL }, 8005, "udp" }, - { "http-alt", { NULL }, 8008, "tcp" }, - { "http-alt", { NULL }, 8008, "udp" }, - { "qbdb", { NULL }, 8019, "tcp" }, - { "qbdb", { NULL }, 8019, "udp" }, - { "intu-ec-svcdisc", { NULL }, 8020, "tcp" }, - { "intu-ec-svcdisc", { NULL }, 8020, "udp" }, - { "intu-ec-client", { NULL }, 8021, "tcp" }, - { "intu-ec-client", { NULL }, 8021, "udp" }, - { "oa-system", { NULL }, 8022, "tcp" }, - { "oa-system", { NULL }, 8022, "udp" }, - { "ca-audit-da", { NULL }, 8025, "tcp" }, - { "ca-audit-da", { NULL }, 8025, "udp" }, - { "ca-audit-ds", { NULL }, 8026, "tcp" }, - { "ca-audit-ds", { NULL }, 8026, "udp" }, - { "pro-ed", { NULL }, 8032, "tcp" }, - { "pro-ed", { NULL }, 8032, "udp" }, - { "mindprint", { NULL }, 8033, "tcp" }, - { "mindprint", { NULL }, 8033, "udp" }, - { "vantronix-mgmt", { NULL }, 8034, "tcp" }, - { "vantronix-mgmt", { NULL }, 8034, "udp" }, - { "ampify", { NULL }, 8040, "tcp" }, - { "ampify", { NULL }, 8040, "udp" }, - { "fs-agent", { NULL }, 8042, "tcp" }, - { "fs-server", { NULL }, 8043, "tcp" }, - { "fs-mgmt", { NULL }, 8044, "tcp" }, - { "senomix01", { NULL }, 8052, "tcp" }, - { "senomix01", { NULL }, 8052, "udp" }, - { "senomix02", { NULL }, 8053, "tcp" }, - { "senomix02", { NULL }, 8053, "udp" }, - { "senomix03", { NULL }, 8054, "tcp" }, - { "senomix03", { NULL }, 8054, "udp" }, - { "senomix04", { NULL }, 8055, "tcp" }, - { "senomix04", { NULL }, 8055, "udp" }, - { "senomix05", { NULL }, 8056, "tcp" }, - { "senomix05", { NULL }, 8056, "udp" }, - { "senomix06", { NULL }, 8057, "tcp" }, - { "senomix06", { NULL }, 8057, "udp" }, - { "senomix07", { NULL }, 8058, "tcp" }, - { "senomix07", { NULL }, 8058, "udp" }, - { "senomix08", { NULL }, 8059, "tcp" }, - { "senomix08", { NULL }, 8059, "udp" }, - { "gadugadu", { NULL }, 8074, "tcp" }, - { "gadugadu", { NULL }, 8074, "udp" }, - { "http-alt", { NULL }, 8080, "tcp" }, - { "http-alt", { NULL }, 8080, "udp" }, - { "sunproxyadmin", { NULL }, 8081, "tcp" }, - { "sunproxyadmin", { NULL }, 8081, "udp" }, - { "us-cli", { NULL }, 8082, "tcp" }, - { "us-cli", { NULL }, 8082, "udp" }, - { "us-srv", { NULL }, 8083, "tcp" }, - { "us-srv", { NULL }, 8083, "udp" }, - { "d-s-n", { NULL }, 8086, "tcp" }, - { "d-s-n", { NULL }, 8086, "udp" }, - { "simplifymedia", { NULL }, 8087, "tcp" }, - { "simplifymedia", { NULL }, 8087, "udp" }, - { "radan-http", { NULL }, 8088, "tcp" }, - { "radan-http", { NULL }, 8088, "udp" }, - { "jamlink", { NULL }, 8091, "tcp" }, - { "sac", { NULL }, 8097, "tcp" }, - { "sac", { NULL }, 8097, "udp" }, - { "xprint-server", { NULL }, 8100, "tcp" }, - { "xprint-server", { NULL }, 8100, "udp" }, - { "ldoms-migr", { NULL }, 8101, "tcp" }, - { "mtl8000-matrix", { NULL }, 8115, "tcp" }, - { "mtl8000-matrix", { NULL }, 8115, "udp" }, - { "cp-cluster", { NULL }, 8116, "tcp" }, - { "cp-cluster", { NULL }, 8116, "udp" }, - { "privoxy", { NULL }, 8118, "tcp" }, - { "privoxy", { NULL }, 8118, "udp" }, - { "apollo-data", { NULL }, 8121, "tcp" }, - { "apollo-data", { NULL }, 8121, "udp" }, - { "apollo-admin", { NULL }, 8122, "tcp" }, - { "apollo-admin", { NULL }, 8122, "udp" }, - { "paycash-online", { NULL }, 8128, "tcp" }, - { "paycash-online", { NULL }, 8128, "udp" }, - { "paycash-wbp", { NULL }, 8129, "tcp" }, - { "paycash-wbp", { NULL }, 8129, "udp" }, - { "indigo-vrmi", { NULL }, 8130, "tcp" }, - { "indigo-vrmi", { NULL }, 8130, "udp" }, - { "indigo-vbcp", { NULL }, 8131, "tcp" }, - { "indigo-vbcp", { NULL }, 8131, "udp" }, - { "dbabble", { NULL }, 8132, "tcp" }, - { "dbabble", { NULL }, 8132, "udp" }, - { "isdd", { NULL }, 8148, "tcp" }, - { "isdd", { NULL }, 8148, "udp" }, - { "patrol", { NULL }, 8160, "tcp" }, - { "patrol", { NULL }, 8160, "udp" }, - { "patrol-snmp", { NULL }, 8161, "tcp" }, - { "patrol-snmp", { NULL }, 8161, "udp" }, - { "vmware-fdm", { NULL }, 8182, "tcp" }, - { "vmware-fdm", { NULL }, 8182, "udp" }, - { "proremote", { NULL }, 8183, "tcp" }, - { "itach", { NULL }, 8184, "tcp" }, - { "itach", { NULL }, 8184, "udp" }, - { "spytechphone", { NULL }, 8192, "tcp" }, - { "spytechphone", { NULL }, 8192, "udp" }, - { "blp1", { NULL }, 8194, "tcp" }, - { "blp1", { NULL }, 8194, "udp" }, - { "blp2", { NULL }, 8195, "tcp" }, - { "blp2", { NULL }, 8195, "udp" }, - { "vvr-data", { NULL }, 8199, "tcp" }, - { "vvr-data", { NULL }, 8199, "udp" }, - { "trivnet1", { NULL }, 8200, "tcp" }, - { "trivnet1", { NULL }, 8200, "udp" }, - { "trivnet2", { NULL }, 8201, "tcp" }, - { "trivnet2", { NULL }, 8201, "udp" }, - { "lm-perfworks", { NULL }, 8204, "tcp" }, - { "lm-perfworks", { NULL }, 8204, "udp" }, - { "lm-instmgr", { NULL }, 8205, "tcp" }, - { "lm-instmgr", { NULL }, 8205, "udp" }, - { "lm-dta", { NULL }, 8206, "tcp" }, - { "lm-dta", { NULL }, 8206, "udp" }, - { "lm-sserver", { NULL }, 8207, "tcp" }, - { "lm-sserver", { NULL }, 8207, "udp" }, - { "lm-webwatcher", { NULL }, 8208, "tcp" }, - { "lm-webwatcher", { NULL }, 8208, "udp" }, - { "rexecj", { NULL }, 8230, "tcp" }, - { "rexecj", { NULL }, 8230, "udp" }, - { "synapse-nhttps", { NULL }, 8243, "tcp" }, - { "synapse-nhttps", { NULL }, 8243, "udp" }, - { "pando-sec", { NULL }, 8276, "tcp" }, - { "pando-sec", { NULL }, 8276, "udp" }, - { "synapse-nhttp", { NULL }, 8280, "tcp" }, - { "synapse-nhttp", { NULL }, 8280, "udp" }, - { "blp3", { NULL }, 8292, "tcp" }, - { "blp3", { NULL }, 8292, "udp" }, - { "hiperscan-id", { NULL }, 8293, "tcp" }, - { "blp4", { NULL }, 8294, "tcp" }, - { "blp4", { NULL }, 8294, "udp" }, - { "tmi", { NULL }, 8300, "tcp" }, - { "tmi", { NULL }, 8300, "udp" }, - { "amberon", { NULL }, 8301, "tcp" }, - { "amberon", { NULL }, 8301, "udp" }, - { "tnp-discover", { NULL }, 8320, "tcp" }, - { "tnp-discover", { NULL }, 8320, "udp" }, - { "tnp", { NULL }, 8321, "tcp" }, - { "tnp", { NULL }, 8321, "udp" }, - { "server-find", { NULL }, 8351, "tcp" }, - { "server-find", { NULL }, 8351, "udp" }, - { "cruise-enum", { NULL }, 8376, "tcp" }, - { "cruise-enum", { NULL }, 8376, "udp" }, - { "cruise-swroute", { NULL }, 8377, "tcp" }, - { "cruise-swroute", { NULL }, 8377, "udp" }, - { "cruise-config", { NULL }, 8378, "tcp" }, - { "cruise-config", { NULL }, 8378, "udp" }, - { "cruise-diags", { NULL }, 8379, "tcp" }, - { "cruise-diags", { NULL }, 8379, "udp" }, - { "cruise-update", { NULL }, 8380, "tcp" }, - { "cruise-update", { NULL }, 8380, "udp" }, - { "m2mservices", { NULL }, 8383, "tcp" }, - { "m2mservices", { NULL }, 8383, "udp" }, - { "cvd", { NULL }, 8400, "tcp" }, - { "cvd", { NULL }, 8400, "udp" }, - { "sabarsd", { NULL }, 8401, "tcp" }, - { "sabarsd", { NULL }, 8401, "udp" }, - { "abarsd", { NULL }, 8402, "tcp" }, - { "abarsd", { NULL }, 8402, "udp" }, - { "admind", { NULL }, 8403, "tcp" }, - { "admind", { NULL }, 8403, "udp" }, - { "svcloud", { NULL }, 8404, "tcp" }, - { "svbackup", { NULL }, 8405, "tcp" }, - { "espeech", { NULL }, 8416, "tcp" }, - { "espeech", { NULL }, 8416, "udp" }, - { "espeech-rtp", { NULL }, 8417, "tcp" }, - { "espeech-rtp", { NULL }, 8417, "udp" }, - { "cybro-a-bus", { NULL }, 8442, "tcp" }, - { "cybro-a-bus", { NULL }, 8442, "udp" }, - { "pcsync-https", { NULL }, 8443, "tcp" }, - { "pcsync-https", { NULL }, 8443, "udp" }, - { "pcsync-http", { NULL }, 8444, "tcp" }, - { "pcsync-http", { NULL }, 8444, "udp" }, - { "npmp", { NULL }, 8450, "tcp" }, - { "npmp", { NULL }, 8450, "udp" }, - { "cisco-avp", { NULL }, 8470, "tcp" }, - { "pim-port", { NULL }, 8471, "tcp" }, - { "pim-port", { NULL }, 8471, "sctp" }, - { "otv", { NULL }, 8472, "tcp" }, - { "otv", { NULL }, 8472, "udp" }, - { "vp2p", { NULL }, 8473, "tcp" }, - { "vp2p", { NULL }, 8473, "udp" }, - { "noteshare", { NULL }, 8474, "tcp" }, - { "noteshare", { NULL }, 8474, "udp" }, - { "fmtp", { NULL }, 8500, "tcp" }, - { "fmtp", { NULL }, 8500, "udp" }, - { "rtsp-alt", { NULL }, 8554, "tcp" }, - { "rtsp-alt", { NULL }, 8554, "udp" }, - { "d-fence", { NULL }, 8555, "tcp" }, - { "d-fence", { NULL }, 8555, "udp" }, - { "oap-admin", { NULL }, 8567, "tcp" }, - { "oap-admin", { NULL }, 8567, "udp" }, - { "asterix", { NULL }, 8600, "tcp" }, - { "asterix", { NULL }, 8600, "udp" }, - { "canon-mfnp", { NULL }, 8610, "tcp" }, - { "canon-mfnp", { NULL }, 8610, "udp" }, - { "canon-bjnp1", { NULL }, 8611, "tcp" }, - { "canon-bjnp1", { NULL }, 8611, "udp" }, - { "canon-bjnp2", { NULL }, 8612, "tcp" }, - { "canon-bjnp2", { NULL }, 8612, "udp" }, - { "canon-bjnp3", { NULL }, 8613, "tcp" }, - { "canon-bjnp3", { NULL }, 8613, "udp" }, - { "canon-bjnp4", { NULL }, 8614, "tcp" }, - { "canon-bjnp4", { NULL }, 8614, "udp" }, - { "sun-as-jmxrmi", { NULL }, 8686, "tcp" }, - { "sun-as-jmxrmi", { NULL }, 8686, "udp" }, - { "vnyx", { NULL }, 8699, "tcp" }, - { "vnyx", { NULL }, 8699, "udp" }, - { "dtp-net", { NULL }, 8732, "udp" }, - { "ibus", { NULL }, 8733, "tcp" }, - { "ibus", { NULL }, 8733, "udp" }, - { "mc-appserver", { NULL }, 8763, "tcp" }, - { "mc-appserver", { NULL }, 8763, "udp" }, - { "openqueue", { NULL }, 8764, "tcp" }, - { "openqueue", { NULL }, 8764, "udp" }, - { "ultraseek-http", { NULL }, 8765, "tcp" }, - { "ultraseek-http", { NULL }, 8765, "udp" }, - { "dpap", { NULL }, 8770, "tcp" }, - { "dpap", { NULL }, 8770, "udp" }, - { "msgclnt", { NULL }, 8786, "tcp" }, - { "msgclnt", { NULL }, 8786, "udp" }, - { "msgsrvr", { NULL }, 8787, "tcp" }, - { "msgsrvr", { NULL }, 8787, "udp" }, - { "sunwebadmin", { NULL }, 8800, "tcp" }, - { "sunwebadmin", { NULL }, 8800, "udp" }, - { "truecm", { NULL }, 8804, "tcp" }, - { "truecm", { NULL }, 8804, "udp" }, - { "dxspider", { NULL }, 8873, "tcp" }, - { "dxspider", { NULL }, 8873, "udp" }, - { "cddbp-alt", { NULL }, 8880, "tcp" }, - { "cddbp-alt", { NULL }, 8880, "udp" }, - { "secure-mqtt", { NULL }, 8883, "tcp" }, - { "secure-mqtt", { NULL }, 8883, "udp" }, - { "ddi-tcp-1", { NULL }, 8888, "tcp" }, - { "ddi-udp-1", { NULL }, 8888, "udp" }, - { "ddi-tcp-2", { NULL }, 8889, "tcp" }, - { "ddi-udp-2", { NULL }, 8889, "udp" }, - { "ddi-tcp-3", { NULL }, 8890, "tcp" }, - { "ddi-udp-3", { NULL }, 8890, "udp" }, - { "ddi-tcp-4", { NULL }, 8891, "tcp" }, - { "ddi-udp-4", { NULL }, 8891, "udp" }, - { "ddi-tcp-5", { NULL }, 8892, "tcp" }, - { "ddi-udp-5", { NULL }, 8892, "udp" }, - { "ddi-tcp-6", { NULL }, 8893, "tcp" }, - { "ddi-udp-6", { NULL }, 8893, "udp" }, - { "ddi-tcp-7", { NULL }, 8894, "tcp" }, - { "ddi-udp-7", { NULL }, 8894, "udp" }, - { "ospf-lite", { NULL }, 8899, "tcp" }, - { "ospf-lite", { NULL }, 8899, "udp" }, - { "jmb-cds1", { NULL }, 8900, "tcp" }, - { "jmb-cds1", { NULL }, 8900, "udp" }, - { "jmb-cds2", { NULL }, 8901, "tcp" }, - { "jmb-cds2", { NULL }, 8901, "udp" }, - { "manyone-http", { NULL }, 8910, "tcp" }, - { "manyone-http", { NULL }, 8910, "udp" }, - { "manyone-xml", { NULL }, 8911, "tcp" }, - { "manyone-xml", { NULL }, 8911, "udp" }, - { "wcbackup", { NULL }, 8912, "tcp" }, - { "wcbackup", { NULL }, 8912, "udp" }, - { "dragonfly", { NULL }, 8913, "tcp" }, - { "dragonfly", { NULL }, 8913, "udp" }, - { "twds", { NULL }, 8937, "tcp" }, - { "cumulus-admin", { NULL }, 8954, "tcp" }, - { "cumulus-admin", { NULL }, 8954, "udp" }, - { "sunwebadmins", { NULL }, 8989, "tcp" }, - { "sunwebadmins", { NULL }, 8989, "udp" }, - { "http-wmap", { NULL }, 8990, "tcp" }, - { "http-wmap", { NULL }, 8990, "udp" }, - { "https-wmap", { NULL }, 8991, "tcp" }, - { "https-wmap", { NULL }, 8991, "udp" }, - { "bctp", { NULL }, 8999, "tcp" }, - { "bctp", { NULL }, 8999, "udp" }, - { "cslistener", { NULL }, 9000, "tcp" }, - { "cslistener", { NULL }, 9000, "udp" }, - { "etlservicemgr", { NULL }, 9001, "tcp" }, - { "etlservicemgr", { NULL }, 9001, "udp" }, - { "dynamid", { NULL }, 9002, "tcp" }, - { "dynamid", { NULL }, 9002, "udp" }, - { "ogs-client", { NULL }, 9007, "udp" }, - { "ogs-server", { NULL }, 9008, "tcp" }, - { "pichat", { NULL }, 9009, "tcp" }, - { "pichat", { NULL }, 9009, "udp" }, - { "sdr", { NULL }, 9010, "tcp" }, - { "tambora", { NULL }, 9020, "tcp" }, - { "tambora", { NULL }, 9020, "udp" }, - { "panagolin-ident", { NULL }, 9021, "tcp" }, - { "panagolin-ident", { NULL }, 9021, "udp" }, - { "paragent", { NULL }, 9022, "tcp" }, - { "paragent", { NULL }, 9022, "udp" }, - { "swa-1", { NULL }, 9023, "tcp" }, - { "swa-1", { NULL }, 9023, "udp" }, - { "swa-2", { NULL }, 9024, "tcp" }, - { "swa-2", { NULL }, 9024, "udp" }, - { "swa-3", { NULL }, 9025, "tcp" }, - { "swa-3", { NULL }, 9025, "udp" }, - { "swa-4", { NULL }, 9026, "tcp" }, - { "swa-4", { NULL }, 9026, "udp" }, - { "versiera", { NULL }, 9050, "tcp" }, - { "fio-cmgmt", { NULL }, 9051, "tcp" }, - { "glrpc", { NULL }, 9080, "tcp" }, - { "glrpc", { NULL }, 9080, "udp" }, - { "lcs-ap", { NULL }, 9082, "sctp" }, - { "emc-pp-mgmtsvc", { NULL }, 9083, "tcp" }, - { "aurora", { NULL }, 9084, "tcp" }, - { "aurora", { NULL }, 9084, "udp" }, - { "aurora", { NULL }, 9084, "sctp" }, - { "ibm-rsyscon", { NULL }, 9085, "tcp" }, - { "ibm-rsyscon", { NULL }, 9085, "udp" }, - { "net2display", { NULL }, 9086, "tcp" }, - { "net2display", { NULL }, 9086, "udp" }, - { "classic", { NULL }, 9087, "tcp" }, - { "classic", { NULL }, 9087, "udp" }, - { "sqlexec", { NULL }, 9088, "tcp" }, - { "sqlexec", { NULL }, 9088, "udp" }, - { "sqlexec-ssl", { NULL }, 9089, "tcp" }, - { "sqlexec-ssl", { NULL }, 9089, "udp" }, - { "websm", { NULL }, 9090, "tcp" }, - { "websm", { NULL }, 9090, "udp" }, - { "xmltec-xmlmail", { NULL }, 9091, "tcp" }, - { "xmltec-xmlmail", { NULL }, 9091, "udp" }, - { "XmlIpcRegSvc", { NULL }, 9092, "tcp" }, - { "XmlIpcRegSvc", { NULL }, 9092, "udp" }, - { "hp-pdl-datastr", { NULL }, 9100, "tcp" }, - { "hp-pdl-datastr", { NULL }, 9100, "udp" }, - { "pdl-datastream", { NULL }, 9100, "tcp" }, - { "pdl-datastream", { NULL }, 9100, "udp" }, - { "bacula-dir", { NULL }, 9101, "tcp" }, - { "bacula-dir", { NULL }, 9101, "udp" }, - { "bacula-fd", { NULL }, 9102, "tcp" }, - { "bacula-fd", { NULL }, 9102, "udp" }, - { "bacula-sd", { NULL }, 9103, "tcp" }, - { "bacula-sd", { NULL }, 9103, "udp" }, - { "peerwire", { NULL }, 9104, "tcp" }, - { "peerwire", { NULL }, 9104, "udp" }, - { "xadmin", { NULL }, 9105, "tcp" }, - { "xadmin", { NULL }, 9105, "udp" }, - { "astergate", { NULL }, 9106, "tcp" }, - { "astergate-disc", { NULL }, 9106, "udp" }, - { "astergatefax", { NULL }, 9107, "tcp" }, - { "mxit", { NULL }, 9119, "tcp" }, - { "mxit", { NULL }, 9119, "udp" }, - { "dddp", { NULL }, 9131, "tcp" }, - { "dddp", { NULL }, 9131, "udp" }, - { "apani1", { NULL }, 9160, "tcp" }, - { "apani1", { NULL }, 9160, "udp" }, - { "apani2", { NULL }, 9161, "tcp" }, - { "apani2", { NULL }, 9161, "udp" }, - { "apani3", { NULL }, 9162, "tcp" }, - { "apani3", { NULL }, 9162, "udp" }, - { "apani4", { NULL }, 9163, "tcp" }, - { "apani4", { NULL }, 9163, "udp" }, - { "apani5", { NULL }, 9164, "tcp" }, - { "apani5", { NULL }, 9164, "udp" }, - { "sun-as-jpda", { NULL }, 9191, "tcp" }, - { "sun-as-jpda", { NULL }, 9191, "udp" }, - { "wap-wsp", { NULL }, 9200, "tcp" }, - { "wap-wsp", { NULL }, 9200, "udp" }, - { "wap-wsp-wtp", { NULL }, 9201, "tcp" }, - { "wap-wsp-wtp", { NULL }, 9201, "udp" }, - { "wap-wsp-s", { NULL }, 9202, "tcp" }, - { "wap-wsp-s", { NULL }, 9202, "udp" }, - { "wap-wsp-wtp-s", { NULL }, 9203, "tcp" }, - { "wap-wsp-wtp-s", { NULL }, 9203, "udp" }, - { "wap-vcard", { NULL }, 9204, "tcp" }, - { "wap-vcard", { NULL }, 9204, "udp" }, - { "wap-vcal", { NULL }, 9205, "tcp" }, - { "wap-vcal", { NULL }, 9205, "udp" }, - { "wap-vcard-s", { NULL }, 9206, "tcp" }, - { "wap-vcard-s", { NULL }, 9206, "udp" }, - { "wap-vcal-s", { NULL }, 9207, "tcp" }, - { "wap-vcal-s", { NULL }, 9207, "udp" }, - { "rjcdb-vcards", { NULL }, 9208, "tcp" }, - { "rjcdb-vcards", { NULL }, 9208, "udp" }, - { "almobile-system", { NULL }, 9209, "tcp" }, - { "almobile-system", { NULL }, 9209, "udp" }, - { "oma-mlp", { NULL }, 9210, "tcp" }, - { "oma-mlp", { NULL }, 9210, "udp" }, - { "oma-mlp-s", { NULL }, 9211, "tcp" }, - { "oma-mlp-s", { NULL }, 9211, "udp" }, - { "serverviewdbms", { NULL }, 9212, "tcp" }, - { "serverviewdbms", { NULL }, 9212, "udp" }, - { "serverstart", { NULL }, 9213, "tcp" }, - { "serverstart", { NULL }, 9213, "udp" }, - { "ipdcesgbs", { NULL }, 9214, "tcp" }, - { "ipdcesgbs", { NULL }, 9214, "udp" }, - { "insis", { NULL }, 9215, "tcp" }, - { "insis", { NULL }, 9215, "udp" }, - { "acme", { NULL }, 9216, "tcp" }, - { "acme", { NULL }, 9216, "udp" }, - { "fsc-port", { NULL }, 9217, "tcp" }, - { "fsc-port", { NULL }, 9217, "udp" }, - { "teamcoherence", { NULL }, 9222, "tcp" }, - { "teamcoherence", { NULL }, 9222, "udp" }, - { "mon", { NULL }, 9255, "tcp" }, - { "mon", { NULL }, 9255, "udp" }, - { "pegasus", { NULL }, 9278, "tcp" }, - { "pegasus", { NULL }, 9278, "udp" }, - { "pegasus-ctl", { NULL }, 9279, "tcp" }, - { "pegasus-ctl", { NULL }, 9279, "udp" }, - { "pgps", { NULL }, 9280, "tcp" }, - { "pgps", { NULL }, 9280, "udp" }, - { "swtp-port1", { NULL }, 9281, "tcp" }, - { "swtp-port1", { NULL }, 9281, "udp" }, - { "swtp-port2", { NULL }, 9282, "tcp" }, - { "swtp-port2", { NULL }, 9282, "udp" }, - { "callwaveiam", { NULL }, 9283, "tcp" }, - { "callwaveiam", { NULL }, 9283, "udp" }, - { "visd", { NULL }, 9284, "tcp" }, - { "visd", { NULL }, 9284, "udp" }, - { "n2h2server", { NULL }, 9285, "tcp" }, - { "n2h2server", { NULL }, 9285, "udp" }, - { "n2receive", { NULL }, 9286, "udp" }, - { "cumulus", { NULL }, 9287, "tcp" }, - { "cumulus", { NULL }, 9287, "udp" }, - { "armtechdaemon", { NULL }, 9292, "tcp" }, - { "armtechdaemon", { NULL }, 9292, "udp" }, - { "storview", { NULL }, 9293, "tcp" }, - { "storview", { NULL }, 9293, "udp" }, - { "armcenterhttp", { NULL }, 9294, "tcp" }, - { "armcenterhttp", { NULL }, 9294, "udp" }, - { "armcenterhttps", { NULL }, 9295, "tcp" }, - { "armcenterhttps", { NULL }, 9295, "udp" }, - { "vrace", { NULL }, 9300, "tcp" }, - { "vrace", { NULL }, 9300, "udp" }, - { "sphinxql", { NULL }, 9306, "tcp" }, - { "sphinxapi", { NULL }, 9312, "tcp" }, - { "secure-ts", { NULL }, 9318, "tcp" }, - { "secure-ts", { NULL }, 9318, "udp" }, - { "guibase", { NULL }, 9321, "tcp" }, - { "guibase", { NULL }, 9321, "udp" }, - { "mpidcmgr", { NULL }, 9343, "tcp" }, - { "mpidcmgr", { NULL }, 9343, "udp" }, - { "mphlpdmc", { NULL }, 9344, "tcp" }, - { "mphlpdmc", { NULL }, 9344, "udp" }, - { "ctechlicensing", { NULL }, 9346, "tcp" }, - { "ctechlicensing", { NULL }, 9346, "udp" }, - { "fjdmimgr", { NULL }, 9374, "tcp" }, - { "fjdmimgr", { NULL }, 9374, "udp" }, - { "boxp", { NULL }, 9380, "tcp" }, - { "boxp", { NULL }, 9380, "udp" }, - { "d2dconfig", { NULL }, 9387, "tcp" }, - { "d2ddatatrans", { NULL }, 9388, "tcp" }, - { "adws", { NULL }, 9389, "tcp" }, - { "otp", { NULL }, 9390, "tcp" }, - { "fjinvmgr", { NULL }, 9396, "tcp" }, - { "fjinvmgr", { NULL }, 9396, "udp" }, - { "mpidcagt", { NULL }, 9397, "tcp" }, - { "mpidcagt", { NULL }, 9397, "udp" }, - { "sec-t4net-srv", { NULL }, 9400, "tcp" }, - { "sec-t4net-srv", { NULL }, 9400, "udp" }, - { "sec-t4net-clt", { NULL }, 9401, "tcp" }, - { "sec-t4net-clt", { NULL }, 9401, "udp" }, - { "sec-pc2fax-srv", { NULL }, 9402, "tcp" }, - { "sec-pc2fax-srv", { NULL }, 9402, "udp" }, - { "git", { NULL }, 9418, "tcp" }, - { "git", { NULL }, 9418, "udp" }, - { "tungsten-https", { NULL }, 9443, "tcp" }, - { "tungsten-https", { NULL }, 9443, "udp" }, - { "wso2esb-console", { NULL }, 9444, "tcp" }, - { "wso2esb-console", { NULL }, 9444, "udp" }, - { "sntlkeyssrvr", { NULL }, 9450, "tcp" }, - { "sntlkeyssrvr", { NULL }, 9450, "udp" }, - { "ismserver", { NULL }, 9500, "tcp" }, - { "ismserver", { NULL }, 9500, "udp" }, - { "sma-spw", { NULL }, 9522, "udp" }, - { "mngsuite", { NULL }, 9535, "tcp" }, - { "mngsuite", { NULL }, 9535, "udp" }, - { "laes-bf", { NULL }, 9536, "tcp" }, - { "laes-bf", { NULL }, 9536, "udp" }, - { "trispen-sra", { NULL }, 9555, "tcp" }, - { "trispen-sra", { NULL }, 9555, "udp" }, - { "ldgateway", { NULL }, 9592, "tcp" }, - { "ldgateway", { NULL }, 9592, "udp" }, - { "cba8", { NULL }, 9593, "tcp" }, - { "cba8", { NULL }, 9593, "udp" }, - { "msgsys", { NULL }, 9594, "tcp" }, - { "msgsys", { NULL }, 9594, "udp" }, - { "pds", { NULL }, 9595, "tcp" }, - { "pds", { NULL }, 9595, "udp" }, - { "mercury-disc", { NULL }, 9596, "tcp" }, - { "mercury-disc", { NULL }, 9596, "udp" }, - { "pd-admin", { NULL }, 9597, "tcp" }, - { "pd-admin", { NULL }, 9597, "udp" }, - { "vscp", { NULL }, 9598, "tcp" }, - { "vscp", { NULL }, 9598, "udp" }, - { "robix", { NULL }, 9599, "tcp" }, - { "robix", { NULL }, 9599, "udp" }, - { "micromuse-ncpw", { NULL }, 9600, "tcp" }, - { "micromuse-ncpw", { NULL }, 9600, "udp" }, - { "streamcomm-ds", { NULL }, 9612, "tcp" }, - { "streamcomm-ds", { NULL }, 9612, "udp" }, - { "iadt-tls", { NULL }, 9614, "tcp" }, - { "erunbook_agent", { NULL }, 9616, "tcp" }, - { "erunbook_server", { NULL }, 9617, "tcp" }, - { "condor", { NULL }, 9618, "tcp" }, - { "condor", { NULL }, 9618, "udp" }, - { "odbcpathway", { NULL }, 9628, "tcp" }, - { "odbcpathway", { NULL }, 9628, "udp" }, - { "uniport", { NULL }, 9629, "tcp" }, - { "uniport", { NULL }, 9629, "udp" }, - { "peoctlr", { NULL }, 9630, "tcp" }, - { "peocoll", { NULL }, 9631, "tcp" }, - { "mc-comm", { NULL }, 9632, "udp" }, - { "pqsflows", { NULL }, 9640, "tcp" }, - { "xmms2", { NULL }, 9667, "tcp" }, - { "xmms2", { NULL }, 9667, "udp" }, - { "tec5-sdctp", { NULL }, 9668, "tcp" }, - { "tec5-sdctp", { NULL }, 9668, "udp" }, - { "client-wakeup", { NULL }, 9694, "tcp" }, - { "client-wakeup", { NULL }, 9694, "udp" }, - { "ccnx", { NULL }, 9695, "tcp" }, - { "ccnx", { NULL }, 9695, "udp" }, - { "board-roar", { NULL }, 9700, "tcp" }, - { "board-roar", { NULL }, 9700, "udp" }, - { "l5nas-parchan", { NULL }, 9747, "tcp" }, - { "l5nas-parchan", { NULL }, 9747, "udp" }, - { "board-voip", { NULL }, 9750, "tcp" }, - { "board-voip", { NULL }, 9750, "udp" }, - { "rasadv", { NULL }, 9753, "tcp" }, - { "rasadv", { NULL }, 9753, "udp" }, - { "tungsten-http", { NULL }, 9762, "tcp" }, - { "tungsten-http", { NULL }, 9762, "udp" }, - { "davsrc", { NULL }, 9800, "tcp" }, - { "davsrc", { NULL }, 9800, "udp" }, - { "sstp-2", { NULL }, 9801, "tcp" }, - { "sstp-2", { NULL }, 9801, "udp" }, - { "davsrcs", { NULL }, 9802, "tcp" }, - { "davsrcs", { NULL }, 9802, "udp" }, - { "sapv1", { NULL }, 9875, "tcp" }, - { "sapv1", { NULL }, 9875, "udp" }, - { "sd", { NULL }, 9876, "tcp" }, - { "sd", { NULL }, 9876, "udp" }, - { "cyborg-systems", { NULL }, 9888, "tcp" }, - { "cyborg-systems", { NULL }, 9888, "udp" }, - { "gt-proxy", { NULL }, 9889, "tcp" }, - { "gt-proxy", { NULL }, 9889, "udp" }, - { "monkeycom", { NULL }, 9898, "tcp" }, - { "monkeycom", { NULL }, 9898, "udp" }, - { "sctp-tunneling", { NULL }, 9899, "tcp" }, - { "sctp-tunneling", { NULL }, 9899, "udp" }, - { "iua", { NULL }, 9900, "tcp" }, - { "iua", { NULL }, 9900, "udp" }, - { "iua", { NULL }, 9900, "sctp" }, - { "enrp", { NULL }, 9901, "udp" }, - { "enrp-sctp", { NULL }, 9901, "sctp" }, - { "enrp-sctp-tls", { NULL }, 9902, "sctp" }, - { "domaintime", { NULL }, 9909, "tcp" }, - { "domaintime", { NULL }, 9909, "udp" }, - { "sype-transport", { NULL }, 9911, "tcp" }, - { "sype-transport", { NULL }, 9911, "udp" }, - { "apc-9950", { NULL }, 9950, "tcp" }, - { "apc-9950", { NULL }, 9950, "udp" }, - { "apc-9951", { NULL }, 9951, "tcp" }, - { "apc-9951", { NULL }, 9951, "udp" }, - { "apc-9952", { NULL }, 9952, "tcp" }, - { "apc-9952", { NULL }, 9952, "udp" }, - { "acis", { NULL }, 9953, "tcp" }, - { "acis", { NULL }, 9953, "udp" }, - { "odnsp", { NULL }, 9966, "tcp" }, - { "odnsp", { NULL }, 9966, "udp" }, - { "dsm-scm-target", { NULL }, 9987, "tcp" }, - { "dsm-scm-target", { NULL }, 9987, "udp" }, - { "nsesrvr", { NULL }, 9988, "tcp" }, - { "osm-appsrvr", { NULL }, 9990, "tcp" }, - { "osm-appsrvr", { NULL }, 9990, "udp" }, - { "osm-oev", { NULL }, 9991, "tcp" }, - { "osm-oev", { NULL }, 9991, "udp" }, - { "palace-1", { NULL }, 9992, "tcp" }, - { "palace-1", { NULL }, 9992, "udp" }, - { "palace-2", { NULL }, 9993, "tcp" }, - { "palace-2", { NULL }, 9993, "udp" }, - { "palace-3", { NULL }, 9994, "tcp" }, - { "palace-3", { NULL }, 9994, "udp" }, - { "palace-4", { NULL }, 9995, "tcp" }, - { "palace-4", { NULL }, 9995, "udp" }, - { "palace-5", { NULL }, 9996, "tcp" }, - { "palace-5", { NULL }, 9996, "udp" }, - { "palace-6", { NULL }, 9997, "tcp" }, - { "palace-6", { NULL }, 9997, "udp" }, - { "distinct32", { NULL }, 9998, "tcp" }, - { "distinct32", { NULL }, 9998, "udp" }, - { "distinct", { NULL }, 9999, "tcp" }, - { "distinct", { NULL }, 9999, "udp" }, - { "ndmp", { NULL }, 10000, "tcp" }, - { "ndmp", { NULL }, 10000, "udp" }, - { "scp-config", { NULL }, 10001, "tcp" }, - { "scp-config", { NULL }, 10001, "udp" }, - { "documentum", { NULL }, 10002, "tcp" }, - { "documentum", { NULL }, 10002, "udp" }, - { "documentum_s", { NULL }, 10003, "tcp" }, - { "documentum_s", { NULL }, 10003, "udp" }, - { "emcrmirccd", { NULL }, 10004, "tcp" }, - { "emcrmird", { NULL }, 10005, "tcp" }, - { "mvs-capacity", { NULL }, 10007, "tcp" }, - { "mvs-capacity", { NULL }, 10007, "udp" }, - { "octopus", { NULL }, 10008, "tcp" }, - { "octopus", { NULL }, 10008, "udp" }, - { "swdtp-sv", { NULL }, 10009, "tcp" }, - { "swdtp-sv", { NULL }, 10009, "udp" }, - { "rxapi", { NULL }, 10010, "tcp" }, - { "zabbix-agent", { NULL }, 10050, "tcp" }, - { "zabbix-agent", { NULL }, 10050, "udp" }, - { "zabbix-trapper", { NULL }, 10051, "tcp" }, - { "zabbix-trapper", { NULL }, 10051, "udp" }, - { "qptlmd", { NULL }, 10055, "tcp" }, - { "amanda", { NULL }, 10080, "tcp" }, - { "amanda", { NULL }, 10080, "udp" }, - { "famdc", { NULL }, 10081, "tcp" }, - { "famdc", { NULL }, 10081, "udp" }, - { "itap-ddtp", { NULL }, 10100, "tcp" }, - { "itap-ddtp", { NULL }, 10100, "udp" }, - { "ezmeeting-2", { NULL }, 10101, "tcp" }, - { "ezmeeting-2", { NULL }, 10101, "udp" }, - { "ezproxy-2", { NULL }, 10102, "tcp" }, - { "ezproxy-2", { NULL }, 10102, "udp" }, - { "ezrelay", { NULL }, 10103, "tcp" }, - { "ezrelay", { NULL }, 10103, "udp" }, - { "swdtp", { NULL }, 10104, "tcp" }, - { "swdtp", { NULL }, 10104, "udp" }, - { "bctp-server", { NULL }, 10107, "tcp" }, - { "bctp-server", { NULL }, 10107, "udp" }, - { "nmea-0183", { NULL }, 10110, "tcp" }, - { "nmea-0183", { NULL }, 10110, "udp" }, - { "netiq-endpoint", { NULL }, 10113, "tcp" }, - { "netiq-endpoint", { NULL }, 10113, "udp" }, - { "netiq-qcheck", { NULL }, 10114, "tcp" }, - { "netiq-qcheck", { NULL }, 10114, "udp" }, - { "netiq-endpt", { NULL }, 10115, "tcp" }, - { "netiq-endpt", { NULL }, 10115, "udp" }, - { "netiq-voipa", { NULL }, 10116, "tcp" }, - { "netiq-voipa", { NULL }, 10116, "udp" }, - { "iqrm", { NULL }, 10117, "tcp" }, - { "iqrm", { NULL }, 10117, "udp" }, - { "bmc-perf-sd", { NULL }, 10128, "tcp" }, - { "bmc-perf-sd", { NULL }, 10128, "udp" }, - { "bmc-gms", { NULL }, 10129, "tcp" }, - { "qb-db-server", { NULL }, 10160, "tcp" }, - { "qb-db-server", { NULL }, 10160, "udp" }, - { "snmptls", { NULL }, 10161, "tcp" }, - { "snmpdtls", { NULL }, 10161, "udp" }, - { "snmptls-trap", { NULL }, 10162, "tcp" }, - { "snmpdtls-trap", { NULL }, 10162, "udp" }, - { "trisoap", { NULL }, 10200, "tcp" }, - { "trisoap", { NULL }, 10200, "udp" }, - { "rsms", { NULL }, 10201, "tcp" }, - { "rscs", { NULL }, 10201, "udp" }, - { "apollo-relay", { NULL }, 10252, "tcp" }, - { "apollo-relay", { NULL }, 10252, "udp" }, - { "axis-wimp-port", { NULL }, 10260, "tcp" }, - { "axis-wimp-port", { NULL }, 10260, "udp" }, - { "blocks", { NULL }, 10288, "tcp" }, - { "blocks", { NULL }, 10288, "udp" }, - { "cosir", { NULL }, 10321, "tcp" }, - { "hip-nat-t", { NULL }, 10500, "udp" }, - { "MOS-lower", { NULL }, 10540, "tcp" }, - { "MOS-lower", { NULL }, 10540, "udp" }, - { "MOS-upper", { NULL }, 10541, "tcp" }, - { "MOS-upper", { NULL }, 10541, "udp" }, - { "MOS-aux", { NULL }, 10542, "tcp" }, - { "MOS-aux", { NULL }, 10542, "udp" }, - { "MOS-soap", { NULL }, 10543, "tcp" }, - { "MOS-soap", { NULL }, 10543, "udp" }, - { "MOS-soap-opt", { NULL }, 10544, "tcp" }, - { "MOS-soap-opt", { NULL }, 10544, "udp" }, - { "gap", { NULL }, 10800, "tcp" }, - { "gap", { NULL }, 10800, "udp" }, - { "lpdg", { NULL }, 10805, "tcp" }, - { "lpdg", { NULL }, 10805, "udp" }, - { "nbd", { NULL }, 10809, "tcp" }, - { "nmc-disc", { NULL }, 10810, "udp" }, - { "helix", { NULL }, 10860, "tcp" }, - { "helix", { NULL }, 10860, "udp" }, - { "rmiaux", { NULL }, 10990, "tcp" }, - { "rmiaux", { NULL }, 10990, "udp" }, - { "irisa", { NULL }, 11000, "tcp" }, - { "irisa", { NULL }, 11000, "udp" }, - { "metasys", { NULL }, 11001, "tcp" }, - { "metasys", { NULL }, 11001, "udp" }, - { "netapp-icmgmt", { NULL }, 11104, "tcp" }, - { "netapp-icdata", { NULL }, 11105, "tcp" }, - { "sgi-lk", { NULL }, 11106, "tcp" }, - { "sgi-lk", { NULL }, 11106, "udp" }, - { "vce", { NULL }, 11111, "tcp" }, - { "vce", { NULL }, 11111, "udp" }, - { "dicom", { NULL }, 11112, "tcp" }, - { "dicom", { NULL }, 11112, "udp" }, - { "suncacao-snmp", { NULL }, 11161, "tcp" }, - { "suncacao-snmp", { NULL }, 11161, "udp" }, - { "suncacao-jmxmp", { NULL }, 11162, "tcp" }, - { "suncacao-jmxmp", { NULL }, 11162, "udp" }, - { "suncacao-rmi", { NULL }, 11163, "tcp" }, - { "suncacao-rmi", { NULL }, 11163, "udp" }, - { "suncacao-csa", { NULL }, 11164, "tcp" }, - { "suncacao-csa", { NULL }, 11164, "udp" }, - { "suncacao-websvc", { NULL }, 11165, "tcp" }, - { "suncacao-websvc", { NULL }, 11165, "udp" }, - { "snss", { NULL }, 11171, "udp" }, - { "oemcacao-jmxmp", { NULL }, 11172, "tcp" }, - { "oemcacao-rmi", { NULL }, 11174, "tcp" }, - { "oemcacao-websvc", { NULL }, 11175, "tcp" }, - { "smsqp", { NULL }, 11201, "tcp" }, - { "smsqp", { NULL }, 11201, "udp" }, - { "wifree", { NULL }, 11208, "tcp" }, - { "wifree", { NULL }, 11208, "udp" }, - { "memcache", { NULL }, 11211, "tcp" }, - { "memcache", { NULL }, 11211, "udp" }, - { "imip", { NULL }, 11319, "tcp" }, - { "imip", { NULL }, 11319, "udp" }, - { "imip-channels", { NULL }, 11320, "tcp" }, - { "imip-channels", { NULL }, 11320, "udp" }, - { "arena-server", { NULL }, 11321, "tcp" }, - { "arena-server", { NULL }, 11321, "udp" }, - { "atm-uhas", { NULL }, 11367, "tcp" }, - { "atm-uhas", { NULL }, 11367, "udp" }, - { "hkp", { NULL }, 11371, "tcp" }, - { "hkp", { NULL }, 11371, "udp" }, - { "asgcypresstcps", { NULL }, 11489, "tcp" }, - { "tempest-port", { NULL }, 11600, "tcp" }, - { "tempest-port", { NULL }, 11600, "udp" }, - { "h323callsigalt", { NULL }, 11720, "tcp" }, - { "h323callsigalt", { NULL }, 11720, "udp" }, - { "intrepid-ssl", { NULL }, 11751, "tcp" }, - { "intrepid-ssl", { NULL }, 11751, "udp" }, - { "xoraya", { NULL }, 11876, "tcp" }, - { "xoraya", { NULL }, 11876, "udp" }, - { "x2e-disc", { NULL }, 11877, "udp" }, - { "sysinfo-sp", { NULL }, 11967, "tcp" }, - { "sysinfo-sp", { NULL }, 11967, "udp" }, - { "wmereceiving", { NULL }, 11997, "sctp" }, - { "wmedistribution", { NULL }, 11998, "sctp" }, - { "wmereporting", { NULL }, 11999, "sctp" }, - { "entextxid", { NULL }, 12000, "tcp" }, - { "entextxid", { NULL }, 12000, "udp" }, - { "entextnetwk", { NULL }, 12001, "tcp" }, - { "entextnetwk", { NULL }, 12001, "udp" }, - { "entexthigh", { NULL }, 12002, "tcp" }, - { "entexthigh", { NULL }, 12002, "udp" }, - { "entextmed", { NULL }, 12003, "tcp" }, - { "entextmed", { NULL }, 12003, "udp" }, - { "entextlow", { NULL }, 12004, "tcp" }, - { "entextlow", { NULL }, 12004, "udp" }, - { "dbisamserver1", { NULL }, 12005, "tcp" }, - { "dbisamserver1", { NULL }, 12005, "udp" }, - { "dbisamserver2", { NULL }, 12006, "tcp" }, - { "dbisamserver2", { NULL }, 12006, "udp" }, - { "accuracer", { NULL }, 12007, "tcp" }, - { "accuracer", { NULL }, 12007, "udp" }, - { "accuracer-dbms", { NULL }, 12008, "tcp" }, - { "accuracer-dbms", { NULL }, 12008, "udp" }, - { "edbsrvr", { NULL }, 12010, "tcp" }, - { "vipera", { NULL }, 12012, "tcp" }, - { "vipera", { NULL }, 12012, "udp" }, - { "vipera-ssl", { NULL }, 12013, "tcp" }, - { "vipera-ssl", { NULL }, 12013, "udp" }, - { "rets-ssl", { NULL }, 12109, "tcp" }, - { "rets-ssl", { NULL }, 12109, "udp" }, - { "nupaper-ss", { NULL }, 12121, "tcp" }, - { "nupaper-ss", { NULL }, 12121, "udp" }, - { "cawas", { NULL }, 12168, "tcp" }, - { "cawas", { NULL }, 12168, "udp" }, - { "hivep", { NULL }, 12172, "tcp" }, - { "hivep", { NULL }, 12172, "udp" }, - { "linogridengine", { NULL }, 12300, "tcp" }, - { "linogridengine", { NULL }, 12300, "udp" }, - { "warehouse-sss", { NULL }, 12321, "tcp" }, - { "warehouse-sss", { NULL }, 12321, "udp" }, - { "warehouse", { NULL }, 12322, "tcp" }, - { "warehouse", { NULL }, 12322, "udp" }, - { "italk", { NULL }, 12345, "tcp" }, - { "italk", { NULL }, 12345, "udp" }, - { "tsaf", { NULL }, 12753, "tcp" }, - { "tsaf", { NULL }, 12753, "udp" }, - { "i-zipqd", { NULL }, 13160, "tcp" }, - { "i-zipqd", { NULL }, 13160, "udp" }, - { "bcslogc", { NULL }, 13216, "tcp" }, - { "bcslogc", { NULL }, 13216, "udp" }, - { "rs-pias", { NULL }, 13217, "tcp" }, - { "rs-pias", { NULL }, 13217, "udp" }, - { "emc-vcas-tcp", { NULL }, 13218, "tcp" }, - { "emc-vcas-udp", { NULL }, 13218, "udp" }, - { "powwow-client", { NULL }, 13223, "tcp" }, - { "powwow-client", { NULL }, 13223, "udp" }, - { "powwow-server", { NULL }, 13224, "tcp" }, - { "powwow-server", { NULL }, 13224, "udp" }, - { "doip-data", { NULL }, 13400, "tcp" }, - { "doip-disc", { NULL }, 13400, "udp" }, - { "bprd", { NULL }, 13720, "tcp" }, - { "bprd", { NULL }, 13720, "udp" }, - { "bpdbm", { NULL }, 13721, "tcp" }, - { "bpdbm", { NULL }, 13721, "udp" }, - { "bpjava-msvc", { NULL }, 13722, "tcp" }, - { "bpjava-msvc", { NULL }, 13722, "udp" }, - { "vnetd", { NULL }, 13724, "tcp" }, - { "vnetd", { NULL }, 13724, "udp" }, - { "bpcd", { NULL }, 13782, "tcp" }, - { "bpcd", { NULL }, 13782, "udp" }, - { "vopied", { NULL }, 13783, "tcp" }, - { "vopied", { NULL }, 13783, "udp" }, - { "nbdb", { NULL }, 13785, "tcp" }, - { "nbdb", { NULL }, 13785, "udp" }, - { "nomdb", { NULL }, 13786, "tcp" }, - { "nomdb", { NULL }, 13786, "udp" }, - { "dsmcc-config", { NULL }, 13818, "tcp" }, - { "dsmcc-config", { NULL }, 13818, "udp" }, - { "dsmcc-session", { NULL }, 13819, "tcp" }, - { "dsmcc-session", { NULL }, 13819, "udp" }, - { "dsmcc-passthru", { NULL }, 13820, "tcp" }, - { "dsmcc-passthru", { NULL }, 13820, "udp" }, - { "dsmcc-download", { NULL }, 13821, "tcp" }, - { "dsmcc-download", { NULL }, 13821, "udp" }, - { "dsmcc-ccp", { NULL }, 13822, "tcp" }, - { "dsmcc-ccp", { NULL }, 13822, "udp" }, - { "bmdss", { NULL }, 13823, "tcp" }, - { "dta-systems", { NULL }, 13929, "tcp" }, - { "dta-systems", { NULL }, 13929, "udp" }, - { "medevolve", { NULL }, 13930, "tcp" }, - { "scotty-ft", { NULL }, 14000, "tcp" }, - { "scotty-ft", { NULL }, 14000, "udp" }, - { "sua", { NULL }, 14001, "tcp" }, - { "sua", { NULL }, 14001, "udp" }, - { "sua", { NULL }, 14001, "sctp" }, - { "sage-best-com1", { NULL }, 14033, "tcp" }, - { "sage-best-com1", { NULL }, 14033, "udp" }, - { "sage-best-com2", { NULL }, 14034, "tcp" }, - { "sage-best-com2", { NULL }, 14034, "udp" }, - { "vcs-app", { NULL }, 14141, "tcp" }, - { "vcs-app", { NULL }, 14141, "udp" }, - { "icpp", { NULL }, 14142, "tcp" }, - { "icpp", { NULL }, 14142, "udp" }, - { "gcm-app", { NULL }, 14145, "tcp" }, - { "gcm-app", { NULL }, 14145, "udp" }, - { "vrts-tdd", { NULL }, 14149, "tcp" }, - { "vrts-tdd", { NULL }, 14149, "udp" }, - { "vcscmd", { NULL }, 14150, "tcp" }, - { "vad", { NULL }, 14154, "tcp" }, - { "vad", { NULL }, 14154, "udp" }, - { "cps", { NULL }, 14250, "tcp" }, - { "cps", { NULL }, 14250, "udp" }, - { "ca-web-update", { NULL }, 14414, "tcp" }, - { "ca-web-update", { NULL }, 14414, "udp" }, - { "hde-lcesrvr-1", { NULL }, 14936, "tcp" }, - { "hde-lcesrvr-1", { NULL }, 14936, "udp" }, - { "hde-lcesrvr-2", { NULL }, 14937, "tcp" }, - { "hde-lcesrvr-2", { NULL }, 14937, "udp" }, - { "hydap", { NULL }, 15000, "tcp" }, - { "hydap", { NULL }, 15000, "udp" }, - { "xpilot", { NULL }, 15345, "tcp" }, - { "xpilot", { NULL }, 15345, "udp" }, - { "3link", { NULL }, 15363, "tcp" }, - { "3link", { NULL }, 15363, "udp" }, - { "cisco-snat", { NULL }, 15555, "tcp" }, - { "cisco-snat", { NULL }, 15555, "udp" }, - { "bex-xr", { NULL }, 15660, "tcp" }, - { "bex-xr", { NULL }, 15660, "udp" }, - { "ptp", { NULL }, 15740, "tcp" }, - { "ptp", { NULL }, 15740, "udp" }, - { "2ping", { NULL }, 15998, "udp" }, - { "programmar", { NULL }, 15999, "tcp" }, - { "fmsas", { NULL }, 16000, "tcp" }, - { "fmsascon", { NULL }, 16001, "tcp" }, - { "gsms", { NULL }, 16002, "tcp" }, - { "alfin", { NULL }, 16003, "udp" }, - { "jwpc", { NULL }, 16020, "tcp" }, - { "jwpc-bin", { NULL }, 16021, "tcp" }, - { "sun-sea-port", { NULL }, 16161, "tcp" }, - { "sun-sea-port", { NULL }, 16161, "udp" }, - { "solaris-audit", { NULL }, 16162, "tcp" }, - { "etb4j", { NULL }, 16309, "tcp" }, - { "etb4j", { NULL }, 16309, "udp" }, - { "pduncs", { NULL }, 16310, "tcp" }, - { "pduncs", { NULL }, 16310, "udp" }, - { "pdefmns", { NULL }, 16311, "tcp" }, - { "pdefmns", { NULL }, 16311, "udp" }, - { "netserialext1", { NULL }, 16360, "tcp" }, - { "netserialext1", { NULL }, 16360, "udp" }, - { "netserialext2", { NULL }, 16361, "tcp" }, - { "netserialext2", { NULL }, 16361, "udp" }, - { "netserialext3", { NULL }, 16367, "tcp" }, - { "netserialext3", { NULL }, 16367, "udp" }, - { "netserialext4", { NULL }, 16368, "tcp" }, - { "netserialext4", { NULL }, 16368, "udp" }, - { "connected", { NULL }, 16384, "tcp" }, - { "connected", { NULL }, 16384, "udp" }, - { "xoms", { NULL }, 16619, "tcp" }, - { "newbay-snc-mc", { NULL }, 16900, "tcp" }, - { "newbay-snc-mc", { NULL }, 16900, "udp" }, - { "sgcip", { NULL }, 16950, "tcp" }, - { "sgcip", { NULL }, 16950, "udp" }, - { "intel-rci-mp", { NULL }, 16991, "tcp" }, - { "intel-rci-mp", { NULL }, 16991, "udp" }, - { "amt-soap-http", { NULL }, 16992, "tcp" }, - { "amt-soap-http", { NULL }, 16992, "udp" }, - { "amt-soap-https", { NULL }, 16993, "tcp" }, - { "amt-soap-https", { NULL }, 16993, "udp" }, - { "amt-redir-tcp", { NULL }, 16994, "tcp" }, - { "amt-redir-tcp", { NULL }, 16994, "udp" }, - { "amt-redir-tls", { NULL }, 16995, "tcp" }, - { "amt-redir-tls", { NULL }, 16995, "udp" }, - { "isode-dua", { NULL }, 17007, "tcp" }, - { "isode-dua", { NULL }, 17007, "udp" }, - { "soundsvirtual", { NULL }, 17185, "tcp" }, - { "soundsvirtual", { NULL }, 17185, "udp" }, - { "chipper", { NULL }, 17219, "tcp" }, - { "chipper", { NULL }, 17219, "udp" }, - { "integrius-stp", { NULL }, 17234, "tcp" }, - { "integrius-stp", { NULL }, 17234, "udp" }, - { "ssh-mgmt", { NULL }, 17235, "tcp" }, - { "ssh-mgmt", { NULL }, 17235, "udp" }, - { "db-lsp", { NULL }, 17500, "tcp" }, - { "db-lsp-disc", { NULL }, 17500, "udp" }, - { "ea", { NULL }, 17729, "tcp" }, - { "ea", { NULL }, 17729, "udp" }, - { "zep", { NULL }, 17754, "tcp" }, - { "zep", { NULL }, 17754, "udp" }, - { "zigbee-ip", { NULL }, 17755, "tcp" }, - { "zigbee-ip", { NULL }, 17755, "udp" }, - { "zigbee-ips", { NULL }, 17756, "tcp" }, - { "zigbee-ips", { NULL }, 17756, "udp" }, - { "sw-orion", { NULL }, 17777, "tcp" }, - { "biimenu", { NULL }, 18000, "tcp" }, - { "biimenu", { NULL }, 18000, "udp" }, - { "radpdf", { NULL }, 18104, "tcp" }, - { "racf", { NULL }, 18136, "tcp" }, - { "opsec-cvp", { NULL }, 18181, "tcp" }, - { "opsec-cvp", { NULL }, 18181, "udp" }, - { "opsec-ufp", { NULL }, 18182, "tcp" }, - { "opsec-ufp", { NULL }, 18182, "udp" }, - { "opsec-sam", { NULL }, 18183, "tcp" }, - { "opsec-sam", { NULL }, 18183, "udp" }, - { "opsec-lea", { NULL }, 18184, "tcp" }, - { "opsec-lea", { NULL }, 18184, "udp" }, - { "opsec-omi", { NULL }, 18185, "tcp" }, - { "opsec-omi", { NULL }, 18185, "udp" }, - { "ohsc", { NULL }, 18186, "tcp" }, - { "ohsc", { NULL }, 18186, "udp" }, - { "opsec-ela", { NULL }, 18187, "tcp" }, - { "opsec-ela", { NULL }, 18187, "udp" }, - { "checkpoint-rtm", { NULL }, 18241, "tcp" }, - { "checkpoint-rtm", { NULL }, 18241, "udp" }, - { "gv-pf", { NULL }, 18262, "tcp" }, - { "gv-pf", { NULL }, 18262, "udp" }, - { "ac-cluster", { NULL }, 18463, "tcp" }, - { "ac-cluster", { NULL }, 18463, "udp" }, - { "rds-ib", { NULL }, 18634, "tcp" }, - { "rds-ib", { NULL }, 18634, "udp" }, - { "rds-ip", { NULL }, 18635, "tcp" }, - { "rds-ip", { NULL }, 18635, "udp" }, - { "ique", { NULL }, 18769, "tcp" }, - { "ique", { NULL }, 18769, "udp" }, - { "infotos", { NULL }, 18881, "tcp" }, - { "infotos", { NULL }, 18881, "udp" }, - { "apc-necmp", { NULL }, 18888, "tcp" }, - { "apc-necmp", { NULL }, 18888, "udp" }, - { "igrid", { NULL }, 19000, "tcp" }, - { "igrid", { NULL }, 19000, "udp" }, - { "j-link", { NULL }, 19020, "tcp" }, - { "opsec-uaa", { NULL }, 19191, "tcp" }, - { "opsec-uaa", { NULL }, 19191, "udp" }, - { "ua-secureagent", { NULL }, 19194, "tcp" }, - { "ua-secureagent", { NULL }, 19194, "udp" }, - { "keysrvr", { NULL }, 19283, "tcp" }, - { "keysrvr", { NULL }, 19283, "udp" }, - { "keyshadow", { NULL }, 19315, "tcp" }, - { "keyshadow", { NULL }, 19315, "udp" }, - { "mtrgtrans", { NULL }, 19398, "tcp" }, - { "mtrgtrans", { NULL }, 19398, "udp" }, - { "hp-sco", { NULL }, 19410, "tcp" }, - { "hp-sco", { NULL }, 19410, "udp" }, - { "hp-sca", { NULL }, 19411, "tcp" }, - { "hp-sca", { NULL }, 19411, "udp" }, - { "hp-sessmon", { NULL }, 19412, "tcp" }, - { "hp-sessmon", { NULL }, 19412, "udp" }, - { "fxuptp", { NULL }, 19539, "tcp" }, - { "fxuptp", { NULL }, 19539, "udp" }, - { "sxuptp", { NULL }, 19540, "tcp" }, - { "sxuptp", { NULL }, 19540, "udp" }, - { "jcp", { NULL }, 19541, "tcp" }, - { "jcp", { NULL }, 19541, "udp" }, - { "iec-104-sec", { NULL }, 19998, "tcp" }, - { "dnp-sec", { NULL }, 19999, "tcp" }, - { "dnp-sec", { NULL }, 19999, "udp" }, - { "dnp", { NULL }, 20000, "tcp" }, - { "dnp", { NULL }, 20000, "udp" }, - { "microsan", { NULL }, 20001, "tcp" }, - { "microsan", { NULL }, 20001, "udp" }, - { "commtact-http", { NULL }, 20002, "tcp" }, - { "commtact-http", { NULL }, 20002, "udp" }, - { "commtact-https", { NULL }, 20003, "tcp" }, - { "commtact-https", { NULL }, 20003, "udp" }, - { "openwebnet", { NULL }, 20005, "tcp" }, - { "openwebnet", { NULL }, 20005, "udp" }, - { "ss-idi-disc", { NULL }, 20012, "udp" }, - { "ss-idi", { NULL }, 20013, "tcp" }, - { "opendeploy", { NULL }, 20014, "tcp" }, - { "opendeploy", { NULL }, 20014, "udp" }, - { "nburn_id", { NULL }, 20034, "tcp" }, - { "nburn_id", { NULL }, 20034, "udp" }, - { "tmophl7mts", { NULL }, 20046, "tcp" }, - { "tmophl7mts", { NULL }, 20046, "udp" }, - { "mountd", { NULL }, 20048, "tcp" }, - { "mountd", { NULL }, 20048, "udp" }, - { "nfsrdma", { NULL }, 20049, "tcp" }, - { "nfsrdma", { NULL }, 20049, "udp" }, - { "nfsrdma", { NULL }, 20049, "sctp" }, - { "tolfab", { NULL }, 20167, "tcp" }, - { "tolfab", { NULL }, 20167, "udp" }, - { "ipdtp-port", { NULL }, 20202, "tcp" }, - { "ipdtp-port", { NULL }, 20202, "udp" }, - { "ipulse-ics", { NULL }, 20222, "tcp" }, - { "ipulse-ics", { NULL }, 20222, "udp" }, - { "emwavemsg", { NULL }, 20480, "tcp" }, - { "emwavemsg", { NULL }, 20480, "udp" }, - { "track", { NULL }, 20670, "tcp" }, - { "track", { NULL }, 20670, "udp" }, - { "athand-mmp", { NULL }, 20999, "tcp" }, - { "athand-mmp", { NULL }, 20999, "udp" }, - { "irtrans", { NULL }, 21000, "tcp" }, - { "irtrans", { NULL }, 21000, "udp" }, - { "dfserver", { NULL }, 21554, "tcp" }, - { "dfserver", { NULL }, 21554, "udp" }, - { "vofr-gateway", { NULL }, 21590, "tcp" }, - { "vofr-gateway", { NULL }, 21590, "udp" }, - { "tvpm", { NULL }, 21800, "tcp" }, - { "tvpm", { NULL }, 21800, "udp" }, - { "webphone", { NULL }, 21845, "tcp" }, - { "webphone", { NULL }, 21845, "udp" }, - { "netspeak-is", { NULL }, 21846, "tcp" }, - { "netspeak-is", { NULL }, 21846, "udp" }, - { "netspeak-cs", { NULL }, 21847, "tcp" }, - { "netspeak-cs", { NULL }, 21847, "udp" }, - { "netspeak-acd", { NULL }, 21848, "tcp" }, - { "netspeak-acd", { NULL }, 21848, "udp" }, - { "netspeak-cps", { NULL }, 21849, "tcp" }, - { "netspeak-cps", { NULL }, 21849, "udp" }, - { "snapenetio", { NULL }, 22000, "tcp" }, - { "snapenetio", { NULL }, 22000, "udp" }, - { "optocontrol", { NULL }, 22001, "tcp" }, - { "optocontrol", { NULL }, 22001, "udp" }, - { "optohost002", { NULL }, 22002, "tcp" }, - { "optohost002", { NULL }, 22002, "udp" }, - { "optohost003", { NULL }, 22003, "tcp" }, - { "optohost003", { NULL }, 22003, "udp" }, - { "optohost004", { NULL }, 22004, "tcp" }, - { "optohost004", { NULL }, 22004, "udp" }, - { "optohost004", { NULL }, 22005, "tcp" }, - { "optohost004", { NULL }, 22005, "udp" }, - { "dcap", { NULL }, 22125, "tcp" }, - { "gsidcap", { NULL }, 22128, "tcp" }, - { "wnn6", { NULL }, 22273, "tcp" }, - { "wnn6", { NULL }, 22273, "udp" }, - { "cis", { NULL }, 22305, "tcp" }, - { "cis", { NULL }, 22305, "udp" }, - { "cis-secure", { NULL }, 22343, "tcp" }, - { "cis-secure", { NULL }, 22343, "udp" }, - { "WibuKey", { NULL }, 22347, "tcp" }, - { "WibuKey", { NULL }, 22347, "udp" }, - { "CodeMeter", { NULL }, 22350, "tcp" }, - { "CodeMeter", { NULL }, 22350, "udp" }, - { "vocaltec-wconf", { NULL }, 22555, "tcp" }, - { "vocaltec-phone", { NULL }, 22555, "udp" }, - { "talikaserver", { NULL }, 22763, "tcp" }, - { "talikaserver", { NULL }, 22763, "udp" }, - { "aws-brf", { NULL }, 22800, "tcp" }, - { "aws-brf", { NULL }, 22800, "udp" }, - { "brf-gw", { NULL }, 22951, "tcp" }, - { "brf-gw", { NULL }, 22951, "udp" }, - { "inovaport1", { NULL }, 23000, "tcp" }, - { "inovaport1", { NULL }, 23000, "udp" }, - { "inovaport2", { NULL }, 23001, "tcp" }, - { "inovaport2", { NULL }, 23001, "udp" }, - { "inovaport3", { NULL }, 23002, "tcp" }, - { "inovaport3", { NULL }, 23002, "udp" }, - { "inovaport4", { NULL }, 23003, "tcp" }, - { "inovaport4", { NULL }, 23003, "udp" }, - { "inovaport5", { NULL }, 23004, "tcp" }, - { "inovaport5", { NULL }, 23004, "udp" }, - { "inovaport6", { NULL }, 23005, "tcp" }, - { "inovaport6", { NULL }, 23005, "udp" }, - { "s102", { NULL }, 23272, "udp" }, - { "elxmgmt", { NULL }, 23333, "tcp" }, - { "elxmgmt", { NULL }, 23333, "udp" }, - { "novar-dbase", { NULL }, 23400, "tcp" }, - { "novar-dbase", { NULL }, 23400, "udp" }, - { "novar-alarm", { NULL }, 23401, "tcp" }, - { "novar-alarm", { NULL }, 23401, "udp" }, - { "novar-global", { NULL }, 23402, "tcp" }, - { "novar-global", { NULL }, 23402, "udp" }, - { "aequus", { NULL }, 23456, "tcp" }, - { "aequus-alt", { NULL }, 23457, "tcp" }, - { "med-ltp", { NULL }, 24000, "tcp" }, - { "med-ltp", { NULL }, 24000, "udp" }, - { "med-fsp-rx", { NULL }, 24001, "tcp" }, - { "med-fsp-rx", { NULL }, 24001, "udp" }, - { "med-fsp-tx", { NULL }, 24002, "tcp" }, - { "med-fsp-tx", { NULL }, 24002, "udp" }, - { "med-supp", { NULL }, 24003, "tcp" }, - { "med-supp", { NULL }, 24003, "udp" }, - { "med-ovw", { NULL }, 24004, "tcp" }, - { "med-ovw", { NULL }, 24004, "udp" }, - { "med-ci", { NULL }, 24005, "tcp" }, - { "med-ci", { NULL }, 24005, "udp" }, - { "med-net-svc", { NULL }, 24006, "tcp" }, - { "med-net-svc", { NULL }, 24006, "udp" }, - { "filesphere", { NULL }, 24242, "tcp" }, - { "filesphere", { NULL }, 24242, "udp" }, - { "vista-4gl", { NULL }, 24249, "tcp" }, - { "vista-4gl", { NULL }, 24249, "udp" }, - { "ild", { NULL }, 24321, "tcp" }, - { "ild", { NULL }, 24321, "udp" }, - { "intel_rci", { NULL }, 24386, "tcp" }, - { "intel_rci", { NULL }, 24386, "udp" }, - { "tonidods", { NULL }, 24465, "tcp" }, - { "tonidods", { NULL }, 24465, "udp" }, - { "binkp", { NULL }, 24554, "tcp" }, - { "binkp", { NULL }, 24554, "udp" }, - { "canditv", { NULL }, 24676, "tcp" }, - { "canditv", { NULL }, 24676, "udp" }, - { "flashfiler", { NULL }, 24677, "tcp" }, - { "flashfiler", { NULL }, 24677, "udp" }, - { "proactivate", { NULL }, 24678, "tcp" }, - { "proactivate", { NULL }, 24678, "udp" }, - { "tcc-http", { NULL }, 24680, "tcp" }, - { "tcc-http", { NULL }, 24680, "udp" }, - { "cslg", { NULL }, 24754, "tcp" }, - { "find", { NULL }, 24922, "tcp" }, - { "find", { NULL }, 24922, "udp" }, - { "icl-twobase1", { NULL }, 25000, "tcp" }, - { "icl-twobase1", { NULL }, 25000, "udp" }, - { "icl-twobase2", { NULL }, 25001, "tcp" }, - { "icl-twobase2", { NULL }, 25001, "udp" }, - { "icl-twobase3", { NULL }, 25002, "tcp" }, - { "icl-twobase3", { NULL }, 25002, "udp" }, - { "icl-twobase4", { NULL }, 25003, "tcp" }, - { "icl-twobase4", { NULL }, 25003, "udp" }, - { "icl-twobase5", { NULL }, 25004, "tcp" }, - { "icl-twobase5", { NULL }, 25004, "udp" }, - { "icl-twobase6", { NULL }, 25005, "tcp" }, - { "icl-twobase6", { NULL }, 25005, "udp" }, - { "icl-twobase7", { NULL }, 25006, "tcp" }, - { "icl-twobase7", { NULL }, 25006, "udp" }, - { "icl-twobase8", { NULL }, 25007, "tcp" }, - { "icl-twobase8", { NULL }, 25007, "udp" }, - { "icl-twobase9", { NULL }, 25008, "tcp" }, - { "icl-twobase9", { NULL }, 25008, "udp" }, - { "icl-twobase10", { NULL }, 25009, "tcp" }, - { "icl-twobase10", { NULL }, 25009, "udp" }, - { "rna", { NULL }, 25471, "sctp" }, - { "sauterdongle", { NULL }, 25576, "tcp" }, - { "vocaltec-hos", { NULL }, 25793, "tcp" }, - { "vocaltec-hos", { NULL }, 25793, "udp" }, - { "tasp-net", { NULL }, 25900, "tcp" }, - { "tasp-net", { NULL }, 25900, "udp" }, - { "niobserver", { NULL }, 25901, "tcp" }, - { "niobserver", { NULL }, 25901, "udp" }, - { "nilinkanalyst", { NULL }, 25902, "tcp" }, - { "nilinkanalyst", { NULL }, 25902, "udp" }, - { "niprobe", { NULL }, 25903, "tcp" }, - { "niprobe", { NULL }, 25903, "udp" }, - { "quake", { NULL }, 26000, "tcp" }, - { "quake", { NULL }, 26000, "udp" }, - { "scscp", { NULL }, 26133, "tcp" }, - { "scscp", { NULL }, 26133, "udp" }, - { "wnn6-ds", { NULL }, 26208, "tcp" }, - { "wnn6-ds", { NULL }, 26208, "udp" }, - { "ezproxy", { NULL }, 26260, "tcp" }, - { "ezproxy", { NULL }, 26260, "udp" }, - { "ezmeeting", { NULL }, 26261, "tcp" }, - { "ezmeeting", { NULL }, 26261, "udp" }, - { "k3software-svr", { NULL }, 26262, "tcp" }, - { "k3software-svr", { NULL }, 26262, "udp" }, - { "k3software-cli", { NULL }, 26263, "tcp" }, - { "k3software-cli", { NULL }, 26263, "udp" }, - { "exoline-tcp", { NULL }, 26486, "tcp" }, - { "exoline-udp", { NULL }, 26486, "udp" }, - { "exoconfig", { NULL }, 26487, "tcp" }, - { "exoconfig", { NULL }, 26487, "udp" }, - { "exonet", { NULL }, 26489, "tcp" }, - { "exonet", { NULL }, 26489, "udp" }, - { "imagepump", { NULL }, 27345, "tcp" }, - { "imagepump", { NULL }, 27345, "udp" }, - { "jesmsjc", { NULL }, 27442, "tcp" }, - { "jesmsjc", { NULL }, 27442, "udp" }, - { "kopek-httphead", { NULL }, 27504, "tcp" }, - { "kopek-httphead", { NULL }, 27504, "udp" }, - { "ars-vista", { NULL }, 27782, "tcp" }, - { "ars-vista", { NULL }, 27782, "udp" }, - { "tw-auth-key", { NULL }, 27999, "tcp" }, - { "tw-auth-key", { NULL }, 27999, "udp" }, - { "nxlmd", { NULL }, 28000, "tcp" }, - { "nxlmd", { NULL }, 28000, "udp" }, - { "pqsp", { NULL }, 28001, "tcp" }, - { "siemensgsm", { NULL }, 28240, "tcp" }, - { "siemensgsm", { NULL }, 28240, "udp" }, - { "sgsap", { NULL }, 29118, "sctp" }, - { "otmp", { NULL }, 29167, "tcp" }, - { "otmp", { NULL }, 29167, "udp" }, - { "sbcap", { NULL }, 29168, "sctp" }, - { "iuhsctpassoc", { NULL }, 29169, "sctp" }, - { "pago-services1", { NULL }, 30001, "tcp" }, - { "pago-services1", { NULL }, 30001, "udp" }, - { "pago-services2", { NULL }, 30002, "tcp" }, - { "pago-services2", { NULL }, 30002, "udp" }, - { "kingdomsonline", { NULL }, 30260, "tcp" }, - { "kingdomsonline", { NULL }, 30260, "udp" }, - { "ovobs", { NULL }, 30999, "tcp" }, - { "ovobs", { NULL }, 30999, "udp" }, - { "autotrac-acp", { NULL }, 31020, "tcp" }, - { "yawn", { NULL }, 31029, "udp" }, - { "xqosd", { NULL }, 31416, "tcp" }, - { "xqosd", { NULL }, 31416, "udp" }, - { "tetrinet", { NULL }, 31457, "tcp" }, - { "tetrinet", { NULL }, 31457, "udp" }, - { "lm-mon", { NULL }, 31620, "tcp" }, - { "lm-mon", { NULL }, 31620, "udp" }, - { "dsx_monitor", { NULL }, 31685, "tcp" }, - { "gamesmith-port", { NULL }, 31765, "tcp" }, - { "gamesmith-port", { NULL }, 31765, "udp" }, - { "iceedcp_tx", { NULL }, 31948, "tcp" }, - { "iceedcp_tx", { NULL }, 31948, "udp" }, - { "iceedcp_rx", { NULL }, 31949, "tcp" }, - { "iceedcp_rx", { NULL }, 31949, "udp" }, - { "iracinghelper", { NULL }, 32034, "tcp" }, - { "iracinghelper", { NULL }, 32034, "udp" }, - { "t1distproc60", { NULL }, 32249, "tcp" }, - { "t1distproc60", { NULL }, 32249, "udp" }, - { "apm-link", { NULL }, 32483, "tcp" }, - { "apm-link", { NULL }, 32483, "udp" }, - { "sec-ntb-clnt", { NULL }, 32635, "tcp" }, - { "sec-ntb-clnt", { NULL }, 32635, "udp" }, - { "DMExpress", { NULL }, 32636, "tcp" }, - { "DMExpress", { NULL }, 32636, "udp" }, - { "filenet-powsrm", { NULL }, 32767, "tcp" }, - { "filenet-powsrm", { NULL }, 32767, "udp" }, - { "filenet-tms", { NULL }, 32768, "tcp" }, - { "filenet-tms", { NULL }, 32768, "udp" }, - { "filenet-rpc", { NULL }, 32769, "tcp" }, - { "filenet-rpc", { NULL }, 32769, "udp" }, - { "filenet-nch", { NULL }, 32770, "tcp" }, - { "filenet-nch", { NULL }, 32770, "udp" }, - { "filenet-rmi", { NULL }, 32771, "tcp" }, - { "filenet-rmi", { NULL }, 32771, "udp" }, - { "filenet-pa", { NULL }, 32772, "tcp" }, - { "filenet-pa", { NULL }, 32772, "udp" }, - { "filenet-cm", { NULL }, 32773, "tcp" }, - { "filenet-cm", { NULL }, 32773, "udp" }, - { "filenet-re", { NULL }, 32774, "tcp" }, - { "filenet-re", { NULL }, 32774, "udp" }, - { "filenet-pch", { NULL }, 32775, "tcp" }, - { "filenet-pch", { NULL }, 32775, "udp" }, - { "filenet-peior", { NULL }, 32776, "tcp" }, - { "filenet-peior", { NULL }, 32776, "udp" }, - { "filenet-obrok", { NULL }, 32777, "tcp" }, - { "filenet-obrok", { NULL }, 32777, "udp" }, - { "mlsn", { NULL }, 32801, "tcp" }, - { "mlsn", { NULL }, 32801, "udp" }, - { "retp", { NULL }, 32811, "tcp" }, - { "idmgratm", { NULL }, 32896, "tcp" }, - { "idmgratm", { NULL }, 32896, "udp" }, - { "aurora-balaena", { NULL }, 33123, "tcp" }, - { "aurora-balaena", { NULL }, 33123, "udp" }, - { "diamondport", { NULL }, 33331, "tcp" }, - { "diamondport", { NULL }, 33331, "udp" }, - { "dgi-serv", { NULL }, 33333, "tcp" }, - { "traceroute", { NULL }, 33434, "tcp" }, - { "traceroute", { NULL }, 33434, "udp" }, - { "snip-slave", { NULL }, 33656, "tcp" }, - { "snip-slave", { NULL }, 33656, "udp" }, - { "turbonote-2", { NULL }, 34249, "tcp" }, - { "turbonote-2", { NULL }, 34249, "udp" }, - { "p-net-local", { NULL }, 34378, "tcp" }, - { "p-net-local", { NULL }, 34378, "udp" }, - { "p-net-remote", { NULL }, 34379, "tcp" }, - { "p-net-remote", { NULL }, 34379, "udp" }, - { "dhanalakshmi", { NULL }, 34567, "tcp" }, - { "profinet-rt", { NULL }, 34962, "tcp" }, - { "profinet-rt", { NULL }, 34962, "udp" }, - { "profinet-rtm", { NULL }, 34963, "tcp" }, - { "profinet-rtm", { NULL }, 34963, "udp" }, - { "profinet-cm", { NULL }, 34964, "tcp" }, - { "profinet-cm", { NULL }, 34964, "udp" }, - { "ethercat", { NULL }, 34980, "tcp" }, - { "ethercat", { NULL }, 34980, "udp" }, - { "allpeers", { NULL }, 36001, "tcp" }, - { "allpeers", { NULL }, 36001, "udp" }, - { "s1-control", { NULL }, 36412, "sctp" }, - { "x2-control", { NULL }, 36422, "sctp" }, - { "m2ap", { NULL }, 36443, "sctp" }, - { "m3ap", { NULL }, 36444, "sctp" }, - { "kastenxpipe", { NULL }, 36865, "tcp" }, - { "kastenxpipe", { NULL }, 36865, "udp" }, - { "neckar", { NULL }, 37475, "tcp" }, - { "neckar", { NULL }, 37475, "udp" }, - { "unisys-eportal", { NULL }, 37654, "tcp" }, - { "unisys-eportal", { NULL }, 37654, "udp" }, - { "galaxy7-data", { NULL }, 38201, "tcp" }, - { "galaxy7-data", { NULL }, 38201, "udp" }, - { "fairview", { NULL }, 38202, "tcp" }, - { "fairview", { NULL }, 38202, "udp" }, - { "agpolicy", { NULL }, 38203, "tcp" }, - { "agpolicy", { NULL }, 38203, "udp" }, - { "turbonote-1", { NULL }, 39681, "tcp" }, - { "turbonote-1", { NULL }, 39681, "udp" }, - { "safetynetp", { NULL }, 40000, "tcp" }, - { "safetynetp", { NULL }, 40000, "udp" }, - { "cscp", { NULL }, 40841, "tcp" }, - { "cscp", { NULL }, 40841, "udp" }, - { "csccredir", { NULL }, 40842, "tcp" }, - { "csccredir", { NULL }, 40842, "udp" }, - { "csccfirewall", { NULL }, 40843, "tcp" }, - { "csccfirewall", { NULL }, 40843, "udp" }, - { "ortec-disc", { NULL }, 40853, "udp" }, - { "fs-qos", { NULL }, 41111, "tcp" }, - { "fs-qos", { NULL }, 41111, "udp" }, - { "tentacle", { NULL }, 41121, "tcp" }, - { "crestron-cip", { NULL }, 41794, "tcp" }, - { "crestron-cip", { NULL }, 41794, "udp" }, - { "crestron-ctp", { NULL }, 41795, "tcp" }, - { "crestron-ctp", { NULL }, 41795, "udp" }, - { "candp", { NULL }, 42508, "tcp" }, - { "candp", { NULL }, 42508, "udp" }, - { "candrp", { NULL }, 42509, "tcp" }, - { "candrp", { NULL }, 42509, "udp" }, - { "caerpc", { NULL }, 42510, "tcp" }, - { "caerpc", { NULL }, 42510, "udp" }, - { "reachout", { NULL }, 43188, "tcp" }, - { "reachout", { NULL }, 43188, "udp" }, - { "ndm-agent-port", { NULL }, 43189, "tcp" }, - { "ndm-agent-port", { NULL }, 43189, "udp" }, - { "ip-provision", { NULL }, 43190, "tcp" }, - { "ip-provision", { NULL }, 43190, "udp" }, - { "noit-transport", { NULL }, 43191, "tcp" }, - { "ew-mgmt", { NULL }, 43440, "tcp" }, - { "ew-disc-cmd", { NULL }, 43440, "udp" }, - { "ciscocsdb", { NULL }, 43441, "tcp" }, - { "ciscocsdb", { NULL }, 43441, "udp" }, - { "pmcd", { NULL }, 44321, "tcp" }, - { "pmcd", { NULL }, 44321, "udp" }, - { "pmcdproxy", { NULL }, 44322, "tcp" }, - { "pmcdproxy", { NULL }, 44322, "udp" }, - { "pcp", { NULL }, 44323, "udp" }, - { "rbr-debug", { NULL }, 44553, "tcp" }, - { "rbr-debug", { NULL }, 44553, "udp" }, - { "EtherNet/IP-2", { NULL }, 44818, "tcp" }, - { "EtherNet/IP-2", { NULL }, 44818, "udp" }, - { "invision-ag", { NULL }, 45054, "tcp" }, - { "invision-ag", { NULL }, 45054, "udp" }, - { "eba", { NULL }, 45678, "tcp" }, - { "eba", { NULL }, 45678, "udp" }, - { "qdb2service", { NULL }, 45825, "tcp" }, - { "qdb2service", { NULL }, 45825, "udp" }, - { "ssr-servermgr", { NULL }, 45966, "tcp" }, - { "ssr-servermgr", { NULL }, 45966, "udp" }, - { "mediabox", { NULL }, 46999, "tcp" }, - { "mediabox", { NULL }, 46999, "udp" }, - { "mbus", { NULL }, 47000, "tcp" }, - { "mbus", { NULL }, 47000, "udp" }, - { "winrm", { NULL }, 47001, "tcp" }, - { "dbbrowse", { NULL }, 47557, "tcp" }, - { "dbbrowse", { NULL }, 47557, "udp" }, - { "directplaysrvr", { NULL }, 47624, "tcp" }, - { "directplaysrvr", { NULL }, 47624, "udp" }, - { "ap", { NULL }, 47806, "tcp" }, - { "ap", { NULL }, 47806, "udp" }, - { "bacnet", { NULL }, 47808, "tcp" }, - { "bacnet", { NULL }, 47808, "udp" }, - { "nimcontroller", { NULL }, 48000, "tcp" }, - { "nimcontroller", { NULL }, 48000, "udp" }, - { "nimspooler", { NULL }, 48001, "tcp" }, - { "nimspooler", { NULL }, 48001, "udp" }, - { "nimhub", { NULL }, 48002, "tcp" }, - { "nimhub", { NULL }, 48002, "udp" }, - { "nimgtw", { NULL }, 48003, "tcp" }, - { "nimgtw", { NULL }, 48003, "udp" }, - { "nimbusdb", { NULL }, 48004, "tcp" }, - { "nimbusdbctrl", { NULL }, 48005, "tcp" }, - { "3gpp-cbsp", { NULL }, 48049, "tcp" }, - { "isnetserv", { NULL }, 48128, "tcp" }, - { "isnetserv", { NULL }, 48128, "udp" }, - { "blp5", { NULL }, 48129, "tcp" }, - { "blp5", { NULL }, 48129, "udp" }, - { "com-bardac-dw", { NULL }, 48556, "tcp" }, - { "com-bardac-dw", { NULL }, 48556, "udp" }, - { "iqobject", { NULL }, 48619, "tcp" }, - { "iqobject", { NULL }, 48619, "udp" }, -# endif /* USE_IANA_REGISTERED_PORTS */ - { NULL, { NULL }, 0, NULL } -}; - -struct servent *getservbyport(int port, const char *proto) -{ - unsigned short u_port; - const char *protocol = NULL; - int error = 0; - size_t i; - - u_port = ntohs((unsigned short)port); - - if (proto) { - switch (ares_strlen(proto)) { - case 3: - if (!strncasecmp(proto, "tcp", 3)) { - protocol = "tcp"; - } else if (!strncasecmp(proto, "udp", 3)) { - protocol = "udp"; - } else { - error = WSAEFAULT; - } - break; - case 4: - if (!strncasecmp(proto, "sctp", 4)) { - protocol = "sctp"; - } else if (!strncasecmp(proto, "dccp", 4)) { - protocol = "dccp"; - } else { - error = WSAEFAULT; - } - break; - default: - error = WSAEFAULT; - } - } - - if (!error) { - for (i = 0; i < (sizeof(IANAports) / sizeof(IANAports[0])) - 1; i++) { - if (u_port == IANAports[i].s_port) { - if (!protocol || !strcasecmp(protocol, IANAports[i].s_proto)) { - return (struct servent *)&IANAports[i]; - } - } - } - error = WSANO_DATA; - } - - SET_SOCKERRNO(error); - return NULL; -} - -#endif /* _WIN32_WCE */ diff --git a/deps/cares/src/lib/ares_private.h b/deps/cares/src/lib/ares_private.h index 263c2a606d3708..ce8c3f2ddc2f6c 100644 --- a/deps/cares/src/lib/ares_private.h +++ b/deps/cares/src/lib/ares_private.h @@ -40,6 +40,36 @@ # include #endif +#include "ares_mem.h" +#include "ares_ipv6.h" +#include "util/ares_math.h" +#include "util/ares_time.h" +#include "util/ares_rand.h" +#include "ares_array.h" +#include "ares_llist.h" +#include "dsa/ares_slist.h" +#include "ares_htable_strvp.h" +#include "ares_htable_szvp.h" +#include "ares_htable_asvp.h" +#include "ares_htable_dict.h" +#include "ares_htable_vpvp.h" +#include "ares_htable_vpstr.h" +#include "record/ares_dns_multistring.h" +#include "ares_buf.h" +#include "record/ares_dns_private.h" +#include "util/ares_iface_ips.h" +#include "util/ares_threads.h" +#include "ares_socket.h" +#include "ares_conn.h" +#include "ares_str.h" +#include "str/ares_strsplit.h" +#include "util/ares_uri.h" + +#ifndef HAVE_GETENV +# include "ares_getenv.h" +# define getenv(ptr) ares_getenv(ptr) +#endif + #define DEFAULT_TIMEOUT 2000 /* milliseconds */ #define DEFAULT_TRIES 3 #ifndef INADDR_NONE @@ -100,42 +130,6 @@ W32_FUNC const char *_w32_GetHostsFile(void); #endif -#include "ares_ipv6.h" - -struct ares_rand_state; -typedef struct ares_rand_state ares_rand_state; - -#include "dsa/ares__array.h" -#include "dsa/ares__llist.h" -#include "dsa/ares__slist.h" -#include "dsa/ares__htable_strvp.h" -#include "dsa/ares__htable_szvp.h" -#include "dsa/ares__htable_asvp.h" -#include "dsa/ares__htable_vpvp.h" -#include "record/ares_dns_multistring.h" -#include "str/ares__buf.h" -#include "record/ares_dns_private.h" -#include "util/ares__iface_ips.h" -#include "util/ares__threads.h" - -#ifndef HAVE_GETENV -# include "ares_getenv.h" -# define getenv(ptr) ares_getenv(ptr) -#endif - -#include "str/ares_str.h" -#include "str/ares_strsplit.h" - -#ifndef HAVE_STRCASECMP -# include "str/ares_strcasecmp.h" -# define strcasecmp(p1, p2) ares_strcasecmp(p1, p2) -#endif - -#ifndef HAVE_STRNCASECMP -# include "str/ares_strcasecmp.h" -# define strncasecmp(p1, p2, n) ares_strncasecmp(p1, p2, n) -#endif - /********* EDNS defines section ******/ #define EDNSPACKETSZ \ 1232 /* Reasonable UDP payload size, as agreed by operators \ @@ -154,140 +148,6 @@ typedef struct ares_rand_state ares_rand_state; struct ares_query; typedef struct ares_query ares_query_t; -struct ares_server; -typedef struct ares_server ares_server_t; - -struct ares_conn; -typedef struct ares_conn ares_conn_t; - -typedef enum { - /*! No flags */ - ARES_CONN_FLAG_NONE = 0, - /*! TCP connection, not UDP */ - ARES_CONN_FLAG_TCP = 1 << 0, - /*! TCP Fast Open is enabled and being used if supported by the OS */ - ARES_CONN_FLAG_TFO = 1 << 1, - /*! TCP Fast Open has not yet sent its first packet. Gets unset on first - * write to a connection */ - ARES_CONN_FLAG_TFO_INITIAL = 1 << 2 -} ares_conn_flags_t; - -struct ares_conn { - ares_server_t *server; - ares_socket_t fd; - struct ares_addr self_ip; - ares_conn_flags_t flags; - /* total number of queries run on this connection since it was established */ - size_t total_queries; - /* list of outstanding queries to this connection */ - ares__llist_t *queries_to_conn; -}; - -#ifdef _MSC_VER -typedef __int64 ares_int64_t; -typedef unsigned __int64 ares_uint64_t; -#else -typedef long long ares_int64_t; -typedef unsigned long long ares_uint64_t; -#endif - -/*! struct timeval on some systems like Windows doesn't support 64bit time so - * therefore can't be used due to Y2K38 issues. Make our own that does have - * 64bit time. */ -typedef struct { - ares_int64_t sec; /*!< Seconds */ - unsigned int usec; /*!< Microseconds. Can't be negative. */ -} ares_timeval_t; - -/*! Various buckets for grouping history */ -typedef enum { - ARES_METRIC_1MINUTE = 0, /*!< Bucket for tracking over the last minute */ - ARES_METRIC_15MINUTES, /*!< Bucket for tracking over the last 15 minutes */ - ARES_METRIC_1HOUR, /*!< Bucket for tracking over the last hour */ - ARES_METRIC_1DAY, /*!< Bucket for tracking over the last day */ - ARES_METRIC_INCEPTION, /*!< Bucket for tracking since inception */ - ARES_METRIC_COUNT /*!< Count of buckets, not a real bucket */ -} ares_server_bucket_t; - -/*! Data metrics collected for each bucket */ -typedef struct { - time_t ts; /*!< Timestamp divided by bucket divisor */ - unsigned int latency_min_ms; /*!< Minimum latency for queries */ - unsigned int latency_max_ms; /*!< Maximum latency for queries */ - ares_uint64_t total_ms; /*!< Cumulative query time for bucket */ - ares_uint64_t total_count; /*!< Number of queries for bucket */ - - time_t prev_ts; /*!< Previous period bucket timestamp */ - ares_uint64_t - prev_total_ms; /*!< Previous period bucket cumulative query time */ - ares_uint64_t prev_total_count; /*!< Previous period bucket query count */ -} ares_server_metrics_t; - -typedef enum { - ARES_COOKIE_INITIAL = 0, - ARES_COOKIE_GENERATED = 1, - ARES_COOKIE_SUPPORTED = 2, - ARES_COOKIE_UNSUPPORTED = 3 -} ares_cookie_state_t; - -/*! Structure holding tracking data for RFC 7873/9018 DNS cookies. - * Implementation plan for this feature is here: - * https://github.com/c-ares/c-ares/issues/620 - */ -typedef struct { - /*! starts at INITIAL, transitions as needed. */ - ares_cookie_state_t state; - /*! randomly-generate client cookie */ - unsigned char client[8]; - /*! timestamp client cookie was generated, used for rotation purposes */ - ares_timeval_t client_ts; - /*! IP address last used for client to connect to server. If this changes - * The client cookie gets invalidated */ - struct ares_addr client_ip; - /*! Server Cookie last received, 8-32 bytes in length */ - unsigned char server[32]; - /*! Length of server cookie on file. */ - size_t server_len; - /*! Timestamp of last attempt to use cookies, but it was determined that the - * server didn't support them */ - ares_timeval_t unsupported_ts; -} ares_cookie_t; - -struct ares_server { - /* Configuration */ - size_t idx; /* index for server in system configuration */ - struct ares_addr addr; - unsigned short udp_port; /* host byte order */ - unsigned short tcp_port; /* host byte order */ - char ll_iface[64]; /* IPv6 Link Local Interface */ - unsigned int ll_scope; /* IPv6 Link Local Scope */ - - size_t consec_failures; /* Consecutive query failure count - * can be hard errors or timeouts - */ - ares__llist_t *connections; - ares_conn_t *tcp_conn; - - /* The next time when we will retry this server if it has hit failures */ - ares_timeval_t next_retry_time; - - /* TCP buffer since multiple responses can come back in one read, or partial - * in a read */ - ares__buf_t *tcp_parser; - - /* TCP output queue */ - ares__buf_t *tcp_send; - - /*! Buckets for collecting metrics about the server */ - ares_server_metrics_t metrics[ARES_METRIC_COUNT]; - - /*! RFC 7873/9018 DNS Cookies */ - ares_cookie_t cookie; - - /* Link back to owning channel */ - ares_channel_t *channel; -}; - /* State to represent a DNS query */ struct ares_query { /* Query ID from qbuf, for faster lookup, and current timeout */ @@ -300,9 +160,9 @@ struct ares_query { * Node object for each list entry the query belongs to in order to * make removal operations O(1). */ - ares__slist_node_t *node_queries_by_timeout; - ares__llist_node_t *node_queries_to_conn; - ares__llist_node_t *node_all_queries; + ares_slist_node_t *node_queries_by_timeout; + ares_llist_node_t *node_queries_to_conn; + ares_llist_node_t *node_all_queries; /* connection handle query is associated with */ ares_conn_t *conn; @@ -328,71 +188,71 @@ struct apattern { unsigned char mask; }; -struct ares__qcache; -typedef struct ares__qcache ares__qcache_t; +struct ares_qcache; +typedef struct ares_qcache ares_qcache_t; struct ares_hosts_file; typedef struct ares_hosts_file ares_hosts_file_t; struct ares_channeldata { /* Configuration data */ - unsigned int flags; - size_t timeout; /* in milliseconds */ - size_t tries; - size_t ndots; - size_t maxtimeout; /* in milliseconds */ - ares_bool_t rotate; - unsigned short udp_port; /* stored in network order */ - unsigned short tcp_port; /* stored in network order */ - int socket_send_buffer_size; /* setsockopt takes int */ - int socket_receive_buffer_size; /* setsockopt takes int */ - char **domains; - size_t ndomains; - struct apattern *sortlist; - size_t nsort; - char *lookups; - size_t ednspsz; - unsigned int qcache_max_ttl; - ares_evsys_t evsys; - unsigned int optmask; + unsigned int flags; + size_t timeout; /* in milliseconds */ + size_t tries; + size_t ndots; + size_t maxtimeout; /* in milliseconds */ + ares_bool_t rotate; + unsigned short udp_port; /* stored in network order */ + unsigned short tcp_port; /* stored in network order */ + int socket_send_buffer_size; /* setsockopt takes int */ + int socket_receive_buffer_size; /* setsockopt takes int */ + char **domains; + size_t ndomains; + struct apattern *sortlist; + size_t nsort; + char *lookups; + size_t ednspsz; + unsigned int qcache_max_ttl; + ares_evsys_t evsys; + unsigned int optmask; /* For binding to local devices and/or IP addresses. Leave * them null/zero for no binding. */ - char local_dev_name[32]; - unsigned int local_ip4; - unsigned char local_ip6[16]; + char local_dev_name[32]; + unsigned int local_ip4; + unsigned char local_ip6[16]; /* Thread safety lock */ - ares__thread_mutex_t *lock; + ares_thread_mutex_t *lock; /* Conditional to wake waiters when queue is empty */ - ares__thread_cond_t *cond_empty; + ares_thread_cond_t *cond_empty; /* Server addresses and communications state. Sorted by least consecutive * failures, followed by the configuration order if failures are equal. */ - ares__slist_t *servers; + ares_slist_t *servers; /* random state to use when generating new ids and generating retry penalties */ - ares_rand_state *rand_state; + ares_rand_state *rand_state; /* All active queries in a single list */ - ares__llist_t *all_queries; + ares_llist_t *all_queries; /* Queries bucketed by qid, for quickly dispatching DNS responses: */ - ares__htable_szvp_t *queries_by_qid; + ares_htable_szvp_t *queries_by_qid; /* Queries bucketed by timeout, for quickly handling timeouts: */ - ares__slist_t *queries_by_timeout; + ares_slist_t *queries_by_timeout; /* Map linked list node member for connection to file descriptor. We use * the node instead of the connection object itself so we can quickly look * up a connection and remove it if necessary (as otherwise we'd have to * scan all connections) */ - ares__htable_asvp_t *connnode_by_socket; + ares_htable_asvp_t *connnode_by_socket; - ares_sock_state_cb sock_state_cb; - void *sock_state_cb_data; + ares_sock_state_cb sock_state_cb; + void *sock_state_cb_data; ares_sock_create_callback sock_create_cb; void *sock_create_cb_data; @@ -400,8 +260,14 @@ struct ares_channeldata { ares_sock_config_callback sock_config_cb; void *sock_config_cb_data; - const struct ares_socket_functions *sock_funcs; + struct ares_socket_functions_ex sock_funcs; void *sock_func_cb_data; + const struct ares_socket_functions *legacy_sock_funcs; + void *legacy_sock_funcs_cb_data; + + ares_pending_write_cb notify_pending_write_cb; + void *notify_pending_write_cb_data; + ares_bool_t notify_pending_write; /* Path for resolv.conf file, configurable via ares_options */ char *resolvconf_path; @@ -416,7 +282,7 @@ struct ares_channeldata { ares_hosts_file_t *hf; /* Query Cache */ - ares__qcache_t *qcache; + ares_qcache_t *qcache; /* Fields controlling server failover behavior. * The retry chance is the probability (1/N) by which we will retry a failed @@ -437,7 +303,7 @@ struct ares_channeldata { * reading may block. The thread handle is provided for waiting on thread * exit. */ ares_bool_t reinit_pending; - ares__thread_t *reinit_thread; + ares_thread_t *reinit_thread; /* Whether the system is up or not. This is mainly to prevent deadlocks * and access violations during the cleanup process. Some things like @@ -447,29 +313,18 @@ struct ares_channeldata { }; /* Does the domain end in ".onion" or ".onion."? Case-insensitive. */ -ares_bool_t ares__is_onion_domain(const char *name); - -/* Memory management functions */ -extern void *(*ares_malloc)(size_t size); -extern void *(*ares_realloc)(void *ptr, size_t size); -extern void (*ares_free)(void *ptr); -void *ares_malloc_zero(size_t size); -void *ares_realloc_zero(void *ptr, size_t orig_size, size_t new_size); - -/* return true if now is exactly check time or later */ -ares_bool_t ares__timedout(const ares_timeval_t *now, - const ares_timeval_t *check); +ares_bool_t ares_is_onion_domain(const char *name); /* Returns one of the normal ares status codes like ARES_SUCCESS */ -ares_status_t ares__send_query(ares_query_t *query, const ares_timeval_t *now); -ares_status_t ares__requeue_query(ares_query_t *query, - const ares_timeval_t *now, - ares_status_t status, - ares_bool_t inc_try_count, - const ares_dns_record_t *dnsrec); +ares_status_t ares_send_query(ares_server_t *requested_server /* Optional */, + ares_query_t *query, const ares_timeval_t *now); +ares_status_t ares_requeue_query(ares_query_t *query, const ares_timeval_t *now, + ares_status_t status, + ares_bool_t inc_try_count, + const ares_dns_record_t *dnsrec); /*! Count the number of labels (dots+1) in a domain */ -size_t ares__name_label_cnt(const char *name); +size_t ares_name_label_cnt(const char *name); /*! Retrieve a list of names to use for searching. The first successful * query in the list wins. This function also uses the HOSTSALIASES file @@ -477,57 +332,45 @@ size_t ares__name_label_cnt(const char *name); * * \param[in] channel initialized ares channel * \param[in] name initial name being searched - * \param[out] names array of names to attempt, use ares__strsplit_free() + * \param[out] names array of names to attempt, use ares_strsplit_free() * when no longer needed. * \param[out] names_len number of names in array * \return ARES_SUCCESS on success, otherwise one of the other error codes. */ -ares_status_t ares__search_name_list(const ares_channel_t *channel, - const char *name, char ***names, - size_t *names_len); +ares_status_t ares_search_name_list(const ares_channel_t *channel, + const char *name, char ***names, + size_t *names_len); /*! Function to create callback arg for converting from ares_callback_dnsrec * to ares_calback */ -void *ares__dnsrec_convert_arg(ares_callback callback, void *arg); +void *ares_dnsrec_convert_arg(ares_callback callback, void *arg); /*! Callback function used to convert from the ares_callback_dnsrec prototype to * the ares_callback prototype, by writing the result and passing that to * the inner callback. */ -void ares__dnsrec_convert_cb(void *arg, ares_status_t status, size_t timeouts, - const ares_dns_record_t *dnsrec); - -void ares__close_connection(ares_conn_t *conn, ares_status_t requeue_status); -void ares__close_sockets(ares_server_t *server); -void ares__check_cleanup_conns(const ares_channel_t *channel); -void ares__free_query(ares_query_t *query); - -ares_rand_state *ares__init_rand_state(void); -void ares__destroy_rand_state(ares_rand_state *state); -void ares__rand_bytes(ares_rand_state *state, unsigned char *buf, size_t len); - -unsigned short ares__generate_new_id(ares_rand_state *state); -void ares__tvnow(ares_timeval_t *now); -void ares__timeval_remaining(ares_timeval_t *remaining, - const ares_timeval_t *now, - const ares_timeval_t *tout); -void ares__timeval_diff(ares_timeval_t *tvdiff, const ares_timeval_t *tvstart, - const ares_timeval_t *tvstop); -ares_status_t ares__expand_name_validated(const unsigned char *encoded, - const unsigned char *abuf, - size_t alen, char **s, size_t *enclen, +void ares_dnsrec_convert_cb(void *arg, ares_status_t status, size_t timeouts, + const ares_dns_record_t *dnsrec); + +void ares_free_query(ares_query_t *query); + +unsigned short ares_generate_new_id(ares_rand_state *state); +ares_status_t ares_expand_name_validated(const unsigned char *encoded, + const unsigned char *abuf, size_t alen, + char **s, size_t *enclen, ares_bool_t is_hostname); -ares_status_t ares_expand_string_ex(const unsigned char *encoded, - const unsigned char *abuf, size_t alen, - unsigned char **s, size_t *enclen); -ares_status_t ares__init_servers_state(ares_channel_t *channel); -ares_status_t ares__init_by_options(ares_channel_t *channel, +ares_status_t ares_expand_string_ex(const unsigned char *encoded, + const unsigned char *abuf, size_t alen, + unsigned char **s, size_t *enclen); +ares_status_t ares_init_servers_state(ares_channel_t *channel); +ares_status_t ares_init_by_options(ares_channel_t *channel, const struct ares_options *options, int optmask); -ares_status_t ares__init_by_sysconfig(ares_channel_t *channel); +ares_status_t ares_init_by_sysconfig(ares_channel_t *channel); +void ares_set_socket_functions_def(ares_channel_t *channel); typedef struct { - ares__llist_t *sconfig; + ares_llist_t *sconfig; struct apattern *sortlist; size_t nsortlist; char **domains; @@ -540,131 +383,108 @@ typedef struct { ares_bool_t usevc; } ares_sysconfig_t; -ares_status_t ares__sysconfig_set_options(ares_sysconfig_t *sysconfig, - const char *str); +ares_status_t ares_sysconfig_set_options(ares_sysconfig_t *sysconfig, + const char *str); -ares_status_t ares__init_by_environment(ares_sysconfig_t *sysconfig); +ares_status_t ares_init_by_environment(ares_sysconfig_t *sysconfig); -ares_status_t ares__init_sysconfig_files(const ares_channel_t *channel, - ares_sysconfig_t *sysconfig); +ares_status_t ares_init_sysconfig_files(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig); #ifdef __APPLE__ -ares_status_t ares__init_sysconfig_macos(ares_sysconfig_t *sysconfig); +ares_status_t ares_init_sysconfig_macos(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig); #endif #ifdef USE_WINSOCK -ares_status_t ares__init_sysconfig_windows(ares_sysconfig_t *sysconfig); +ares_status_t ares_init_sysconfig_windows(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig); #endif -ares_status_t ares__parse_sortlist(struct apattern **sortlist, size_t *nsort, - const char *str); - -void ares__destroy_servers_state(ares_channel_t *channel); +ares_status_t ares_parse_sortlist(struct apattern **sortlist, size_t *nsort, + const char *str); /* Returns ARES_SUCCESS if alias found, alias is set. Returns ARES_ENOTFOUND * if not alias found. Returns other errors on critical failure like * ARES_ENOMEM */ -ares_status_t ares__lookup_hostaliases(const ares_channel_t *channel, - const char *name, char **alias); +ares_status_t ares_lookup_hostaliases(const ares_channel_t *channel, + const char *name, char **alias); -ares_status_t ares__cat_domain(const char *name, const char *domain, char **s); -ares_status_t ares__sortaddrinfo(ares_channel_t *channel, - struct ares_addrinfo_node *ai_node); +ares_status_t ares_cat_domain(const char *name, const char *domain, char **s); +ares_status_t ares_sortaddrinfo(ares_channel_t *channel, + struct ares_addrinfo_node *ai_node); -void ares__freeaddrinfo_nodes(struct ares_addrinfo_node *ai_node); -ares_bool_t ares__is_localhost(const char *name); +void ares_freeaddrinfo_nodes(struct ares_addrinfo_node *ai_node); +ares_bool_t ares_is_localhost(const char *name); struct ares_addrinfo_node * - ares__append_addrinfo_node(struct ares_addrinfo_node **ai_node); -void ares__addrinfo_cat_nodes(struct ares_addrinfo_node **head, - struct ares_addrinfo_node *tail); + ares_append_addrinfo_node(struct ares_addrinfo_node **ai_node); +void ares_addrinfo_cat_nodes(struct ares_addrinfo_node **head, + struct ares_addrinfo_node *tail); -void ares__freeaddrinfo_cnames(struct ares_addrinfo_cname *ai_cname); +void ares_freeaddrinfo_cnames(struct ares_addrinfo_cname *ai_cname); -struct ares_addrinfo_cname * - ares__append_addrinfo_cname(struct ares_addrinfo_cname **ai_cname); +struct ares_addrinfo_cname * + ares_append_addrinfo_cname(struct ares_addrinfo_cname **ai_cname); ares_status_t ares_append_ai_node(int aftype, unsigned short port, unsigned int ttl, const void *adata, struct ares_addrinfo_node **nodes); -void ares__addrinfo_cat_cnames(struct ares_addrinfo_cname **head, - struct ares_addrinfo_cname *tail); +void ares_addrinfo_cat_cnames(struct ares_addrinfo_cname **head, + struct ares_addrinfo_cname *tail); -ares_status_t ares__parse_into_addrinfo(const ares_dns_record_t *dnsrec, - ares_bool_t cname_only_is_enodata, - unsigned short port, - struct ares_addrinfo *ai); +ares_status_t ares_parse_into_addrinfo(const ares_dns_record_t *dnsrec, + ares_bool_t cname_only_is_enodata, + unsigned short port, + struct ares_addrinfo *ai); ares_status_t ares_parse_ptr_reply_dnsrec(const ares_dns_record_t *dnsrec, const void *addr, int addrlen, int family, struct hostent **host); -ares_status_t ares__addrinfo2hostent(const struct ares_addrinfo *ai, int family, - struct hostent **host); -ares_status_t ares__addrinfo2addrttl(const struct ares_addrinfo *ai, int family, - size_t req_naddrttls, - struct ares_addrttl *addrttls, - struct ares_addr6ttl *addr6ttls, - size_t *naddrttls); -ares_status_t ares__addrinfo_localhost(const char *name, unsigned short port, - const struct ares_addrinfo_hints *hints, - struct ares_addrinfo *ai); -ares_status_t ares__open_connection(ares_conn_t **conn_out, - ares_channel_t *channel, - ares_server_t *server, ares_bool_t is_tcp); -ares_bool_t ares_sockaddr_to_ares_addr(struct ares_addr *ares_addr, - unsigned short *port, - const struct sockaddr *sockaddr); -ares_socket_t ares__open_socket(ares_channel_t *channel, int af, int type, - int protocol); -ares_bool_t ares__socket_try_again(int errnum); -ares_ssize_t ares__conn_write(ares_conn_t *conn, const void *data, size_t len); -ares_ssize_t ares__socket_recvfrom(ares_channel_t *channel, ares_socket_t s, - void *data, size_t data_len, int flags, - struct sockaddr *from, - ares_socklen_t *from_len); -ares_ssize_t ares__socket_recv(ares_channel_t *channel, ares_socket_t s, - void *data, size_t data_len); -void ares__close_socket(ares_channel_t *channel, ares_socket_t s); -ares_status_t ares__connect_socket(ares_channel_t *channel, - ares_socket_t sockfd, - const struct sockaddr *addr, - ares_socklen_t addrlen); -void ares__destroy_server(ares_server_t *server); - -ares_status_t ares__servers_update(ares_channel_t *channel, - ares__llist_t *server_list, - ares_bool_t user_specified); -ares_status_t ares__sconfig_append(ares__llist_t **sconfig, - const struct ares_addr *addr, - unsigned short udp_port, - unsigned short tcp_port, - const char *ll_iface); -ares_status_t ares__sconfig_append_fromstr(ares__llist_t **sconfig, - const char *str, - ares_bool_t ignore_invalid); -ares_status_t ares_in_addr_to_server_config_llist(const struct in_addr *servers, - size_t nservers, - ares__llist_t **llist); +ares_status_t ares_addrinfo2hostent(const struct ares_addrinfo *ai, int family, + struct hostent **host); +ares_status_t ares_addrinfo2addrttl(const struct ares_addrinfo *ai, int family, + size_t req_naddrttls, + struct ares_addrttl *addrttls, + struct ares_addr6ttl *addr6ttls, + size_t *naddrttls); +ares_status_t ares_addrinfo_localhost(const char *name, unsigned short port, + const struct ares_addrinfo_hints *hints, + struct ares_addrinfo *ai); + +ares_status_t ares_servers_update(ares_channel_t *channel, + ares_llist_t *server_list, + ares_bool_t user_specified); +ares_status_t + ares_sconfig_append(const ares_channel_t *channel, ares_llist_t **sconfig, + const struct ares_addr *addr, unsigned short udp_port, + unsigned short tcp_port, const char *ll_iface); +ares_status_t ares_sconfig_append_fromstr(const ares_channel_t *channel, + ares_llist_t **sconfig, + const char *str, + ares_bool_t ignore_invalid); +ares_status_t ares_in_addr_to_sconfig_llist(const struct in_addr *servers, + size_t nservers, + ares_llist_t **llist); ares_status_t ares_get_server_addr(const ares_server_t *server, - ares__buf_t *buf); + ares_buf_t *buf); struct ares_hosts_entry; typedef struct ares_hosts_entry ares_hosts_entry_t; -void ares__hosts_file_destroy(ares_hosts_file_t *hf); -ares_status_t ares__hosts_search_ipaddr(ares_channel_t *channel, - ares_bool_t use_env, const char *ipaddr, - const ares_hosts_entry_t **entry); -ares_status_t ares__hosts_search_host(ares_channel_t *channel, - ares_bool_t use_env, const char *host, - const ares_hosts_entry_t **entry); -ares_status_t ares__hosts_entry_to_hostent(const ares_hosts_entry_t *entry, - int family, - struct hostent **hostent); -ares_status_t ares__hosts_entry_to_addrinfo(const ares_hosts_entry_t *entry, - const char *name, int family, - unsigned short port, - ares_bool_t want_cnames, - struct ares_addrinfo *ai); +void ares_hosts_file_destroy(ares_hosts_file_t *hf); +ares_status_t ares_hosts_search_ipaddr(ares_channel_t *channel, + ares_bool_t use_env, const char *ipaddr, + const ares_hosts_entry_t **entry); +ares_status_t ares_hosts_search_host(ares_channel_t *channel, + ares_bool_t use_env, const char *host, + const ares_hosts_entry_t **entry); +ares_status_t ares_hosts_entry_to_hostent(const ares_hosts_entry_t *entry, + int family, struct hostent **hostent); +ares_status_t ares_hosts_entry_to_addrinfo(const ares_hosts_entry_t *entry, + const char *name, int family, + unsigned short port, + ares_bool_t want_cnames, + struct ares_addrinfo *ai); /* Same as ares_query_dnsrec() except does not take a channel lock. Use this * if a channel lock is already held */ @@ -674,9 +494,17 @@ ares_status_t ares_query_nolock(ares_channel_t *channel, const char *name, ares_callback_dnsrec callback, void *arg, unsigned short *qid); -/* Same as ares_send_dnsrec() except does not take a channel lock. Use this - * if a channel lock is already held */ -ares_status_t ares_send_nolock(ares_channel_t *channel, +/*! Flags controlling behavior for ares_send_nolock() */ +typedef enum { + ARES_SEND_FLAG_NOCACHE = 1 << 0, /*!< Do not query the cache */ + ARES_SEND_FLAG_NORETRY = 1 << 1 /*!< Do not retry this query on error */ +} ares_send_flags_t; + +/* Similar to ares_send_dnsrec() except does not take a channel lock, allows + * specifying a particular server to use, and also flags controlling behavior. + */ +ares_status_t ares_send_nolock(ares_channel_t *channel, ares_server_t *server, + ares_send_flags_t flags, const ares_dns_record_t *dnsrec, ares_callback_dnsrec callback, void *arg, unsigned short *qid); @@ -691,7 +519,7 @@ void ares_gethostbyaddr_nolock(ares_channel_t *channel, const void *addr, * offset within the buffer. * * It is assumed that either a const buffer is being used, or before - * the message processing was started that ares__buf_reclaim() was called. + * the message processing was started that ares_buf_reclaim() was called. * * \param[in] buf Initialized buffer object * \param[out] name Pointer passed by reference to be filled in with @@ -701,8 +529,8 @@ void ares_gethostbyaddr_nolock(ares_channel_t *channel, const void *addr, * a valid hostname or will return error. * \return ARES_SUCCESS on success */ -ares_status_t ares__dns_name_parse(ares__buf_t *buf, char **name, - ares_bool_t is_hostname); +ares_status_t ares_dns_name_parse(ares_buf_t *buf, char **name, + ares_bool_t is_hostname); /*! Write the DNS name to the buffer in the DNS domain-name syntax as a * series of labels. The maximum domain name length is 255 characters with @@ -721,9 +549,9 @@ ares_status_t ares__dns_name_parse(ares__buf_t *buf, char **name, * \return ARES_SUCCESS on success, most likely ARES_EBADNAME if the name is * bad. */ -ares_status_t ares__dns_name_write(ares__buf_t *buf, ares__llist_t **list, - ares_bool_t validate_hostname, - const char *name); +ares_status_t ares_dns_name_write(ares_buf_t *buf, ares_llist_t **list, + ares_bool_t validate_hostname, + const char *name); /*! Check if the queue is empty, if so, wake any waiters. This is only * effective if built with threading support. @@ -734,35 +562,20 @@ ares_status_t ares__dns_name_write(ares__buf_t *buf, ares__llist_t **list, */ void ares_queue_notify_empty(ares_channel_t *channel); - -#define SOCK_STATE_CALLBACK(c, s, r, w) \ - do { \ - if ((c)->sock_state_cb) { \ - (c)->sock_state_cb((c)->sock_state_cb_data, (s), (r), (w)); \ - } \ - } while (0) - -#define ARES_CONFIG_CHECK(x) \ - (x && x->lookups && ares__slist_len(x->servers) > 0 && x->timeout > 0 && \ +#define ARES_CONFIG_CHECK(x) \ + (x && x->lookups && ares_slist_len(x->servers) > 0 && x->timeout > 0 && \ x->tries > 0) -ares_bool_t ares__subnet_match(const struct ares_addr *addr, - const struct ares_addr *subnet, - unsigned char netmask); -ares_bool_t ares__addr_is_linklocal(const struct ares_addr *addr); - -ares_bool_t ares__is_64bit(void); -size_t ares__round_up_pow2(size_t n); -size_t ares__log2(size_t n); -size_t ares__pow(size_t x, size_t y); -size_t ares__count_digits(size_t n); -size_t ares__count_hexdigits(size_t n); -unsigned char ares__count_bits_u8(unsigned char x); -void ares__qcache_destroy(ares__qcache_t *cache); -ares_status_t ares__qcache_create(ares_rand_state *rand_state, - unsigned int max_ttl, - ares__qcache_t **cache_out); -void ares__qcache_flush(ares__qcache_t *cache); +ares_bool_t ares_subnet_match(const struct ares_addr *addr, + const struct ares_addr *subnet, + unsigned char netmask); +ares_bool_t ares_addr_is_linklocal(const struct ares_addr *addr); + +void ares_qcache_destroy(ares_qcache_t *cache); +ares_status_t ares_qcache_create(ares_rand_state *rand_state, + unsigned int max_ttl, + ares_qcache_t **cache_out); +void ares_qcache_flush(ares_qcache_t *cache); ares_status_t ares_qcache_insert(ares_channel_t *channel, const ares_timeval_t *now, const ares_query_t *query, @@ -784,10 +597,10 @@ ares_status_t ares_cookie_validate(ares_query_t *query, ares_conn_t *conn, const ares_timeval_t *now); -ares_status_t ares__channel_threading_init(ares_channel_t *channel); -void ares__channel_threading_destroy(ares_channel_t *channel); -void ares__channel_lock(const ares_channel_t *channel); -void ares__channel_unlock(const ares_channel_t *channel); +ares_status_t ares_channel_threading_init(ares_channel_t *channel); +void ares_channel_threading_destroy(ares_channel_t *channel); +void ares_channel_lock(const ares_channel_t *channel); +void ares_channel_unlock(const ares_channel_t *channel); struct ares_event_thread; typedef struct ares_event_thread ares_event_thread_t; diff --git a/deps/cares/src/lib/ares_process.c b/deps/cares/src/lib/ares_process.c index f05f67d8f2b176..62a6ae1ddaa46e 100644 --- a/deps/cares/src/lib/ares_process.c +++ b/deps/cares/src/lib/ares_process.c @@ -46,32 +46,30 @@ static void timeadd(ares_timeval_t *now, size_t millisecs); -static void write_tcp_data(ares_channel_t *channel, fd_set *write_fds, - ares_socket_t write_fd); -static void read_packets(ares_channel_t *channel, fd_set *read_fds, - ares_socket_t read_fd, const ares_timeval_t *now); -static void process_timeouts(ares_channel_t *channel, +static ares_status_t process_write(ares_channel_t *channel, + ares_socket_t write_fd); +static ares_status_t process_read(ares_channel_t *channel, + ares_socket_t read_fd, + const ares_timeval_t *now); +static ares_status_t process_timeouts(ares_channel_t *channel, const ares_timeval_t *now); static ares_status_t process_answer(ares_channel_t *channel, const unsigned char *abuf, size_t alen, - ares_conn_t *conn, ares_bool_t tcp, + ares_conn_t *conn, const ares_timeval_t *now); static void handle_conn_error(ares_conn_t *conn, ares_bool_t critical_failure, ares_status_t failure_status); - static ares_bool_t same_questions(const ares_query_t *query, const ares_dns_record_t *arec); -static ares_bool_t same_address(const struct sockaddr *sa, - const struct ares_addr *aa); static void end_query(ares_channel_t *channel, ares_server_t *server, ares_query_t *query, ares_status_t status, const ares_dns_record_t *dnsrec); -static void ares__query_disassociate_from_conn(ares_query_t *query) +static void ares_query_remove_from_conn(ares_query_t *query) { /* If its not part of a connection, it can't be tracked for timeouts either */ - ares__slist_node_destroy(query->node_queries_by_timeout); - ares__llist_node_destroy(query->node_queries_to_conn); + ares_slist_node_destroy(query->node_queries_by_timeout); + ares_llist_node_destroy(query->node_queries_to_conn); query->node_queries_by_timeout = NULL; query->node_queries_to_conn = NULL; query->conn = NULL; @@ -82,7 +80,7 @@ static void invoke_server_state_cb(const ares_server_t *server, ares_bool_t success, int flags) { const ares_channel_t *channel = server->channel; - ares__buf_t *buf; + ares_buf_t *buf; ares_status_t status; char *server_string; @@ -90,18 +88,18 @@ static void invoke_server_state_cb(const ares_server_t *server, return; } - buf = ares__buf_create(); + buf = ares_buf_create(); if (buf == NULL) { return; /* LCOV_EXCL_LINE: OutOfMemory */ } status = ares_get_server_addr(server, buf); if (status != ARES_SUCCESS) { - ares__buf_destroy(buf); /* LCOV_EXCL_LINE: OutOfMemory */ - return; /* LCOV_EXCL_LINE: OutOfMemory */ + ares_buf_destroy(buf); /* LCOV_EXCL_LINE: OutOfMemory */ + return; /* LCOV_EXCL_LINE: OutOfMemory */ } - server_string = ares__buf_finish_str(buf, NULL); + server_string = ares_buf_finish_str(buf, NULL); buf = NULL; if (server_string == NULL) { return; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -115,19 +113,19 @@ static void invoke_server_state_cb(const ares_server_t *server, static void server_increment_failures(ares_server_t *server, ares_bool_t used_tcp) { - ares__slist_node_t *node; + ares_slist_node_t *node; const ares_channel_t *channel = server->channel; ares_timeval_t next_retry_time; - node = ares__slist_node_find(channel->servers, server); + node = ares_slist_node_find(channel->servers, server); if (node == NULL) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ } server->consec_failures++; - ares__slist_node_reinsert(node); + ares_slist_node_reinsert(node); - ares__tvnow(&next_retry_time); + ares_tvnow(&next_retry_time); timeadd(&next_retry_time, channel->server_retry_delay); server->next_retry_time = next_retry_time; @@ -138,17 +136,17 @@ static void server_increment_failures(ares_server_t *server, static void server_set_good(ares_server_t *server, ares_bool_t used_tcp) { - ares__slist_node_t *node; + ares_slist_node_t *node; const ares_channel_t *channel = server->channel; - node = ares__slist_node_find(channel->servers, server); + node = ares_slist_node_find(channel->servers, server); if (node == NULL) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ } if (server->consec_failures > 0) { server->consec_failures = 0; - ares__slist_node_reinsert(node); + ares_slist_node_reinsert(node); } server->next_retry_time.sec = 0; @@ -160,8 +158,8 @@ static void server_set_good(ares_server_t *server, ares_bool_t used_tcp) } /* return true if now is exactly check time or later */ -ares_bool_t ares__timedout(const ares_timeval_t *now, - const ares_timeval_t *check) +ares_bool_t ares_timedout(const ares_timeval_t *now, + const ares_timeval_t *check) { ares_int64_t secs = (now->sec - check->sec); @@ -190,380 +188,422 @@ static void timeadd(ares_timeval_t *now, size_t millisecs) } } -/* - * generic process function - */ -static void processfds(ares_channel_t *channel, fd_set *read_fds, - ares_socket_t read_fd, fd_set *write_fds, - ares_socket_t write_fd) +static ares_status_t ares_process_fds_nolock(ares_channel_t *channel, + const ares_fd_events_t *events, + size_t nevents, unsigned int flags) { ares_timeval_t now; + size_t i; + ares_status_t status = ARES_SUCCESS; - if (channel == NULL) { - return; /* LCOV_EXCL_LINE: DefensiveCoding */ + if (channel == NULL || (events == NULL && nevents != 0)) { + return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ } - ares__channel_lock(channel); + ares_tvnow(&now); + + /* Process write events */ + for (i = 0; i < nevents; i++) { + if (events[i].fd == ARES_SOCKET_BAD || + !(events[i].events & ARES_FD_EVENT_WRITE)) { + continue; + } + status = process_write(channel, events[i].fd); + /* We only care about ENOMEM, anything else is handled via connection + * retries, etc */ + if (status == ARES_ENOMEM) { + goto done; + } + } - ares__tvnow(&now); - read_packets(channel, read_fds, read_fd, &now); - process_timeouts(channel, &now); - /* Write last as the other 2 operations might have triggered writes */ - write_tcp_data(channel, write_fds, write_fd); + /* Process read events */ + for (i = 0; i < nevents; i++) { + if (events[i].fd == ARES_SOCKET_BAD || + !(events[i].events & ARES_FD_EVENT_READ)) { + continue; + } + status = process_read(channel, events[i].fd, &now); + if (status == ARES_ENOMEM) { + goto done; + } + } + + if (!(flags & ARES_PROCESS_FLAG_SKIP_NON_FD)) { + ares_check_cleanup_conns(channel); + status = process_timeouts(channel, &now); + if (status == ARES_ENOMEM) { + goto done; + } + } - /* See if any connections should be cleaned up */ - ares__check_cleanup_conns(channel); - ares__channel_unlock(channel); +done: + if (status == ARES_ENOMEM) { + return ARES_ENOMEM; + } + return ARES_SUCCESS; } -/* Something interesting happened on the wire, or there was a timeout. - * See what's up and respond accordingly. - */ -void ares_process(ares_channel_t *channel, fd_set *read_fds, fd_set *write_fds) +ares_status_t ares_process_fds(ares_channel_t *channel, + const ares_fd_events_t *events, size_t nevents, + unsigned int flags) { - processfds(channel, read_fds, ARES_SOCKET_BAD, write_fds, ARES_SOCKET_BAD); + ares_status_t status; + + if (channel == NULL) { + return ARES_EFORMERR; + } + + ares_channel_lock(channel); + status = ares_process_fds_nolock(channel, events, nevents, flags); + ares_channel_unlock(channel); + return status; } -/* Something interesting happened on the wire, or there was a timeout. - * See what's up and respond accordingly. - */ -void ares_process_fd(ares_channel_t *channel, - ares_socket_t read_fd, /* use ARES_SOCKET_BAD or valid - file descriptors */ - ares_socket_t write_fd) +void ares_process_fd(ares_channel_t *channel, ares_socket_t read_fd, + ares_socket_t write_fd) { - processfds(channel, NULL, read_fd, NULL, write_fd); + ares_fd_events_t events[2]; + size_t nevents = 0; + + memset(events, 0, sizeof(events)); + + if (read_fd != ARES_SOCKET_BAD) { + nevents++; + events[nevents - 1].fd = read_fd; + events[nevents - 1].events |= ARES_FD_EVENT_READ; + } + + if (write_fd != ARES_SOCKET_BAD) { + if (write_fd != read_fd) { + nevents++; + } + events[nevents - 1].fd = write_fd; + events[nevents - 1].events |= ARES_FD_EVENT_WRITE; + } + + ares_process_fds(channel, events, nevents, ARES_PROCESS_FLAG_NONE); } -/* If any TCP sockets select true for writing, write out queued data - * we have for them. - */ -static void write_tcp_data(ares_channel_t *channel, fd_set *write_fds, - ares_socket_t write_fd) +static ares_socket_t *channel_socket_list(const ares_channel_t *channel, + size_t *num) { - ares__slist_node_t *node; + ares_slist_node_t *snode; + ares_array_t *arr = ares_array_create(sizeof(ares_socket_t), NULL); - if (!write_fds && (write_fd == ARES_SOCKET_BAD)) { - /* no possible action */ - return; + *num = 0; + + if (arr == NULL) { + return NULL; /* LCOV_EXCL_LINE: OutOfMemory */ } - for (node = ares__slist_node_first(channel->servers); node != NULL; - node = ares__slist_node_next(node)) { - ares_server_t *server = ares__slist_node_val(node); - const unsigned char *data; - size_t data_len; - ares_ssize_t count; + for (snode = ares_slist_node_first(channel->servers); snode != NULL; + snode = ares_slist_node_next(snode)) { + ares_server_t *server = ares_slist_node_val(snode); + ares_llist_node_t *node; - /* Make sure server has data to send and is selected in write_fds or - write_fd. */ - if (ares__buf_len(server->tcp_send) == 0 || server->tcp_conn == NULL) { - continue; - } + for (node = ares_llist_node_first(server->connections); node != NULL; + node = ares_llist_node_next(node)) { + const ares_conn_t *conn = ares_llist_node_val(node); + ares_socket_t *sptr; + ares_status_t status; - if (write_fds) { - if (!FD_ISSET(server->tcp_conn->fd, write_fds)) { - continue; - } - } else { - if (server->tcp_conn->fd != write_fd) { + if (conn->fd == ARES_SOCKET_BAD) { continue; } - } - if (write_fds) { - /* If there's an error and we close this socket, then open - * another with the same fd to talk to another server, then we - * don't want to think that it was the new socket that was - * ready. This is not disastrous, but is likely to result in - * extra system calls and confusion. */ - FD_CLR(server->tcp_conn->fd, write_fds); - } - - data = ares__buf_peek(server->tcp_send, &data_len); - count = ares__conn_write(server->tcp_conn, data, data_len); - if (count <= 0) { - if (!ares__socket_try_again(SOCKERRNO)) { - handle_conn_error(server->tcp_conn, ARES_TRUE, ARES_ECONNREFUSED); + status = ares_array_insert_last((void **)&sptr, arr); + if (status != ARES_SUCCESS) { + ares_array_destroy(arr); /* LCOV_EXCL_LINE: OutOfMemory */ + return NULL; /* LCOV_EXCL_LINE: OutOfMemory */ } - continue; - } - - /* Strip data written from the buffer */ - ares__buf_consume(server->tcp_send, (size_t)count); - - /* Notify state callback all data is written */ - if (ares__buf_len(server->tcp_send) == 0) { - SOCK_STATE_CALLBACK(channel, server->tcp_conn->fd, 1, 0); + *sptr = conn->fd; } } + + return ares_array_finish(arr, num); } -/* If any TCP socket selects true for reading, read some data, - * allocate a buffer if we finish reading the length word, and process - * a packet if we finish reading one. +/* Something interesting happened on the wire, or there was a timeout. + * See what's up and respond accordingly. */ -static void read_tcp_data(ares_channel_t *channel, ares_conn_t *conn, - const ares_timeval_t *now) +void ares_process(ares_channel_t *channel, fd_set *read_fds, fd_set *write_fds) { - ares_ssize_t count; - ares_server_t *server = conn->server; - - /* Fetch buffer to store data we are reading */ - size_t ptr_len = 65535; - unsigned char *ptr; - - ptr = ares__buf_append_start(server->tcp_parser, &ptr_len); - - if (ptr == NULL) { - handle_conn_error(conn, ARES_FALSE /* not critical to connection */, - ARES_SUCCESS); - return; /* bail out on malloc failure. TODO: make this - function return error codes */ - } + size_t i; + size_t num_sockets; + ares_socket_t *socketlist; + ares_fd_events_t *events = NULL; + size_t nevents = 0; - /* Read from socket */ - count = ares__socket_recv(channel, conn->fd, ptr, ptr_len); - if (count <= 0) { - ares__buf_append_finish(server->tcp_parser, 0); - if (!(count == -1 && ares__socket_try_again(SOCKERRNO))) { - handle_conn_error(conn, ARES_TRUE, ARES_ECONNREFUSED); - } + if (channel == NULL) { return; } - /* Record amount of data read */ - ares__buf_append_finish(server->tcp_parser, (size_t)count); - - /* Process all queued answers */ - while (1) { - unsigned short dns_len = 0; - const unsigned char *data = NULL; - size_t data_len = 0; - ares_status_t status; + ares_channel_lock(channel); - /* Tag so we can roll back */ - ares__buf_tag(server->tcp_parser); + /* There is no good way to iterate across an fd_set, instead we must pull a + * list of all known fds, and iterate across that checking against the fd_set. + */ + socketlist = channel_socket_list(channel, &num_sockets); - /* Read length indicator */ - if (ares__buf_fetch_be16(server->tcp_parser, &dns_len) != ARES_SUCCESS) { - ares__buf_tag_rollback(server->tcp_parser); - break; + /* Lets create an events array, maximum number is the number of sockets in + * the list, so we'll use that and just track entries with nevents */ + if (num_sockets) { + events = ares_malloc_zero(sizeof(*events) * num_sockets); + if (events == NULL) { + goto done; } + } - /* Not enough data for a full response yet */ - if (ares__buf_consume(server->tcp_parser, dns_len) != ARES_SUCCESS) { - ares__buf_tag_rollback(server->tcp_parser); - break; + for (i = 0; i < num_sockets; i++) { + ares_bool_t had_read = ARES_FALSE; + if (read_fds && FD_ISSET(socketlist[i], read_fds)) { + nevents++; + events[nevents - 1].fd = socketlist[i]; + events[nevents - 1].events |= ARES_FD_EVENT_READ; + had_read = ARES_TRUE; } - - /* Can't fail except for misuse */ - data = ares__buf_tag_fetch(server->tcp_parser, &data_len); - if (data == NULL || data_len < 2) { - ares__buf_tag_clear(server->tcp_parser); - break; + if (write_fds && FD_ISSET(socketlist[i], write_fds)) { + if (!had_read) { + nevents++; + } + events[nevents - 1].fd = socketlist[i]; + events[nevents - 1].events |= ARES_FD_EVENT_WRITE; } + } - /* Strip off 2 bytes length */ - data += 2; - data_len -= 2; +done: + ares_process_fds_nolock(channel, events, nevents, ARES_PROCESS_FLAG_NONE); + ares_free(events); + ares_free(socketlist); + ares_channel_unlock(channel); +} - /* We finished reading this answer; process it */ - status = process_answer(channel, data, data_len, conn, ARES_TRUE, now); - if (status != ARES_SUCCESS) { - handle_conn_error(conn, ARES_TRUE, status); - return; - } +static ares_status_t process_write(ares_channel_t *channel, + ares_socket_t write_fd) +{ + ares_conn_t *conn = ares_conn_from_fd(channel, write_fd); + ares_status_t status; - /* Since we processed the answer, clear the tag so space can be reclaimed */ - ares__buf_tag_clear(server->tcp_parser); + if (conn == NULL) { + return ARES_SUCCESS; + } + + /* Mark as connected if we got here and TFO Initial not set */ + if (!(conn->flags & ARES_CONN_FLAG_TFO_INITIAL)) { + conn->state_flags |= ARES_CONN_STATE_CONNECTED; + } + + status = ares_conn_flush(conn); + if (status != ARES_SUCCESS) { + handle_conn_error(conn, ARES_TRUE, status); } + return status; } -static ares_socket_t *channel_socket_list(const ares_channel_t *channel, - size_t *num) +void ares_process_pending_write(ares_channel_t *channel) { - ares__slist_node_t *snode; - ares__array_t *arr = ares__array_create(sizeof(ares_socket_t), NULL); + ares_slist_node_t *node; - *num = 0; + if (channel == NULL) { + return; + } - if (arr == NULL) { - return NULL; /* LCOV_EXCL_LINE: OutOfMemory */ + ares_channel_lock(channel); + if (!channel->notify_pending_write) { + ares_channel_unlock(channel); + return; } - for (snode = ares__slist_node_first(channel->servers); snode != NULL; - snode = ares__slist_node_next(snode)) { - ares_server_t *server = ares__slist_node_val(snode); - ares__llist_node_t *node; + /* Set as untriggerd before calling into ares_conn_flush(), this is + * because its possible ares_conn_flush() might cause additional data to + * be enqueued if there is some form of exception so it will need to recurse. + */ + channel->notify_pending_write = ARES_FALSE; - for (node = ares__llist_node_first(server->connections); node != NULL; - node = ares__llist_node_next(node)) { - const ares_conn_t *conn = ares__llist_node_val(node); - ares_socket_t *sptr; - ares_status_t status; + for (node = ares_slist_node_first(channel->servers); node != NULL; + node = ares_slist_node_next(node)) { + ares_server_t *server = ares_slist_node_val(node); + ares_conn_t *conn = server->tcp_conn; + ares_status_t status; - if (conn->fd == ARES_SOCKET_BAD) { - continue; - } + if (conn == NULL) { + continue; + } - status = ares__array_insert_last((void **)&sptr, arr); - if (status != ARES_SUCCESS) { - ares__array_destroy(arr); /* LCOV_EXCL_LINE: OutOfMemory */ - return NULL; /* LCOV_EXCL_LINE: OutOfMemory */ - } - *sptr = conn->fd; + /* Enqueue any pending data if there is any */ + status = ares_conn_flush(conn); + if (status != ARES_SUCCESS) { + handle_conn_error(conn, ARES_TRUE, status); } } - return ares__array_finish(arr, num); + ares_channel_unlock(channel); } -/* If any UDP sockets select true for reading, process them. */ -static void read_udp_packets_fd(ares_channel_t *channel, ares_conn_t *conn, - const ares_timeval_t *now) +static ares_status_t read_conn_packets(ares_conn_t *conn) { - ares_ssize_t read_len; - unsigned char buf[MAXENDSSZ + 1]; + ares_bool_t read_again; + ares_conn_err_t err; + const ares_channel_t *channel = conn->server->channel; -#ifdef HAVE_RECVFROM - ares_socklen_t fromlen; + do { + size_t count; + size_t len = 65535; + unsigned char *ptr; + size_t start_len = ares_buf_len(conn->in_buf); + + /* If UDP, lets write out a placeholder for the length indicator */ + if (!(conn->flags & ARES_CONN_FLAG_TCP) && + ares_buf_append_be16(conn->in_buf, 0) != ARES_SUCCESS) { + handle_conn_error(conn, ARES_FALSE /* not critical to connection */, + ARES_SUCCESS); + return ARES_ENOMEM; + } - union { - struct sockaddr sa; - struct sockaddr_in sa4; - struct sockaddr_in6 sa6; - } from; + /* Get a buffer of sufficient size */ + ptr = ares_buf_append_start(conn->in_buf, &len); - memset(&from, 0, sizeof(from)); -#endif - - /* To reduce event loop overhead, read and process as many - * packets as we can. */ - do { - if (conn->fd == ARES_SOCKET_BAD) { - read_len = -1; - } else { - if (conn->server->addr.family == AF_INET) { - fromlen = sizeof(from.sa4); - } else { - fromlen = sizeof(from.sa6); - } - read_len = ares__socket_recvfrom(channel, conn->fd, (void *)buf, - sizeof(buf), 0, &from.sa, &fromlen); + if (ptr == NULL) { + handle_conn_error(conn, ARES_FALSE /* not critical to connection */, + ARES_SUCCESS); + return ARES_ENOMEM; } - if (read_len == 0) { - /* UDP is connectionless, so result code of 0 is a 0-length UDP - * packet, and not an indication the connection is closed like on - * tcp */ - continue; - } else if (read_len < 0) { - if (ares__socket_try_again(SOCKERRNO)) { - break; + /* Read from socket */ + err = ares_conn_read(conn, ptr, len, &count); + + if (err != ARES_CONN_ERR_SUCCESS) { + ares_buf_append_finish(conn->in_buf, 0); + if (!(conn->flags & ARES_CONN_FLAG_TCP)) { + ares_buf_set_length(conn->in_buf, start_len); } + break; + } - handle_conn_error(conn, ARES_TRUE, ARES_ECONNREFUSED); - return; -#ifdef HAVE_RECVFROM - } else if (!same_address(&from.sa, &conn->server->addr)) { - /* The address the response comes from does not match the address we - * sent the request to. Someone may be attempting to perform a cache - * poisoning attack. */ - continue; -#endif + /* Record amount of data read */ + ares_buf_append_finish(conn->in_buf, count); - } else { - process_answer(channel, buf, (size_t)read_len, conn, ARES_FALSE, now); + /* Only loop if sockets support non-blocking operation, and are using UDP + * or are using TCP and read the maximum buffer size */ + read_again = ARES_FALSE; + if (channel->sock_funcs.flags & ARES_SOCKFUNC_FLAG_NONBLOCKING && + (!(conn->flags & ARES_CONN_FLAG_TCP) || count == len)) { + read_again = ARES_TRUE; } + /* If UDP, overwrite length */ + if (!(conn->flags & ARES_CONN_FLAG_TCP)) { + len = ares_buf_len(conn->in_buf); + ares_buf_set_length(conn->in_buf, start_len); + ares_buf_append_be16(conn->in_buf, (unsigned short)count); + ares_buf_set_length(conn->in_buf, len); + } /* Try to read again only if *we* set up the socket, otherwise it may be * a blocking socket and would cause recvfrom to hang. */ - } while (read_len >= 0 && channel->sock_funcs == NULL); -} + } while (read_again); -static void read_packets(ares_channel_t *channel, fd_set *read_fds, - ares_socket_t read_fd, const ares_timeval_t *now) -{ - size_t i; - ares_socket_t *socketlist = NULL; - size_t num_sockets = 0; - ares_conn_t *conn = NULL; - ares__llist_node_t *node = NULL; - - if (!read_fds && (read_fd == ARES_SOCKET_BAD)) { - /* no possible action */ - return; + if (err != ARES_CONN_ERR_SUCCESS && err != ARES_CONN_ERR_WOULDBLOCK) { + handle_conn_error(conn, ARES_TRUE, ARES_ECONNREFUSED); + return ARES_ECONNREFUSED; } - /* Single socket specified */ - if (!read_fds) { - node = ares__htable_asvp_get_direct(channel->connnode_by_socket, read_fd); - if (node == NULL) { - return; - } + return ARES_SUCCESS; +} - conn = ares__llist_node_val(node); +static ares_status_t read_answers(ares_conn_t *conn, const ares_timeval_t *now) +{ + ares_status_t status; + ares_channel_t *channel = conn->server->channel; - if (conn->flags & ARES_CONN_FLAG_TCP) { - read_tcp_data(channel, conn, now); - } else { - read_udp_packets_fd(channel, conn, now); - } + /* Process all queued answers */ + while (1) { + unsigned short dns_len = 0; + const unsigned char *data = NULL; + size_t data_len = 0; - return; - } + /* Tag so we can roll back */ + ares_buf_tag(conn->in_buf); - /* There is no good way to iterate across an fd_set, instead we must pull a - * list of all known fds, and iterate across that checking against the fd_set. - */ - socketlist = channel_socket_list(channel, &num_sockets); + /* Read length indicator */ + status = ares_buf_fetch_be16(conn->in_buf, &dns_len); + if (status != ARES_SUCCESS) { + ares_buf_tag_rollback(conn->in_buf); + break; + } - for (i = 0; i < num_sockets; i++) { - if (!FD_ISSET(socketlist[i], read_fds)) { - continue; + /* Not enough data for a full response yet */ + status = ares_buf_consume(conn->in_buf, dns_len); + if (status != ARES_SUCCESS) { + ares_buf_tag_rollback(conn->in_buf); + break; } - /* If there's an error and we close this socket, then open - * another with the same fd to talk to another server, then we - * don't want to think that it was the new socket that was - * ready. This is not disastrous, but is likely to result in - * extra system calls and confusion. */ - FD_CLR(socketlist[i], read_fds); - - node = - ares__htable_asvp_get_direct(channel->connnode_by_socket, socketlist[i]); - if (node == NULL) { - return; + /* Can't fail except for misuse */ + data = ares_buf_tag_fetch(conn->in_buf, &data_len); + if (data == NULL || data_len < 2) { + ares_buf_tag_clear(conn->in_buf); + break; } - conn = ares__llist_node_val(node); + /* Strip off 2 bytes length */ + data += 2; + data_len -= 2; - if (conn->flags & ARES_CONN_FLAG_TCP) { - read_tcp_data(channel, conn, now); - } else { - read_udp_packets_fd(channel, conn, now); + /* We finished reading this answer; process it */ + status = process_answer(channel, data, data_len, conn, now); + if (status != ARES_SUCCESS) { + handle_conn_error(conn, ARES_TRUE, status); + return status; } + + /* Since we processed the answer, clear the tag so space can be reclaimed */ + ares_buf_tag_clear(conn->in_buf); } + return status; +} - ares_free(socketlist); +static ares_status_t process_read(ares_channel_t *channel, + ares_socket_t read_fd, + const ares_timeval_t *now) +{ + ares_conn_t *conn = ares_conn_from_fd(channel, read_fd); + ares_status_t status; + + if (conn == NULL) { + return ARES_SUCCESS; + } + + /* TODO: There might be a potential issue here where there was a read that + * read some data, then looped and read again and got a disconnect. + * Right now, that would cause a resend instead of processing the data + * we have. This is fairly unlikely to occur due to only looping if + * a full buffer of 65535 bytes was read. */ + status = read_conn_packets(conn); + + if (status != ARES_SUCCESS) { + return status; + } + + return read_answers(conn, now); } /* If any queries have timed out, note the timeout and move them on. */ -static void process_timeouts(ares_channel_t *channel, const ares_timeval_t *now) +static ares_status_t process_timeouts(ares_channel_t *channel, + const ares_timeval_t *now) { - ares__slist_node_t *node; + ares_slist_node_t *node; + ares_status_t status = ARES_SUCCESS; /* Just keep popping off the first as this list will re-sort as things come * and go. We don't want to try to rely on 'next' as some operation might * cause a cleanup of that pointer and would become invalid */ - while ((node = ares__slist_node_first(channel->queries_by_timeout)) != NULL) { - ares_query_t *query = ares__slist_node_val(node); + while ((node = ares_slist_node_first(channel->queries_by_timeout)) != NULL) { + ares_query_t *query = ares_slist_node_val(node); ares_conn_t *conn; /* Since this is sorted, as soon as we hit a query that isn't timed out, * break */ - if (!ares__timedout(now, &query->timeout)) { + if (!ares_timedout(now, &query->timeout)) { break; } @@ -571,8 +611,16 @@ static void process_timeouts(ares_channel_t *channel, const ares_timeval_t *now) conn = query->conn; server_increment_failures(conn->server, query->using_tcp); - ares__requeue_query(query, now, ARES_ETIMEOUT, ARES_TRUE, NULL); + status = ares_requeue_query(query, now, ARES_ETIMEOUT, ARES_TRUE, NULL); + if (status == ARES_ENOMEM) { + goto done; + } } +done: + if (status == ARES_ENOMEM) { + return ARES_ENOMEM; + } + return ARES_SUCCESS; } static ares_status_t rewrite_without_edns(ares_query_t *query) @@ -607,17 +655,22 @@ static ares_status_t rewrite_without_edns(ares_query_t *query) * the connection to be terminated after this call. */ static ares_status_t process_answer(ares_channel_t *channel, const unsigned char *abuf, size_t alen, - ares_conn_t *conn, ares_bool_t tcp, + ares_conn_t *conn, const ares_timeval_t *now) { ares_query_t *query; - /* Cache these as once ares__send_query() gets called, it may end up + /* Cache these as once ares_send_query() gets called, it may end up * invalidating the connection all-together */ ares_server_t *server = conn->server; ares_dns_record_t *rdnsrec = NULL; ares_status_t status; ares_bool_t is_cached = ARES_FALSE; + /* UDP can have 0-byte messages, drop them to the ground */ + if (alen == 0) { + return ARES_SUCCESS; + } + /* Parse the response */ status = ares_dns_parse(abuf, alen, 0, &rdnsrec); if (status != ARES_SUCCESS) { @@ -629,8 +682,8 @@ static ares_status_t process_answer(ares_channel_t *channel, /* Find the query corresponding to this packet. The queries are * hashed/bucketed by query id, so this lookup should be quick. */ - query = ares__htable_szvp_get_direct(channel->queries_by_qid, - ares_dns_record_get_id(rdnsrec)); + query = ares_htable_szvp_get_direct(channel->queries_by_qid, + ares_dns_record_get_id(rdnsrec)); if (!query) { /* We may have stopped listening for this query, that's ok */ status = ARES_SUCCESS; @@ -657,7 +710,7 @@ static ares_status_t process_answer(ares_channel_t *channel, * remove it from the connection's queue so we can possibly invalidate the * connection. Delay cleaning up the connection though as we may enqueue * something new. */ - ares__llist_node_destroy(query->node_queries_to_conn); + ares_llist_node_destroy(query->node_queries_to_conn); query->node_queries_to_conn = NULL; /* If we use EDNS and server answers with FORMERR without an OPT RR, the @@ -672,7 +725,8 @@ static ares_status_t process_answer(ares_channel_t *channel, goto cleanup; } - ares__send_query(query, now); + /* Send to same server */ + ares_send_query(server, query, now); status = ARES_SUCCESS; goto cleanup; } @@ -681,10 +735,11 @@ static ares_status_t process_answer(ares_channel_t *channel, * don't accept the packet, and switch the query to TCP if we hadn't * done so already. */ - if (ares_dns_record_get_flags(rdnsrec) & ARES_FLAG_TC && !tcp && + if (ares_dns_record_get_flags(rdnsrec) & ARES_FLAG_TC && + !(conn->flags & ARES_CONN_FLAG_TCP) && !(channel->flags & ARES_FLAG_IGNTC)) { query->using_tcp = ARES_TRUE; - ares__send_query(query, now); + ares_send_query(NULL, query, now); status = ARES_SUCCESS; /* Switched to TCP is ok */ goto cleanup; } @@ -711,7 +766,7 @@ static ares_status_t process_answer(ares_channel_t *channel, } server_increment_failures(server, query->using_tcp); - ares__requeue_query(query, now, status, ARES_TRUE, rdnsrec); + ares_requeue_query(query, now, status, ARES_TRUE, rdnsrec); /* Should any of these cause a connection termination? * Maybe SERVER_FAILURE? */ @@ -753,19 +808,18 @@ static void handle_conn_error(ares_conn_t *conn, ares_bool_t critical_failure, } /* This will requeue any connections automatically */ - ares__close_connection(conn, failure_status); + ares_close_connection(conn, failure_status); } -ares_status_t ares__requeue_query(ares_query_t *query, - const ares_timeval_t *now, - ares_status_t status, - ares_bool_t inc_try_count, - const ares_dns_record_t *dnsrec) +ares_status_t ares_requeue_query(ares_query_t *query, const ares_timeval_t *now, + ares_status_t status, + ares_bool_t inc_try_count, + const ares_dns_record_t *dnsrec) { - ares_channel_t *channel = query->channel; - size_t max_tries = ares__slist_len(channel->servers) * channel->tries; + ares_channel_t *channel = query->channel; + size_t max_tries = ares_slist_len(channel->servers) * channel->tries; - ares__query_disassociate_from_conn(query); + ares_query_remove_from_conn(query); if (status != ARES_SUCCESS) { query->error_status = status; @@ -776,7 +830,7 @@ ares_status_t ares__requeue_query(ares_query_t *query, } if (query->try_count < max_tries && !query->no_retries) { - return ares__send_query(query, now); + return ares_send_query(NULL, query, now); } /* If we are here, all attempts to perform query failed. */ @@ -788,32 +842,58 @@ ares_status_t ares__requeue_query(ares_query_t *query, return ARES_ETIMEOUT; } -/* Pick a random server from the list, we first get a random number in the - * range of the number of servers, then scan until we find that server in - * the list */ -static ares_server_t *ares__random_server(ares_channel_t *channel) +/*! Count the number of servers that share the same highest priority (lowest + * consecutive failures). Since they are sorted in priority order, we just + * stop when the consecutive failure count changes. Used for random selection + * of good servers. */ +static size_t count_highest_prio_servers(const ares_channel_t *channel) { - unsigned char c; - size_t cnt; - size_t idx; - ares__slist_node_t *node; - size_t num_servers = ares__slist_len(channel->servers); + ares_slist_node_t *node; + size_t cnt = 0; + size_t last_consec_failures = SIZE_MAX; + + for (node = ares_slist_node_first(channel->servers); node != NULL; + node = ares_slist_node_next(node)) { + const ares_server_t *server = ares_slist_node_val(node); + + if (last_consec_failures != SIZE_MAX && + last_consec_failures < server->consec_failures) { + break; + } + + last_consec_failures = server->consec_failures; + cnt++; + } + + return cnt; +} + +/* Pick a random *best* server from the list, we first get a random number in + * the range of the number of *best* servers, then scan until we find that + * server in the list */ +static ares_server_t *ares_random_server(ares_channel_t *channel) +{ + unsigned char c; + size_t cnt; + size_t idx; + ares_slist_node_t *node; + size_t num_servers = count_highest_prio_servers(channel); /* Silence coverity, not possible */ if (num_servers == 0) { return NULL; } - ares__rand_bytes(channel->rand_state, &c, 1); + ares_rand_bytes(channel->rand_state, &c, 1); cnt = c; idx = cnt % num_servers; cnt = 0; - for (node = ares__slist_node_first(channel->servers); node != NULL; - node = ares__slist_node_next(node)) { + for (node = ares_slist_node_first(channel->servers); node != NULL; + node = ares_slist_node_next(node)) { if (cnt == idx) { - return ares__slist_node_val(node); + return ares_slist_node_val(node); } cnt++; @@ -822,40 +902,32 @@ static ares_server_t *ares__random_server(ares_channel_t *channel) return NULL; } -/* Pick a server from the list with failover behavior. - * - * We default to using the first server in the sorted list of servers. That is - * the server with the lowest number of consecutive failures and then the - * highest priority server (by idx) if there is a draw. - * - * However, if a server temporarily goes down and hits some failures, then that - * server will never be retried until all other servers hit the same number of - * failures. This may prevent the server from being retried for a long time. - * - * To resolve this, with some probability we select a failed server to retry - * instead. - */ -static ares_server_t *ares__failover_server(ares_channel_t *channel) +static void server_probe_cb(void *arg, ares_status_t status, size_t timeouts, + const ares_dns_record_t *dnsrec) { - ares_server_t *first_server = ares__slist_first_val(channel->servers); - const ares_server_t *last_server = ares__slist_last_val(channel->servers); - unsigned short r; - - /* Defensive code against no servers being available on the channel. */ - if (first_server == NULL) { - return NULL; /* LCOV_EXCL_LINE: DefensiveCoding */ - } - - /* If no servers have failures, then prefer the first server in the list. */ - if (last_server != NULL && last_server->consec_failures == 0) { - return first_server; - } + (void)arg; + (void)status; + (void)timeouts; + (void)dnsrec; + /* Nothing to do, the logic internally will handle success/fail of this */ +} - /* If we are not configured with a server retry chance then return the first - * server. - */ - if (channel->server_retry_chance == 0) { - return first_server; +/* Determine if we should probe a downed server */ +static void ares_probe_failed_server(ares_channel_t *channel, + const ares_server_t *server, + const ares_query_t *query) +{ + const ares_server_t *last_server = ares_slist_last_val(channel->servers); + unsigned short r; + ares_timeval_t now; + ares_slist_node_t *node; + ares_server_t *probe_server = NULL; + + /* If no servers have failures, or we're not configured with a server retry + * chance, then nothing to probe */ + if ((last_server != NULL && last_server->consec_failures == 0) || + channel->server_retry_chance == 0) { + return; } /* Generate a random value to decide whether to retry a failed server. The @@ -863,36 +935,49 @@ static ares_server_t *ares__failover_server(ares_channel_t *channel) * precision of 1/2^B where B is the number of bits in the random value. * We use an unsigned short for the random value for increased precision. */ - ares__rand_bytes(channel->rand_state, (unsigned char *)&r, sizeof(r)); - if (r % channel->server_retry_chance == 0) { - /* Select a suitable failed server to retry. */ - ares_timeval_t now; - ares__slist_node_t *node; - - ares__tvnow(&now); - for (node = ares__slist_node_first(channel->servers); node != NULL; - node = ares__slist_node_next(node)) { - ares_server_t *node_val = ares__slist_node_val(node); - if (node_val != NULL && node_val->consec_failures > 0 && - ares__timedout(&now, &node_val->next_retry_time)) { - return node_val; - } + ares_rand_bytes(channel->rand_state, (unsigned char *)&r, sizeof(r)); + if (r % channel->server_retry_chance != 0) { + return; + } + + /* Select the first server with failures to retry that has passed the retry + * timeout and doesn't already have a pending probe */ + ares_tvnow(&now); + for (node = ares_slist_node_first(channel->servers); node != NULL; + node = ares_slist_node_next(node)) { + ares_server_t *node_val = ares_slist_node_val(node); + if (node_val != NULL && node_val->consec_failures > 0 && + !node_val->probe_pending && + ares_timedout(&now, &node_val->next_retry_time)) { + probe_server = node_val; + break; } } - /* If we have not returned yet, then return the first server. */ - return first_server; + /* Either nothing to probe or the query was enqueud to the same server + * we were going to probe. Do nothing. */ + if (probe_server == NULL || server == probe_server) { + return; + } + + /* Enqueue an identical query onto the specified server without honoring + * the cache or allowing retries. We want to make sure it only attempts to + * use the server in question */ + probe_server->probe_pending = ARES_TRUE; + ares_send_nolock(channel, probe_server, + ARES_SEND_FLAG_NOCACHE | ARES_SEND_FLAG_NORETRY, + query->query, server_probe_cb, NULL, NULL); } -static size_t ares__calc_query_timeout(const ares_query_t *query, - const ares_server_t *server, - const ares_timeval_t *now) +static size_t ares_calc_query_timeout(const ares_query_t *query, + const ares_server_t *server, + const ares_timeval_t *now) { const ares_channel_t *channel = query->channel; size_t timeout = ares_metrics_server_timeout(server, now); size_t timeplus = timeout; size_t rounds; - size_t num_servers = ares__slist_len(channel->servers); + size_t num_servers = ares_slist_len(channel->servers); if (num_servers == 0) { return 0; /* LCOV_EXCL_LINE: DefensiveCoding */ @@ -922,7 +1007,7 @@ static size_t ares__calc_query_timeout(const ares_query_t *query, unsigned short r; float delta_multiplier; - ares__rand_bytes(channel->rand_state, (unsigned char *)&r, sizeof(r)); + ares_rand_bytes(channel->rand_state, (unsigned char *)&r, sizeof(r)); delta_multiplier = ((float)r / USHRT_MAX) * 0.5f; timeplus -= (size_t)((float)timeplus * delta_multiplier); } @@ -936,24 +1021,24 @@ static size_t ares__calc_query_timeout(const ares_query_t *query, return timeplus; } -static ares_conn_t *ares__fetch_connection(const ares_channel_t *channel, - ares_server_t *server, - const ares_query_t *query) +static ares_conn_t *ares_fetch_connection(const ares_channel_t *channel, + ares_server_t *server, + const ares_query_t *query) { - ares__llist_node_t *node; - ares_conn_t *conn; + ares_llist_node_t *node; + ares_conn_t *conn; if (query->using_tcp) { return server->tcp_conn; } /* Fetch existing UDP connection */ - node = ares__llist_node_first(server->connections); + node = ares_llist_node_first(server->connections); if (node == NULL) { return NULL; } - conn = ares__llist_node_val(node); + conn = ares_llist_node_val(node); /* Not UDP, skip */ if (conn->flags & ARES_CONN_FLAG_TCP) { return NULL; @@ -968,13 +1053,10 @@ static ares_conn_t *ares__fetch_connection(const ares_channel_t *channel, return conn; } -static ares_status_t ares__conn_query_write(ares_conn_t *conn, - ares_query_t *query, - const ares_timeval_t *now) +static ares_status_t ares_conn_query_write(ares_conn_t *conn, + ares_query_t *query, + const ares_timeval_t *now) { - unsigned char *qbuf = NULL; - size_t qbuf_len = 0; - ares_ssize_t len; ares_server_t *server = conn->server; ares_channel_t *channel = server->channel; ares_status_t status; @@ -984,81 +1066,57 @@ static ares_status_t ares__conn_query_write(ares_conn_t *conn, return status; } - if (conn->flags & ARES_CONN_FLAG_TCP) { - size_t prior_len = ares__buf_len(server->tcp_send); - - status = ares_dns_write_buf_tcp(query->query, server->tcp_send); - if (status != ARES_SUCCESS) { - return status; - } - - if (conn->flags & ARES_CONN_FLAG_TFO_INITIAL) { - /* When using TFO, we need to put it on the wire immediately. */ - size_t data_len; - const unsigned char *data = NULL; - - data = ares__buf_peek(server->tcp_send, &data_len); - len = ares__conn_write(conn, data, data_len); - if (len <= 0) { - if (ares__socket_try_again(SOCKERRNO)) { - /* This means we must not have qualified for TFO, keep the data - * buffered, wait on write signal. */ - return ARES_SUCCESS; - } - - /* TCP TFO might delay failure. Reflect that here */ - return ARES_ECONNREFUSED; - } - - /* Consume what was written */ - ares__buf_consume(server->tcp_send, (size_t)len); - return ARES_SUCCESS; - } - - if (prior_len == 0) { - SOCK_STATE_CALLBACK(channel, conn->fd, 1, 1); - } - - return ARES_SUCCESS; - } - - /* UDP Here */ - status = ares_dns_write(query->query, &qbuf, &qbuf_len); + /* We write using the TCP format even for UDP, we just strip the length + * before putting on the wire */ + status = ares_dns_write_buf_tcp(query->query, conn->out_buf); if (status != ARES_SUCCESS) { return status; } - len = ares__conn_write(conn, qbuf, qbuf_len); - ares_free(qbuf); + /* Not pending a TFO write and not connected, so we can't even try to + * write until we get a signal */ + if (conn->flags & ARES_CONN_FLAG_TCP && + !(conn->state_flags & ARES_CONN_STATE_CONNECTED) && + !(conn->flags & ARES_CONN_FLAG_TFO_INITIAL)) { + return ARES_SUCCESS; + } - if (len == -1) { - if (ares__socket_try_again(SOCKERRNO)) { - return ARES_ESERVFAIL; - } - /* UDP is connection-less, but we might receive an ICMP unreachable which - * means we can't talk to the remote host at all and that will be - * reflected here */ - return ARES_ECONNREFUSED; + /* Delay actual write if possible (TCP only, and only if callback + * configured) */ + if (channel->notify_pending_write_cb && !channel->notify_pending_write && + conn->flags & ARES_CONN_FLAG_TCP) { + channel->notify_pending_write = ARES_TRUE; + channel->notify_pending_write_cb(channel->notify_pending_write_cb_data); + return ARES_SUCCESS; } - return ARES_SUCCESS; + /* Unfortunately we need to write right away and can't aggregate multiple + * queries into a single write. */ + return ares_conn_flush(conn); } -ares_status_t ares__send_query(ares_query_t *query, const ares_timeval_t *now) +ares_status_t ares_send_query(ares_server_t *requested_server, + ares_query_t *query, const ares_timeval_t *now) { ares_channel_t *channel = query->channel; ares_server_t *server; ares_conn_t *conn; size_t timeplus; ares_status_t status; + ares_bool_t probe_downed_server = ARES_TRUE; + /* Choose the server to send the query to */ - if (channel->rotate) { - /* Pull random server */ - server = ares__random_server(channel); + if (requested_server != NULL) { + server = requested_server; } else { - /* Pull server with failover behavior */ - server = ares__failover_server(channel); + /* If rotate is turned on, do a random selection */ + if (channel->rotate) { + server = ares_random_server(channel); + } else { + /* First server in list */ + server = ares_slist_first_val(channel->servers); + } } if (server == NULL) { @@ -1066,9 +1124,16 @@ ares_status_t ares__send_query(ares_query_t *query, const ares_timeval_t *now) return ARES_ENOSERVER; } - conn = ares__fetch_connection(channel, server, query); + /* If a query is directed to a specific query, or the server chosen has + * failures, or the query is being retried, don't probe for downed servers */ + if (requested_server != NULL || server->consec_failures > 0 || + query->try_count != 0) { + probe_downed_server = ARES_FALSE; + } + + conn = ares_fetch_connection(channel, server, query); if (conn == NULL) { - status = ares__open_connection(&conn, channel, server, query->using_tcp); + status = ares_open_connection(&conn, channel, server, query->using_tcp); switch (status) { /* Good result, continue on */ case ARES_SUCCESS: @@ -1079,7 +1144,7 @@ ares_status_t ares__send_query(ares_query_t *query, const ares_timeval_t *now) case ARES_ECONNREFUSED: case ARES_EBADFAMILY: server_increment_failures(server, query->using_tcp); - return ares__requeue_query(query, now, status, ARES_TRUE, NULL); + return ares_requeue_query(query, now, status, ARES_TRUE, NULL); /* Anything else is not retryable, likely ENOMEM */ default: @@ -1089,7 +1154,7 @@ ares_status_t ares__send_query(ares_query_t *query, const ares_timeval_t *now) } /* Write the query */ - status = ares__conn_query_write(conn, query, now); + status = ares_conn_query_write(conn, query, now); switch (status) { /* Good result, continue on */ case ARES_SUCCESS: @@ -1105,30 +1170,28 @@ ares_status_t ares__send_query(ares_query_t *query, const ares_timeval_t *now) case ARES_ECONNREFUSED: case ARES_EBADFAMILY: handle_conn_error(conn, ARES_TRUE, status); - status = ares__requeue_query(query, now, status, ARES_TRUE, NULL); + status = ares_requeue_query(query, now, status, ARES_TRUE, NULL); if (status == ARES_ETIMEOUT) { status = ARES_ECONNREFUSED; } return status; - /* FIXME: Handle EAGAIN here since it likely can happen. Right now we - * just requeue to a different server/connection. */ default: server_increment_failures(server, query->using_tcp); - status = ares__requeue_query(query, now, status, ARES_TRUE, NULL); + status = ares_requeue_query(query, now, status, ARES_TRUE, NULL); return status; } - timeplus = ares__calc_query_timeout(query, server, now); + timeplus = ares_calc_query_timeout(query, server, now); /* Keep track of queries bucketed by timeout, so we can process * timeout events quickly. */ - ares__slist_node_destroy(query->node_queries_by_timeout); + ares_slist_node_destroy(query->node_queries_by_timeout); query->ts = *now; query->timeout = *now; timeadd(&query->timeout, timeplus); query->node_queries_by_timeout = - ares__slist_insert(channel->queries_by_timeout, query); + ares_slist_insert(channel->queries_by_timeout, query); if (!query->node_queries_by_timeout) { /* LCOV_EXCL_START: OutOfMemory */ end_query(channel, server, query, ARES_ENOMEM, NULL); @@ -1138,9 +1201,9 @@ ares_status_t ares__send_query(ares_query_t *query, const ares_timeval_t *now) /* Keep track of queries bucketed by connection, so we can process errors * quickly. */ - ares__llist_node_destroy(query->node_queries_to_conn); + ares_llist_node_destroy(query->node_queries_to_conn); query->node_queries_to_conn = - ares__llist_insert_last(conn->queries_to_conn, query); + ares_llist_insert_last(conn->queries_to_conn, query); if (query->node_queries_to_conn == NULL) { /* LCOV_EXCL_START: OutOfMemory */ @@ -1151,6 +1214,13 @@ ares_status_t ares__send_query(ares_query_t *query, const ares_timeval_t *now) query->conn = conn; conn->total_queries++; + + /* We just successfully enqueud a query, see if we should probe downed + * servers. */ + if (probe_downed_server) { + ares_probe_failed_server(channel, server, query); + } + return ARES_SUCCESS; } @@ -1197,12 +1267,12 @@ static ares_bool_t same_questions(const ares_query_t *query, * server to preserve the case of the name in the response packet. * https://datatracker.ietf.org/doc/html/draft-vixie-dnsext-dns0x20-00 */ - if (strcmp(qname, aname) != 0) { + if (!ares_streq(qname, aname)) { goto done; } } else { /* without DNS0x20 use case-insensitive matching */ - if (strcasecmp(qname, aname) != 0) { + if (!ares_strcaseeq(qname, aname)) { goto done; } } @@ -1214,42 +1284,12 @@ static ares_bool_t same_questions(const ares_query_t *query, return rv; } -static ares_bool_t same_address(const struct sockaddr *sa, - const struct ares_addr *aa) -{ - const void *addr1; - const void *addr2; - - if (sa->sa_family == aa->family) { - switch (aa->family) { - case AF_INET: - addr1 = &aa->addr.addr4; - addr2 = &(CARES_INADDR_CAST(const struct sockaddr_in *, sa))->sin_addr; - if (memcmp(addr1, addr2, sizeof(aa->addr.addr4)) == 0) { - return ARES_TRUE; /* match */ - } - break; - case AF_INET6: - addr1 = &aa->addr.addr6; - addr2 = - &(CARES_INADDR_CAST(const struct sockaddr_in6 *, sa))->sin6_addr; - if (memcmp(addr1, addr2, sizeof(aa->addr.addr6)) == 0) { - return ARES_TRUE; /* match */ - } - break; - default: - break; /* LCOV_EXCL_LINE */ - } - } - return ARES_FALSE; /* different */ -} - static void ares_detach_query(ares_query_t *query) { /* Remove the query from all the lists in which it is linked */ - ares__query_disassociate_from_conn(query); - ares__htable_szvp_remove(query->channel->queries_by_qid, query->qid); - ares__llist_node_destroy(query->node_all_queries); + ares_query_remove_from_conn(query); + ares_htable_szvp_remove(query->channel->queries_by_qid, query->qid); + ares_llist_node_destroy(query->node_all_queries); query->node_all_queries = NULL; } @@ -1257,11 +1297,17 @@ static void end_query(ares_channel_t *channel, ares_server_t *server, ares_query_t *query, ares_status_t status, const ares_dns_record_t *dnsrec) { + /* If we were probing for the server to come back online, lets mark it as + * no longer being probed */ + if (server != NULL) { + server->probe_pending = ARES_FALSE; + } + ares_metrics_record(query, server, status, dnsrec); /* Invoke the callback. */ query->callback(query->arg, status, query->timeouts, dnsrec); - ares__free_query(query); + ares_free_query(query); /* Check and notify if no other queries are enqueued on the channel. This * must come after the callback and freeing the query for 2 reasons. @@ -1271,7 +1317,7 @@ static void end_query(ares_channel_t *channel, ares_server_t *server, ares_queue_notify_empty(channel); } -void ares__free_query(ares_query_t *query) +void ares_free_query(ares_query_t *query) { ares_detach_query(query); /* Zero out some important stuff, to help catch bugs */ diff --git a/deps/cares/src/lib/ares_qcache.c b/deps/cares/src/lib/ares_qcache.c index 9725212fded7d1..97c0a9137da58b 100644 --- a/deps/cares/src/lib/ares_qcache.c +++ b/deps/cares/src/lib/ares_qcache.c @@ -25,10 +25,10 @@ */ #include "ares_private.h" -struct ares__qcache { - ares__htable_strvp_t *cache; - ares__slist_t *expire; - unsigned int max_ttl; +struct ares_qcache { + ares_htable_strvp_t *cache; + ares_slist_t *expire; + unsigned int max_ttl; }; typedef struct { @@ -36,11 +36,11 @@ typedef struct { ares_dns_record_t *dnsrec; time_t expire_ts; time_t insert_ts; -} ares__qcache_entry_t; +} ares_qcache_entry_t; -static char *ares__qcache_calc_key(const ares_dns_record_t *dnsrec) +static char *ares_qcache_calc_key(const ares_dns_record_t *dnsrec) { - ares__buf_t *buf = ares__buf_create(); + ares_buf_t *buf = ares_buf_create(); size_t i; ares_status_t status; ares_dns_flags_t flags; @@ -51,13 +51,13 @@ static char *ares__qcache_calc_key(const ares_dns_record_t *dnsrec) /* Format is OPCODE|FLAGS[|QTYPE1|QCLASS1|QNAME1]... */ - status = ares__buf_append_str( + status = ares_buf_append_str( buf, ares_dns_opcode_tostr(ares_dns_record_get_opcode(dnsrec))); if (status != ARES_SUCCESS) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_append_byte(buf, '|'); + status = ares_buf_append_byte(buf, '|'); if (status != ARES_SUCCESS) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -65,13 +65,13 @@ static char *ares__qcache_calc_key(const ares_dns_record_t *dnsrec) flags = ares_dns_record_get_flags(dnsrec); /* Only care about RD and CD */ if (flags & ARES_FLAG_RD) { - status = ares__buf_append_str(buf, "rd"); + status = ares_buf_append_str(buf, "rd"); if (status != ARES_SUCCESS) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } } if (flags & ARES_FLAG_CD) { - status = ares__buf_append_str(buf, "cd"); + status = ares_buf_append_str(buf, "cd"); if (status != ARES_SUCCESS) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -88,27 +88,27 @@ static char *ares__qcache_calc_key(const ares_dns_record_t *dnsrec) goto fail; /* LCOV_EXCL_LINE: DefensiveCoding */ } - status = ares__buf_append_byte(buf, '|'); + status = ares_buf_append_byte(buf, '|'); if (status != ARES_SUCCESS) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_append_str(buf, ares_dns_rec_type_tostr(qtype)); + status = ares_buf_append_str(buf, ares_dns_rec_type_tostr(qtype)); if (status != ARES_SUCCESS) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_append_byte(buf, '|'); + status = ares_buf_append_byte(buf, '|'); if (status != ARES_SUCCESS) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_append_str(buf, ares_dns_class_tostr(qclass)); + status = ares_buf_append_str(buf, ares_dns_class_tostr(qclass)); if (status != ARES_SUCCESS) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_append_byte(buf, '|'); + status = ares_buf_append_byte(buf, '|'); if (status != ARES_SUCCESS) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -122,64 +122,63 @@ static char *ares__qcache_calc_key(const ares_dns_record_t *dnsrec) } if (name_len > 0) { - status = ares__buf_append(buf, (const unsigned char *)name, name_len); + status = ares_buf_append(buf, (const unsigned char *)name, name_len); if (status != ARES_SUCCESS) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } } } - return ares__buf_finish_str(buf, NULL); + return ares_buf_finish_str(buf, NULL); /* LCOV_EXCL_START: OutOfMemory */ fail: - ares__buf_destroy(buf); + ares_buf_destroy(buf); return NULL; /* LCOV_EXCL_STOP */ } -static void ares__qcache_expire(ares__qcache_t *cache, - const ares_timeval_t *now) +static void ares_qcache_expire(ares_qcache_t *cache, const ares_timeval_t *now) { - ares__slist_node_t *node; + ares_slist_node_t *node; if (cache == NULL) { return; } - while ((node = ares__slist_node_first(cache->expire)) != NULL) { - const ares__qcache_entry_t *entry = ares__slist_node_val(node); + while ((node = ares_slist_node_first(cache->expire)) != NULL) { + const ares_qcache_entry_t *entry = ares_slist_node_val(node); /* If now is NULL, we're flushing everything, so don't break */ if (now != NULL && entry->expire_ts > now->sec) { break; } - ares__htable_strvp_remove(cache->cache, entry->key); - ares__slist_node_destroy(node); + ares_htable_strvp_remove(cache->cache, entry->key); + ares_slist_node_destroy(node); } } -void ares__qcache_flush(ares__qcache_t *cache) +void ares_qcache_flush(ares_qcache_t *cache) { - ares__qcache_expire(cache, NULL /* flush all */); + ares_qcache_expire(cache, NULL /* flush all */); } -void ares__qcache_destroy(ares__qcache_t *cache) +void ares_qcache_destroy(ares_qcache_t *cache) { if (cache == NULL) { return; } - ares__htable_strvp_destroy(cache->cache); - ares__slist_destroy(cache->expire); + ares_htable_strvp_destroy(cache->cache); + ares_slist_destroy(cache->expire); ares_free(cache); } -static int ares__qcache_entry_sort_cb(const void *arg1, const void *arg2) +static int ares_qcache_entry_sort_cb(const void *arg1, const void *arg2) { - const ares__qcache_entry_t *entry1 = arg1; - const ares__qcache_entry_t *entry2 = arg2; + const ares_qcache_entry_t *entry1 = arg1; + const ares_qcache_entry_t *entry2 = arg2; if (entry1->expire_ts > entry2->expire_ts) { return 1; @@ -192,9 +191,9 @@ static int ares__qcache_entry_sort_cb(const void *arg1, const void *arg2) return 0; } -static void ares__qcache_entry_destroy_cb(void *arg) +static void ares_qcache_entry_destroy_cb(void *arg) { - ares__qcache_entry_t *entry = arg; + ares_qcache_entry_t *entry = arg; if (entry == NULL) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ } @@ -204,12 +203,12 @@ static void ares__qcache_entry_destroy_cb(void *arg) ares_free(entry); } -ares_status_t ares__qcache_create(ares_rand_state *rand_state, - unsigned int max_ttl, - ares__qcache_t **cache_out) +ares_status_t ares_qcache_create(ares_rand_state *rand_state, + unsigned int max_ttl, + ares_qcache_t **cache_out) { - ares_status_t status = ARES_SUCCESS; - ares__qcache_t *cache; + ares_status_t status = ARES_SUCCESS; + ares_qcache_t *cache; cache = ares_malloc_zero(sizeof(*cache)); if (cache == NULL) { @@ -217,14 +216,14 @@ ares_status_t ares__qcache_create(ares_rand_state *rand_state, goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - cache->cache = ares__htable_strvp_create(NULL); + cache->cache = ares_htable_strvp_create(NULL); if (cache->cache == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - cache->expire = ares__slist_create(rand_state, ares__qcache_entry_sort_cb, - ares__qcache_entry_destroy_cb); + cache->expire = ares_slist_create(rand_state, ares_qcache_entry_sort_cb, + ares_qcache_entry_destroy_cb); if (cache->expire == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto done; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -235,7 +234,7 @@ ares_status_t ares__qcache_create(ares_rand_state *rand_state, done: if (status != ARES_SUCCESS) { *cache_out = NULL; - ares__qcache_destroy(cache); + ares_qcache_destroy(cache); return status; } @@ -243,7 +242,7 @@ ares_status_t ares__qcache_create(ares_rand_state *rand_state, return status; } -static unsigned int ares__qcache_calc_minttl(ares_dns_record_t *dnsrec) +static unsigned int ares_qcache_calc_minttl(ares_dns_record_t *dnsrec) { unsigned int minttl = 0xFFFFFFFF; size_t sect; @@ -272,7 +271,7 @@ static unsigned int ares__qcache_calc_minttl(ares_dns_record_t *dnsrec) return minttl; } -static unsigned int ares__qcache_soa_minimum(ares_dns_record_t *dnsrec) +static unsigned int ares_qcache_soa_minimum(ares_dns_record_t *dnsrec) { size_t i; @@ -302,15 +301,15 @@ static unsigned int ares__qcache_soa_minimum(ares_dns_record_t *dnsrec) } /* On success, takes ownership of dnsrec */ -static ares_status_t ares__qcache_insert(ares__qcache_t *qcache, - ares_dns_record_t *qresp, - const ares_dns_record_t *qreq, - const ares_timeval_t *now) +static ares_status_t ares_qcache_insert_int(ares_qcache_t *qcache, + ares_dns_record_t *qresp, + const ares_dns_record_t *qreq, + const ares_timeval_t *now) { - ares__qcache_entry_t *entry; - unsigned int ttl; - ares_dns_rcode_t rcode = ares_dns_record_get_rcode(qresp); - ares_dns_flags_t flags = ares_dns_record_get_flags(qresp); + ares_qcache_entry_t *entry; + unsigned int ttl; + ares_dns_rcode_t rcode = ares_dns_record_get_rcode(qresp); + ares_dns_flags_t flags = ares_dns_record_get_flags(qresp); if (qcache == NULL || qresp == NULL) { return ARES_EFORMERR; @@ -328,9 +327,9 @@ static ares_status_t ares__qcache_insert(ares__qcache_t *qcache, /* Look at SOA for NXDOMAIN for minimum */ if (rcode == ARES_RCODE_NXDOMAIN) { - ttl = ares__qcache_soa_minimum(qresp); + ttl = ares_qcache_soa_minimum(qresp); } else { - ttl = ares__qcache_calc_minttl(qresp); + ttl = ares_qcache_calc_minttl(qresp); } if (ttl > qcache->max_ttl) { @@ -355,16 +354,16 @@ static ares_status_t ares__qcache_insert(ares__qcache_t *qcache, * request had, so we have to re-parse the request in order to generate the * key for caching, but we'll only do this once we know for sure we really * want to cache it */ - entry->key = ares__qcache_calc_key(qreq); + entry->key = ares_qcache_calc_key(qreq); if (entry->key == NULL) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } - if (!ares__htable_strvp_insert(qcache->cache, entry->key, entry)) { + if (!ares_htable_strvp_insert(qcache->cache, entry->key, entry)) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } - if (ares__slist_insert(qcache->expire, entry) == NULL) { + if (ares_slist_insert(qcache->expire, entry) == NULL) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -373,7 +372,7 @@ static ares_status_t ares__qcache_insert(ares__qcache_t *qcache, /* LCOV_EXCL_START: OutOfMemory */ fail: if (entry != NULL && entry->key != NULL) { - ares__htable_strvp_remove(qcache->cache, entry->key); + ares_htable_strvp_remove(qcache->cache, entry->key); ares_free(entry->key); ares_free(entry); } @@ -386,9 +385,9 @@ ares_status_t ares_qcache_fetch(ares_channel_t *channel, const ares_dns_record_t *dnsrec, const ares_dns_record_t **dnsrec_resp) { - char *key = NULL; - ares__qcache_entry_t *entry; - ares_status_t status = ARES_SUCCESS; + char *key = NULL; + ares_qcache_entry_t *entry; + ares_status_t status = ARES_SUCCESS; if (channel == NULL || dnsrec == NULL || dnsrec_resp == NULL) { return ARES_EFORMERR; @@ -398,22 +397,22 @@ ares_status_t ares_qcache_fetch(ares_channel_t *channel, return ARES_ENOTFOUND; } - ares__qcache_expire(channel->qcache, now); + ares_qcache_expire(channel->qcache, now); - key = ares__qcache_calc_key(dnsrec); + key = ares_qcache_calc_key(dnsrec); if (key == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - entry = ares__htable_strvp_get_direct(channel->qcache->cache, key); + entry = ares_htable_strvp_get_direct(channel->qcache->cache, key); if (entry == NULL) { status = ARES_ENOTFOUND; goto done; } - ares_dns_record_write_ttl_decrement( - entry->dnsrec, (unsigned int)(now->sec - entry->insert_ts)); + ares_dns_record_ttl_decrement(entry->dnsrec, + (unsigned int)(now->sec - entry->insert_ts)); *dnsrec_resp = entry->dnsrec; @@ -427,5 +426,5 @@ ares_status_t ares_qcache_insert(ares_channel_t *channel, const ares_query_t *query, ares_dns_record_t *dnsrec) { - return ares__qcache_insert(channel->qcache, dnsrec, query->query, now); + return ares_qcache_insert_int(channel->qcache, dnsrec, query->query, now); } diff --git a/deps/cares/src/lib/ares_query.c b/deps/cares/src/lib/ares_query.c index 4d0861a5f52d51..ca3b6a9b732add 100644 --- a/deps/cares/src/lib/ares_query.c +++ b/deps/cares/src/lib/ares_query.c @@ -105,7 +105,8 @@ ares_status_t ares_query_nolock(ares_channel_t *channel, const char *name, qquery->arg = arg; /* Send it off. qcallback will be called when we get an answer. */ - status = ares_send_nolock(channel, dnsrec, ares_query_dnsrec_cb, qquery, qid); + status = ares_send_nolock(channel, NULL, 0, dnsrec, ares_query_dnsrec_cb, + qquery, qid); ares_dns_record_destroy(dnsrec); return status; @@ -123,9 +124,9 @@ ares_status_t ares_query_dnsrec(ares_channel_t *channel, const char *name, return ARES_EFORMERR; } - ares__channel_lock(channel); + ares_channel_lock(channel); status = ares_query_nolock(channel, name, dnsclass, type, callback, arg, qid); - ares__channel_unlock(channel); + ares_channel_unlock(channel); return status; } @@ -138,13 +139,13 @@ void ares_query(ares_channel_t *channel, const char *name, int dnsclass, return; } - carg = ares__dnsrec_convert_arg(callback, arg); + carg = ares_dnsrec_convert_arg(callback, arg); if (carg == NULL) { callback(arg, ARES_ENOMEM, 0, NULL, 0); /* LCOV_EXCL_LINE: OutOfMemory */ return; /* LCOV_EXCL_LINE: OutOfMemory */ } ares_query_dnsrec(channel, name, (ares_dns_class_t)dnsclass, - (ares_dns_rec_type_t)type, ares__dnsrec_convert_cb, carg, + (ares_dns_rec_type_t)type, ares_dnsrec_convert_cb, carg, NULL); } diff --git a/deps/cares/src/lib/ares_search.c b/deps/cares/src/lib/ares_search.c index 2d3c0fc5145684..c605caf42cb7a8 100644 --- a/deps/cares/src/lib/ares_search.c +++ b/deps/cares/src/lib/ares_search.c @@ -55,7 +55,7 @@ static void squery_free(struct search_query *squery) if (squery == NULL) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ } - ares__strsplit_free(squery->names, squery->names_cnt); + ares_strsplit_free(squery->names, squery->names_cnt); ares_dns_record_destroy(squery->dnsrec); ares_free(squery); } @@ -92,8 +92,8 @@ static ares_status_t ares_search_next(ares_channel_t *channel, return status; } - status = - ares_send_nolock(channel, squery->dnsrec, search_callback, squery, NULL); + status = ares_send_nolock(channel, NULL, 0, squery->dnsrec, search_callback, + squery, NULL); if (status != ARES_EFORMERR) { *skip_cleanup = ARES_TRUE; @@ -114,10 +114,9 @@ static void search_callback(void *arg, ares_status_t status, size_t timeouts, squery->timeouts += timeouts; if (dnsrec) { - ares_dns_rcode_t rcode = ares_dns_record_get_rcode(dnsrec); - size_t ancount = ares_dns_record_rr_cnt(dnsrec, - ARES_SECTION_ANSWER); - mystatus = ares_dns_query_reply_tostatus(rcode, ancount); + ares_dns_rcode_t rcode = ares_dns_record_get_rcode(dnsrec); + size_t ancount = ares_dns_record_rr_cnt(dnsrec, ARES_SECTION_ANSWER); + mystatus = ares_dns_query_reply_tostatus(rcode, ancount); } else { mystatus = status; } @@ -128,9 +127,9 @@ static void search_callback(void *arg, ares_status_t status, size_t timeouts, break; case ARES_ESERVFAIL: case ARES_EREFUSED: - /* Issue #852, systemd-resolved may return SERVFAIL or REFUSED on a + /* Issue #852, systemd-resolved may return SERVFAIL or REFUSED on a * single label domain name. */ - if (ares__name_label_cnt(squery->names[squery->next_name_idx-1]) != 1) { + if (ares_name_label_cnt(squery->names[squery->next_name_idx - 1]) != 1) { end_squery(squery, mystatus, dnsrec); return; } @@ -169,8 +168,8 @@ static void search_callback(void *arg, ares_status_t status, size_t timeouts, /* Determine if the domain should be looked up as-is, or if it is eligible * for search by appending domains */ -static ares_bool_t ares__search_eligible(const ares_channel_t *channel, - const char *name) +static ares_bool_t ares_search_eligible(const ares_channel_t *channel, + const char *name) { size_t len = ares_strlen(name); @@ -186,10 +185,10 @@ static ares_bool_t ares__search_eligible(const ares_channel_t *channel, return ARES_TRUE; } -size_t ares__name_label_cnt(const char *name) +size_t ares_name_label_cnt(const char *name) { - const char *p; - size_t ndots = 0; + const char *p; + size_t ndots = 0; if (name == NULL) { return 0; @@ -202,12 +201,12 @@ size_t ares__name_label_cnt(const char *name) } /* Label count is 1 greater than ndots */ - return ndots+1; + return ndots + 1; } -ares_status_t ares__search_name_list(const ares_channel_t *channel, - const char *name, char ***names, - size_t *names_len) +ares_status_t ares_search_name_list(const ares_channel_t *channel, + const char *name, char ***names, + size_t *names_len) { ares_status_t status; char **list = NULL; @@ -218,7 +217,7 @@ ares_status_t ares__search_name_list(const ares_channel_t *channel, size_t i; /* Perform HOSTALIASES resolution */ - status = ares__lookup_hostaliases(channel, name, &alias); + status = ares_lookup_hostaliases(channel, name, &alias); if (status == ARES_SUCCESS) { /* If hostalias succeeds, there is no searching, it is used as-is */ list_len = 1; @@ -235,7 +234,7 @@ ares_status_t ares__search_name_list(const ares_channel_t *channel, } /* See if searching is eligible at all, if not, look up as-is only */ - if (!ares__search_eligible(channel, name)) { + if (!ares_search_eligible(channel, name)) { list_len = 1; list = ares_malloc_zero(sizeof(*list) * list_len); if (list == NULL) { @@ -252,7 +251,7 @@ ares_status_t ares__search_name_list(const ares_channel_t *channel, } /* Count the number of dots in name, 1 less than label count */ - ndots = ares__name_label_cnt(name); + ndots = ares_name_label_cnt(name); if (ndots > 0) { ndots--; } @@ -266,7 +265,7 @@ ares_status_t ares__search_name_list(const ares_channel_t *channel, } /* Set status here, its possible there are no search domains at all, so - * status may be ARES_ENOTFOUND from ares__lookup_hostaliases(). */ + * status may be ARES_ENOTFOUND from ares_lookup_hostaliases(). */ status = ARES_SUCCESS; /* Try as-is first */ @@ -281,7 +280,7 @@ ares_status_t ares__search_name_list(const ares_channel_t *channel, /* Append each search suffix to the name */ for (i = 0; i < channel->ndomains; i++) { - status = ares__cat_domain(name, channel->domains[i], &list[idx]); + status = ares_cat_domain(name, channel->domains[i], &list[idx]); if (status != ARES_SUCCESS) { goto done; } @@ -304,7 +303,7 @@ ares_status_t ares__search_name_list(const ares_channel_t *channel, *names = list; *names_len = list_len; } else { - ares__strsplit_free(list, list_len); + ares_strsplit_free(list, list_len); } ares_free(alias); @@ -334,7 +333,7 @@ static ares_status_t ares_search_int(ares_channel_t *channel, } /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */ - if (ares__is_onion_domain(name)) { + if (ares_is_onion_domain(name)) { status = ARES_ENOTFOUND; goto fail; } @@ -363,7 +362,7 @@ static ares_status_t ares_search_int(ares_channel_t *channel, squery->ever_got_nodata = ARES_FALSE; status = - ares__search_name_list(channel, name, &squery->names, &squery->names_cnt); + ares_search_name_list(channel, name, &squery->names, &squery->names_cnt); if (status != ARES_SUCCESS) { goto fail; } @@ -383,7 +382,7 @@ static ares_status_t ares_search_int(ares_channel_t *channel, return status; } -/* Callback argument structure passed to ares__dnsrec_convert_cb(). */ +/* Callback argument structure passed to ares_dnsrec_convert_cb(). */ typedef struct { ares_callback callback; void *arg; @@ -391,7 +390,7 @@ typedef struct { /*! Function to create callback arg for converting from ares_callback_dnsrec * to ares_calback */ -void *ares__dnsrec_convert_arg(ares_callback callback, void *arg) +void *ares_dnsrec_convert_arg(ares_callback callback, void *arg) { dnsrec_convert_arg_t *carg = ares_malloc_zero(sizeof(*carg)); if (carg == NULL) { @@ -406,8 +405,8 @@ void *ares__dnsrec_convert_arg(ares_callback callback, void *arg) * the ares_callback prototype, by writing the result and passing that to * the inner callback. */ -void ares__dnsrec_convert_cb(void *arg, ares_status_t status, size_t timeouts, - const ares_dns_record_t *dnsrec) +void ares_dnsrec_convert_cb(void *arg, ares_status_t status, size_t timeouts, + const ares_dns_record_t *dnsrec) { dnsrec_convert_arg_t *carg = arg; unsigned char *abuf = NULL; @@ -442,11 +441,11 @@ void ares_search(ares_channel_t *channel, const char *name, int dnsclass, } /* For now, ares_search_int() uses the ares_callback prototype. We need to - * wrap the callback passed to this function in ares__dnsrec_convert_cb, to + * wrap the callback passed to this function in ares_dnsrec_convert_cb, to * convert from ares_callback_dnsrec to ares_callback. Allocate the convert * arg structure here. */ - carg = ares__dnsrec_convert_arg(callback, arg); + carg = ares_dnsrec_convert_arg(callback, arg); if (carg == NULL) { callback(arg, ARES_ENOMEM, 0, NULL, 0); return; @@ -463,9 +462,9 @@ void ares_search(ares_channel_t *channel, const char *name, int dnsclass, return; } - ares__channel_lock(channel); - ares_search_int(channel, dnsrec, ares__dnsrec_convert_cb, carg); - ares__channel_unlock(channel); + ares_channel_lock(channel); + ares_search_int(channel, dnsrec, ares_dnsrec_convert_cb, carg); + ares_channel_unlock(channel); ares_dns_record_destroy(dnsrec); } @@ -481,15 +480,15 @@ ares_status_t ares_search_dnsrec(ares_channel_t *channel, return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ } - ares__channel_lock(channel); + ares_channel_lock(channel); status = ares_search_int(channel, dnsrec, callback, arg); - ares__channel_unlock(channel); + ares_channel_unlock(channel); return status; } /* Concatenate two domains. */ -ares_status_t ares__cat_domain(const char *name, const char *domain, char **s) +ares_status_t ares_cat_domain(const char *name, const char *domain, char **s) { size_t nlen = ares_strlen(name); size_t dlen = ares_strlen(domain); @@ -500,7 +499,7 @@ ares_status_t ares__cat_domain(const char *name, const char *domain, char **s) } memcpy(*s, name, nlen); (*s)[nlen] = '.'; - if (strcmp(domain, ".") == 0) { + if (ares_streq(domain, ".")) { /* Avoid appending the root domain to the separator, which would set *s to an ill-formed value (ending in two consecutive dots). */ dlen = 0; @@ -510,14 +509,15 @@ ares_status_t ares__cat_domain(const char *name, const char *domain, char **s) return ARES_SUCCESS; } -ares_status_t ares__lookup_hostaliases(const ares_channel_t *channel, - const char *name, char **alias) +ares_status_t ares_lookup_hostaliases(const ares_channel_t *channel, + const char *name, char **alias) { - ares_status_t status = ARES_SUCCESS; - const char *hostaliases = NULL; - ares__buf_t *buf = NULL; - ares__llist_t *lines = NULL; - ares__llist_node_t *node; + ares_status_t status = ARES_SUCCESS; + const char *hostaliases = NULL; + ares_buf_t *buf = NULL; + ares_array_t *lines = NULL; + size_t num; + size_t i; if (channel == NULL || name == NULL || alias == NULL) { return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ @@ -541,13 +541,13 @@ ares_status_t ares__lookup_hostaliases(const ares_channel_t *channel, goto done; } - buf = ares__buf_create(); + buf = ares_buf_create(); if (buf == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_load_file(hostaliases, buf); + status = ares_buf_load_file(hostaliases, buf); if (status != ARES_SUCCESS) { goto done; } @@ -560,44 +560,45 @@ ares_status_t ares__lookup_hostaliases(const ares_channel_t *channel, * curl www.curl.se */ - status = ares__buf_split(buf, (const unsigned char *)"\n", 1, - ARES_BUF_SPLIT_TRIM, 0, &lines); + status = ares_buf_split(buf, (const unsigned char *)"\n", 1, + ARES_BUF_SPLIT_TRIM, 0, &lines); if (status != ARES_SUCCESS) { goto done; } - for (node = ares__llist_node_first(lines); node != NULL; - node = ares__llist_node_next(node)) { - ares__buf_t *line = ares__llist_node_val(node); + num = ares_array_len(lines); + for (i = 0; i < num; i++) { + ares_buf_t **bufptr = ares_array_at(lines, i); + ares_buf_t *line = *bufptr; char hostname[64] = ""; char fqdn[256] = ""; /* Pull off hostname */ - ares__buf_tag(line); - ares__buf_consume_nonwhitespace(line); - if (ares__buf_tag_fetch_string(line, hostname, sizeof(hostname)) != + ares_buf_tag(line); + ares_buf_consume_nonwhitespace(line); + if (ares_buf_tag_fetch_string(line, hostname, sizeof(hostname)) != ARES_SUCCESS) { continue; } /* Match hostname */ - if (strcasecmp(hostname, name) != 0) { + if (!ares_strcaseeq(hostname, name)) { continue; } /* consume whitespace */ - ares__buf_consume_whitespace(line, ARES_TRUE); + ares_buf_consume_whitespace(line, ARES_TRUE); /* pull off fqdn */ - ares__buf_tag(line); - ares__buf_consume_nonwhitespace(line); - if (ares__buf_tag_fetch_string(line, fqdn, sizeof(fqdn)) != ARES_SUCCESS || + ares_buf_tag(line); + ares_buf_consume_nonwhitespace(line); + if (ares_buf_tag_fetch_string(line, fqdn, sizeof(fqdn)) != ARES_SUCCESS || ares_strlen(fqdn) == 0) { continue; } /* Validate characterset */ - if (!ares__is_hostname(fqdn)) { + if (!ares_is_hostname(fqdn)) { continue; } @@ -615,8 +616,8 @@ ares_status_t ares__lookup_hostaliases(const ares_channel_t *channel, status = ARES_ENOTFOUND; done: - ares__buf_destroy(buf); - ares__llist_destroy(lines); + ares_buf_destroy(buf); + ares_array_destroy(lines); return status; } diff --git a/deps/cares/src/lib/ares_send.c b/deps/cares/src/lib/ares_send.c index 64ff7edd3ac602..ca178a1741ed7d 100644 --- a/deps/cares/src/lib/ares_send.c +++ b/deps/cares/src/lib/ares_send.c @@ -37,8 +37,8 @@ static unsigned short generate_unique_qid(ares_channel_t *channel) unsigned short id; do { - id = ares__generate_new_id(channel->rand_state); - } while (ares__htable_szvp_get(channel->queries_by_qid, id, NULL)); + id = ares_generate_new_id(channel->rand_state); + } while (ares_htable_szvp_get(channel->queries_by_qid, id, NULL)); return id; } @@ -77,14 +77,14 @@ static ares_status_t ares_apply_dns0x20(ares_channel_t *channel, * is 1 bit per byte */ total_bits = ((len + 7) / 8) * 8; remaining_bits = total_bits; - ares__rand_bytes(channel->rand_state, randdata, total_bits / 8); + ares_rand_bytes(channel->rand_state, randdata, total_bits / 8); /* Randomly apply 0x20 to name */ for (i = 0; i < len; i++) { size_t bit; /* Only apply 0x20 to alpha characters */ - if (!ares__isalpha(name[i])) { + if (!ares_isalpha(name[i])) { dns0x20name[i] = name[i]; continue; } @@ -105,7 +105,8 @@ static ares_status_t ares_apply_dns0x20(ares_channel_t *channel, return status; } -ares_status_t ares_send_nolock(ares_channel_t *channel, +ares_status_t ares_send_nolock(ares_channel_t *channel, ares_server_t *server, + ares_send_flags_t flags, const ares_dns_record_t *dnsrec, ares_callback_dnsrec callback, void *arg, unsigned short *qid) @@ -116,20 +117,22 @@ ares_status_t ares_send_nolock(ares_channel_t *channel, unsigned short id = generate_unique_qid(channel); const ares_dns_record_t *dnsrec_resp = NULL; - ares__tvnow(&now); + ares_tvnow(&now); - if (ares__slist_len(channel->servers) == 0) { + if (ares_slist_len(channel->servers) == 0) { callback(arg, ARES_ENOSERVER, 0, NULL); return ARES_ENOSERVER; } - /* Check query cache */ - status = ares_qcache_fetch(channel, &now, dnsrec, &dnsrec_resp); - if (status != ARES_ENOTFOUND) { - /* ARES_SUCCESS means we retrieved the cache, anything else is a critical - * failure, all result in termination */ - callback(arg, status, 0, dnsrec_resp); - return status; + if (!(flags & ARES_SEND_FLAG_NOCACHE)) { + /* Check query cache */ + status = ares_qcache_fetch(channel, &now, dnsrec, &dnsrec_resp); + if (status != ARES_ENOTFOUND) { + /* ARES_SUCCESS means we retrieved the cache, anything else is a critical + * failure, all result in termination */ + callback(arg, status, 0, dnsrec_resp); + return status; + } } /* Allocate space for query and allocated fields. */ @@ -162,7 +165,7 @@ ares_status_t ares_send_nolock(ares_channel_t *channel, if (status != ARES_SUCCESS) { /* LCOV_EXCL_START: OutOfMemory */ callback(arg, status, 0, NULL); - ares__free_query(query); + ares_free_query(query); return status; /* LCOV_EXCL_STOP */ } @@ -175,6 +178,9 @@ ares_status_t ares_send_nolock(ares_channel_t *channel, /* Initialize query status. */ query->try_count = 0; + if (flags & ARES_SEND_FLAG_NORETRY) { + query->no_retries = ARES_TRUE; + } query->error_status = ARES_SUCCESS; query->timeouts = 0; @@ -184,12 +190,11 @@ ares_status_t ares_send_nolock(ares_channel_t *channel, query->node_queries_to_conn = NULL; /* Chain the query into the list of all queries. */ - query->node_all_queries = - ares__llist_insert_last(channel->all_queries, query); + query->node_all_queries = ares_llist_insert_last(channel->all_queries, query); if (query->node_all_queries == NULL) { /* LCOV_EXCL_START: OutOfMemory */ callback(arg, ARES_ENOMEM, 0, NULL); - ares__free_query(query); + ares_free_query(query); return ARES_ENOMEM; /* LCOV_EXCL_STOP */ } @@ -197,17 +202,17 @@ ares_status_t ares_send_nolock(ares_channel_t *channel, /* Keep track of queries bucketed by qid, so we can process DNS * responses quickly. */ - if (!ares__htable_szvp_insert(channel->queries_by_qid, query->qid, query)) { + if (!ares_htable_szvp_insert(channel->queries_by_qid, query->qid, query)) { /* LCOV_EXCL_START: OutOfMemory */ callback(arg, ARES_ENOMEM, 0, NULL); - ares__free_query(query); + ares_free_query(query); return ARES_ENOMEM; /* LCOV_EXCL_STOP */ } /* Perform the first query action. */ - status = ares__send_query(query, &now); + status = ares_send_query(server, query, &now); if (status == ARES_SUCCESS && qid) { *qid = id; } @@ -225,11 +230,11 @@ ares_status_t ares_send_dnsrec(ares_channel_t *channel, return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ } - ares__channel_lock(channel); + ares_channel_lock(channel); - status = ares_send_nolock(channel, dnsrec, callback, arg, qid); + status = ares_send_nolock(channel, NULL, 0, dnsrec, callback, arg, qid); - ares__channel_unlock(channel); + ares_channel_unlock(channel); return status; } @@ -257,7 +262,7 @@ void ares_send(ares_channel_t *channel, const unsigned char *qbuf, int qlen, return; } - carg = ares__dnsrec_convert_arg(callback, arg); + carg = ares_dnsrec_convert_arg(callback, arg); if (carg == NULL) { /* LCOV_EXCL_START: OutOfMemory */ status = ARES_ENOMEM; @@ -267,7 +272,7 @@ void ares_send(ares_channel_t *channel, const unsigned char *qbuf, int qlen, /* LCOV_EXCL_STOP */ } - ares_send_dnsrec(channel, dnsrec, ares__dnsrec_convert_cb, carg, NULL); + ares_send_dnsrec(channel, dnsrec, ares_dnsrec_convert_cb, carg, NULL); ares_dns_record_destroy(dnsrec); } @@ -280,11 +285,11 @@ size_t ares_queue_active_queries(const ares_channel_t *channel) return 0; } - ares__channel_lock(channel); + ares_channel_lock(channel); - len = ares__llist_len(channel->all_queries); + len = ares_llist_len(channel->all_queries); - ares__channel_unlock(channel); + ares_channel_unlock(channel); return len; } diff --git a/deps/cares/src/lib/ares_set_socket_functions.c b/deps/cares/src/lib/ares_set_socket_functions.c new file mode 100644 index 00000000000000..143c491174fdba --- /dev/null +++ b/deps/cares/src/lib/ares_set_socket_functions.c @@ -0,0 +1,586 @@ +/* MIT License + * + * Copyright (c) 2024 Brad House + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ +#include "ares_private.h" +#ifdef HAVE_SYS_UIO_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_NETINET_TCP_H +# include +#endif +#ifdef HAVE_NETDB_H +# include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif + +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_IOCTL_H +# include +#endif +#ifdef NETWARE +# include +#endif + +#include +#include +#include + + +#if defined(__linux__) && defined(TCP_FASTOPEN_CONNECT) +# define TFO_SUPPORTED 1 +# define TFO_SKIP_CONNECT 0 +# define TFO_USE_SENDTO 0 +# define TFO_USE_CONNECTX 0 +# define TFO_CLIENT_SOCKOPT TCP_FASTOPEN_CONNECT +#elif defined(__FreeBSD__) && defined(TCP_FASTOPEN) +# define TFO_SUPPORTED 1 +# define TFO_SKIP_CONNECT 1 +# define TFO_USE_SENDTO 1 +# define TFO_USE_CONNECTX 0 +# define TFO_CLIENT_SOCKOPT TCP_FASTOPEN +#elif defined(__APPLE__) && defined(HAVE_CONNECTX) +# define TFO_SUPPORTED 1 +# define TFO_SKIP_CONNECT 0 +# define TFO_USE_SENDTO 0 +# define TFO_USE_CONNECTX 1 +# undef TFO_CLIENT_SOCKOPT +#else +# define TFO_SUPPORTED 0 +#endif + +#ifndef HAVE_WRITEV +/* Structure for scatter/gather I/O. */ +struct iovec { + void *iov_base; /* Pointer to data. */ + size_t iov_len; /* Length of data. */ +}; +#endif + +ares_status_t + ares_set_socket_functions_ex(ares_channel_t *channel, + const struct ares_socket_functions_ex *funcs, + void *user_data) +{ + unsigned int known_versions[] = { 1 }; + size_t i; + + if (channel == NULL || funcs == NULL) { + return ARES_EFORMERR; + } + + /* Check to see if we know the version referenced */ + for (i = 0; i < sizeof(known_versions) / sizeof(*known_versions); i++) { + if (funcs->version == known_versions[i]) { + break; + } + } + if (i == sizeof(known_versions) / sizeof(*known_versions)) { + return ARES_EFORMERR; + } + + memset(&channel->sock_funcs, 0, sizeof(channel->sock_funcs)); + + /* Copy individually for ABI compliance. memcpy() with a sizeof would do + * invalid reads */ + if (funcs->version >= 1) { + if (funcs->asocket == NULL || funcs->aclose == NULL || + funcs->asetsockopt == NULL || funcs->aconnect == NULL || + funcs->arecvfrom == NULL || funcs->asendto == NULL) { + return ARES_EFORMERR; + } + channel->sock_funcs.version = funcs->version; + channel->sock_funcs.flags = funcs->flags; + channel->sock_funcs.asocket = funcs->asocket; + channel->sock_funcs.aclose = funcs->aclose; + channel->sock_funcs.asetsockopt = funcs->asetsockopt; + channel->sock_funcs.aconnect = funcs->aconnect; + channel->sock_funcs.arecvfrom = funcs->arecvfrom; + channel->sock_funcs.asendto = funcs->asendto; + channel->sock_funcs.agetsockname = funcs->agetsockname; + channel->sock_funcs.abind = funcs->abind; + } + + /* Implement newer versions here ...*/ + + + channel->sock_func_cb_data = user_data; + + return ARES_SUCCESS; +} + +static int setsocknonblock(ares_socket_t sockfd, /* operate on this */ + int nonblock /* TRUE or FALSE */) +{ +#if defined(HAVE_FCNTL_O_NONBLOCK) + + /* most recent unix versions */ + int flags; + flags = fcntl(sockfd, F_GETFL, 0); + if (nonblock) { + return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK); + } else { + return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK)); /* LCOV_EXCL_LINE */ + } + +#elif defined(HAVE_IOCTL_FIONBIO) + + /* older unix versions */ + int flags = nonblock ? 1 : 0; + return ioctl(sockfd, FIONBIO, &flags); + +#elif defined(HAVE_IOCTLSOCKET_FIONBIO) + +# ifdef WATT32 + char flags = nonblock ? 1 : 0; +# else + /* Windows */ + unsigned long flags = nonblock ? 1UL : 0UL; +# endif + return ioctlsocket(sockfd, (long)FIONBIO, &flags); + +#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO) + + /* Amiga */ + long flags = nonblock ? 1L : 0L; + return IoctlSocket(sockfd, FIONBIO, flags); + +#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK) + + /* BeOS */ + long b = nonblock ? 1L : 0L; + return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); + +#else +# error "no non-blocking method was found/used/set" +#endif +} + +static int default_aclose(ares_socket_t sock, void *user_data) +{ + (void)user_data; + +#if defined(HAVE_CLOSESOCKET) + return closesocket(sock); +#elif defined(HAVE_CLOSESOCKET_CAMEL) + return CloseSocket(sock); +#elif defined(HAVE_CLOSE_S) + return close_s(sock); +#else + return close(sock); +#endif +} + +static ares_socket_t default_asocket(int domain, int type, int protocol, + void *user_data) +{ + ares_socket_t s; + (void)user_data; + + s = socket(domain, type, protocol); + if (s == ARES_SOCKET_BAD) { + return s; + } + + if (setsocknonblock(s, 1) != 0) { + goto fail; /* LCOV_EXCL_LINE */ + } + +#if defined(FD_CLOEXEC) && !defined(MSDOS) + /* Configure the socket fd as close-on-exec. */ + if (fcntl(s, F_SETFD, FD_CLOEXEC) != 0) { + goto fail; /* LCOV_EXCL_LINE */ + } +#endif + + /* No need to emit SIGPIPE on socket errors */ +#if defined(SO_NOSIGPIPE) + { + int opt = 1; + (void)setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, (void *)&opt, sizeof(opt)); + } +#endif + + + if (type == SOCK_STREAM) { + int opt = 1; + +#ifdef TCP_NODELAY + /* + * Disable the Nagle algorithm (only relevant for TCP sockets, and thus not + * in configure_socket). In general, in DNS lookups we're pretty much + * interested in firing off a single request and then waiting for a reply, + * so batching isn't very interesting. + */ + if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (void *)&opt, sizeof(opt)) != + 0) { + goto fail; + } +#endif + } + +#if defined(IPV6_V6ONLY) && defined(USE_WINSOCK) + /* Support for IPv4-mapped IPv6 addresses. + * Linux kernel, NetBSD, FreeBSD and Darwin: default is off; + * Windows Vista and later: default is on; + * DragonFly BSD: acts like off, and dummy setting; + * OpenBSD and earlier Windows: unsupported. + * Linux: controlled by /proc/sys/net/ipv6/bindv6only. + */ + if (domain == PF_INET6) { + int on = 0; + (void)setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&on, sizeof(on)); + } +#endif + + return s; + +fail: + default_aclose(s, user_data); + return ARES_SOCKET_BAD; +} + +static int default_asetsockopt(ares_socket_t sock, ares_socket_opt_t opt, + const void *val, ares_socklen_t val_size, + void *user_data) +{ + switch (opt) { + case ARES_SOCKET_OPT_SENDBUF_SIZE: + if (val_size != sizeof(int)) { + SET_SOCKERRNO(EINVAL); + return -1; + } + return setsockopt(sock, SOL_SOCKET, SO_SNDBUF, val, val_size); + + case ARES_SOCKET_OPT_RECVBUF_SIZE: + if (val_size != sizeof(int)) { + SET_SOCKERRNO(EINVAL); + return -1; + } + return setsockopt(sock, SOL_SOCKET, SO_RCVBUF, val, val_size); + + case ARES_SOCKET_OPT_BIND_DEVICE: + if (!ares_str_isprint(val, (size_t)val_size)) { + SET_SOCKERRNO(EINVAL); + return -1; + } +#ifdef SO_BINDTODEVICE + return setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, val, val_size); +#else + SET_SOCKERRNO(ENOSYS); + return -1; +#endif + + case ARES_SOCKET_OPT_TCP_FASTOPEN: + if (val_size != sizeof(ares_bool_t)) { + SET_SOCKERRNO(EINVAL); + return -1; + } +#if defined(TFO_CLIENT_SOCKOPT) + { + int oval; + const ares_bool_t *pval = val; + oval = (int)*pval; + return setsockopt(sock, IPPROTO_TCP, TFO_CLIENT_SOCKOPT, (void *)&oval, + sizeof(oval)); + } +#elif TFO_SUPPORTED + return 0; +#else + SET_SOCKERRNO(ENOSYS); + return -1; +#endif + } + + (void)user_data; + SET_SOCKERRNO(ENOSYS); + return -1; +} + +static int default_aconnect(ares_socket_t sock, const struct sockaddr *address, + ares_socklen_t address_len, unsigned int flags, + void *user_data) +{ + (void)user_data; + +#if defined(TFO_SKIP_CONNECT) && TFO_SKIP_CONNECT + if (flags & ARES_SOCKET_CONN_TCP_FASTOPEN) { + return 0; + } + return connect(sock, address, address_len); +#elif defined(TFO_USE_CONNECTX) && TFO_USE_CONNECTX + if (flags & ARES_SOCKET_CONN_TCP_FASTOPEN) { + sa_endpoints_t endpoints; + + memset(&endpoints, 0, sizeof(endpoints)); + endpoints.sae_dstaddr = address; + endpoints.sae_dstaddrlen = address_len; + + return connectx(sock, &endpoints, SAE_ASSOCID_ANY, + CONNECT_DATA_IDEMPOTENT | CONNECT_RESUME_ON_READ_WRITE, + NULL, 0, NULL, NULL); + } else { + return connect(sock, address, address_len); + } +#else + (void)flags; + return connect(sock, address, address_len); +#endif +} + +static ares_ssize_t default_arecvfrom(ares_socket_t sock, void *buffer, + size_t length, int flags, + struct sockaddr *address, + ares_socklen_t *address_len, + void *user_data) +{ + (void)user_data; + +#ifdef HAVE_RECVFROM + return (ares_ssize_t)recvfrom(sock, buffer, (RECVFROM_TYPE_ARG3)length, flags, + address, address_len); +#else + if (address != NULL && address_len != NULL) { + memset(address, 0, (size_t)*address_len); + address->sa_family = AF_UNSPEC; + } + return (ares_ssize_t)recv(sock, buffer, (RECVFROM_TYPE_ARG3)length, flags); +#endif +} + +static ares_ssize_t default_asendto(ares_socket_t sock, const void *buffer, + size_t length, int flags, + const struct sockaddr *address, + ares_socklen_t address_len, void *user_data) +{ + (void)user_data; + + if (address != NULL) { +#ifdef HAVE_SENDTO + return (ares_ssize_t)sendto((SEND_TYPE_ARG1)sock, (SEND_TYPE_ARG2)buffer, + (SEND_TYPE_ARG3)length, (SEND_TYPE_ARG4)flags, + address, address_len); +#else + (void)address_len; +#endif + } + + return (ares_ssize_t)send((SEND_TYPE_ARG1)sock, (SEND_TYPE_ARG2)buffer, + (SEND_TYPE_ARG3)length, (SEND_TYPE_ARG4)flags); +} + +static int default_agetsockname(ares_socket_t sock, struct sockaddr *address, + ares_socklen_t *address_len, void *user_data) +{ + (void)user_data; + return getsockname(sock, address, address_len); +} + +static int default_abind(ares_socket_t sock, unsigned int flags, + const struct sockaddr *address, socklen_t address_len, + void *user_data) +{ + (void)user_data; + +#ifdef IP_BIND_ADDRESS_NO_PORT + if (flags & ARES_SOCKET_BIND_TCP && flags & ARES_SOCKET_BIND_CLIENT) { + int opt = 1; + (void)setsockopt(sock, SOL_IP, IP_BIND_ADDRESS_NO_PORT, &opt, sizeof(opt)); + } +#else + (void)flags; +#endif + + return bind(sock, address, address_len); +} + +static unsigned int default_aif_nametoindex(const char *ifname, void *user_data) +{ + (void)user_data; + return ares_os_if_nametoindex(ifname); +} + +static const char *default_aif_indextoname(unsigned int ifindex, + char *ifname_buf, + size_t ifname_buf_len, + void *user_data) +{ + (void)user_data; + return ares_os_if_indextoname(ifindex, ifname_buf, ifname_buf_len); +} + +static const struct ares_socket_functions_ex default_socket_functions = { + 1, + ARES_SOCKFUNC_FLAG_NONBLOCKING, + default_asocket, + default_aclose, + default_asetsockopt, + default_aconnect, + default_arecvfrom, + default_asendto, + default_agetsockname, + default_abind, + default_aif_nametoindex, + default_aif_indextoname +}; + +void ares_set_socket_functions_def(ares_channel_t *channel) +{ + ares_set_socket_functions_ex(channel, &default_socket_functions, NULL); +} + +static int legacycb_aclose(ares_socket_t sock, void *user_data) +{ + ares_channel_t *channel = user_data; + + if (channel->legacy_sock_funcs != NULL && + channel->legacy_sock_funcs->aclose != NULL) { + return channel->legacy_sock_funcs->aclose( + sock, channel->legacy_sock_funcs_cb_data); + } + + return default_aclose(sock, NULL); +} + +static ares_socket_t legacycb_asocket(int domain, int type, int protocol, + void *user_data) +{ + ares_channel_t *channel = user_data; + + if (channel->legacy_sock_funcs != NULL && + channel->legacy_sock_funcs->asocket != NULL) { + return channel->legacy_sock_funcs->asocket( + domain, type, protocol, channel->legacy_sock_funcs_cb_data); + } + + return default_asocket(domain, type, protocol, NULL); +} + +static int legacycb_asetsockopt(ares_socket_t sock, ares_socket_opt_t opt, + const void *val, ares_socklen_t val_size, + void *user_data) +{ + (void)sock; + (void)opt; + (void)val; + (void)val_size; + (void)user_data; + SET_SOCKERRNO(ENOSYS); + return -1; +} + +static int legacycb_aconnect(ares_socket_t sock, const struct sockaddr *address, + ares_socklen_t address_len, unsigned int flags, + void *user_data) +{ + ares_channel_t *channel = user_data; + + if (channel->legacy_sock_funcs != NULL && + channel->legacy_sock_funcs->aconnect != NULL) { + return channel->legacy_sock_funcs->aconnect( + sock, address, address_len, channel->legacy_sock_funcs_cb_data); + } + + return default_aconnect(sock, address, address_len, flags, NULL); +} + +static ares_ssize_t legacycb_arecvfrom(ares_socket_t sock, void *buffer, + size_t length, int flags, + struct sockaddr *address, + ares_socklen_t *address_len, + void *user_data) +{ + ares_channel_t *channel = user_data; + + if (channel->legacy_sock_funcs != NULL && + channel->legacy_sock_funcs->arecvfrom != NULL) { + if (address != NULL && address_len != NULL) { + memset(address, 0, (size_t)*address_len); + address->sa_family = AF_UNSPEC; + } + return channel->legacy_sock_funcs->arecvfrom( + sock, buffer, length, flags, address, address_len, + channel->legacy_sock_funcs_cb_data); + } + + return default_arecvfrom(sock, buffer, length, flags, address, address_len, + NULL); +} + +static ares_ssize_t legacycb_asendto(ares_socket_t sock, const void *buffer, + size_t length, int flags, + const struct sockaddr *address, + ares_socklen_t address_len, + void *user_data) +{ + ares_channel_t *channel = user_data; + + if (channel->legacy_sock_funcs != NULL && + channel->legacy_sock_funcs->asendv != NULL) { + struct iovec vec; + vec.iov_base = (void *)((size_t)buffer); /* Cast off const */ + vec.iov_len = length; + return channel->legacy_sock_funcs->asendv( + sock, &vec, 1, channel->legacy_sock_funcs_cb_data); + } + + return default_asendto(sock, buffer, length, flags, address, address_len, + NULL); +} + + +static const struct ares_socket_functions_ex legacy_socket_functions = { + 1, + 0, + legacycb_asocket, + legacycb_aclose, + legacycb_asetsockopt, + legacycb_aconnect, + legacycb_arecvfrom, + legacycb_asendto, + NULL, /* agetsockname */ + NULL, /* abind */ + NULL, /* aif_nametoindex */ + NULL /* aif_indextoname */ +}; + +void ares_set_socket_functions(ares_channel_t *channel, + const struct ares_socket_functions *funcs, + void *data) +{ + if (channel == NULL || channel->optmask & ARES_OPT_EVENT_THREAD) { + return; + } + + channel->legacy_sock_funcs = funcs; + channel->legacy_sock_funcs_cb_data = data; + ares_set_socket_functions_ex(channel, &legacy_socket_functions, channel); +} diff --git a/deps/cares/src/lib/ares_setup.h b/deps/cares/src/lib/ares_setup.h index b6ce077ff64758..8890c3c338bf15 100644 --- a/deps/cares/src/lib/ares_setup.h +++ b/deps/cares/src/lib/ares_setup.h @@ -199,51 +199,15 @@ #endif -#ifdef __hpux -# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL) -# ifdef _APP32_64BIT_OFF_T -# define OLD_APP32_64BIT_OFF_T _APP32_64BIT_OFF_T -# undef _APP32_64BIT_OFF_T -# else -# undef OLD_APP32_64BIT_OFF_T -# endif -# endif -#endif - -#ifdef __hpux -# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL) -# ifdef OLD_APP32_64BIT_OFF_T -# define _APP32_64BIT_OFF_T OLD_APP32_64BIT_OFF_T -# undef OLD_APP32_64BIT_OFF_T -# endif -# endif -#endif - - -/* - * Definition of timeval struct for platforms that don't have it. - */ +/* Definition of timeval struct for platforms that don't have it. */ #ifndef HAVE_STRUCT_TIMEVAL struct timeval { - long tv_sec; - long tv_usec; + ares_int64_t tv_sec; + long tv_usec; }; #endif -/* - * Function-like macro definition used to close a socket. - */ - -#if defined(HAVE_CLOSESOCKET) -# define sclose(x) closesocket((x)) -#elif defined(HAVE_CLOSESOCKET_CAMEL) -# define sclose(x) CloseSocket((x)) -#elif defined(HAVE_CLOSE_S) -# define sclose(x) close_s((x)) -#else -# define sclose(x) close((x)) -#endif /* * Macro used to include code only in debug builds. @@ -257,111 +221,4 @@ struct timeval { } while (0) #endif -/* - * Macro SOCKERRNO / SET_SOCKERRNO() returns / sets the *socket-related* errno - * (or equivalent) on this platform to hide platform details to code using it. - */ - -#ifdef USE_WINSOCK -# define SOCKERRNO ((int)WSAGetLastError()) -# define SET_SOCKERRNO(x) (WSASetLastError((int)(x))) -#else -# define SOCKERRNO (errno) -# define SET_SOCKERRNO(x) (errno = (x)) -#endif - - -/* - * Macro ERRNO / SET_ERRNO() returns / sets the NOT *socket-related* errno - * (or equivalent) on this platform to hide platform details to code using it. - */ - -#if defined(WIN32) && !defined(WATT32) -# define ERRNO ((int)GetLastError()) -# define SET_ERRNO(x) (SetLastError((DWORD)(x))) -#else -# define ERRNO (errno) -# define SET_ERRNO(x) (errno = (x)) -#endif - - -/* - * Portable error number symbolic names defined to Winsock error codes. - */ - -#ifdef USE_WINSOCK -# undef EBADF /* override definition in errno.h */ -# define EBADF WSAEBADF -# undef EINTR /* override definition in errno.h */ -# define EINTR WSAEINTR -# undef EINVAL /* override definition in errno.h */ -# define EINVAL WSAEINVAL -# undef EWOULDBLOCK /* override definition in errno.h */ -# define EWOULDBLOCK WSAEWOULDBLOCK -# undef EINPROGRESS /* override definition in errno.h */ -# define EINPROGRESS WSAEINPROGRESS -# undef EALREADY /* override definition in errno.h */ -# define EALREADY WSAEALREADY -# undef ENOTSOCK /* override definition in errno.h */ -# define ENOTSOCK WSAENOTSOCK -# undef EDESTADDRREQ /* override definition in errno.h */ -# define EDESTADDRREQ WSAEDESTADDRREQ -# undef EMSGSIZE /* override definition in errno.h */ -# define EMSGSIZE WSAEMSGSIZE -# undef EPROTOTYPE /* override definition in errno.h */ -# define EPROTOTYPE WSAEPROTOTYPE -# undef ENOPROTOOPT /* override definition in errno.h */ -# define ENOPROTOOPT WSAENOPROTOOPT -# undef EPROTONOSUPPORT /* override definition in errno.h */ -# define EPROTONOSUPPORT WSAEPROTONOSUPPORT -# define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT -# undef EOPNOTSUPP /* override definition in errno.h */ -# define EOPNOTSUPP WSAEOPNOTSUPP -# define EPFNOSUPPORT WSAEPFNOSUPPORT -# undef EAFNOSUPPORT /* override definition in errno.h */ -# define EAFNOSUPPORT WSAEAFNOSUPPORT -# undef EADDRINUSE /* override definition in errno.h */ -# define EADDRINUSE WSAEADDRINUSE -# undef EADDRNOTAVAIL /* override definition in errno.h */ -# define EADDRNOTAVAIL WSAEADDRNOTAVAIL -# undef ENETDOWN /* override definition in errno.h */ -# define ENETDOWN WSAENETDOWN -# undef ENETUNREACH /* override definition in errno.h */ -# define ENETUNREACH WSAENETUNREACH -# undef ENETRESET /* override definition in errno.h */ -# define ENETRESET WSAENETRESET -# undef ECONNABORTED /* override definition in errno.h */ -# define ECONNABORTED WSAECONNABORTED -# undef ECONNRESET /* override definition in errno.h */ -# define ECONNRESET WSAECONNRESET -# undef ENOBUFS /* override definition in errno.h */ -# define ENOBUFS WSAENOBUFS -# undef EISCONN /* override definition in errno.h */ -# define EISCONN WSAEISCONN -# undef ENOTCONN /* override definition in errno.h */ -# define ENOTCONN WSAENOTCONN -# define ESHUTDOWN WSAESHUTDOWN -# define ETOOMANYREFS WSAETOOMANYREFS -# undef ETIMEDOUT /* override definition in errno.h */ -# define ETIMEDOUT WSAETIMEDOUT -# undef ECONNREFUSED /* override definition in errno.h */ -# define ECONNREFUSED WSAECONNREFUSED -# undef ELOOP /* override definition in errno.h */ -# define ELOOP WSAELOOP -# ifndef ENAMETOOLONG /* possible previous definition in errno.h */ -# define ENAMETOOLONG WSAENAMETOOLONG -# endif -# define EHOSTDOWN WSAEHOSTDOWN -# undef EHOSTUNREACH /* override definition in errno.h */ -# define EHOSTUNREACH WSAEHOSTUNREACH -# ifndef ENOTEMPTY /* possible previous definition in errno.h */ -# define ENOTEMPTY WSAENOTEMPTY -# endif -# define EPROCLIM WSAEPROCLIM -# define EUSERS WSAEUSERS -# define EDQUOT WSAEDQUOT -# define ESTALE WSAESTALE -# define EREMOTE WSAEREMOTE -#endif - #endif /* __ARES_SETUP_H */ diff --git a/deps/cares/src/lib/ares_socket.c b/deps/cares/src/lib/ares_socket.c new file mode 100644 index 00000000000000..df02fd61b60b14 --- /dev/null +++ b/deps/cares/src/lib/ares_socket.c @@ -0,0 +1,424 @@ +/* MIT License + * + * Copyright (c) Massachusetts Institute of Technology + * Copyright (c) The c-ares project and its contributors + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ +#include "ares_private.h" +#ifdef HAVE_SYS_UIO_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_NETINET_TCP_H +# include +#endif +#ifdef HAVE_NETDB_H +# include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif + +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_IOCTL_H +# include +#endif +#ifdef NETWARE +# include +#endif + +#include +#include +#include + +static ares_conn_err_t ares_socket_deref_error(int err) +{ + switch (err) { +#if defined(EWOULDBLOCK) + case EWOULDBLOCK: + return ARES_CONN_ERR_WOULDBLOCK; +#endif +#if defined(EAGAIN) && (!defined(EWOULDBLOCK) || EAGAIN != EWOULDBLOCK) + case EAGAIN: + return ARES_CONN_ERR_WOULDBLOCK; +#endif + case EINPROGRESS: + return ARES_CONN_ERR_WOULDBLOCK; + case ENETDOWN: + return ARES_CONN_ERR_NETDOWN; + case ENETUNREACH: + return ARES_CONN_ERR_NETUNREACH; + case ECONNABORTED: + return ARES_CONN_ERR_CONNABORTED; + case ECONNRESET: + return ARES_CONN_ERR_CONNRESET; + case ECONNREFUSED: + return ARES_CONN_ERR_CONNREFUSED; + case ETIMEDOUT: + return ARES_CONN_ERR_CONNTIMEDOUT; + case EHOSTDOWN: + return ARES_CONN_ERR_HOSTDOWN; + case EHOSTUNREACH: + return ARES_CONN_ERR_HOSTUNREACH; + case EINTR: + return ARES_CONN_ERR_INTERRUPT; + case EAFNOSUPPORT: + return ARES_CONN_ERR_AFNOSUPPORT; + case EADDRNOTAVAIL: + return ARES_CONN_ERR_BADADDR; + default: + break; + } + + return ARES_CONN_ERR_FAILURE; +} + +ares_bool_t ares_sockaddr_addr_eq(const struct sockaddr *sa, + const struct ares_addr *aa) +{ + const void *addr1; + const void *addr2; + + if (sa->sa_family == aa->family) { + switch (aa->family) { + case AF_INET: + addr1 = &aa->addr.addr4; + addr2 = &(CARES_INADDR_CAST(const struct sockaddr_in *, sa))->sin_addr; + if (memcmp(addr1, addr2, sizeof(aa->addr.addr4)) == 0) { + return ARES_TRUE; /* match */ + } + break; + case AF_INET6: + addr1 = &aa->addr.addr6; + addr2 = + &(CARES_INADDR_CAST(const struct sockaddr_in6 *, sa))->sin6_addr; + if (memcmp(addr1, addr2, sizeof(aa->addr.addr6)) == 0) { + return ARES_TRUE; /* match */ + } + break; + default: + break; /* LCOV_EXCL_LINE */ + } + } + return ARES_FALSE; /* different */ +} + +ares_conn_err_t ares_socket_write(ares_channel_t *channel, ares_socket_t fd, + const void *data, size_t len, size_t *written, + const struct sockaddr *sa, + ares_socklen_t salen) +{ + int flags = 0; + ares_ssize_t rv; + ares_conn_err_t err = ARES_CONN_ERR_SUCCESS; + +#ifdef HAVE_MSG_NOSIGNAL + flags |= MSG_NOSIGNAL; +#endif + + rv = channel->sock_funcs.asendto(fd, data, len, flags, sa, salen, + channel->sock_func_cb_data); + if (rv <= 0) { + err = ares_socket_deref_error(SOCKERRNO); + } else { + *written = (size_t)rv; + } + return err; +} + +ares_conn_err_t ares_socket_recv(ares_channel_t *channel, ares_socket_t s, + ares_bool_t is_tcp, void *data, + size_t data_len, size_t *read_bytes) +{ + ares_ssize_t rv; + + *read_bytes = 0; + + rv = channel->sock_funcs.arecvfrom(s, data, data_len, 0, NULL, 0, + channel->sock_func_cb_data); + + if (rv > 0) { + *read_bytes = (size_t)rv; + return ARES_CONN_ERR_SUCCESS; + } + + if (rv == 0) { + /* UDP allows 0-byte packets and is connectionless, so this is success */ + if (!is_tcp) { + return ARES_CONN_ERR_SUCCESS; + } else { + return ARES_CONN_ERR_CONNCLOSED; + } + } + + /* If we're here, rv<0 */ + return ares_socket_deref_error(SOCKERRNO); +} + +ares_conn_err_t ares_socket_recvfrom(ares_channel_t *channel, ares_socket_t s, + ares_bool_t is_tcp, void *data, + size_t data_len, int flags, + struct sockaddr *from, + ares_socklen_t *from_len, + size_t *read_bytes) +{ + ares_ssize_t rv; + + rv = channel->sock_funcs.arecvfrom(s, data, data_len, flags, from, from_len, + channel->sock_func_cb_data); + + if (rv > 0) { + *read_bytes = (size_t)rv; + return ARES_CONN_ERR_SUCCESS; + } + + if (rv == 0) { + /* UDP allows 0-byte packets and is connectionless, so this is success */ + if (!is_tcp) { + return ARES_CONN_ERR_SUCCESS; + } else { + return ARES_CONN_ERR_CONNCLOSED; + } + } + + /* If we're here, rv<0 */ + return ares_socket_deref_error(SOCKERRNO); +} + +ares_conn_err_t ares_socket_enable_tfo(const ares_channel_t *channel, + ares_socket_t fd) +{ + ares_bool_t opt = ARES_TRUE; + + if (channel->sock_funcs.asetsockopt(fd, ARES_SOCKET_OPT_TCP_FASTOPEN, + (void *)&opt, sizeof(opt), + channel->sock_func_cb_data) != 0) { + return ARES_CONN_ERR_NOTIMP; + } + + return ARES_CONN_ERR_SUCCESS; +} + +ares_status_t ares_socket_configure(ares_channel_t *channel, int family, + ares_bool_t is_tcp, ares_socket_t fd) +{ + union { + struct sockaddr sa; + struct sockaddr_in sa4; + struct sockaddr_in6 sa6; + } local; + + ares_socklen_t bindlen = 0; + int rv; + unsigned int bind_flags = 0; + + /* Set the socket's send and receive buffer sizes. */ + if (channel->socket_send_buffer_size > 0) { + rv = channel->sock_funcs.asetsockopt( + fd, ARES_SOCKET_OPT_SENDBUF_SIZE, + (void *)&channel->socket_send_buffer_size, + sizeof(channel->socket_send_buffer_size), channel->sock_func_cb_data); + if (rv != 0 && SOCKERRNO != ENOSYS) { + return ARES_ECONNREFUSED; /* LCOV_EXCL_LINE: UntestablePath */ + } + } + + if (channel->socket_receive_buffer_size > 0) { + rv = channel->sock_funcs.asetsockopt( + fd, ARES_SOCKET_OPT_RECVBUF_SIZE, + (void *)&channel->socket_receive_buffer_size, + sizeof(channel->socket_receive_buffer_size), channel->sock_func_cb_data); + if (rv != 0 && SOCKERRNO != ENOSYS) { + return ARES_ECONNREFUSED; /* LCOV_EXCL_LINE: UntestablePath */ + } + } + + /* Bind to network interface if configured */ + if (ares_strlen(channel->local_dev_name)) { + /* Prior versions silently ignored failure, so we need to maintain that + * compatibility */ + (void)channel->sock_funcs.asetsockopt( + fd, ARES_SOCKET_OPT_BIND_DEVICE, channel->local_dev_name, + sizeof(channel->local_dev_name), channel->sock_func_cb_data); + } + + /* Bind to ip address if configured */ + if (family == AF_INET && channel->local_ip4) { + memset(&local.sa4, 0, sizeof(local.sa4)); + local.sa4.sin_family = AF_INET; + local.sa4.sin_addr.s_addr = htonl(channel->local_ip4); + bindlen = sizeof(local.sa4); + } else if (family == AF_INET6 && + memcmp(channel->local_ip6, ares_in6addr_any._S6_un._S6_u8, + sizeof(channel->local_ip6)) != 0) { + /* Only if not link-local and an ip other than "::" is specified */ + memset(&local.sa6, 0, sizeof(local.sa6)); + local.sa6.sin6_family = AF_INET6; + memcpy(&local.sa6.sin6_addr, channel->local_ip6, + sizeof(channel->local_ip6)); + bindlen = sizeof(local.sa6); + } + + + if (bindlen && channel->sock_funcs.abind != NULL) { + bind_flags |= ARES_SOCKET_BIND_CLIENT; + if (is_tcp) { + bind_flags |= ARES_SOCKET_BIND_TCP; + } + if (channel->sock_funcs.abind(fd, bind_flags, &local.sa, bindlen, + channel->sock_func_cb_data) != 0) { + return ARES_ECONNREFUSED; + } + } + + return ARES_SUCCESS; +} + +ares_bool_t ares_sockaddr_to_ares_addr(struct ares_addr *ares_addr, + unsigned short *port, + const struct sockaddr *sockaddr) +{ + if (sockaddr->sa_family == AF_INET) { + /* NOTE: memcpy sockaddr_in due to alignment issues found by UBSAN due to + * dnsinfo packing on MacOS */ + struct sockaddr_in sockaddr_in; + memcpy(&sockaddr_in, sockaddr, sizeof(sockaddr_in)); + + ares_addr->family = AF_INET; + memcpy(&ares_addr->addr.addr4, &(sockaddr_in.sin_addr), + sizeof(ares_addr->addr.addr4)); + + if (port) { + *port = ntohs(sockaddr_in.sin_port); + } + return ARES_TRUE; + } + + if (sockaddr->sa_family == AF_INET6) { + /* NOTE: memcpy sockaddr_in6 due to alignment issues found by UBSAN due to + * dnsinfo packing on MacOS */ + struct sockaddr_in6 sockaddr_in6; + memcpy(&sockaddr_in6, sockaddr, sizeof(sockaddr_in6)); + + ares_addr->family = AF_INET6; + memcpy(&ares_addr->addr.addr6, &(sockaddr_in6.sin6_addr), + sizeof(ares_addr->addr.addr6)); + if (port) { + *port = ntohs(sockaddr_in6.sin6_port); + } + return ARES_TRUE; + } + + return ARES_FALSE; +} + +ares_conn_err_t ares_socket_open(ares_socket_t *sock, ares_channel_t *channel, + int af, int type, int protocol) +{ + ares_socket_t s; + + *sock = ARES_SOCKET_BAD; + + s = + channel->sock_funcs.asocket(af, type, protocol, channel->sock_func_cb_data); + + if (s == ARES_SOCKET_BAD) { + return ares_socket_deref_error(SOCKERRNO); + } + + *sock = s; + + return ARES_CONN_ERR_SUCCESS; +} + +ares_conn_err_t ares_socket_connect(ares_channel_t *channel, + ares_socket_t sockfd, ares_bool_t is_tfo, + const struct sockaddr *addr, + ares_socklen_t addrlen) +{ + ares_conn_err_t err = ARES_CONN_ERR_SUCCESS; + unsigned int flags = 0; + + if (is_tfo) { + flags |= ARES_SOCKET_CONN_TCP_FASTOPEN; + } + + do { + int rv; + + rv = channel->sock_funcs.aconnect(sockfd, addr, addrlen, flags, + channel->sock_func_cb_data); + + if (rv < 0) { + err = ares_socket_deref_error(SOCKERRNO); + } else { + err = ARES_CONN_ERR_SUCCESS; + } + } while (err == ARES_CONN_ERR_INTERRUPT); + + return err; +} + +void ares_socket_close(ares_channel_t *channel, ares_socket_t s) +{ + if (channel == NULL || s == ARES_SOCKET_BAD) { + return; + } + + channel->sock_funcs.aclose(s, channel->sock_func_cb_data); +} + +void ares_set_socket_callback(ares_channel_t *channel, + ares_sock_create_callback cb, void *data) +{ + if (channel == NULL) { + return; + } + channel->sock_create_cb = cb; + channel->sock_create_cb_data = data; +} + +void ares_set_socket_configure_callback(ares_channel_t *channel, + ares_sock_config_callback cb, + void *data) +{ + if (channel == NULL || channel->optmask & ARES_OPT_EVENT_THREAD) { + return; + } + channel->sock_config_cb = cb; + channel->sock_config_cb_data = data; +} + +void ares_set_pending_write_cb(ares_channel_t *channel, + ares_pending_write_cb callback, void *user_data) +{ + if (channel == NULL || channel->optmask & ARES_OPT_EVENT_THREAD) { + return; + } + channel->notify_pending_write_cb = callback; + channel->notify_pending_write_cb_data = user_data; +} diff --git a/deps/cares/src/lib/ares_socket.h b/deps/cares/src/lib/ares_socket.h new file mode 100644 index 00000000000000..24a99ab3316943 --- /dev/null +++ b/deps/cares/src/lib/ares_socket.h @@ -0,0 +1,163 @@ +/* MIT License + * + * Copyright (c) 2024 Brad House + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ + +#ifndef __ARES_SOCKET_H +#define __ARES_SOCKET_H + +/* Macro SOCKERRNO / SET_SOCKERRNO() returns / sets the *socket-related* errno + * (or equivalent) on this platform to hide platform details to code using it. + */ +#ifdef USE_WINSOCK +# define SOCKERRNO ((int)WSAGetLastError()) +# define SET_SOCKERRNO(x) (WSASetLastError((int)(x))) +#else +# define SOCKERRNO (errno) +# define SET_SOCKERRNO(x) (errno = (x)) +#endif + +/* Portable error number symbolic names defined to Winsock error codes. */ +#ifdef USE_WINSOCK +# undef EBADF /* override definition in errno.h */ +# define EBADF WSAEBADF +# undef EINTR /* override definition in errno.h */ +# define EINTR WSAEINTR +# undef EINVAL /* override definition in errno.h */ +# define EINVAL WSAEINVAL +# undef EWOULDBLOCK /* override definition in errno.h */ +# define EWOULDBLOCK WSAEWOULDBLOCK +# undef EINPROGRESS /* override definition in errno.h */ +# define EINPROGRESS WSAEINPROGRESS +# undef EALREADY /* override definition in errno.h */ +# define EALREADY WSAEALREADY +# undef ENOTSOCK /* override definition in errno.h */ +# define ENOTSOCK WSAENOTSOCK +# undef EDESTADDRREQ /* override definition in errno.h */ +# define EDESTADDRREQ WSAEDESTADDRREQ +# undef EMSGSIZE /* override definition in errno.h */ +# define EMSGSIZE WSAEMSGSIZE +# undef EPROTOTYPE /* override definition in errno.h */ +# define EPROTOTYPE WSAEPROTOTYPE +# undef ENOPROTOOPT /* override definition in errno.h */ +# define ENOPROTOOPT WSAENOPROTOOPT +# undef EPROTONOSUPPORT /* override definition in errno.h */ +# define EPROTONOSUPPORT WSAEPROTONOSUPPORT +# define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +# undef EOPNOTSUPP /* override definition in errno.h */ +# define EOPNOTSUPP WSAEOPNOTSUPP +# undef ENOSYS /* override definition in errno.h */ +# define ENOSYS WSAEOPNOTSUPP +# define EPFNOSUPPORT WSAEPFNOSUPPORT +# undef EAFNOSUPPORT /* override definition in errno.h */ +# define EAFNOSUPPORT WSAEAFNOSUPPORT +# undef EADDRINUSE /* override definition in errno.h */ +# define EADDRINUSE WSAEADDRINUSE +# undef EADDRNOTAVAIL /* override definition in errno.h */ +# define EADDRNOTAVAIL WSAEADDRNOTAVAIL +# undef ENETDOWN /* override definition in errno.h */ +# define ENETDOWN WSAENETDOWN +# undef ENETUNREACH /* override definition in errno.h */ +# define ENETUNREACH WSAENETUNREACH +# undef ENETRESET /* override definition in errno.h */ +# define ENETRESET WSAENETRESET +# undef ECONNABORTED /* override definition in errno.h */ +# define ECONNABORTED WSAECONNABORTED +# undef ECONNRESET /* override definition in errno.h */ +# define ECONNRESET WSAECONNRESET +# undef ENOBUFS /* override definition in errno.h */ +# define ENOBUFS WSAENOBUFS +# undef EISCONN /* override definition in errno.h */ +# define EISCONN WSAEISCONN +# undef ENOTCONN /* override definition in errno.h */ +# define ENOTCONN WSAENOTCONN +# define ESHUTDOWN WSAESHUTDOWN +# define ETOOMANYREFS WSAETOOMANYREFS +# undef ETIMEDOUT /* override definition in errno.h */ +# define ETIMEDOUT WSAETIMEDOUT +# undef ECONNREFUSED /* override definition in errno.h */ +# define ECONNREFUSED WSAECONNREFUSED +# undef ELOOP /* override definition in errno.h */ +# define ELOOP WSAELOOP +# ifndef ENAMETOOLONG /* possible previous definition in errno.h */ +# define ENAMETOOLONG WSAENAMETOOLONG +# endif +# define EHOSTDOWN WSAEHOSTDOWN +# undef EHOSTUNREACH /* override definition in errno.h */ +# define EHOSTUNREACH WSAEHOSTUNREACH +# ifndef ENOTEMPTY /* possible previous definition in errno.h */ +# define ENOTEMPTY WSAENOTEMPTY +# endif +# define EPROCLIM WSAEPROCLIM +# define EUSERS WSAEUSERS +# define EDQUOT WSAEDQUOT +# define ESTALE WSAESTALE +# define EREMOTE WSAEREMOTE +#endif + +/*! Socket errors */ +typedef enum { + ARES_CONN_ERR_SUCCESS = 0, /*!< Success */ + ARES_CONN_ERR_WOULDBLOCK = 1, /*!< Operation would block */ + ARES_CONN_ERR_CONNCLOSED = 2, /*!< Connection closed (gracefully) */ + ARES_CONN_ERR_CONNABORTED = 3, /*!< Connection Aborted */ + ARES_CONN_ERR_CONNRESET = 4, /*!< Connection Reset */ + ARES_CONN_ERR_CONNREFUSED = 5, /*!< Connection Refused */ + ARES_CONN_ERR_CONNTIMEDOUT = 6, /*!< Connection Timed Out */ + ARES_CONN_ERR_HOSTDOWN = 7, /*!< Host Down */ + ARES_CONN_ERR_HOSTUNREACH = 8, /*!< Host Unreachable */ + ARES_CONN_ERR_NETDOWN = 9, /*!< Network Down */ + ARES_CONN_ERR_NETUNREACH = 10, /*!< Network Unreachable */ + ARES_CONN_ERR_INTERRUPT = 11, /*!< Call interrupted by signal, repeat */ + ARES_CONN_ERR_AFNOSUPPORT = 12, /*!< Address family not supported */ + ARES_CONN_ERR_BADADDR = 13, /*!< Bad Address / Unavailable */ + ARES_CONN_ERR_NOMEM = 14, /*!< Out of memory */ + ARES_CONN_ERR_INVALID = 15, /*!< Invalid Usage */ + ARES_CONN_ERR_TOOLARGE = 16, /*!< Request size too large */ + ARES_CONN_ERR_NOTIMP = 17, /*!< Not implemented */ + ARES_CONN_ERR_FAILURE = 99 /*!< Generic failure */ +} ares_conn_err_t; + +ares_bool_t ares_sockaddr_addr_eq(const struct sockaddr *sa, + const struct ares_addr *aa); +ares_status_t ares_socket_configure(ares_channel_t *channel, int family, + ares_bool_t is_tcp, ares_socket_t fd); +ares_conn_err_t ares_socket_enable_tfo(const ares_channel_t *channel, + ares_socket_t fd); +ares_conn_err_t ares_socket_open(ares_socket_t *sock, ares_channel_t *channel, + int af, int type, int protocol); +ares_bool_t ares_socket_try_again(int errnum); +void ares_socket_close(ares_channel_t *channel, ares_socket_t s); +ares_conn_err_t ares_socket_connect(ares_channel_t *channel, + ares_socket_t sockfd, ares_bool_t is_tfo, + const struct sockaddr *addr, + ares_socklen_t addrlen); +ares_bool_t ares_sockaddr_to_ares_addr(struct ares_addr *ares_addr, + unsigned short *port, + const struct sockaddr *sockaddr); +ares_conn_err_t ares_socket_write(ares_channel_t *channel, ares_socket_t fd, + const void *data, size_t len, size_t *written, + const struct sockaddr *sa, + ares_socklen_t salen); +#endif diff --git a/deps/cares/src/lib/ares__sortaddrinfo.c b/deps/cares/src/lib/ares_sortaddrinfo.c similarity index 94% rename from deps/cares/src/lib/ares__sortaddrinfo.c rename to deps/cares/src/lib/ares_sortaddrinfo.c index 1aab81ecf84ce7..e6c21ea0ad712a 100644 --- a/deps/cares/src/lib/ares__sortaddrinfo.c +++ b/deps/cares/src/lib/ares_sortaddrinfo.c @@ -345,8 +345,9 @@ static int rfc6724_compare(const void *ptr1, const void *ptr2) static int find_src_addr(ares_channel_t *channel, const struct sockaddr *addr, struct sockaddr *src_addr) { - ares_socket_t sock; - ares_socklen_t len; + ares_socket_t sock; + ares_socklen_t len; + ares_conn_err_t err; switch (addr->sa_family) { case AF_INET: @@ -360,25 +361,27 @@ static int find_src_addr(ares_channel_t *channel, const struct sockaddr *addr, return 0; } - sock = ares__open_socket(channel, addr->sa_family, SOCK_DGRAM, IPPROTO_UDP); - if (sock == ARES_SOCKET_BAD) { - if (SOCKERRNO == EAFNOSUPPORT) { - return 0; - } else { - return -1; - } + err = + ares_socket_open(&sock, channel, addr->sa_family, SOCK_DGRAM, IPPROTO_UDP); + if (err == ARES_CONN_ERR_AFNOSUPPORT) { + return 0; + } else if (err != ARES_CONN_ERR_SUCCESS) { + return -1; } - if (ares__connect_socket(channel, sock, addr, len) != ARES_SUCCESS) { - ares__close_socket(channel, sock); + err = ares_socket_connect(channel, sock, ARES_FALSE, addr, len); + if (err != ARES_CONN_ERR_SUCCESS && err != ARES_CONN_ERR_WOULDBLOCK) { + ares_socket_close(channel, sock); return 0; } - if (getsockname(sock, src_addr, &len) != 0) { - ares__close_socket(channel, sock); + if (channel->sock_funcs.agetsockname == NULL || + channel->sock_funcs.agetsockname(sock, src_addr, &len, + channel->sock_func_cb_data) != 0) { + ares_socket_close(channel, sock); return -1; } - ares__close_socket(channel, sock); + ares_socket_close(channel, sock); return 1; } @@ -386,8 +389,8 @@ static int find_src_addr(ares_channel_t *channel, const struct sockaddr *addr, * Sort the linked list starting at sentinel->ai_next in RFC6724 order. * Will leave the list unchanged if an error occurs. */ -ares_status_t ares__sortaddrinfo(ares_channel_t *channel, - struct ares_addrinfo_node *list_sentinel) +ares_status_t ares_sortaddrinfo(ares_channel_t *channel, + struct ares_addrinfo_node *list_sentinel) { struct ares_addrinfo_node *cur; size_t nelem = 0; diff --git a/deps/cares/src/lib/ares_sysconfig.c b/deps/cares/src/lib/ares_sysconfig.c index 61e6a423a7578a..9f0d7e5061ffe0 100644 --- a/deps/cares/src/lib/ares_sysconfig.c +++ b/deps/cares/src/lib/ares_sysconfig.c @@ -56,11 +56,11 @@ #endif #include "ares_inet_net_pton.h" -#include "ares_platform.h" #if defined(__MVS__) -static ares_status_t ares__init_sysconfig_mvs(ares_sysconfig_t *sysconfig) +static ares_status_t ares_init_sysconfig_mvs(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig) { struct __res_state *res = 0; size_t count4; @@ -99,9 +99,9 @@ static ares_status_t ares__init_sysconfig_mvs(ares_sysconfig_t *sysconfig) addr.addr.addr4.s_addr = addr_in->sin_addr.s_addr; addr.family = AF_INET; - status = - ares__sconfig_append(&sysconfig->sconfig, &addr, htons(addr_in->sin_port), - htons(addr_in->sin_port), NULL); + status = ares_sconfig_append(channel, &sysconfig->sconfig, &addr, + htons(addr_in->sin_port), + htons(addr_in->sin_port), NULL); if (status != ARES_SUCCESS) { return status; @@ -116,9 +116,9 @@ static ares_status_t ares__init_sysconfig_mvs(ares_sysconfig_t *sysconfig) memcpy(&(addr.addr.addr6), &(addr_in->sin6_addr), sizeof(addr_in->sin6_addr)); - status = - ares__sconfig_append(&sysconfig->sconfig, &addr, htons(addr_in->sin_port), - htons(addr_in->sin_port), NULL); + status = ares_sconfig_append(channel, &sysconfig->sconfig, &addr, + htons(addr_in->sin_port), + htons(addr_in->sin_port), NULL); if (status != ARES_SUCCESS) { return status; @@ -130,7 +130,8 @@ static ares_status_t ares__init_sysconfig_mvs(ares_sysconfig_t *sysconfig) #endif #if defined(__riscos__) -static ares_status_t ares__init_sysconfig_riscos(ares_sysconfig_t *sysconfig) +static ares_status_t ares_init_sysconfig_riscos(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig) { char *line; ares_status_t status = ARES_SUCCESS; @@ -153,8 +154,8 @@ static ares_status_t ares__init_sysconfig_riscos(ares_sysconfig_t *sysconfig) if (space) { *space = '\0'; } - status = - ares__sconfig_append_fromstr(&sysconfig->sconfig, pos, ARES_TRUE); + status = ares_sconfig_append_fromstr(channel, &sysconfig->sconfig, pos, + ARES_TRUE); if (status != ARES_SUCCESS) { break; } @@ -169,7 +170,8 @@ static ares_status_t ares__init_sysconfig_riscos(ares_sysconfig_t *sysconfig) #endif #if defined(WATT32) -static ares_status_t ares__init_sysconfig_watt32(ares_sysconfig_t *sysconfig) +static ares_status_t ares_init_sysconfig_watt32(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig) { size_t i; ares_status_t status; @@ -182,7 +184,8 @@ static ares_status_t ares__init_sysconfig_watt32(ares_sysconfig_t *sysconfig) addr.family = AF_INET; addr.addr.addr4.s_addr = htonl(def_nameservers[i]); - status = ares__sconfig_append(&sysconfig->sconfig, &addr, 0, 0, NULL); + status = + ares_sconfig_append(channel, &sysconfig->sconfig, &addr, 0, 0, NULL); if (status != ARES_SUCCESS) { return status; @@ -194,7 +197,8 @@ static ares_status_t ares__init_sysconfig_watt32(ares_sysconfig_t *sysconfig) #endif #if defined(ANDROID) || defined(__ANDROID__) -static ares_status_t ares__init_sysconfig_android(ares_sysconfig_t *sysconfig) +static ares_status_t ares_init_sysconfig_android(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig) { size_t i; char **dns_servers; @@ -211,8 +215,8 @@ static ares_status_t ares__init_sysconfig_android(ares_sysconfig_t *sysconfig) dns_servers = ares_get_android_server_list(MAX_DNS_PROPERTIES, &num_servers); if (dns_servers != NULL) { for (i = 0; i < num_servers; i++) { - status = ares__sconfig_append_fromstr(&sysconfig->sconfig, dns_servers[i], - ARES_TRUE); + status = ares_sconfig_append_fromstr(channel, &sysconfig->sconfig, + dns_servers[i], ARES_TRUE); if (status != ARES_SUCCESS) { return status; } @@ -224,7 +228,7 @@ static ares_status_t ares__init_sysconfig_android(ares_sysconfig_t *sysconfig) } domains = ares_get_android_search_domains_list(); - sysconfig->domains = ares__strsplit(domains, ", ", &sysconfig->ndomains); + sysconfig->domains = ares_strsplit(domains, ", ", &sysconfig->ndomains); ares_free(domains); # ifdef HAVE___SYSTEM_PROPERTY_GET @@ -243,8 +247,8 @@ static ares_status_t ares__init_sysconfig_android(ares_sysconfig_t *sysconfig) if (__system_property_get(propname, propvalue) < 1) { break; } - status = - ares__sconfig_append_fromstr(&sysconfig->sconfig, propvalue, ARES_TRUE); + status = ares_sconfig_append_fromstr(channel, &sysconfig->sconfig, + propvalue, ARES_TRUE); if (status != ARES_SUCCESS) { return status; } @@ -257,7 +261,9 @@ static ares_status_t ares__init_sysconfig_android(ares_sysconfig_t *sysconfig) #endif #if defined(CARES_USE_LIBRESOLV) -static ares_status_t ares__init_sysconfig_libresolv(ares_sysconfig_t *sysconfig) +static ares_status_t + ares_init_sysconfig_libresolv(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig) { struct __res_state res; ares_status_t status = ARES_SUCCESS; @@ -265,7 +271,7 @@ static ares_status_t ares__init_sysconfig_libresolv(ares_sysconfig_t *sysconfig) int nscount; size_t i; size_t entries = 0; - ares__buf_t *ipbuf = NULL; + ares_buf_t *ipbuf = NULL; memset(&res, 0, sizeof(res)); @@ -295,58 +301,58 @@ static ares_status_t ares__init_sysconfig_libresolv(ares_sysconfig_t *sysconfig) /* [ip]:port%iface */ - ipbuf = ares__buf_create(); + ipbuf = ares_buf_create(); if (ipbuf == NULL) { status = ARES_ENOMEM; goto done; } - status = ares__buf_append_str(ipbuf, "["); + status = ares_buf_append_str(ipbuf, "["); if (status != ARES_SUCCESS) { goto done; } - status = ares__buf_append_str(ipbuf, ipaddr); + status = ares_buf_append_str(ipbuf, ipaddr); if (status != ARES_SUCCESS) { goto done; } - status = ares__buf_append_str(ipbuf, "]"); + status = ares_buf_append_str(ipbuf, "]"); if (status != ARES_SUCCESS) { goto done; } if (port) { - status = ares__buf_append_str(ipbuf, ":"); + status = ares_buf_append_str(ipbuf, ":"); if (status != ARES_SUCCESS) { goto done; } - status = ares__buf_append_num_dec(ipbuf, port, 0); + status = ares_buf_append_num_dec(ipbuf, port, 0); if (status != ARES_SUCCESS) { goto done; } } if (ll_scope) { - status = ares__buf_append_str(ipbuf, "%"); + status = ares_buf_append_str(ipbuf, "%"); if (status != ARES_SUCCESS) { goto done; } - status = ares__buf_append_num_dec(ipbuf, ll_scope, 0); + status = ares_buf_append_num_dec(ipbuf, ll_scope, 0); if (status != ARES_SUCCESS) { goto done; } } - ipstr = ares__buf_finish_str(ipbuf, NULL); + ipstr = ares_buf_finish_str(ipbuf, NULL); ipbuf = NULL; if (ipstr == NULL) { status = ARES_ENOMEM; goto done; } - status = - ares__sconfig_append_fromstr(&sysconfig->sconfig, ipstr, ARES_TRUE); + status = ares_sconfig_append_fromstr(channel, &sysconfig->sconfig, ipstr, + ARES_TRUE); ares_free(ipstr); if (status != ARES_SUCCESS) { @@ -400,7 +406,7 @@ static ares_status_t ares__init_sysconfig_libresolv(ares_sysconfig_t *sysconfig) } done: - ares__buf_destroy(ipbuf); + ares_buf_destroy(ipbuf); res_ndestroy(&res); return status; } @@ -408,8 +414,8 @@ static ares_status_t ares__init_sysconfig_libresolv(ares_sysconfig_t *sysconfig) static void ares_sysconfig_free(ares_sysconfig_t *sysconfig) { - ares__llist_destroy(sysconfig->sconfig); - ares__strsplit_free(sysconfig->domains, sysconfig->ndomains); + ares_llist_destroy(sysconfig->sconfig); + ares_strsplit_free(sysconfig->domains, sysconfig->ndomains); ares_free(sysconfig->sortlist); ares_free(sysconfig->lookups); memset(sysconfig, 0, sizeof(*sysconfig)); @@ -421,7 +427,7 @@ static ares_status_t ares_sysconfig_apply(ares_channel_t *channel, ares_status_t status; if (sysconfig->sconfig && !(channel->optmask & ARES_OPT_SERVERS)) { - status = ares__servers_update(channel, sysconfig->sconfig, ARES_FALSE); + status = ares_servers_update(channel, sysconfig->sconfig, ARES_FALSE); if (status != ARES_SUCCESS) { return status; } @@ -431,12 +437,12 @@ static ares_status_t ares_sysconfig_apply(ares_channel_t *channel, /* Make sure we duplicate first then replace so even if there is * ARES_ENOMEM, the channel stays in a good state */ char **temp = - ares__strsplit_duplicate(sysconfig->domains, sysconfig->ndomains); + ares_strsplit_duplicate(sysconfig->domains, sysconfig->ndomains); if (temp == NULL) { return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ } - ares__strsplit_free(channel->domains, channel->ndomains); + ares_strsplit_free(channel->domains, channel->ndomains); channel->domains = temp; channel->ndomains = sysconfig->ndomains; } @@ -488,7 +494,7 @@ static ares_status_t ares_sysconfig_apply(ares_channel_t *channel, return ARES_SUCCESS; } -ares_status_t ares__init_by_sysconfig(ares_channel_t *channel) +ares_status_t ares_init_by_sysconfig(ares_channel_t *channel) { ares_status_t status; ares_sysconfig_t sysconfig; @@ -497,21 +503,21 @@ ares_status_t ares__init_by_sysconfig(ares_channel_t *channel) sysconfig.ndots = 1; /* Default value if not otherwise set */ #if defined(USE_WINSOCK) - status = ares__init_sysconfig_windows(&sysconfig); + status = ares_init_sysconfig_windows(channel, &sysconfig); #elif defined(__MVS__) - status = ares__init_sysconfig_mvs(&sysconfig); + status = ares_init_sysconfig_mvs(channel, &sysconfig); #elif defined(__riscos__) - status = ares__init_sysconfig_riscos(&sysconfig); + status = ares_init_sysconfig_riscos(channel, &sysconfig); #elif defined(WATT32) - status = ares__init_sysconfig_watt32(&sysconfig); + status = ares_init_sysconfig_watt32(channel, &sysconfig); #elif defined(ANDROID) || defined(__ANDROID__) - status = ares__init_sysconfig_android(&sysconfig); + status = ares_init_sysconfig_android(channel, &sysconfig); #elif defined(__APPLE__) - status = ares__init_sysconfig_macos(&sysconfig); + status = ares_init_sysconfig_macos(channel, &sysconfig); #elif defined(CARES_USE_LIBRESOLV) - status = ares__init_sysconfig_libresolv(&sysconfig); + status = ares_init_sysconfig_libresolv(channel, &sysconfig); #else - status = ares__init_sysconfig_files(channel, &sysconfig); + status = ares_init_sysconfig_files(channel, &sysconfig); #endif if (status != ARES_SUCCESS) { @@ -519,7 +525,7 @@ ares_status_t ares__init_by_sysconfig(ares_channel_t *channel) } /* Environment is supposed to override sysconfig */ - status = ares__init_by_environment(&sysconfig); + status = ares_init_by_environment(&sysconfig); if (status != ARES_SUCCESS) { goto done; } @@ -527,10 +533,10 @@ ares_status_t ares__init_by_sysconfig(ares_channel_t *channel) /* Lock when applying the configuration to the channel. Don't need to * lock prior to this. */ - ares__channel_lock(channel); + ares_channel_lock(channel); status = ares_sysconfig_apply(channel, &sysconfig); - ares__channel_unlock(channel); + ares_channel_unlock(channel); if (status != ARES_SUCCESS) { goto done; diff --git a/deps/cares/src/lib/ares_sysconfig_files.c b/deps/cares/src/lib/ares_sysconfig_files.c index 7b8bdbe41879d6..49bc330d9d346d 100644 --- a/deps/cares/src/lib/ares_sysconfig_files.c +++ b/deps/cares/src/lib/ares_sysconfig_files.c @@ -60,7 +60,6 @@ #endif #include "ares_inet_net_pton.h" -#include "ares_platform.h" static unsigned char ip_natural_mask(const struct ares_addr *addr) { @@ -110,7 +109,7 @@ static ares_bool_t sortlist_append(struct apattern **sortlist, size_t *nsort, return ARES_TRUE; } -static ares_status_t parse_sort(ares__buf_t *buf, struct apattern *pat) +static ares_status_t parse_sort(ares_buf_t *buf, struct apattern *pat) { ares_status_t status; const unsigned char ip_charset[] = "ABCDEFabcdef0123456789.:"; @@ -120,22 +119,22 @@ static ares_status_t parse_sort(ares__buf_t *buf, struct apattern *pat) memset(pat, 0, sizeof(*pat)); /* Consume any leading whitespace */ - ares__buf_consume_whitespace(buf, ARES_TRUE); + ares_buf_consume_whitespace(buf, ARES_TRUE); /* If no length, just ignore, return ENOTFOUND as an indicator */ - if (ares__buf_len(buf) == 0) { + if (ares_buf_len(buf) == 0) { return ARES_ENOTFOUND; } - ares__buf_tag(buf); + ares_buf_tag(buf); /* Consume ip address */ - if (ares__buf_consume_charset(buf, ip_charset, sizeof(ip_charset) - 1) == 0) { + if (ares_buf_consume_charset(buf, ip_charset, sizeof(ip_charset) - 1) == 0) { return ARES_EBADSTR; } /* Fetch ip address */ - status = ares__buf_tag_fetch_string(buf, ipaddr, sizeof(ipaddr)); + status = ares_buf_tag_fetch_string(buf, ipaddr, sizeof(ipaddr)); if (status != ARES_SUCCESS) { return status; } @@ -147,24 +146,24 @@ static ares_status_t parse_sort(ares__buf_t *buf, struct apattern *pat) } /* See if there is a subnet mask */ - if (ares__buf_begins_with(buf, (const unsigned char *)"/", 1)) { + if (ares_buf_begins_with(buf, (const unsigned char *)"/", 1)) { char maskstr[16]; const unsigned char ipv4_charset[] = "0123456789."; /* Consume / */ - ares__buf_consume(buf, 1); + ares_buf_consume(buf, 1); - ares__buf_tag(buf); + ares_buf_tag(buf); /* Consume mask */ - if (ares__buf_consume_charset(buf, ipv4_charset, - sizeof(ipv4_charset) - 1) == 0) { + if (ares_buf_consume_charset(buf, ipv4_charset, sizeof(ipv4_charset) - 1) == + 0) { return ARES_EBADSTR; } /* Fetch mask */ - status = ares__buf_tag_fetch_string(buf, maskstr, sizeof(maskstr)); + status = ares_buf_tag_fetch_string(buf, maskstr, sizeof(maskstr)); if (status != ARES_SUCCESS) { return status; } @@ -190,33 +189,34 @@ static ares_status_t parse_sort(ares__buf_t *buf, struct apattern *pat) return ARES_EBADSTR; } ptr = (const unsigned char *)&maskaddr.addr.addr4; - pat->mask = (unsigned char)(ares__count_bits_u8(ptr[0]) + - ares__count_bits_u8(ptr[1]) + - ares__count_bits_u8(ptr[2]) + - ares__count_bits_u8(ptr[3])); + pat->mask = (unsigned char)(ares_count_bits_u8(ptr[0]) + + ares_count_bits_u8(ptr[1]) + + ares_count_bits_u8(ptr[2]) + + ares_count_bits_u8(ptr[3])); } } else { pat->mask = ip_natural_mask(&pat->addr); } /* Consume any trailing whitespace */ - ares__buf_consume_whitespace(buf, ARES_TRUE); + ares_buf_consume_whitespace(buf, ARES_TRUE); /* If we have any trailing bytes other than whitespace, its a parse failure */ - if (ares__buf_len(buf) != 0) { + if (ares_buf_len(buf) != 0) { return ARES_EBADSTR; } return ARES_SUCCESS; } -ares_status_t ares__parse_sortlist(struct apattern **sortlist, size_t *nsort, - const char *str) +ares_status_t ares_parse_sortlist(struct apattern **sortlist, size_t *nsort, + const char *str) { - ares__buf_t *buf = NULL; - ares__llist_t *list = NULL; - ares_status_t status = ARES_SUCCESS; - ares__llist_node_t *node = NULL; + ares_buf_t *buf = NULL; + ares_status_t status = ARES_SUCCESS; + ares_array_t *arr = NULL; + size_t num = 0; + size_t i; if (sortlist == NULL || nsort == NULL || str == NULL) { return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ @@ -229,22 +229,23 @@ ares_status_t ares__parse_sortlist(struct apattern **sortlist, size_t *nsort, *sortlist = NULL; *nsort = 0; - buf = ares__buf_create_const((const unsigned char *)str, ares_strlen(str)); + buf = ares_buf_create_const((const unsigned char *)str, ares_strlen(str)); if (buf == NULL) { status = ARES_ENOMEM; goto done; } /* Split on space or semicolon */ - status = ares__buf_split(buf, (const unsigned char *)" ;", 2, - ARES_BUF_SPLIT_NONE, 0, &list); + status = ares_buf_split(buf, (const unsigned char *)" ;", 2, + ARES_BUF_SPLIT_NONE, 0, &arr); if (status != ARES_SUCCESS) { goto done; } - for (node = ares__llist_node_first(list); node != NULL; - node = ares__llist_node_next(node)) { - ares__buf_t *entry = ares__llist_node_val(node); + num = ares_array_len(arr); + for (i = 0; i < num; i++) { + ares_buf_t **bufptr = ares_array_at(arr, i); + ares_buf_t *entry = *bufptr; struct apattern pat; @@ -266,8 +267,8 @@ ares_status_t ares__parse_sortlist(struct apattern **sortlist, size_t *nsort, status = ARES_SUCCESS; done: - ares__buf_destroy(buf); - ares__llist_destroy(list); + ares_buf_destroy(buf); + ares_array_destroy(arr); if (status != ARES_SUCCESS) { ares_free(*sortlist); @@ -283,12 +284,12 @@ static ares_status_t config_search(ares_sysconfig_t *sysconfig, const char *str, { if (sysconfig->domains && sysconfig->ndomains > 0) { /* if we already have some domains present, free them first */ - ares__strsplit_free(sysconfig->domains, sysconfig->ndomains); + ares_strsplit_free(sysconfig->domains, sysconfig->ndomains); sysconfig->domains = NULL; sysconfig->ndomains = 0; } - sysconfig->domains = ares__strsplit(str, ", ", &sysconfig->ndomains); + sysconfig->domains = ares_strsplit(str, ", ", &sysconfig->ndomains); if (sysconfig->domains == NULL) { return ARES_ENOMEM; } @@ -306,52 +307,45 @@ static ares_status_t config_search(ares_sysconfig_t *sysconfig, const char *str, return ARES_SUCCESS; } -static ares_status_t buf_fetch_string(ares__buf_t *buf, char *str, +static ares_status_t buf_fetch_string(ares_buf_t *buf, char *str, size_t str_len) { ares_status_t status; - ares__buf_tag(buf); - ares__buf_consume(buf, ares__buf_len(buf)); + ares_buf_tag(buf); + ares_buf_consume(buf, ares_buf_len(buf)); - status = ares__buf_tag_fetch_string(buf, str, str_len); + status = ares_buf_tag_fetch_string(buf, str, str_len); return status; } -static ares_status_t config_lookup(ares_sysconfig_t *sysconfig, - ares__buf_t *buf, const char *separators) +static ares_status_t config_lookup(ares_sysconfig_t *sysconfig, ares_buf_t *buf, + const char *separators) { - ares_status_t status; - char lookupstr[32]; - size_t lookupstr_cnt = 0; - ares__llist_t *lookups = NULL; - ares__llist_node_t *node; - size_t separators_len = ares_strlen(separators); - - status = ares__buf_split(buf, (const unsigned char *)separators, - separators_len, ARES_BUF_SPLIT_TRIM, 0, &lookups); + ares_status_t status; + char lookupstr[32]; + size_t lookupstr_cnt = 0; + char **lookups = NULL; + size_t num = 0; + size_t i; + size_t separators_len = ares_strlen(separators); + + status = + ares_buf_split_str(buf, (const unsigned char *)separators, separators_len, + ARES_BUF_SPLIT_TRIM, 0, &lookups, &num); if (status != ARES_SUCCESS) { goto done; } - memset(lookupstr, 0, sizeof(lookupstr)); - - for (node = ares__llist_node_first(lookups); node != NULL; - node = ares__llist_node_next(node)) { - char value[128]; - char ch; - ares__buf_t *valbuf = ares__llist_node_val(node); - - status = buf_fetch_string(valbuf, value, sizeof(value)); - if (status != ARES_SUCCESS) { - continue; - } + for (i = 0; i < num; i++) { + const char *value = lookups[i]; + char ch; - if (strcasecmp(value, "dns") == 0 || strcasecmp(value, "bind") == 0 || - strcasecmp(value, "resolv") == 0 || strcasecmp(value, "resolve") == 0) { + if (ares_strcaseeq(value, "dns") || ares_strcaseeq(value, "bind") || + ares_strcaseeq(value, "resolv") || ares_strcaseeq(value, "resolve")) { ch = 'b'; - } else if (strcasecmp(value, "files") == 0 || - strcasecmp(value, "file") == 0 || - strcasecmp(value, "local") == 0) { + } else if (ares_strcaseeq(value, "files") || + ares_strcaseeq(value, "file") || + ares_strcaseeq(value, "local")) { ch = 'f'; } else { continue; @@ -364,10 +358,12 @@ static ares_status_t config_lookup(ares_sysconfig_t *sysconfig, } if (lookupstr_cnt) { + lookupstr[lookupstr_cnt] = 0; ares_free(sysconfig->lookups); sysconfig->lookups = ares_strdup(lookupstr); if (sysconfig->lookups == NULL) { - return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ + status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ + goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } } @@ -377,83 +373,85 @@ static ares_status_t config_lookup(ares_sysconfig_t *sysconfig, if (status != ARES_ENOMEM) { status = ARES_SUCCESS; } - ares__llist_destroy(lookups); + ares_free_array(lookups, num, ares_free); return status; } static ares_status_t process_option(ares_sysconfig_t *sysconfig, - ares__buf_t *option) + ares_buf_t *option) { - ares__llist_t *kv = NULL; - char key[32] = ""; - char val[32] = ""; - unsigned int valint = 0; - ares_status_t status; + char **kv = NULL; + size_t num = 0; + const char *key; + const char *val; + unsigned int valint = 0; + ares_status_t status; /* Split on : */ - status = ares__buf_split(option, (const unsigned char *)":", 1, - ARES_BUF_SPLIT_TRIM, 2, &kv); + status = ares_buf_split_str(option, (const unsigned char *)":", 1, + ARES_BUF_SPLIT_TRIM, 2, &kv, &num); if (status != ARES_SUCCESS) { goto done; } - status = buf_fetch_string(ares__llist_first_val(kv), key, sizeof(key)); - if (status != ARES_SUCCESS) { + if (num < 1) { + status = ARES_EBADSTR; goto done; } - if (ares__llist_len(kv) == 2) { - status = buf_fetch_string(ares__llist_last_val(kv), val, sizeof(val)); - if (status != ARES_SUCCESS) { - goto done; - } + + key = kv[0]; + if (num == 2) { + val = kv[1]; valint = (unsigned int)strtoul(val, NULL, 10); } - if (strcmp(key, "ndots") == 0) { + if (ares_streq(key, "ndots")) { sysconfig->ndots = valint; - } else if (strcmp(key, "retrans") == 0 || strcmp(key, "timeout") == 0) { + } else if (ares_streq(key, "retrans") || ares_streq(key, "timeout")) { if (valint == 0) { return ARES_EFORMERR; } sysconfig->timeout_ms = valint * 1000; - } else if (strcmp(key, "retry") == 0 || strcmp(key, "attempts") == 0) { + } else if (ares_streq(key, "retry") || ares_streq(key, "attempts")) { if (valint == 0) { return ARES_EFORMERR; } sysconfig->tries = valint; - } else if (strcmp(key, "rotate") == 0) { + } else if (ares_streq(key, "rotate")) { sysconfig->rotate = ARES_TRUE; - } else if (strcmp(key, "use-vc") == 0 || strcmp(key, "usevc") == 0) { + } else if (ares_streq(key, "use-vc") || ares_streq(key, "usevc")) { sysconfig->usevc = ARES_TRUE; } done: - ares__llist_destroy(kv); + ares_free_array(kv, num, ares_free); return status; } -ares_status_t ares__sysconfig_set_options(ares_sysconfig_t *sysconfig, - const char *str) +ares_status_t ares_sysconfig_set_options(ares_sysconfig_t *sysconfig, + const char *str) { - ares__buf_t *buf = NULL; - ares__llist_t *options = NULL; - ares_status_t status; - ares__llist_node_t *node; + ares_buf_t *buf = NULL; + ares_array_t *options = NULL; + size_t num; + size_t i; + ares_status_t status; - buf = ares__buf_create_const((const unsigned char *)str, ares_strlen(str)); + buf = ares_buf_create_const((const unsigned char *)str, ares_strlen(str)); if (buf == NULL) { return ARES_ENOMEM; } - status = ares__buf_split(buf, (const unsigned char *)" \t", 2, - ARES_BUF_SPLIT_TRIM, 0, &options); + status = ares_buf_split(buf, (const unsigned char *)" \t", 2, + ARES_BUF_SPLIT_TRIM, 0, &options); if (status != ARES_SUCCESS) { goto done; } - for (node = ares__llist_node_first(options); node != NULL; - node = ares__llist_node_next(node)) { - ares__buf_t *valbuf = ares__llist_node_val(node); + num = ares_array_len(options); + for (i = 0; i < num; i++) { + ares_buf_t **bufptr = ares_array_at(options, i); + ares_buf_t *valbuf = *bufptr; status = process_option(sysconfig, valbuf); /* Out of memory is the only fatal condition */ @@ -465,12 +463,12 @@ ares_status_t ares__sysconfig_set_options(ares_sysconfig_t *sysconfig, status = ARES_SUCCESS; done: - ares__llist_destroy(options); - ares__buf_destroy(buf); + ares_array_destroy(options); + ares_buf_destroy(buf); return status; } -ares_status_t ares__init_by_environment(ares_sysconfig_t *sysconfig) +ares_status_t ares_init_by_environment(ares_sysconfig_t *sysconfig) { const char *localdomain; const char *res_options; @@ -491,7 +489,7 @@ ares_status_t ares__init_by_environment(ares_sysconfig_t *sysconfig) res_options = getenv("RES_OPTIONS"); if (res_options) { - status = ares__sysconfig_set_options(sysconfig, res_options); + status = ares_sysconfig_set_options(sysconfig, res_options); if (status != ARES_SUCCESS) { return status; } @@ -551,70 +549,71 @@ ares_status_t ares__init_by_environment(ares_sysconfig_t *sysconfig) /* This function will only return ARES_SUCCESS or ARES_ENOMEM. Any other * conditions are ignored. Users may mess up config files, but we want to * process anything we can. */ -static ares_status_t parse_resolvconf_line(ares_sysconfig_t *sysconfig, - ares__buf_t *line) +static ares_status_t parse_resolvconf_line(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig, + ares_buf_t *line) { char option[32]; char value[512]; ares_status_t status = ARES_SUCCESS; /* Ignore lines beginning with a comment */ - if (ares__buf_begins_with(line, (const unsigned char *)"#", 1) || - ares__buf_begins_with(line, (const unsigned char *)";", 1)) { + if (ares_buf_begins_with(line, (const unsigned char *)"#", 1) || + ares_buf_begins_with(line, (const unsigned char *)";", 1)) { return ARES_SUCCESS; } - ares__buf_tag(line); + ares_buf_tag(line); /* Shouldn't be possible, but if it happens, ignore the line. */ - if (ares__buf_consume_nonwhitespace(line) == 0) { + if (ares_buf_consume_nonwhitespace(line) == 0) { return ARES_SUCCESS; } - status = ares__buf_tag_fetch_string(line, option, sizeof(option)); + status = ares_buf_tag_fetch_string(line, option, sizeof(option)); if (status != ARES_SUCCESS) { return ARES_SUCCESS; } - ares__buf_consume_whitespace(line, ARES_TRUE); + ares_buf_consume_whitespace(line, ARES_TRUE); status = buf_fetch_string(line, value, sizeof(value)); if (status != ARES_SUCCESS) { return ARES_SUCCESS; } - ares__str_trim(value); + ares_str_trim(value); if (*value == 0) { return ARES_SUCCESS; } /* At this point we have a string option and a string value, both trimmed * of leading and trailing whitespace. Lets try to evaluate them */ - if (strcmp(option, "domain") == 0) { + if (ares_streq(option, "domain")) { /* Domain is legacy, don't overwrite an existing config set by search */ if (sysconfig->domains == NULL) { status = config_search(sysconfig, value, 1); } - } else if (strcmp(option, "lookup") == 0 || - strcmp(option, "hostresorder") == 0) { - ares__buf_tag_rollback(line); + } else if (ares_streq(option, "lookup") || + ares_streq(option, "hostresorder")) { + ares_buf_tag_rollback(line); status = config_lookup(sysconfig, line, " \t"); - } else if (strcmp(option, "search") == 0) { + } else if (ares_streq(option, "search")) { status = config_search(sysconfig, value, 0); - } else if (strcmp(option, "nameserver") == 0) { - status = - ares__sconfig_append_fromstr(&sysconfig->sconfig, value, ARES_TRUE); - } else if (strcmp(option, "sortlist") == 0) { + } else if (ares_streq(option, "nameserver")) { + status = ares_sconfig_append_fromstr(channel, &sysconfig->sconfig, value, + ARES_TRUE); + } else if (ares_streq(option, "sortlist")) { /* Ignore all failures except ENOMEM. If the sysadmin set a bad * sortlist, just ignore the sortlist, don't cause an inoperable * channel */ status = - ares__parse_sortlist(&sysconfig->sortlist, &sysconfig->nsortlist, value); + ares_parse_sortlist(&sysconfig->sortlist, &sysconfig->nsortlist, value); if (status != ARES_ENOMEM) { status = ARES_SUCCESS; } - } else if (strcmp(option, "options") == 0) { - status = ares__sysconfig_set_options(sysconfig, value); + } else if (ares_streq(option, "options")) { + status = ares_sysconfig_set_options(sysconfig, value); } return status; @@ -623,44 +622,51 @@ static ares_status_t parse_resolvconf_line(ares_sysconfig_t *sysconfig, /* This function will only return ARES_SUCCESS or ARES_ENOMEM. Any other * conditions are ignored. Users may mess up config files, but we want to * process anything we can. */ -static ares_status_t parse_nsswitch_line(ares_sysconfig_t *sysconfig, - ares__buf_t *line) +static ares_status_t parse_nsswitch_line(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig, + ares_buf_t *line) { - char option[32]; - ares__buf_t *buf; - ares_status_t status = ARES_SUCCESS; - ares__llist_t *sects = NULL; + char option[32]; + ares_status_t status = ARES_SUCCESS; + ares_array_t *sects = NULL; + ares_buf_t **bufptr; + ares_buf_t *buf; + + (void)channel; /* Ignore lines beginning with a comment */ - if (ares__buf_begins_with(line, (const unsigned char *)"#", 1)) { + if (ares_buf_begins_with(line, (const unsigned char *)"#", 1)) { return ARES_SUCCESS; } /* database : values (space delimited) */ - status = ares__buf_split(line, (const unsigned char *)":", 1, - ARES_BUF_SPLIT_TRIM, 2, §s); + status = ares_buf_split(line, (const unsigned char *)":", 1, + ARES_BUF_SPLIT_TRIM, 2, §s); - if (status != ARES_SUCCESS || ares__llist_len(sects) != 2) { + if (status != ARES_SUCCESS || ares_array_len(sects) != 2) { goto done; } - buf = ares__llist_first_val(sects); + bufptr = ares_array_at(sects, 0); + buf = *bufptr; + status = buf_fetch_string(buf, option, sizeof(option)); if (status != ARES_SUCCESS) { goto done; } /* Only support "hosts:" */ - if (strcmp(option, "hosts") != 0) { + if (!ares_streq(option, "hosts")) { goto done; } /* Values are space separated */ - buf = ares__llist_last_val(sects); + bufptr = ares_array_at(sects, 1); + buf = *bufptr; status = config_lookup(sysconfig, buf, " \t"); done: - ares__llist_destroy(sects); + ares_array_destroy(sects); if (status != ARES_ENOMEM) { status = ARES_SUCCESS; } @@ -670,52 +676,59 @@ static ares_status_t parse_nsswitch_line(ares_sysconfig_t *sysconfig, /* This function will only return ARES_SUCCESS or ARES_ENOMEM. Any other * conditions are ignored. Users may mess up config files, but we want to * process anything we can. */ -static ares_status_t parse_svcconf_line(ares_sysconfig_t *sysconfig, - ares__buf_t *line) +static ares_status_t parse_svcconf_line(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig, + ares_buf_t *line) { - char option[32]; - ares__buf_t *buf; - ares_status_t status = ARES_SUCCESS; - ares__llist_t *sects = NULL; + char option[32]; + ares_buf_t **bufptr; + ares_buf_t *buf; + ares_status_t status = ARES_SUCCESS; + ares_array_t *sects = NULL; + + (void)channel; /* Ignore lines beginning with a comment */ - if (ares__buf_begins_with(line, (const unsigned char *)"#", 1)) { + if (ares_buf_begins_with(line, (const unsigned char *)"#", 1)) { return ARES_SUCCESS; } /* database = values (comma delimited)*/ - status = ares__buf_split(line, (const unsigned char *)"=", 1, - ARES_BUF_SPLIT_TRIM, 2, §s); + status = ares_buf_split(line, (const unsigned char *)"=", 1, + ARES_BUF_SPLIT_TRIM, 2, §s); - if (status != ARES_SUCCESS || ares__llist_len(sects) != 2) { + if (status != ARES_SUCCESS || ares_array_len(sects) != 2) { goto done; } - buf = ares__llist_first_val(sects); + bufptr = ares_array_at(sects, 0); + buf = *bufptr; status = buf_fetch_string(buf, option, sizeof(option)); if (status != ARES_SUCCESS) { goto done; } /* Only support "hosts=" */ - if (strcmp(option, "hosts") != 0) { + if (!ares_streq(option, "hosts")) { goto done; } /* Values are comma separated */ - buf = ares__llist_last_val(sects); + bufptr = ares_array_at(sects, 1); + buf = *bufptr; status = config_lookup(sysconfig, buf, ","); done: - ares__llist_destroy(sects); + ares_array_destroy(sects); if (status != ARES_ENOMEM) { status = ARES_SUCCESS; } return status; } -typedef ares_status_t (*line_callback_t)(ares_sysconfig_t *sysconfig, - ares__buf_t *line); +typedef ares_status_t (*line_callback_t)(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig, + ares_buf_t *line); /* Should only return: * ARES_ENOTFOUND - file not found @@ -724,56 +737,60 @@ typedef ares_status_t (*line_callback_t)(ares_sysconfig_t *sysconfig, * ARES_SUCCESS - file processed, doesn't necessarily mean it was a good * file, but we're not erroring out if we can't parse * something (or anything at all) */ -static ares_status_t process_config_lines(const char *filename, - ares_sysconfig_t *sysconfig, - line_callback_t cb) +static ares_status_t process_config_lines(const ares_channel_t *channel, + const char *filename, + ares_sysconfig_t *sysconfig, + line_callback_t cb) { - ares_status_t status = ARES_SUCCESS; - ares__llist_node_t *node; - ares__llist_t *lines = NULL; - ares__buf_t *buf = NULL; + ares_status_t status = ARES_SUCCESS; + ares_array_t *lines = NULL; + ares_buf_t *buf = NULL; + size_t num; + size_t i; - buf = ares__buf_create(); + buf = ares_buf_create(); if (buf == NULL) { status = ARES_ENOMEM; goto done; } - status = ares__buf_load_file(filename, buf); + status = ares_buf_load_file(filename, buf); if (status != ARES_SUCCESS) { goto done; } - status = ares__buf_split(buf, (const unsigned char *)"\n", 1, - ARES_BUF_SPLIT_TRIM, 0, &lines); + status = ares_buf_split(buf, (const unsigned char *)"\n", 1, + ARES_BUF_SPLIT_TRIM, 0, &lines); if (status != ARES_SUCCESS) { goto done; } - for (node = ares__llist_node_first(lines); node != NULL; - node = ares__llist_node_next(node)) { - ares__buf_t *line = ares__llist_node_val(node); + num = ares_array_len(lines); + for (i = 0; i < num; i++) { + ares_buf_t **bufptr = ares_array_at(lines, i); + ares_buf_t *line = *bufptr; - status = cb(sysconfig, line); + status = cb(channel, sysconfig, line); if (status != ARES_SUCCESS) { goto done; } } done: - ares__buf_destroy(buf); - ares__llist_destroy(lines); + ares_buf_destroy(buf); + ares_array_destroy(lines); return status; } -ares_status_t ares__init_sysconfig_files(const ares_channel_t *channel, - ares_sysconfig_t *sysconfig) +ares_status_t ares_init_sysconfig_files(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig) { ares_status_t status = ARES_SUCCESS; /* Resolv.conf */ - status = process_config_lines((channel->resolvconf_path != NULL) + status = process_config_lines(channel, + (channel->resolvconf_path != NULL) ? channel->resolvconf_path : PATH_RESOLV_CONF, sysconfig, parse_resolvconf_line); @@ -782,21 +799,22 @@ ares_status_t ares__init_sysconfig_files(const ares_channel_t *channel, } /* Nsswitch.conf */ - status = - process_config_lines("/etc/nsswitch.conf", sysconfig, parse_nsswitch_line); + status = process_config_lines(channel, "/etc/nsswitch.conf", sysconfig, + parse_nsswitch_line); if (status != ARES_SUCCESS && status != ARES_ENOTFOUND) { goto done; } /* netsvc.conf */ - status = - process_config_lines("/etc/netsvc.conf", sysconfig, parse_svcconf_line); + status = process_config_lines(channel, "/etc/netsvc.conf", sysconfig, + parse_svcconf_line); if (status != ARES_SUCCESS && status != ARES_ENOTFOUND) { goto done; } /* svc.conf */ - status = process_config_lines("/etc/svc.conf", sysconfig, parse_svcconf_line); + status = process_config_lines(channel, "/etc/svc.conf", sysconfig, + parse_svcconf_line); if (status != ARES_SUCCESS && status != ARES_ENOTFOUND) { goto done; } diff --git a/deps/cares/src/lib/ares_sysconfig_mac.c b/deps/cares/src/lib/ares_sysconfig_mac.c index 38ac451ca5f410..4d46ffd58df53b 100644 --- a/deps/cares/src/lib/ares_sysconfig_mac.c +++ b/deps/cares/src/lib/ares_sysconfig_mac.c @@ -154,14 +154,15 @@ static ares_bool_t search_is_duplicate(const ares_sysconfig_t *sysconfig, { size_t i; for (i = 0; i < sysconfig->ndomains; i++) { - if (strcasecmp(sysconfig->domains[i], name) == 0) { + if (ares_strcaseeq(sysconfig->domains[i], name)) { return ARES_TRUE; } } return ARES_FALSE; } -static ares_status_t read_resolver(const dns_resolver_t *resolver, +static ares_status_t read_resolver(const ares_channel_t *channel, + const dns_resolver_t *resolver, ares_sysconfig_t *sysconfig) { int i; @@ -243,7 +244,7 @@ static ares_status_t read_resolver(const dns_resolver_t *resolver, # endif if (resolver->options != NULL) { - status = ares__sysconfig_set_options(sysconfig, resolver->options); + status = ares_sysconfig_set_options(sysconfig, resolver->options); if (status != ARES_SUCCESS) { return status; } @@ -269,7 +270,7 @@ static ares_status_t read_resolver(const dns_resolver_t *resolver, unsigned short addrport; const struct sockaddr *sockaddr; char if_name_str[256] = ""; - const char *if_name; + const char *if_name = NULL; /* UBSAN alignment workaround to fetch memory address */ memcpy(&sockaddr, resolver->nameserver + i, sizeof(sockaddr)); @@ -282,10 +283,14 @@ static ares_status_t read_resolver(const dns_resolver_t *resolver, addrport = port; } - if_name = ares__if_indextoname(resolver->if_index, if_name_str, - sizeof(if_name_str)); - status = ares__sconfig_append(&sysconfig->sconfig, &addr, addrport, - addrport, if_name); + if (channel->sock_funcs.aif_indextoname != NULL) { + if_name = channel->sock_funcs.aif_indextoname( + resolver->if_index, if_name_str, sizeof(if_name_str), + channel->sock_func_cb_data); + } + + status = ares_sconfig_append(channel, &sysconfig->sconfig, &addr, addrport, + addrport, if_name); if (status != ARES_SUCCESS) { return status; } @@ -294,7 +299,8 @@ static ares_status_t read_resolver(const dns_resolver_t *resolver, return status; } -static ares_status_t read_resolvers(dns_resolver_t **resolvers, int nresolvers, +static ares_status_t read_resolvers(const ares_channel_t *channel, + dns_resolver_t **resolvers, int nresolvers, ares_sysconfig_t *sysconfig) { ares_status_t status = ARES_SUCCESS; @@ -309,13 +315,14 @@ static ares_status_t read_resolvers(dns_resolver_t **resolvers, int nresolvers, */ memcpy(&resolver_ptr, resolvers + i, sizeof(resolver_ptr)); - status = read_resolver(resolver_ptr, sysconfig); + status = read_resolver(channel, resolver_ptr, sysconfig); } return status; } -ares_status_t ares__init_sysconfig_macos(ares_sysconfig_t *sysconfig) +ares_status_t ares_init_sysconfig_macos(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig) { dnsinfo_t *dnsinfo = NULL; dns_config_t *sc_dns = NULL; @@ -343,7 +350,8 @@ ares_status_t ares__init_sysconfig_macos(ares_sysconfig_t *sysconfig) * Likely this wasn't available via `/etc/resolv.conf` nor `libresolv` anyhow * so its not worse to prior configuration methods, worst case. */ - status = read_resolvers(sc_dns->resolver, sc_dns->n_resolver, sysconfig); + status = + read_resolvers(channel, sc_dns->resolver, sc_dns->n_resolver, sysconfig); done: if (dnsinfo) { diff --git a/deps/cares/src/lib/ares_sysconfig_win.c b/deps/cares/src/lib/ares_sysconfig_win.c index ce2a261cec82bb..f6e07f92e47380 100644 --- a/deps/cares/src/lib/ares_sysconfig_win.c +++ b/deps/cares/src/lib/ares_sysconfig_win.c @@ -53,7 +53,6 @@ #endif #include "ares_inet_net_pton.h" -#include "ares_platform.h" #if defined(USE_WINSOCK) /* @@ -420,7 +419,7 @@ static ares_bool_t get_DNS_Windows(char **outptr) memset(&addr, 0, sizeof(addr)); addr.family = AF_INET6; memcpy(&addr.addr.addr6, &namesrvr.sa6->sin6_addr, 16); - if (ares__addr_is_linklocal(&addr)) { + if (ares_addr_is_linklocal(&addr)) { ll_scope = ipaaEntry->Ipv6IfIndex; } @@ -514,10 +513,6 @@ static ares_bool_t get_SuffixList_Windows(char **outptr) *outptr = NULL; - if (ares__getplatform() != WIN_NT) { - return ARES_FALSE; - } - /* 1. Global DNS Suffix Search List */ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { @@ -589,13 +584,15 @@ static ares_bool_t get_SuffixList_Windows(char **outptr) return *outptr != NULL ? ARES_TRUE : ARES_FALSE; } -ares_status_t ares__init_sysconfig_windows(ares_sysconfig_t *sysconfig) +ares_status_t ares_init_sysconfig_windows(const ares_channel_t *channel, + ares_sysconfig_t *sysconfig) { char *line = NULL; ares_status_t status = ARES_SUCCESS; if (get_DNS_Windows(&line)) { - status = ares__sconfig_append_fromstr(&sysconfig->sconfig, line, ARES_TRUE); + status = ares_sconfig_append_fromstr(channel, &sysconfig->sconfig, line, + ARES_TRUE); ares_free(line); if (status != ARES_SUCCESS) { goto done; @@ -603,7 +600,7 @@ ares_status_t ares__init_sysconfig_windows(ares_sysconfig_t *sysconfig) } if (get_SuffixList_Windows(&line)) { - sysconfig->domains = ares__strsplit(line, ", ", &sysconfig->ndomains); + sysconfig->domains = ares_strsplit(line, ", ", &sysconfig->ndomains); ares_free(line); if (sysconfig->domains == NULL) { status = ARES_EFILE; diff --git a/deps/cares/src/lib/ares_timeout.c b/deps/cares/src/lib/ares_timeout.c index 5ed8b553a3c5ef..0d2fdcff21f657 100644 --- a/deps/cares/src/lib/ares_timeout.c +++ b/deps/cares/src/lib/ares_timeout.c @@ -32,9 +32,9 @@ #endif -void ares__timeval_remaining(ares_timeval_t *remaining, - const ares_timeval_t *now, - const ares_timeval_t *tout) +void ares_timeval_remaining(ares_timeval_t *remaining, + const ares_timeval_t *now, + const ares_timeval_t *tout) { memset(remaining, 0, sizeof(*remaining)); @@ -53,8 +53,8 @@ void ares__timeval_remaining(ares_timeval_t *remaining, } } -void ares__timeval_diff(ares_timeval_t *tvdiff, const ares_timeval_t *tvstart, - const ares_timeval_t *tvstop) +void ares_timeval_diff(ares_timeval_t *tvdiff, const ares_timeval_t *tvstart, + const ares_timeval_t *tvstop) { tvdiff->sec = tvstop->sec - tvstart->sec; if (tvstop->usec > tvstart->usec) { @@ -89,24 +89,24 @@ static struct timeval *ares_timeout_int(const ares_channel_t *channel, struct timeval *tvbuf) { const ares_query_t *query; - ares__slist_node_t *node; + ares_slist_node_t *node; ares_timeval_t now; ares_timeval_t atvbuf; ares_timeval_t amaxtv; /* The minimum timeout of all queries is always the first entry in * channel->queries_by_timeout */ - node = ares__slist_node_first(channel->queries_by_timeout); + node = ares_slist_node_first(channel->queries_by_timeout); /* no queries/timeout */ if (node == NULL) { return maxtv; } - query = ares__slist_node_val(node); + query = ares_slist_node_val(node); - ares__tvnow(&now); + ares_tvnow(&now); - ares__timeval_remaining(&atvbuf, &now, &query->timeout); + ares_timeval_remaining(&atvbuf, &now, &query->timeout); ares_timeval_to_struct_timeval(tvbuf, &atvbuf); @@ -141,11 +141,11 @@ struct timeval *ares_timeout(const ares_channel_t *channel, return NULL; } - ares__channel_lock(channel); + ares_channel_lock(channel); rv = ares_timeout_int(channel, maxtv, tvbuf); - ares__channel_unlock(channel); + ares_channel_unlock(channel); return rv; } diff --git a/deps/cares/src/lib/ares_update_servers.c b/deps/cares/src/lib/ares_update_servers.c index 639f79d815915f..70a9381499f8c2 100644 --- a/deps/cares/src/lib/ares_update_servers.c +++ b/deps/cares/src/lib/ares_update_servers.c @@ -39,6 +39,9 @@ #ifdef HAVE_NET_IF_H # include #endif +#ifdef HAVE_STDINT_H +# include +#endif #if defined(USE_WINSOCK) # if defined(HAVE_IPHLPAPI_H) @@ -61,8 +64,8 @@ typedef struct { unsigned int ll_scope; } ares_sconfig_t; -static ares_bool_t ares__addr_match(const struct ares_addr *addr1, - const struct ares_addr *addr2) +static ares_bool_t ares_addr_match(const struct ares_addr *addr1, + const struct ares_addr *addr2) { if (addr1 == NULL && addr2 == NULL) { return ARES_TRUE; /* LCOV_EXCL_LINE: DefensiveCoding */ @@ -90,9 +93,9 @@ static ares_bool_t ares__addr_match(const struct ares_addr *addr1, return ARES_FALSE; } -ares_bool_t ares__subnet_match(const struct ares_addr *addr, - const struct ares_addr *subnet, - unsigned char netmask) +ares_bool_t ares_subnet_match(const struct ares_addr *addr, + const struct ares_addr *subnet, + unsigned char netmask) { const unsigned char *addr_ptr; const unsigned char *subnet_ptr; @@ -144,7 +147,7 @@ ares_bool_t ares__subnet_match(const struct ares_addr *addr, return ARES_TRUE; } -ares_bool_t ares__addr_is_linklocal(const struct ares_addr *addr) +ares_bool_t ares_addr_is_linklocal(const struct ares_addr *addr) { struct ares_addr subnet; const unsigned char subnetaddr[16] = { 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, @@ -155,7 +158,7 @@ ares_bool_t ares__addr_is_linklocal(const struct ares_addr *addr) subnet.family = AF_INET6; memcpy(&subnet.addr.addr6, subnetaddr, 16); - return ares__subnet_match(addr, &subnet, 10); + return ares_subnet_match(addr, &subnet, 10); } static ares_bool_t ares_server_blacklisted(const struct ares_addr *addr) @@ -185,13 +188,60 @@ static ares_bool_t ares_server_blacklisted(const struct ares_addr *addr) struct ares_addr subnet; subnet.family = AF_INET6; memcpy(&subnet.addr.addr6, blacklist_v6[i].netbase, 16); - if (ares__subnet_match(addr, &subnet, blacklist_v6[i].netmask)) { + if (ares_subnet_match(addr, &subnet, blacklist_v6[i].netmask)) { return ARES_TRUE; } } return ARES_FALSE; } +static ares_status_t parse_nameserver_uri(ares_buf_t *buf, + ares_sconfig_t *sconfig) +{ + ares_uri_t *uri = NULL; + ares_status_t status = ARES_SUCCESS; + const char *port; + char *ll_scope; + char hoststr[256]; + size_t addrlen; + + status = ares_uri_parse_buf(&uri, buf); + if (status != ARES_SUCCESS) { + return status; + } + + if (!ares_streq("dns", ares_uri_get_scheme(uri))) { + status = ARES_EBADSTR; + goto done; + } + + ares_strcpy(hoststr, ares_uri_get_host(uri), sizeof(hoststr)); + ll_scope = strchr(hoststr, '%'); + if (ll_scope != NULL) { + *ll_scope = 0; + ll_scope++; + ares_strcpy(sconfig->ll_iface, ll_scope, sizeof(sconfig->ll_iface)); + } + + /* Convert ip address from string to network byte order */ + sconfig->addr.family = AF_UNSPEC; + if (ares_dns_pton(hoststr, &sconfig->addr, &addrlen) == NULL) { + status = ARES_EBADSTR; + goto done; + } + + sconfig->udp_port = ares_uri_get_port(uri); + sconfig->tcp_port = sconfig->udp_port; + port = ares_uri_get_query_key(uri, "tcpport"); + if (port != NULL) { + sconfig->tcp_port = (unsigned short)atoi(port); + } + +done: + ares_uri_destroy(uri); + return status; +} + /* Parse address and port in these formats, either ipv4 or ipv6 addresses * are allowed: * ipaddr @@ -211,7 +261,7 @@ static ares_bool_t ares_server_blacklisted(const struct ares_addr *addr) * Returns an error code on failure, else ARES_SUCCESS */ -static ares_status_t parse_nameserver(ares__buf_t *buf, ares_sconfig_t *sconfig) +static ares_status_t parse_nameserver(ares_buf_t *buf, ares_sconfig_t *sconfig) { ares_status_t status; char ipaddr[INET6_ADDRSTRLEN] = ""; @@ -220,57 +270,57 @@ static ares_status_t parse_nameserver(ares__buf_t *buf, ares_sconfig_t *sconfig) memset(sconfig, 0, sizeof(*sconfig)); /* Consume any leading whitespace */ - ares__buf_consume_whitespace(buf, ARES_TRUE); + ares_buf_consume_whitespace(buf, ARES_TRUE); /* pop off IP address. If it is in [ ] then it can be ipv4 or ipv6. If * not, ipv4 only */ - if (ares__buf_begins_with(buf, (const unsigned char *)"[", 1)) { + if (ares_buf_begins_with(buf, (const unsigned char *)"[", 1)) { /* Consume [ */ - ares__buf_consume(buf, 1); + ares_buf_consume(buf, 1); - ares__buf_tag(buf); + ares_buf_tag(buf); /* Consume until ] */ - if (ares__buf_consume_until_charset(buf, (const unsigned char *)"]", 1, - ARES_TRUE) == 0) { + if (ares_buf_consume_until_charset(buf, (const unsigned char *)"]", 1, + ARES_TRUE) == SIZE_MAX) { return ARES_EBADSTR; } - status = ares__buf_tag_fetch_string(buf, ipaddr, sizeof(ipaddr)); + status = ares_buf_tag_fetch_string(buf, ipaddr, sizeof(ipaddr)); if (status != ARES_SUCCESS) { return status; } /* Skip over ] */ - ares__buf_consume(buf, 1); + ares_buf_consume(buf, 1); } else { size_t offset; /* Not in [ ], see if '.' is in first 4 characters, if it is, then its ipv4, * otherwise treat as ipv6 */ - ares__buf_tag(buf); + ares_buf_tag(buf); - offset = ares__buf_consume_until_charset(buf, (const unsigned char *)".", 1, - ARES_TRUE); - ares__buf_tag_rollback(buf); - ares__buf_tag(buf); + offset = ares_buf_consume_until_charset(buf, (const unsigned char *)".", 1, + ARES_TRUE); + ares_buf_tag_rollback(buf); + ares_buf_tag(buf); if (offset > 0 && offset < 4) { /* IPv4 */ - if (ares__buf_consume_charset(buf, (const unsigned char *)"0123456789.", - 11) == 0) { + if (ares_buf_consume_charset(buf, (const unsigned char *)"0123456789.", + 11) == 0) { return ARES_EBADSTR; } } else { /* IPv6 */ const unsigned char ipv6_charset[] = "ABCDEFabcdef0123456789.:"; - if (ares__buf_consume_charset(buf, ipv6_charset, - sizeof(ipv6_charset) - 1) == 0) { + if (ares_buf_consume_charset(buf, ipv6_charset, + sizeof(ipv6_charset) - 1) == 0) { return ARES_EBADSTR; } } - status = ares__buf_tag_fetch_string(buf, ipaddr, sizeof(ipaddr)); + status = ares_buf_tag_fetch_string(buf, ipaddr, sizeof(ipaddr)); if (status != ARES_SUCCESS) { return status; } @@ -283,21 +333,21 @@ static ares_status_t parse_nameserver(ares__buf_t *buf, ares_sconfig_t *sconfig) } /* Pull off port */ - if (ares__buf_begins_with(buf, (const unsigned char *)":", 1)) { + if (ares_buf_begins_with(buf, (const unsigned char *)":", 1)) { char portstr[6]; /* Consume : */ - ares__buf_consume(buf, 1); + ares_buf_consume(buf, 1); - ares__buf_tag(buf); + ares_buf_tag(buf); /* Read numbers */ - if (ares__buf_consume_charset(buf, (const unsigned char *)"0123456789", - 10) == 0) { + if (ares_buf_consume_charset(buf, (const unsigned char *)"0123456789", + 10) == 0) { return ARES_EBADSTR; } - status = ares__buf_tag_fetch_string(buf, portstr, sizeof(portstr)); + status = ares_buf_tag_fetch_string(buf, portstr, sizeof(portstr)); if (status != ARES_SUCCESS) { return status; } @@ -307,22 +357,22 @@ static ares_status_t parse_nameserver(ares__buf_t *buf, ares_sconfig_t *sconfig) } /* Pull off interface modifier */ - if (ares__buf_begins_with(buf, (const unsigned char *)"%", 1)) { + if (ares_buf_begins_with(buf, (const unsigned char *)"%", 1)) { const unsigned char iface_charset[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789.-_\\:{}"; /* Consume % */ - ares__buf_consume(buf, 1); + ares_buf_consume(buf, 1); - ares__buf_tag(buf); + ares_buf_tag(buf); - if (ares__buf_consume_charset(buf, iface_charset, - sizeof(iface_charset) - 1) == 0) { + if (ares_buf_consume_charset(buf, iface_charset, + sizeof(iface_charset) - 1) == 0) { return ARES_EBADSTR; } - status = ares__buf_tag_fetch_string(buf, sconfig->ll_iface, - sizeof(sconfig->ll_iface)); + status = ares_buf_tag_fetch_string(buf, sconfig->ll_iface, + sizeof(sconfig->ll_iface)); if (status != ARES_SUCCESS) { return status; } @@ -330,24 +380,29 @@ static ares_status_t parse_nameserver(ares__buf_t *buf, ares_sconfig_t *sconfig) /* Consume any trailing whitespace so we can bail out if there is something * after we didn't read */ - ares__buf_consume_whitespace(buf, ARES_TRUE); + ares_buf_consume_whitespace(buf, ARES_TRUE); - if (ares__buf_len(buf) != 0) { + if (ares_buf_len(buf) != 0) { return ARES_EBADSTR; } return ARES_SUCCESS; } -static ares_status_t ares__sconfig_linklocal(ares_sconfig_t *s, - const char *ll_iface) +static ares_status_t ares_sconfig_linklocal(const ares_channel_t *channel, + ares_sconfig_t *s, + const char *ll_iface) { unsigned int ll_scope = 0; + if (ares_str_isnum(ll_iface)) { char ifname[IF_NAMESIZE] = ""; ll_scope = (unsigned int)atoi(ll_iface); - if (ares__if_indextoname(ll_scope, ifname, sizeof(ifname)) == NULL) { + if (channel->sock_funcs.aif_indextoname == NULL || + channel->sock_funcs.aif_indextoname(ll_scope, ifname, sizeof(ifname), + channel->sock_func_cb_data) == + NULL) { DEBUGF(fprintf(stderr, "Interface %s for ipv6 Link Local not found\n", ll_iface)); return ARES_ENOTFOUND; @@ -357,7 +412,10 @@ static ares_status_t ares__sconfig_linklocal(ares_sconfig_t *s, return ARES_SUCCESS; } - ll_scope = ares__if_nametoindex(ll_iface); + if (channel->sock_funcs.aif_nametoindex != NULL) { + ll_scope = + channel->sock_funcs.aif_nametoindex(ll_iface, channel->sock_func_cb_data); + } if (ll_scope == 0) { DEBUGF(fprintf(stderr, "Interface %s for ipv6 Link Local not found\n", ll_iface)); @@ -368,11 +426,11 @@ static ares_status_t ares__sconfig_linklocal(ares_sconfig_t *s, return ARES_SUCCESS; } -ares_status_t ares__sconfig_append(ares__llist_t **sconfig, - const struct ares_addr *addr, - unsigned short udp_port, - unsigned short tcp_port, - const char *ll_iface) +ares_status_t ares_sconfig_append(const ares_channel_t *channel, + ares_llist_t **sconfig, + const struct ares_addr *addr, + unsigned short udp_port, + unsigned short tcp_port, const char *ll_iface) { ares_sconfig_t *s; ares_status_t status; @@ -392,7 +450,7 @@ ares_status_t ares__sconfig_append(ares__llist_t **sconfig, } if (*sconfig == NULL) { - *sconfig = ares__llist_create(ares_free); + *sconfig = ares_llist_create(ares_free); if (*sconfig == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -405,13 +463,13 @@ ares_status_t ares__sconfig_append(ares__llist_t **sconfig, /* Handle link-local enumeration. If an interface is specified on a * non-link-local address, we'll simply end up ignoring that */ - if (ares__addr_is_linklocal(&s->addr)) { + if (ares_addr_is_linklocal(&s->addr)) { if (ares_strlen(ll_iface) == 0) { /* Silently ignore this entry, we require an interface */ status = ARES_SUCCESS; goto fail; } - status = ares__sconfig_linklocal(s, ll_iface); + status = ares_sconfig_linklocal(channel, s, ll_iface); /* Silently ignore this entry, we can't validate the interface */ if (status != ARES_SUCCESS) { status = ARES_SUCCESS; @@ -419,7 +477,7 @@ ares_status_t ares__sconfig_append(ares__llist_t **sconfig, } } - if (ares__llist_insert_last(*sconfig, s) == NULL) { + if (ares_llist_insert_last(*sconfig, s) == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -448,36 +506,43 @@ ares_status_t ares__sconfig_append(ares__llist_t **sconfig, * * Returns an error code on failure, else ARES_SUCCESS. */ -ares_status_t ares__sconfig_append_fromstr(ares__llist_t **sconfig, - const char *str, - ares_bool_t ignore_invalid) +ares_status_t ares_sconfig_append_fromstr(const ares_channel_t *channel, + ares_llist_t **sconfig, + const char *str, + ares_bool_t ignore_invalid) { - ares_status_t status = ARES_SUCCESS; - ares__buf_t *buf = NULL; - ares__llist_t *list = NULL; - ares__llist_node_t *node; + ares_status_t status = ARES_SUCCESS; + ares_buf_t *buf = NULL; + ares_array_t *list = NULL; + size_t num; + size_t i; /* On Windows, there may be more than one nameserver specified in the same * registry key, so we parse input as a space or comma separated list. */ - buf = ares__buf_create_const((const unsigned char *)str, ares_strlen(str)); + buf = ares_buf_create_const((const unsigned char *)str, ares_strlen(str)); if (buf == NULL) { status = ARES_ENOMEM; goto done; } - status = ares__buf_split(buf, (const unsigned char *)" ,", 2, - ARES_BUF_SPLIT_NONE, 0, &list); + status = ares_buf_split(buf, (const unsigned char *)" ,", 2, + ARES_BUF_SPLIT_NONE, 0, &list); if (status != ARES_SUCCESS) { goto done; } - for (node = ares__llist_node_first(list); node != NULL; - node = ares__llist_node_next(node)) { - ares__buf_t *entry = ares__llist_node_val(node); + num = ares_array_len(list); + for (i = 0; i < num; i++) { + ares_buf_t **bufptr = ares_array_at(list, i); + ares_buf_t *entry = *bufptr; ares_sconfig_t s; - status = parse_nameserver(entry, &s); + status = parse_nameserver_uri(entry, &s); + if (status != ARES_SUCCESS) { + status = parse_nameserver(entry, &s); + } + if (status != ARES_SUCCESS) { if (ignore_invalid) { continue; @@ -486,8 +551,8 @@ ares_status_t ares__sconfig_append_fromstr(ares__llist_t **sconfig, } } - status = ares__sconfig_append(sconfig, &s.addr, s.udp_port, s.tcp_port, - s.ll_iface); + status = ares_sconfig_append(channel, sconfig, &s.addr, s.udp_port, + s.tcp_port, s.ll_iface); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -496,14 +561,14 @@ ares_status_t ares__sconfig_append_fromstr(ares__llist_t **sconfig, status = ARES_SUCCESS; done: - ares__llist_destroy(list); - ares__buf_destroy(buf); + ares_array_destroy(list); + ares_buf_destroy(buf); return status; } -static unsigned short ares__sconfig_get_port(const ares_channel_t *channel, - const ares_sconfig_t *s, - ares_bool_t is_tcp) +static unsigned short ares_sconfig_get_port(const ares_channel_t *channel, + const ares_sconfig_t *s, + ares_bool_t is_tcp) { unsigned short port = is_tcp ? s->tcp_port : s->udp_port; @@ -518,24 +583,24 @@ static unsigned short ares__sconfig_get_port(const ares_channel_t *channel, return port; } -static ares__slist_node_t *ares__server_find(ares_channel_t *channel, - const ares_sconfig_t *s) +static ares_slist_node_t *ares_server_find(const ares_channel_t *channel, + const ares_sconfig_t *s) { - ares__slist_node_t *node; + ares_slist_node_t *node; - for (node = ares__slist_node_first(channel->servers); node != NULL; - node = ares__slist_node_next(node)) { - const ares_server_t *server = ares__slist_node_val(node); + for (node = ares_slist_node_first(channel->servers); node != NULL; + node = ares_slist_node_next(node)) { + const ares_server_t *server = ares_slist_node_val(node); - if (!ares__addr_match(&server->addr, &s->addr)) { + if (!ares_addr_match(&server->addr, &s->addr)) { continue; } - if (server->tcp_port != ares__sconfig_get_port(channel, s, ARES_TRUE)) { + if (server->tcp_port != ares_sconfig_get_port(channel, s, ARES_TRUE)) { continue; } - if (server->udp_port != ares__sconfig_get_port(channel, s, ARES_FALSE)) { + if (server->udp_port != ares_sconfig_get_port(channel, s, ARES_FALSE)) { continue; } @@ -544,28 +609,28 @@ static ares__slist_node_t *ares__server_find(ares_channel_t *channel, return NULL; } -static ares_bool_t ares__server_isdup(const ares_channel_t *channel, - ares__llist_node_t *s) +static ares_bool_t ares_server_isdup(const ares_channel_t *channel, + ares_llist_node_t *s) { /* Scan backwards to see if this is a duplicate */ - ares__llist_node_t *prev; - const ares_sconfig_t *server = ares__llist_node_val(s); + ares_llist_node_t *prev; + const ares_sconfig_t *server = ares_llist_node_val(s); - for (prev = ares__llist_node_prev(s); prev != NULL; - prev = ares__llist_node_prev(prev)) { - const ares_sconfig_t *p = ares__llist_node_val(prev); + for (prev = ares_llist_node_prev(s); prev != NULL; + prev = ares_llist_node_prev(prev)) { + const ares_sconfig_t *p = ares_llist_node_val(prev); - if (!ares__addr_match(&server->addr, &p->addr)) { + if (!ares_addr_match(&server->addr, &p->addr)) { continue; } - if (ares__sconfig_get_port(channel, server, ARES_TRUE) != - ares__sconfig_get_port(channel, p, ARES_TRUE)) { + if (ares_sconfig_get_port(channel, server, ARES_TRUE) != + ares_sconfig_get_port(channel, p, ARES_TRUE)) { continue; } - if (ares__sconfig_get_port(channel, server, ARES_FALSE) != - ares__sconfig_get_port(channel, p, ARES_FALSE)) { + if (ares_sconfig_get_port(channel, server, ARES_FALSE) != + ares_sconfig_get_port(channel, p, ARES_FALSE)) { continue; } @@ -575,9 +640,9 @@ static ares_bool_t ares__server_isdup(const ares_channel_t *channel, return ARES_FALSE; } -static ares_status_t ares__server_create(ares_channel_t *channel, - const ares_sconfig_t *sconfig, - size_t idx) +static ares_status_t ares_server_create(ares_channel_t *channel, + const ares_sconfig_t *sconfig, + size_t idx) { ares_status_t status; ares_server_t *server = ares_malloc_zero(sizeof(*server)); @@ -588,8 +653,8 @@ static ares_status_t ares__server_create(ares_channel_t *channel, server->idx = idx; server->channel = channel; - server->udp_port = ares__sconfig_get_port(channel, sconfig, ARES_FALSE); - server->tcp_port = ares__sconfig_get_port(channel, sconfig, ARES_TRUE); + server->udp_port = ares_sconfig_get_port(channel, sconfig, ARES_FALSE); + server->tcp_port = ares_sconfig_get_port(channel, sconfig, ARES_TRUE); server->addr.family = sconfig->addr.family; server->next_retry_time.sec = 0; server->next_retry_time.usec = 0; @@ -608,25 +673,13 @@ static ares_status_t ares__server_create(ares_channel_t *channel, server->ll_scope = sconfig->ll_scope; } - server->tcp_parser = ares__buf_create(); - if (server->tcp_parser == NULL) { - status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ - goto done; /* LCOV_EXCL_LINE: OutOfMemory */ - } - - server->tcp_send = ares__buf_create(); - if (server->tcp_send == NULL) { - status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ - goto done; /* LCOV_EXCL_LINE: OutOfMemory */ - } - - server->connections = ares__llist_create(NULL); + server->connections = ares_llist_create(NULL); if (server->connections == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - if (ares__slist_insert(channel->servers, server) == NULL) { + if (ares_slist_insert(channel->servers, server) == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -635,31 +688,31 @@ static ares_status_t ares__server_create(ares_channel_t *channel, done: if (status != ARES_SUCCESS) { - ares__destroy_server(server); /* LCOV_EXCL_LINE: OutOfMemory */ + ares_destroy_server(server); /* LCOV_EXCL_LINE: OutOfMemory */ } return status; } -static ares_bool_t ares__server_in_newconfig(const ares_server_t *server, - ares__llist_t *srvlist) +static ares_bool_t ares_server_in_newconfig(const ares_server_t *server, + ares_llist_t *srvlist) { - ares__llist_node_t *node; + ares_llist_node_t *node; const ares_channel_t *channel = server->channel; - for (node = ares__llist_node_first(srvlist); node != NULL; - node = ares__llist_node_next(node)) { - const ares_sconfig_t *s = ares__llist_node_val(node); + for (node = ares_llist_node_first(srvlist); node != NULL; + node = ares_llist_node_next(node)) { + const ares_sconfig_t *s = ares_llist_node_val(node); - if (!ares__addr_match(&server->addr, &s->addr)) { + if (!ares_addr_match(&server->addr, &s->addr)) { continue; } - if (server->tcp_port != ares__sconfig_get_port(channel, s, ARES_TRUE)) { + if (server->tcp_port != ares_sconfig_get_port(channel, s, ARES_TRUE)) { continue; } - if (server->udp_port != ares__sconfig_get_port(channel, s, ARES_FALSE)) { + if (server->udp_port != ares_sconfig_get_port(channel, s, ARES_FALSE)) { continue; } @@ -669,19 +722,19 @@ static ares_bool_t ares__server_in_newconfig(const ares_server_t *server, return ARES_FALSE; } -static ares_bool_t ares__servers_remove_stale(ares_channel_t *channel, - ares__llist_t *srvlist) +static ares_bool_t ares_servers_remove_stale(ares_channel_t *channel, + ares_llist_t *srvlist) { - ares_bool_t stale_removed = ARES_FALSE; - ares__slist_node_t *snode = ares__slist_node_first(channel->servers); + ares_bool_t stale_removed = ARES_FALSE; + ares_slist_node_t *snode = ares_slist_node_first(channel->servers); while (snode != NULL) { - ares__slist_node_t *snext = ares__slist_node_next(snode); - const ares_server_t *server = ares__slist_node_val(snode); - if (!ares__server_in_newconfig(server, srvlist)) { + ares_slist_node_t *snext = ares_slist_node_next(snode); + const ares_server_t *server = ares_slist_node_val(snode); + if (!ares_server_in_newconfig(server, srvlist)) { /* This will clean up all server state via the destruction callback and * move any queries to new servers */ - ares__slist_node_destroy(snode); + ares_slist_node_destroy(snode); stale_removed = ARES_TRUE; } snode = snext; @@ -689,21 +742,21 @@ static ares_bool_t ares__servers_remove_stale(ares_channel_t *channel, return stale_removed; } -static void ares__servers_trim_single(ares_channel_t *channel) +static void ares_servers_trim_single(ares_channel_t *channel) { - while (ares__slist_len(channel->servers) > 1) { - ares__slist_node_destroy(ares__slist_node_last(channel->servers)); + while (ares_slist_len(channel->servers) > 1) { + ares_slist_node_destroy(ares_slist_node_last(channel->servers)); } } -ares_status_t ares__servers_update(ares_channel_t *channel, - ares__llist_t *server_list, - ares_bool_t user_specified) +ares_status_t ares_servers_update(ares_channel_t *channel, + ares_llist_t *server_list, + ares_bool_t user_specified) { - ares__llist_node_t *node; - size_t idx = 0; - ares_status_t status; - ares_bool_t list_changed = ARES_FALSE; + ares_llist_node_t *node; + size_t idx = 0; + ares_status_t status; + ares_bool_t list_changed = ARES_FALSE; if (channel == NULL) { return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ @@ -714,19 +767,19 @@ ares_status_t ares__servers_update(ares_channel_t *channel, */ /* Add new entries */ - for (node = ares__llist_node_first(server_list); node != NULL; - node = ares__llist_node_next(node)) { - const ares_sconfig_t *sconfig = ares__llist_node_val(node); - ares__slist_node_t *snode; + for (node = ares_llist_node_first(server_list); node != NULL; + node = ares_llist_node_next(node)) { + const ares_sconfig_t *sconfig = ares_llist_node_val(node); + ares_slist_node_t *snode; /* If a server has already appeared in the list of new servers, skip it. */ - if (ares__server_isdup(channel, node)) { + if (ares_server_isdup(channel, node)) { continue; } - snode = ares__server_find(channel, sconfig); + snode = ares_server_find(channel, sconfig); if (snode != NULL) { - ares_server_t *server = ares__slist_node_val(snode); + ares_server_t *server = ares_slist_node_val(snode); /* Copy over link-local settings. Its possible some of this data has * changed, maybe ... */ @@ -740,10 +793,10 @@ ares_status_t ares__servers_update(ares_channel_t *channel, server->idx = idx; /* Index changed, reinsert node, doesn't require any memory * allocations so can't fail. */ - ares__slist_node_reinsert(snode); + ares_slist_node_reinsert(snode); } } else { - status = ares__server_create(channel, sconfig, idx); + status = ares_server_create(channel, sconfig, idx); if (status != ARES_SUCCESS) { goto done; } @@ -755,13 +808,13 @@ ares_status_t ares__servers_update(ares_channel_t *channel, } /* Remove any servers that don't exist in the current configuration */ - if (ares__servers_remove_stale(channel, server_list)) { + if (ares_servers_remove_stale(channel, server_list)) { list_changed = ARES_TRUE; } /* Trim to one server if ARES_FLAG_PRIMARY is set. */ if (channel->flags & ARES_FLAG_PRIMARY) { - ares__servers_trim_single(channel); + ares_servers_trim_single(channel); } if (user_specified) { @@ -771,7 +824,7 @@ ares_status_t ares__servers_update(ares_channel_t *channel, /* Clear any cached query results only if the server list changed */ if (list_changed) { - ares__qcache_flush(channel->qcache); + ares_qcache_flush(channel->qcache); } status = ARES_SUCCESS; @@ -781,15 +834,15 @@ ares_status_t ares__servers_update(ares_channel_t *channel, } static ares_status_t - ares_addr_node_to_server_config_llist(const struct ares_addr_node *servers, - ares__llist_t **llist) + ares_addr_node_to_sconfig_llist(const struct ares_addr_node *servers, + ares_llist_t **llist) { const struct ares_addr_node *node; - ares__llist_t *s; + ares_llist_t *s; *llist = NULL; - s = ares__llist_create(ares_free); + s = ares_llist_create(ares_free); if (s == NULL) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -816,7 +869,7 @@ static ares_status_t sizeof(sconfig->addr.addr.addr6)); } - if (ares__llist_insert_last(s, sconfig) == NULL) { + if (ares_llist_insert_last(s, sconfig) == NULL) { ares_free(sconfig); /* LCOV_EXCL_LINE: OutOfMemory */ goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -827,20 +880,21 @@ static ares_status_t /* LCOV_EXCL_START: OutOfMemory */ fail: - ares__llist_destroy(s); + ares_llist_destroy(s); return ARES_ENOMEM; /* LCOV_EXCL_STOP */ } -static ares_status_t ares_addr_port_node_to_server_config_llist( - const struct ares_addr_port_node *servers, ares__llist_t **llist) +static ares_status_t + ares_addrpnode_to_sconfig_llist(const struct ares_addr_port_node *servers, + ares_llist_t **llist) { const struct ares_addr_port_node *node; - ares__llist_t *s; + ares_llist_t *s; *llist = NULL; - s = ares__llist_create(ares_free); + s = ares_llist_create(ares_free); if (s == NULL) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -870,7 +924,7 @@ static ares_status_t ares_addr_port_node_to_server_config_llist( sconfig->tcp_port = (unsigned short)node->tcp_port; sconfig->udp_port = (unsigned short)node->udp_port; - if (ares__llist_insert_last(s, sconfig) == NULL) { + if (ares_llist_insert_last(s, sconfig) == NULL) { ares_free(sconfig); /* LCOV_EXCL_LINE: OutOfMemory */ goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -881,21 +935,21 @@ static ares_status_t ares_addr_port_node_to_server_config_llist( /* LCOV_EXCL_START: OutOfMemory */ fail: - ares__llist_destroy(s); + ares_llist_destroy(s); return ARES_ENOMEM; /* LCOV_EXCL_STOP */ } -ares_status_t ares_in_addr_to_server_config_llist(const struct in_addr *servers, - size_t nservers, - ares__llist_t **llist) +ares_status_t ares_in_addr_to_sconfig_llist(const struct in_addr *servers, + size_t nservers, + ares_llist_t **llist) { - size_t i; - ares__llist_t *s; + size_t i; + ares_llist_t *s; *llist = NULL; - s = ares__llist_create(ares_free); + s = ares_llist_create(ares_free); if (s == NULL) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -912,7 +966,7 @@ ares_status_t ares_in_addr_to_server_config_llist(const struct in_addr *servers, memcpy(&sconfig->addr.addr.addr4, &servers[i], sizeof(sconfig->addr.addr.addr4)); - if (ares__llist_insert_last(s, sconfig) == NULL) { + if (ares_llist_insert_last(s, sconfig) == NULL) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } } @@ -922,21 +976,90 @@ ares_status_t ares_in_addr_to_server_config_llist(const struct in_addr *servers, /* LCOV_EXCL_START: OutOfMemory */ fail: - ares__llist_destroy(s); + ares_llist_destroy(s); return ARES_ENOMEM; /* LCOV_EXCL_STOP */ } +static ares_bool_t ares_server_use_uri(const ares_server_t *server) +{ + /* Currently only reason to use new format is if the ports for udp and tcp + * are different */ + if (server->tcp_port != server->udp_port) { + return ARES_TRUE; + } + return ARES_FALSE; +} + +static ares_status_t ares_get_server_addr_uri(const ares_server_t *server, + ares_buf_t *buf) +{ + ares_uri_t *uri = NULL; + ares_status_t status; + char addr[INET6_ADDRSTRLEN]; + + uri = ares_uri_create(); + if (uri == NULL) { + return ARES_ENOMEM; + } + + status = ares_uri_set_scheme(uri, "dns"); + if (status != ARES_SUCCESS) { + goto done; + } + + ares_inet_ntop(server->addr.family, &server->addr.addr, addr, sizeof(addr)); + + if (ares_strlen(server->ll_iface)) { + char addr_iface[256]; + + snprintf(addr_iface, sizeof(addr_iface), "%s%%%s", addr, server->ll_iface); + status = ares_uri_set_host(uri, addr_iface); + } else { + status = ares_uri_set_host(uri, addr); + } + + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_set_port(uri, server->udp_port); + if (status != ARES_SUCCESS) { + goto done; + } + + if (server->udp_port != server->tcp_port) { + char port[6]; + snprintf(port, sizeof(port), "%d", server->tcp_port); + status = ares_uri_set_query_key(uri, "tcpport", port); + if (status != ARES_SUCCESS) { + goto done; + } + } + + status = ares_uri_write_buf(uri, buf); + if (status != ARES_SUCCESS) { + goto done; + } + +done: + ares_uri_destroy(uri); + return status; +} + /* Write out the details of a server to a buffer */ -ares_status_t ares_get_server_addr(const ares_server_t *server, - ares__buf_t *buf) +ares_status_t ares_get_server_addr(const ares_server_t *server, ares_buf_t *buf) { ares_status_t status; char addr[INET6_ADDRSTRLEN]; + if (ares_server_use_uri(server)) { + return ares_get_server_addr_uri(server, buf); + } + /* ipv4addr or [ipv6addr] */ if (server->addr.family == AF_INET6) { - status = ares__buf_append_byte(buf, '['); + status = ares_buf_append_byte(buf, '['); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -944,37 +1067,37 @@ ares_status_t ares_get_server_addr(const ares_server_t *server, ares_inet_ntop(server->addr.family, &server->addr.addr, addr, sizeof(addr)); - status = ares__buf_append_str(buf, addr); + status = ares_buf_append_str(buf, addr); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } if (server->addr.family == AF_INET6) { - status = ares__buf_append_byte(buf, ']'); + status = ares_buf_append_byte(buf, ']'); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } } /* :port */ - status = ares__buf_append_byte(buf, ':'); + status = ares_buf_append_byte(buf, ':'); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_append_num_dec(buf, server->udp_port, 0); + status = ares_buf_append_num_dec(buf, server->udp_port, 0); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* %iface */ if (ares_strlen(server->ll_iface)) { - status = ares__buf_append_byte(buf, '%'); + status = ares_buf_append_byte(buf, '%'); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_append_str(buf, server->ll_iface); + status = ares_buf_append_str(buf, server->ll_iface); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -990,17 +1113,17 @@ int ares_get_servers(const ares_channel_t *channel, struct ares_addr_node *srvr_last = NULL; struct ares_addr_node *srvr_curr; ares_status_t status = ARES_SUCCESS; - ares__slist_node_t *node; + ares_slist_node_t *node; if (channel == NULL) { return ARES_ENODATA; } - ares__channel_lock(channel); + ares_channel_lock(channel); - for (node = ares__slist_node_first(channel->servers); node != NULL; - node = ares__slist_node_next(node)) { - const ares_server_t *server = ares__slist_node_val(node); + for (node = ares_slist_node_first(channel->servers); node != NULL; + node = ares_slist_node_next(node)) { + const ares_server_t *server = ares_slist_node_val(node); /* Allocate storage for this server node appending it to the list */ srvr_curr = ares_malloc_data(ARES_DATATYPE_ADDR_NODE); @@ -1033,7 +1156,7 @@ int ares_get_servers(const ares_channel_t *channel, *servers = srvr_head; - ares__channel_unlock(channel); + ares_channel_unlock(channel); return (int)status; } @@ -1045,17 +1168,17 @@ int ares_get_servers_ports(const ares_channel_t *channel, struct ares_addr_port_node *srvr_last = NULL; struct ares_addr_port_node *srvr_curr; ares_status_t status = ARES_SUCCESS; - ares__slist_node_t *node; + ares_slist_node_t *node; if (channel == NULL) { return ARES_ENODATA; } - ares__channel_lock(channel); + ares_channel_lock(channel); - for (node = ares__slist_node_first(channel->servers); node != NULL; - node = ares__slist_node_next(node)) { - const ares_server_t *server = ares__slist_node_val(node); + for (node = ares_slist_node_first(channel->servers); node != NULL; + node = ares_slist_node_next(node)) { + const ares_server_t *server = ares_slist_node_val(node); /* Allocate storage for this server node appending it to the list */ srvr_curr = ares_malloc_data(ARES_DATATYPE_ADDR_PORT_NODE); @@ -1091,30 +1214,30 @@ int ares_get_servers_ports(const ares_channel_t *channel, *servers = srvr_head; - ares__channel_unlock(channel); + ares_channel_unlock(channel); return (int)status; } int ares_set_servers(ares_channel_t *channel, const struct ares_addr_node *servers) { - ares__llist_t *slist; - ares_status_t status; + ares_llist_t *slist; + ares_status_t status; if (channel == NULL) { return ARES_ENODATA; } - status = ares_addr_node_to_server_config_llist(servers, &slist); + status = ares_addr_node_to_sconfig_llist(servers, &slist); if (status != ARES_SUCCESS) { return (int)status; } - ares__channel_lock(channel); - status = ares__servers_update(channel, slist, ARES_TRUE); - ares__channel_unlock(channel); + ares_channel_lock(channel); + status = ares_servers_update(channel, slist, ARES_TRUE); + ares_channel_unlock(channel); - ares__llist_destroy(slist); + ares_llist_destroy(slist); return (int)status; } @@ -1122,23 +1245,23 @@ int ares_set_servers(ares_channel_t *channel, int ares_set_servers_ports(ares_channel_t *channel, const struct ares_addr_port_node *servers) { - ares__llist_t *slist; - ares_status_t status; + ares_llist_t *slist; + ares_status_t status; if (channel == NULL) { return ARES_ENODATA; } - status = ares_addr_port_node_to_server_config_llist(servers, &slist); + status = ares_addrpnode_to_sconfig_llist(servers, &slist); if (status != ARES_SUCCESS) { return (int)status; } - ares__channel_lock(channel); - status = ares__servers_update(channel, slist, ARES_TRUE); - ares__channel_unlock(channel); + ares_channel_lock(channel); + status = ares_servers_update(channel, slist, ARES_TRUE); + ares_channel_unlock(channel); - ares__llist_destroy(slist); + ares_llist_destroy(slist); return (int)status; } @@ -1147,8 +1270,8 @@ int ares_set_servers_ports(ares_channel_t *channel, /* IPv6 addresses with ports require square brackets [fe80::1]:53 */ static ares_status_t set_servers_csv(ares_channel_t *channel, const char *_csv) { - ares_status_t status; - ares__llist_t *slist = NULL; + ares_status_t status; + ares_llist_t *slist = NULL; if (channel == NULL) { return ARES_ENODATA; @@ -1156,23 +1279,23 @@ static ares_status_t set_servers_csv(ares_channel_t *channel, const char *_csv) if (ares_strlen(_csv) == 0) { /* blank all servers */ - ares__channel_lock(channel); - status = ares__servers_update(channel, NULL, ARES_TRUE); - ares__channel_unlock(channel); + ares_channel_lock(channel); + status = ares_servers_update(channel, NULL, ARES_TRUE); + ares_channel_unlock(channel); return status; } - status = ares__sconfig_append_fromstr(&slist, _csv, ARES_FALSE); + status = ares_sconfig_append_fromstr(channel, &slist, _csv, ARES_FALSE); if (status != ARES_SUCCESS) { - ares__llist_destroy(slist); + ares_llist_destroy(slist); return status; } - ares__channel_lock(channel); - status = ares__servers_update(channel, slist, ARES_TRUE); - ares__channel_unlock(channel); + ares_channel_lock(channel); + status = ares_servers_update(channel, slist, ARES_TRUE); + ares_channel_unlock(channel); - ares__llist_destroy(slist); + ares_llist_destroy(slist); return status; } @@ -1190,24 +1313,24 @@ int ares_set_servers_ports_csv(ares_channel_t *channel, const char *_csv) char *ares_get_servers_csv(const ares_channel_t *channel) { - ares__buf_t *buf = NULL; - char *out = NULL; - ares__slist_node_t *node; + ares_buf_t *buf = NULL; + char *out = NULL; + ares_slist_node_t *node; - ares__channel_lock(channel); + ares_channel_lock(channel); - buf = ares__buf_create(); + buf = ares_buf_create(); if (buf == NULL) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - for (node = ares__slist_node_first(channel->servers); node != NULL; - node = ares__slist_node_next(node)) { + for (node = ares_slist_node_first(channel->servers); node != NULL; + node = ares_slist_node_next(node)) { ares_status_t status; - const ares_server_t *server = ares__slist_node_val(node); + const ares_server_t *server = ares_slist_node_val(node); - if (ares__buf_len(buf)) { - status = ares__buf_append_byte(buf, ','); + if (ares_buf_len(buf)) { + status = ares_buf_append_byte(buf, ','); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -1219,12 +1342,12 @@ char *ares_get_servers_csv(const ares_channel_t *channel) } } - out = ares__buf_finish_str(buf, NULL); + out = ares_buf_finish_str(buf, NULL); buf = NULL; done: - ares__channel_unlock(channel); - ares__buf_destroy(buf); + ares_channel_unlock(channel); + ares_buf_destroy(buf); return out; } diff --git a/deps/cares/src/lib/config-dos.h b/deps/cares/src/lib/config-dos.h index db758fcca6619a..afbcfb2858ea0b 100644 --- a/deps/cares/src/lib/config-dos.h +++ b/deps/cares/src/lib/config-dos.h @@ -21,6 +21,7 @@ #define HAVE_RECV 1 #define HAVE_RECVFROM 1 #define HAVE_SEND 1 +#define HAVE_SENDTO 1 #define HAVE_STRDUP 1 #define HAVE_STRICMP 1 #define HAVE_STRUCT_IN6_ADDR 1 diff --git a/deps/cares/src/lib/config-win32.h b/deps/cares/src/lib/config-win32.h index b9c4ec17336b86..be233a2f8b9c2d 100644 --- a/deps/cares/src/lib/config-win32.h +++ b/deps/cares/src/lib/config-win32.h @@ -187,6 +187,9 @@ /* Define if you have the send function. */ #define HAVE_SEND 1 +/* Define if you have the sendto function. */ +#define HAVE_SENDTO 1 + /* Define to the type of arg 1 for send. */ #define SEND_TYPE_ARG1 SOCKET diff --git a/deps/cares/src/lib/dsa/ares__array.c b/deps/cares/src/lib/dsa/ares_array.c similarity index 60% rename from deps/cares/src/lib/dsa/ares__array.c rename to deps/cares/src/lib/dsa/ares_array.c index 0c724248bf2e09..c421d5c5f670bd 100644 --- a/deps/cares/src/lib/dsa/ares__array.c +++ b/deps/cares/src/lib/dsa/ares_array.c @@ -24,23 +24,23 @@ * SPDX-License-Identifier: MIT */ #include "ares_private.h" -#include "ares__array.h" +#include "ares_array.h" #define ARES__ARRAY_MIN 4 -struct ares__array { - ares__array_destructor_t destruct; - void *arr; - size_t member_size; - size_t cnt; - size_t offset; - size_t alloc_cnt; +struct ares_array { + ares_array_destructor_t destruct; + void *arr; + size_t member_size; + size_t cnt; + size_t offset; + size_t alloc_cnt; }; -ares__array_t *ares__array_create(size_t member_size, - ares__array_destructor_t destruct) +ares_array_t *ares_array_create(size_t member_size, + ares_array_destructor_t destruct) { - ares__array_t *arr; + ares_array_t *arr; if (member_size == 0) { return NULL; @@ -56,7 +56,7 @@ ares__array_t *ares__array_create(size_t member_size, return arr; } -size_t ares__array_len(const ares__array_t *arr) +size_t ares_array_len(const ares_array_t *arr) { if (arr == NULL) { return 0; @@ -64,7 +64,7 @@ size_t ares__array_len(const ares__array_t *arr) return arr->cnt; } -void *ares__array_at(ares__array_t *arr, size_t idx) +void *ares_array_at(ares_array_t *arr, size_t idx) { if (arr == NULL || idx >= arr->cnt) { return NULL; @@ -72,7 +72,7 @@ void *ares__array_at(ares__array_t *arr, size_t idx) return (unsigned char *)arr->arr + ((idx + arr->offset) * arr->member_size); } -const void *ares__array_at_const(const ares__array_t *arr, size_t idx) +const void *ares_array_at_const(const ares_array_t *arr, size_t idx) { if (arr == NULL || idx >= arr->cnt) { return NULL; @@ -80,7 +80,7 @@ const void *ares__array_at_const(const ares__array_t *arr, size_t idx) return (unsigned char *)arr->arr + ((idx + arr->offset) * arr->member_size); } -ares_status_t ares__array_sort(ares__array_t *arr, ares__array_cmp_t cmp) +ares_status_t ares_array_sort(ares_array_t *arr, ares_array_cmp_t cmp) { if (arr == NULL || cmp == NULL) { return ARES_EFORMERR; @@ -96,7 +96,7 @@ ares_status_t ares__array_sort(ares__array_t *arr, ares__array_cmp_t cmp) return ARES_SUCCESS; } -void ares__array_destroy(ares__array_t *arr) +void ares_array_destroy(ares_array_t *arr) { size_t i; @@ -106,7 +106,7 @@ void ares__array_destroy(ares__array_t *arr) if (arr->destruct != NULL) { for (i = 0; i < arr->cnt; i++) { - arr->destruct(ares__array_at(arr, i)); + arr->destruct(ares_array_at(arr, i)); } } @@ -116,8 +116,8 @@ void ares__array_destroy(ares__array_t *arr) /* NOTE: this function operates on actual indexes, NOT indexes using the * arr->offset */ -static ares_status_t ares__array_move(ares__array_t *arr, size_t dest_idx, - size_t src_idx) +static ares_status_t ares_array_move(ares_array_t *arr, size_t dest_idx, + size_t src_idx) { void *dest_ptr; const void *src_ptr; @@ -140,18 +140,14 @@ static ares_status_t ares__array_move(ares__array_t *arr, size_t dest_idx, if (dest_idx > src_idx && arr->cnt + (dest_idx - src_idx) > arr->alloc_cnt) { return ARES_EFORMERR; } - if (dest_idx < src_idx) { - nmembers = arr->cnt - dest_idx; - } else { - nmembers = arr->cnt - src_idx; - } + nmembers = arr->cnt - (src_idx - arr->offset); memmove(dest_ptr, src_ptr, nmembers * arr->member_size); return ARES_SUCCESS; } -void *ares__array_finish(ares__array_t *arr, size_t *num_members) +void *ares_array_finish(ares_array_t *arr, size_t *num_members) { void *ptr; @@ -161,7 +157,7 @@ void *ares__array_finish(ares__array_t *arr, size_t *num_members) /* Make sure we move data to beginning of allocation */ if (arr->offset != 0) { - if (ares__array_move(arr, 0, arr->offset) != ARES_SUCCESS) { + if (ares_array_move(arr, 0, arr->offset) != ARES_SUCCESS) { return NULL; } arr->offset = 0; @@ -173,7 +169,7 @@ void *ares__array_finish(ares__array_t *arr, size_t *num_members) return ptr; } -ares_status_t ares__array_set_size(ares__array_t *arr, size_t size) +ares_status_t ares_array_set_size(ares_array_t *arr, size_t size) { void *temp; @@ -182,7 +178,7 @@ ares_status_t ares__array_set_size(ares__array_t *arr, size_t size) } /* Always operate on powers of 2 */ - size = ares__round_up_pow2(size); + size = ares_round_up_pow2(size); if (size < ARES__ARRAY_MIN) { size = ARES__ARRAY_MIN; @@ -203,8 +199,8 @@ ares_status_t ares__array_set_size(ares__array_t *arr, size_t size) return ARES_SUCCESS; } -ares_status_t ares__array_insert_at(void **elem_ptr, ares__array_t *arr, - size_t idx) +ares_status_t ares_array_insert_at(void **elem_ptr, ares_array_t *arr, + size_t idx) { void *ptr; ares_status_t status; @@ -219,14 +215,14 @@ ares_status_t ares__array_insert_at(void **elem_ptr, ares__array_t *arr, } /* Allocate more if needed */ - status = ares__array_set_size(arr, arr->cnt + 1); + status = ares_array_set_size(arr, arr->cnt + 1); if (status != ARES_SUCCESS) { return status; } /* Shift if we have memory but not enough room at the end */ if (arr->cnt + 1 + arr->offset > arr->alloc_cnt) { - status = ares__array_move(arr, 0, arr->offset); + status = ares_array_move(arr, 0, arr->offset); if (status != ARES_SUCCESS) { return status; } @@ -236,7 +232,7 @@ ares_status_t ares__array_insert_at(void **elem_ptr, ares__array_t *arr, /* If we're inserting anywhere other than the end, we need to move some * elements out of the way */ if (idx != arr->cnt) { - status = ares__array_move(arr, idx + arr->offset + 1, idx + arr->offset); + status = ares_array_move(arr, idx + arr->offset + 1, idx + arr->offset); if (status != ARES_SUCCESS) { return status; } @@ -255,46 +251,88 @@ ares_status_t ares__array_insert_at(void **elem_ptr, ares__array_t *arr, return ARES_SUCCESS; } -ares_status_t ares__array_insert_last(void **elem_ptr, ares__array_t *arr) +ares_status_t ares_array_insert_last(void **elem_ptr, ares_array_t *arr) +{ + return ares_array_insert_at(elem_ptr, arr, ares_array_len(arr)); +} + +ares_status_t ares_array_insert_first(void **elem_ptr, ares_array_t *arr) +{ + return ares_array_insert_at(elem_ptr, arr, 0); +} + +ares_status_t ares_array_insertdata_at(ares_array_t *arr, size_t idx, + const void *data_ptr) +{ + ares_status_t status; + void *ptr = NULL; + + status = ares_array_insert_at(&ptr, arr, idx); + if (status != ARES_SUCCESS) { + return status; + } + memcpy(ptr, data_ptr, arr->member_size); + return ARES_SUCCESS; +} + +ares_status_t ares_array_insertdata_last(ares_array_t *arr, + const void *data_ptr) { - return ares__array_insert_at(elem_ptr, arr, ares__array_len(arr)); + ares_status_t status; + void *ptr = NULL; + + status = ares_array_insert_last(&ptr, arr); + if (status != ARES_SUCCESS) { + return status; + } + memcpy(ptr, data_ptr, arr->member_size); + return ARES_SUCCESS; } -ares_status_t ares__array_insert_first(void **elem_ptr, ares__array_t *arr) +ares_status_t ares_array_insertdata_first(ares_array_t *arr, + const void *data_ptr) { - return ares__array_insert_at(elem_ptr, arr, 0); + ares_status_t status; + void *ptr = NULL; + + status = ares_array_insert_last(&ptr, arr); + if (status != ARES_SUCCESS) { + return status; + } + memcpy(ptr, data_ptr, arr->member_size); + return ARES_SUCCESS; } -void *ares__array_first(ares__array_t *arr) +void *ares_array_first(ares_array_t *arr) { - return ares__array_at(arr, 0); + return ares_array_at(arr, 0); } -void *ares__array_last(ares__array_t *arr) +void *ares_array_last(ares_array_t *arr) { - size_t cnt = ares__array_len(arr); + size_t cnt = ares_array_len(arr); if (cnt == 0) { return NULL; } - return ares__array_at(arr, cnt - 1); + return ares_array_at(arr, cnt - 1); } -const void *ares__array_first_const(const ares__array_t *arr) +const void *ares_array_first_const(const ares_array_t *arr) { - return ares__array_at_const(arr, 0); + return ares_array_at_const(arr, 0); } -const void *ares__array_last_const(const ares__array_t *arr) +const void *ares_array_last_const(const ares_array_t *arr) { - size_t cnt = ares__array_len(arr); + size_t cnt = ares_array_len(arr); if (cnt == 0) { return NULL; } - return ares__array_at_const(arr, cnt - 1); + return ares_array_at_const(arr, cnt - 1); } -ares_status_t ares__array_claim_at(void *dest, size_t dest_size, - ares__array_t *arr, size_t idx) +ares_status_t ares_array_claim_at(void *dest, size_t dest_size, + ares_array_t *arr, size_t idx) { ares_status_t status; @@ -307,7 +345,7 @@ ares_status_t ares__array_claim_at(void *dest, size_t dest_size, } if (dest) { - memcpy(dest, ares__array_at(arr, idx), arr->member_size); + memcpy(dest, ares_array_at(arr, idx), arr->member_size); } if (idx == 0) { @@ -317,7 +355,7 @@ ares_status_t ares__array_claim_at(void *dest, size_t dest_size, } else if (idx != arr->cnt - 1) { /* Must shift entire array if removing an element from the middle. Does * nothing if removing last element other than decrement count. */ - status = ares__array_move(arr, idx + arr->offset, idx + arr->offset + 1); + status = ares_array_move(arr, idx + arr->offset, idx + arr->offset + 1); if (status != ARES_SUCCESS) { return status; } @@ -327,9 +365,9 @@ ares_status_t ares__array_claim_at(void *dest, size_t dest_size, return ARES_SUCCESS; } -ares_status_t ares__array_remove_at(ares__array_t *arr, size_t idx) +ares_status_t ares_array_remove_at(ares_array_t *arr, size_t idx) { - void *ptr = ares__array_at(arr, idx); + void *ptr = ares_array_at(arr, idx); if (arr == NULL || ptr == NULL) { return ARES_EFORMERR; } @@ -338,19 +376,19 @@ ares_status_t ares__array_remove_at(ares__array_t *arr, size_t idx) arr->destruct(ptr); } - return ares__array_claim_at(NULL, 0, arr, idx); + return ares_array_claim_at(NULL, 0, arr, idx); } -ares_status_t ares__array_remove_first(ares__array_t *arr) +ares_status_t ares_array_remove_first(ares_array_t *arr) { - return ares__array_remove_at(arr, 0); + return ares_array_remove_at(arr, 0); } -ares_status_t ares__array_remove_last(ares__array_t *arr) +ares_status_t ares_array_remove_last(ares_array_t *arr) { - size_t cnt = ares__array_len(arr); + size_t cnt = ares_array_len(arr); if (cnt == 0) { return ARES_EFORMERR; } - return ares__array_remove_at(arr, cnt - 1); + return ares_array_remove_at(arr, cnt - 1); } diff --git a/deps/cares/src/lib/dsa/ares__htable.c b/deps/cares/src/lib/dsa/ares_htable.c similarity index 64% rename from deps/cares/src/lib/dsa/ares__htable.c rename to deps/cares/src/lib/dsa/ares_htable.c index 9049b3246b36f1..f76b67cae9a668 100644 --- a/deps/cares/src/lib/dsa/ares__htable.c +++ b/deps/cares/src/lib/dsa/ares_htable.c @@ -24,33 +24,37 @@ * SPDX-License-Identifier: MIT */ #include "ares_private.h" -#include "ares__llist.h" -#include "ares__htable.h" +#include "ares_llist.h" +#include "ares_htable.h" #define ARES__HTABLE_MAX_BUCKETS (1U << 24) #define ARES__HTABLE_MIN_BUCKETS (1U << 4) #define ARES__HTABLE_EXPAND_PERCENT 75 -struct ares__htable { - ares__htable_hashfunc_t hash; - ares__htable_bucket_key_t bucket_key; - ares__htable_bucket_free_t bucket_free; - ares__htable_key_eq_t key_eq; - unsigned int seed; - unsigned int size; - size_t num_keys; - size_t num_collisions; - /* NOTE: if we converted buckets into ares__slist_t we could guarantee on +struct ares_htable { + ares_htable_hashfunc_t hash; + ares_htable_bucket_key_t bucket_key; + ares_htable_bucket_free_t bucket_free; + ares_htable_key_eq_t key_eq; + unsigned int seed; + unsigned int size; + size_t num_keys; + size_t num_collisions; + /* NOTE: if we converted buckets into ares_slist_t we could guarantee on * hash collisions we would have O(log n) worst case insert and search * performance. (We'd also need to make key_eq into a key_cmp to * support sort). That said, risk with a random hash seed is near zero, - * and ares__slist_t is heavier weight, so I think using ares__llist_t + * and ares_slist_t is heavier weight, so I think using ares_llist_t * is an overall win. */ - ares__llist_t **buckets; + ares_llist_t **buckets; }; -static unsigned int ares__htable_generate_seed(ares__htable_t *htable) +static unsigned int ares_htable_generate_seed(ares_htable_t *htable) { +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + /* Seed needs to be static for fuzzing */ + return 0; +#else unsigned int seed = 0; time_t t = time(NULL); @@ -61,11 +65,12 @@ static unsigned int ares__htable_generate_seed(ares__htable_t *htable) seed |= (unsigned int)((size_t)&seed & 0xFFFFFFFF); seed |= (unsigned int)(((ares_uint64_t)t) & 0xFFFFFFFF); return seed; +#endif } -static void ares__htable_buckets_destroy(ares__llist_t **buckets, - unsigned int size, - ares_bool_t destroy_vals) +static void ares_htable_buckets_destroy(ares_llist_t **buckets, + unsigned int size, + ares_bool_t destroy_vals) { unsigned int i; @@ -79,30 +84,30 @@ static void ares__htable_buckets_destroy(ares__llist_t **buckets, } if (!destroy_vals) { - ares__llist_replace_destructor(buckets[i], NULL); + ares_llist_replace_destructor(buckets[i], NULL); } - ares__llist_destroy(buckets[i]); + ares_llist_destroy(buckets[i]); } ares_free(buckets); } -void ares__htable_destroy(ares__htable_t *htable) +void ares_htable_destroy(ares_htable_t *htable) { if (htable == NULL) { return; } - ares__htable_buckets_destroy(htable->buckets, htable->size, ARES_TRUE); + ares_htable_buckets_destroy(htable->buckets, htable->size, ARES_TRUE); ares_free(htable); } -ares__htable_t *ares__htable_create(ares__htable_hashfunc_t hash_func, - ares__htable_bucket_key_t bucket_key, - ares__htable_bucket_free_t bucket_free, - ares__htable_key_eq_t key_eq) +ares_htable_t *ares_htable_create(ares_htable_hashfunc_t hash_func, + ares_htable_bucket_key_t bucket_key, + ares_htable_bucket_free_t bucket_free, + ares_htable_key_eq_t key_eq) { - ares__htable_t *htable = NULL; + ares_htable_t *htable = NULL; if (hash_func == NULL || bucket_key == NULL || bucket_free == NULL || key_eq == NULL) { @@ -118,7 +123,7 @@ ares__htable_t *ares__htable_create(ares__htable_hashfunc_t hash_func, htable->bucket_key = bucket_key; htable->bucket_free = bucket_free; htable->key_eq = key_eq; - htable->seed = ares__htable_generate_seed(htable); + htable->seed = ares_htable_generate_seed(htable); htable->size = ARES__HTABLE_MIN_BUCKETS; htable->buckets = ares_malloc_zero(sizeof(*htable->buckets) * htable->size); @@ -129,11 +134,11 @@ ares__htable_t *ares__htable_create(ares__htable_hashfunc_t hash_func, return htable; fail: - ares__htable_destroy(htable); + ares_htable_destroy(htable); return NULL; } -const void **ares__htable_all_buckets(const ares__htable_t *htable, size_t *num) +const void **ares_htable_all_buckets(const ares_htable_t *htable, size_t *num) { const void **out = NULL; size_t cnt = 0; @@ -151,10 +156,10 @@ const void **ares__htable_all_buckets(const ares__htable_t *htable, size_t *num) } for (i = 0; i < htable->size; i++) { - ares__llist_node_t *node; - for (node = ares__llist_node_first(htable->buckets[i]); node != NULL; - node = ares__llist_node_next(node)) { - out[cnt++] = ares__llist_node_val(node); + ares_llist_node_t *node; + for (node = ares_llist_node_first(htable->buckets[i]); node != NULL; + node = ares_llist_node_next(node)) { + out[cnt++] = ares_llist_node_val(node); } } @@ -169,14 +174,14 @@ const void **ares__htable_all_buckets(const ares__htable_t *htable, size_t *num) * efficient */ #define HASH_IDX(h, key) h->hash(key, h->seed) & (h->size - 1) -static ares__llist_node_t *ares__htable_find(const ares__htable_t *htable, - unsigned int idx, const void *key) +static ares_llist_node_t *ares_htable_find(const ares_htable_t *htable, + unsigned int idx, const void *key) { - ares__llist_node_t *node = NULL; + ares_llist_node_t *node = NULL; - for (node = ares__llist_node_first(htable->buckets[idx]); node != NULL; - node = ares__llist_node_next(node)) { - if (htable->key_eq(key, htable->bucket_key(ares__llist_node_val(node)))) { + for (node = ares_llist_node_first(htable->buckets[idx]); node != NULL; + node = ares_llist_node_next(node)) { + if (htable->key_eq(key, htable->bucket_key(ares_llist_node_val(node)))) { break; } } @@ -184,14 +189,14 @@ static ares__llist_node_t *ares__htable_find(const ares__htable_t *htable, return node; } -static ares_bool_t ares__htable_expand(ares__htable_t *htable) +static ares_bool_t ares_htable_expand(ares_htable_t *htable) { - ares__llist_t **buckets = NULL; - unsigned int old_size = htable->size; - size_t i; - ares__llist_t **prealloc_llist = NULL; - size_t prealloc_llist_len = 0; - ares_bool_t rv = ARES_FALSE; + ares_llist_t **buckets = NULL; + unsigned int old_size = htable->size; + size_t i; + ares_llist_t **prealloc_llist = NULL; + size_t prealloc_llist_len = 0; + ares_bool_t rv = ARES_FALSE; /* Not a failure, just won't expand */ if (old_size == ARES__HTABLE_MAX_BUCKETS) { @@ -219,7 +224,7 @@ static ares_bool_t ares__htable_expand(ares__htable_t *htable) } } for (i = 0; i < prealloc_llist_len; i++) { - prealloc_llist[i] = ares__llist_create(htable->bucket_free); + prealloc_llist[i] = ares_llist_create(htable->bucket_free); if (prealloc_llist[i] == NULL) { goto done; } @@ -228,7 +233,7 @@ static ares_bool_t ares__htable_expand(ares__htable_t *htable) /* Iterate across all buckets and move the entries to the new buckets */ htable->num_collisions = 0; for (i = 0; i < old_size; i++) { - ares__llist_node_t *node; + ares_llist_node_t *node; /* Nothing in this bucket */ if (htable->buckets[i] == NULL) { @@ -238,8 +243,8 @@ static ares_bool_t ares__htable_expand(ares__htable_t *htable) /* Fast path optimization (most likely case), there is likely only a single * entry in both the source and destination, check for this to confirm and * if so, just move the bucket over */ - if (ares__llist_len(htable->buckets[i]) == 1) { - const void *val = ares__llist_first_val(htable->buckets[i]); + if (ares_llist_len(htable->buckets[i]) == 1) { + const void *val = ares_llist_first_val(htable->buckets[i]); size_t idx = HASH_IDX(htable, htable->bucket_key(val)); if (buckets[idx] == NULL) { @@ -251,13 +256,13 @@ static ares_bool_t ares__htable_expand(ares__htable_t *htable) } /* Slow path, collisions */ - while ((node = ares__llist_node_first(htable->buckets[i])) != NULL) { - const void *val = ares__llist_node_val(node); + while ((node = ares_llist_node_first(htable->buckets[i])) != NULL) { + const void *val = ares_llist_node_val(node); size_t idx = HASH_IDX(htable, htable->bucket_key(val)); /* Try fast path again as maybe we popped one collision off and the * next we can reuse the llist parent */ - if (buckets[idx] == NULL && ares__llist_len(htable->buckets[i]) == 1) { + if (buckets[idx] == NULL && ares_llist_len(htable->buckets[i]) == 1) { /* Swap! */ buckets[idx] = htable->buckets[i]; htable->buckets[i] = NULL; @@ -277,12 +282,12 @@ static ares_bool_t ares__htable_expand(ares__htable_t *htable) htable->num_collisions++; } - ares__llist_node_move_parent_first(node, buckets[idx]); + ares_llist_node_mvparent_first(node, buckets[idx]); } /* Abandoned bucket, destroy */ if (htable->buckets[i] != NULL) { - ares__llist_destroy(htable->buckets[i]); + ares_llist_destroy(htable->buckets[i]); htable->buckets[i] = NULL; } } @@ -297,8 +302,8 @@ static ares_bool_t ares__htable_expand(ares__htable_t *htable) done: ares_free(buckets); /* destroy any unused preallocated buckets */ - ares__htable_buckets_destroy(prealloc_llist, (unsigned int)prealloc_llist_len, - ARES_FALSE); + ares_htable_buckets_destroy(prealloc_llist, (unsigned int)prealloc_llist_len, + ARES_FALSE); /* On failure, we need to restore the htable size */ if (rv != ARES_TRUE) { @@ -308,11 +313,11 @@ static ares_bool_t ares__htable_expand(ares__htable_t *htable) return rv; } -ares_bool_t ares__htable_insert(ares__htable_t *htable, void *bucket) +ares_bool_t ares_htable_insert(ares_htable_t *htable, void *bucket) { - unsigned int idx = 0; - ares__llist_node_t *node = NULL; - const void *key = NULL; + unsigned int idx = 0; + ares_llist_node_t *node = NULL; + const void *key = NULL; if (htable == NULL || bucket == NULL) { return ARES_FALSE; @@ -323,9 +328,9 @@ ares_bool_t ares__htable_insert(ares__htable_t *htable, void *bucket) idx = HASH_IDX(htable, key); /* See if we have a matching bucket already, if so, replace it */ - node = ares__htable_find(htable, idx, key); + node = ares_htable_find(htable, idx, key); if (node != NULL) { - ares__llist_node_replace(node, bucket); + ares_llist_node_replace(node, bucket); return ARES_TRUE; } @@ -333,7 +338,7 @@ ares_bool_t ares__htable_insert(ares__htable_t *htable, void *bucket) * increased beyond our threshold */ if (htable->num_keys + 1 > (htable->size * ARES__HTABLE_EXPAND_PERCENT) / 100) { - if (!ares__htable_expand(htable)) { + if (!ares_htable_expand(htable)) { return ARES_FALSE; /* LCOV_EXCL_LINE */ } /* If we expanded, need to calculate a new index */ @@ -342,19 +347,19 @@ ares_bool_t ares__htable_insert(ares__htable_t *htable, void *bucket) /* We lazily allocate the linked list */ if (htable->buckets[idx] == NULL) { - htable->buckets[idx] = ares__llist_create(htable->bucket_free); + htable->buckets[idx] = ares_llist_create(htable->bucket_free); if (htable->buckets[idx] == NULL) { return ARES_FALSE; } } - node = ares__llist_insert_first(htable->buckets[idx], bucket); + node = ares_llist_insert_first(htable->buckets[idx], bucket); if (node == NULL) { return ARES_FALSE; } /* Track collisions for rehash stability */ - if (ares__llist_len(htable->buckets[idx]) > 1) { + if (ares_llist_len(htable->buckets[idx]) > 1) { htable->num_collisions++; } @@ -363,7 +368,7 @@ ares_bool_t ares__htable_insert(ares__htable_t *htable, void *bucket) return ARES_TRUE; } -void *ares__htable_get(const ares__htable_t *htable, const void *key) +void *ares_htable_get(const ares_htable_t *htable, const void *key) { unsigned int idx; @@ -373,20 +378,20 @@ void *ares__htable_get(const ares__htable_t *htable, const void *key) idx = HASH_IDX(htable, key); - return ares__llist_node_val(ares__htable_find(htable, idx, key)); + return ares_llist_node_val(ares_htable_find(htable, idx, key)); } -ares_bool_t ares__htable_remove(ares__htable_t *htable, const void *key) +ares_bool_t ares_htable_remove(ares_htable_t *htable, const void *key) { - ares__llist_node_t *node; - unsigned int idx; + ares_llist_node_t *node; + unsigned int idx; if (htable == NULL || key == NULL) { return ARES_FALSE; } idx = HASH_IDX(htable, key); - node = ares__htable_find(htable, idx, key); + node = ares_htable_find(htable, idx, key); if (node == NULL) { return ARES_FALSE; } @@ -394,15 +399,15 @@ ares_bool_t ares__htable_remove(ares__htable_t *htable, const void *key) htable->num_keys--; /* Reduce collisions */ - if (ares__llist_len(ares__llist_node_parent(node)) > 1) { + if (ares_llist_len(ares_llist_node_parent(node)) > 1) { htable->num_collisions--; } - ares__llist_node_destroy(node); + ares_llist_node_destroy(node); return ARES_TRUE; } -size_t ares__htable_num_keys(const ares__htable_t *htable) +size_t ares_htable_num_keys(const ares_htable_t *htable) { if (htable == NULL) { return 0; @@ -410,16 +415,15 @@ size_t ares__htable_num_keys(const ares__htable_t *htable) return htable->num_keys; } -unsigned int ares__htable_hash_FNV1a(const unsigned char *key, size_t key_len, - unsigned int seed) +unsigned int ares_htable_hash_FNV1a(const unsigned char *key, size_t key_len, + unsigned int seed) { - /* recommended seed is 2166136261U, but we don't want collisions */ - unsigned int hv = seed; + unsigned int hv = seed ^ 2166136261U; size_t i; for (i = 0; i < key_len; i++) { hv ^= (unsigned int)key[i]; - /* hv *= 0x01000193 */ + /* hv *= 16777619 (0x01000193) */ hv += (hv << 1) + (hv << 4) + (hv << 7) + (hv << 8) + (hv << 24); } @@ -427,16 +431,15 @@ unsigned int ares__htable_hash_FNV1a(const unsigned char *key, size_t key_len, } /* Case insensitive version, meant for ASCII strings */ -unsigned int ares__htable_hash_FNV1a_casecmp(const unsigned char *key, - size_t key_len, unsigned int seed) +unsigned int ares_htable_hash_FNV1a_casecmp(const unsigned char *key, + size_t key_len, unsigned int seed) { - /* recommended seed is 2166136261U, but we don't want collisions */ - unsigned int hv = seed; + unsigned int hv = seed ^ 2166136261U; size_t i; for (i = 0; i < key_len; i++) { - hv ^= (unsigned int)ares__tolower(key[i]); - /* hv *= 0x01000193 */ + hv ^= (unsigned int)ares_tolower(key[i]); + /* hv *= 16777619 (0x01000193) */ hv += (hv << 1) + (hv << 4) + (hv << 7) + (hv << 8) + (hv << 24); } diff --git a/deps/cares/src/lib/dsa/ares__htable.h b/deps/cares/src/lib/dsa/ares_htable.h similarity index 76% rename from deps/cares/src/lib/dsa/ares__htable.h rename to deps/cares/src/lib/dsa/ares_htable.h index d09c865977cdae..5700286eb0fabf 100644 --- a/deps/cares/src/lib/dsa/ares__htable.h +++ b/deps/cares/src/lib/dsa/ares_htable.h @@ -27,7 +27,7 @@ #define __ARES__HTABLE_H -/*! \addtogroup ares__htable Base HashTable Data Structure +/*! \addtogroup ares_htable Base HashTable Data Structure * * This is a basic hashtable data structure that is meant to be wrapped * by a higher level implementation. This data structure is designed to @@ -45,10 +45,10 @@ * @{ */ -struct ares__htable; +struct ares_htable; /*! Opaque data type for generic hash table implementation */ -typedef struct ares__htable ares__htable_t; +typedef struct ares_htable ares_htable_t; /*! Callback for generating a hash of the key. * @@ -58,21 +58,21 @@ typedef struct ares__htable ares__htable_t; * but otherwise will not change between calls. * \return hash */ -typedef unsigned int (*ares__htable_hashfunc_t)(const void *key, - unsigned int seed); +typedef unsigned int (*ares_htable_hashfunc_t)(const void *key, + unsigned int seed); /*! Callback to free the bucket * * \param[in] bucket user provided bucket */ -typedef void (*ares__htable_bucket_free_t)(void *bucket); +typedef void (*ares_htable_bucket_free_t)(void *bucket); /*! Callback to extract the key from the user-provided bucket * * \param[in] bucket user provided bucket * \return pointer to key held in bucket */ -typedef const void *(*ares__htable_bucket_key_t)(const void *bucket); +typedef const void *(*ares_htable_bucket_key_t)(const void *bucket); /*! Callback to compare two keys for equality * @@ -80,15 +80,14 @@ typedef const void *(*ares__htable_bucket_key_t)(const void *bucket); * \param[in] key2 second key * \return ARES_TRUE if equal, ARES_FALSE if not */ -typedef ares_bool_t (*ares__htable_key_eq_t)(const void *key1, - const void *key2); +typedef ares_bool_t (*ares_htable_key_eq_t)(const void *key1, const void *key2); /*! Destroy the initialized hashtable * * \param[in] htable initialized hashtable */ -void ares__htable_destroy(ares__htable_t *htable); +void ares_htable_destroy(ares_htable_t *htable); /*! Create a new hashtable * @@ -98,17 +97,17 @@ void ares__htable_destroy(ares__htable_t *htable); * \param[in] key_eq Required. Callback to check for key equality. * \return initialized hashtable. NULL if out of memory or misuse. */ -ares__htable_t *ares__htable_create(ares__htable_hashfunc_t hash_func, - ares__htable_bucket_key_t bucket_key, - ares__htable_bucket_free_t bucket_free, - ares__htable_key_eq_t key_eq); +ares_htable_t *ares_htable_create(ares_htable_hashfunc_t hash_func, + ares_htable_bucket_key_t bucket_key, + ares_htable_bucket_free_t bucket_free, + ares_htable_key_eq_t key_eq); /*! Count of keys from initialized hashtable * * \param[in] htable Initialized hashtable. * \return count of keys */ -size_t ares__htable_num_keys(const ares__htable_t *htable); +size_t ares_htable_num_keys(const ares_htable_t *htable); /*! Retrieve an array of buckets from the hashtable. This is mainly used as * a helper for retrieving an array of keys. @@ -120,8 +119,7 @@ size_t ares__htable_num_keys(const ares__htable_t *htable); * will be a dangling pointer. It is expected wrappers will make * such values safe by duplicating them. */ -const void **ares__htable_all_buckets(const ares__htable_t *htable, - size_t *num); +const void **ares_htable_all_buckets(const ares_htable_t *htable, size_t *num); /*! Insert bucket into hashtable * @@ -130,7 +128,7 @@ const void **ares__htable_all_buckets(const ares__htable_t *htable, * allowed to be NULL. * \return ARES_TRUE on success, ARES_FALSE if out of memory */ -ares_bool_t ares__htable_insert(ares__htable_t *htable, void *bucket); +ares_bool_t ares_htable_insert(ares_htable_t *htable, void *bucket); /*! Retrieve bucket from hashtable based on key. * @@ -138,7 +136,7 @@ ares_bool_t ares__htable_insert(ares__htable_t *htable, void *bucket); * \param[in] key Pointer to key to use for comparison. * \return matching bucket, or NULL if not found. */ -void *ares__htable_get(const ares__htable_t *htable, const void *key); +void *ares_htable_get(const ares_htable_t *htable, const void *key); /*! Remove bucket from hashtable by key * @@ -146,7 +144,7 @@ void *ares__htable_get(const ares__htable_t *htable, const void *key); * \param[in] key Pointer to key to use for comparison * \return ARES_TRUE if found, ARES_FALSE if not found */ -ares_bool_t ares__htable_remove(ares__htable_t *htable, const void *key); +ares_bool_t ares_htable_remove(ares_htable_t *htable, const void *key); /*! FNV1a hash algorithm. Can be used as underlying primitive for building * a wrapper hashtable. @@ -156,8 +154,8 @@ ares_bool_t ares__htable_remove(ares__htable_t *htable, const void *key); * \param[in] seed Seed for generating hash * \return hash value */ -unsigned int ares__htable_hash_FNV1a(const unsigned char *key, size_t key_len, - unsigned int seed); +unsigned int ares_htable_hash_FNV1a(const unsigned char *key, size_t key_len, + unsigned int seed); /*! FNV1a hash algorithm, but converts all characters to lowercase before * hashing to make the hash case-insensitive. Can be used as underlying @@ -168,8 +166,8 @@ unsigned int ares__htable_hash_FNV1a(const unsigned char *key, size_t key_len, * \param[in] seed Seed for generating hash * \return hash value */ -unsigned int ares__htable_hash_FNV1a_casecmp(const unsigned char *key, - size_t key_len, unsigned int seed); +unsigned int ares_htable_hash_FNV1a_casecmp(const unsigned char *key, + size_t key_len, unsigned int seed); /*! @} */ diff --git a/deps/cares/src/lib/dsa/ares__htable_asvp.c b/deps/cares/src/lib/dsa/ares_htable_asvp.c similarity index 62% rename from deps/cares/src/lib/dsa/ares__htable_asvp.c rename to deps/cares/src/lib/dsa/ares_htable_asvp.c index 4b9267ff6c14ee..32f4d2c9949962 100644 --- a/deps/cares/src/lib/dsa/ares__htable_asvp.c +++ b/deps/cares/src/lib/dsa/ares_htable_asvp.c @@ -24,46 +24,45 @@ * SPDX-License-Identifier: MIT */ #include "ares_private.h" -#include "ares__htable.h" -#include "ares__htable_asvp.h" +#include "ares_htable.h" +#include "ares_htable_asvp.h" -struct ares__htable_asvp { - ares__htable_asvp_val_free_t free_val; - ares__htable_t *hash; +struct ares_htable_asvp { + ares_htable_asvp_val_free_t free_val; + ares_htable_t *hash; }; typedef struct { - ares_socket_t key; - void *val; - ares__htable_asvp_t *parent; -} ares__htable_asvp_bucket_t; + ares_socket_t key; + void *val; + ares_htable_asvp_t *parent; +} ares_htable_asvp_bucket_t; -void ares__htable_asvp_destroy(ares__htable_asvp_t *htable) +void ares_htable_asvp_destroy(ares_htable_asvp_t *htable) { if (htable == NULL) { return; } - ares__htable_destroy(htable->hash); + ares_htable_destroy(htable->hash); ares_free(htable); } static unsigned int hash_func(const void *key, unsigned int seed) { const ares_socket_t *arg = key; - return ares__htable_hash_FNV1a((const unsigned char *)arg, sizeof(*arg), - seed); + return ares_htable_hash_FNV1a((const unsigned char *)arg, sizeof(*arg), seed); } static const void *bucket_key(const void *bucket) { - const ares__htable_asvp_bucket_t *arg = bucket; + const ares_htable_asvp_bucket_t *arg = bucket; return &arg->key; } static void bucket_free(void *bucket) { - ares__htable_asvp_bucket_t *arg = bucket; + ares_htable_asvp_bucket_t *arg = bucket; if (arg->parent->free_val) { arg->parent->free_val(arg->val); @@ -84,16 +83,15 @@ static ares_bool_t key_eq(const void *key1, const void *key2) return ARES_FALSE; } -ares__htable_asvp_t * - ares__htable_asvp_create(ares__htable_asvp_val_free_t val_free) +ares_htable_asvp_t * + ares_htable_asvp_create(ares_htable_asvp_val_free_t val_free) { - ares__htable_asvp_t *htable = ares_malloc(sizeof(*htable)); + ares_htable_asvp_t *htable = ares_malloc(sizeof(*htable)); if (htable == NULL) { goto fail; } - htable->hash = - ares__htable_create(hash_func, bucket_key, bucket_free, key_eq); + htable->hash = ares_htable_create(hash_func, bucket_key, bucket_free, key_eq); if (htable->hash == NULL) { goto fail; } @@ -104,14 +102,14 @@ ares__htable_asvp_t * fail: if (htable) { - ares__htable_destroy(htable->hash); + ares_htable_destroy(htable->hash); ares_free(htable); } return NULL; } -ares_socket_t *ares__htable_asvp_keys(const ares__htable_asvp_t *htable, - size_t *num) +ares_socket_t *ares_htable_asvp_keys(const ares_htable_asvp_t *htable, + size_t *num) { const void **buckets = NULL; size_t cnt = 0; @@ -124,7 +122,7 @@ ares_socket_t *ares__htable_asvp_keys(const ares__htable_asvp_t *htable, *num = 0; - buckets = ares__htable_all_buckets(htable->hash, &cnt); + buckets = ares_htable_all_buckets(htable->hash, &cnt); if (buckets == NULL || cnt == 0) { return NULL; } @@ -136,7 +134,7 @@ ares_socket_t *ares__htable_asvp_keys(const ares__htable_asvp_t *htable, } for (i = 0; i < cnt; i++) { - out[i] = ((const ares__htable_asvp_bucket_t *)buckets[i])->key; + out[i] = ((const ares_htable_asvp_bucket_t *)buckets[i])->key; } ares_free(buckets); @@ -144,10 +142,10 @@ ares_socket_t *ares__htable_asvp_keys(const ares__htable_asvp_t *htable, return out; } -ares_bool_t ares__htable_asvp_insert(ares__htable_asvp_t *htable, - ares_socket_t key, void *val) +ares_bool_t ares_htable_asvp_insert(ares_htable_asvp_t *htable, + ares_socket_t key, void *val) { - ares__htable_asvp_bucket_t *bucket = NULL; + ares_htable_asvp_bucket_t *bucket = NULL; if (htable == NULL) { goto fail; @@ -162,7 +160,7 @@ ares_bool_t ares__htable_asvp_insert(ares__htable_asvp_t *htable, bucket->key = key; bucket->val = val; - if (!ares__htable_insert(htable->hash, bucket)) { + if (!ares_htable_insert(htable->hash, bucket)) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -175,10 +173,10 @@ ares_bool_t ares__htable_asvp_insert(ares__htable_asvp_t *htable, return ARES_FALSE; } -ares_bool_t ares__htable_asvp_get(const ares__htable_asvp_t *htable, - ares_socket_t key, void **val) +ares_bool_t ares_htable_asvp_get(const ares_htable_asvp_t *htable, + ares_socket_t key, void **val) { - ares__htable_asvp_bucket_t *bucket = NULL; + ares_htable_asvp_bucket_t *bucket = NULL; if (val) { *val = NULL; @@ -188,7 +186,7 @@ ares_bool_t ares__htable_asvp_get(const ares__htable_asvp_t *htable, return ARES_FALSE; } - bucket = ares__htable_get(htable->hash, &key); + bucket = ares_htable_get(htable->hash, &key); if (bucket == NULL) { return ARES_FALSE; } @@ -199,28 +197,28 @@ ares_bool_t ares__htable_asvp_get(const ares__htable_asvp_t *htable, return ARES_TRUE; } -void *ares__htable_asvp_get_direct(const ares__htable_asvp_t *htable, - ares_socket_t key) +void *ares_htable_asvp_get_direct(const ares_htable_asvp_t *htable, + ares_socket_t key) { void *val = NULL; - ares__htable_asvp_get(htable, key, &val); + ares_htable_asvp_get(htable, key, &val); return val; } -ares_bool_t ares__htable_asvp_remove(ares__htable_asvp_t *htable, - ares_socket_t key) +ares_bool_t ares_htable_asvp_remove(ares_htable_asvp_t *htable, + ares_socket_t key) { if (htable == NULL) { return ARES_FALSE; } - return ares__htable_remove(htable->hash, &key); + return ares_htable_remove(htable->hash, &key); } -size_t ares__htable_asvp_num_keys(const ares__htable_asvp_t *htable) +size_t ares_htable_asvp_num_keys(const ares_htable_asvp_t *htable) { if (htable == NULL) { return 0; } - return ares__htable_num_keys(htable->hash); + return ares_htable_num_keys(htable->hash); } diff --git a/deps/cares/src/lib/dsa/ares_htable_dict.c b/deps/cares/src/lib/dsa/ares_htable_dict.c new file mode 100644 index 00000000000000..93d7a20137c8db --- /dev/null +++ b/deps/cares/src/lib/dsa/ares_htable_dict.c @@ -0,0 +1,228 @@ +/* MIT License + * + * Copyright (c) 2024 Brad House + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ +#include "ares_private.h" +#include "ares_htable.h" +#include "ares_htable_dict.h" + +struct ares_htable_dict { + ares_htable_t *hash; +}; + +typedef struct { + char *key; + char *val; + ares_htable_dict_t *parent; +} ares_htable_dict_bucket_t; + +void ares_htable_dict_destroy(ares_htable_dict_t *htable) +{ + if (htable == NULL) { + return; /* LCOV_EXCL_LINE: DefensiveCoding */ + } + + ares_htable_destroy(htable->hash); + ares_free(htable); +} + +static unsigned int hash_func(const void *key, unsigned int seed) +{ + return ares_htable_hash_FNV1a_casecmp(key, ares_strlen(key), seed); +} + +static const void *bucket_key(const void *bucket) +{ + const ares_htable_dict_bucket_t *arg = bucket; + return arg->key; +} + +static void bucket_free(void *bucket) +{ + ares_htable_dict_bucket_t *arg = bucket; + + ares_free(arg->key); + ares_free(arg->val); + + ares_free(arg); +} + +static ares_bool_t key_eq(const void *key1, const void *key2) +{ + return ares_strcaseeq(key1, key2); +} + +ares_htable_dict_t *ares_htable_dict_create(void) +{ + ares_htable_dict_t *htable = ares_malloc(sizeof(*htable)); + if (htable == NULL) { + goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ + } + + htable->hash = ares_htable_create(hash_func, bucket_key, bucket_free, key_eq); + if (htable->hash == NULL) { + goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ + } + + return htable; + +/* LCOV_EXCL_START: OutOfMemory */ +fail: + if (htable) { + ares_htable_destroy(htable->hash); + ares_free(htable); + } + return NULL; + /* LCOV_EXCL_STOP */ +} + +ares_bool_t ares_htable_dict_insert(ares_htable_dict_t *htable, const char *key, + const char *val) +{ + ares_htable_dict_bucket_t *bucket = NULL; + + if (htable == NULL || ares_strlen(key) == 0) { + goto fail; + } + + bucket = ares_malloc_zero(sizeof(*bucket)); + if (bucket == NULL) { + goto fail; + } + + bucket->parent = htable; + bucket->key = ares_strdup(key); + if (bucket->key == NULL) { + goto fail; + } + + if (val != NULL) { + bucket->val = ares_strdup(val); + if (bucket->val == NULL) { + goto fail; + } + } + + if (!ares_htable_insert(htable->hash, bucket)) { + goto fail; + } + + return ARES_TRUE; + +fail: + if (bucket) { + ares_free(bucket->val); + ares_free(bucket); + } + return ARES_FALSE; +} + +ares_bool_t ares_htable_dict_get(const ares_htable_dict_t *htable, + const char *key, const char **val) +{ + const ares_htable_dict_bucket_t *bucket = NULL; + + if (val) { + *val = NULL; + } + + if (htable == NULL) { + return ARES_FALSE; + } + + bucket = ares_htable_get(htable->hash, key); + if (bucket == NULL) { + return ARES_FALSE; + } + + if (val) { + *val = bucket->val; + } + return ARES_TRUE; +} + +const char *ares_htable_dict_get_direct(const ares_htable_dict_t *htable, + const char *key) +{ + const char *val = NULL; + ares_htable_dict_get(htable, key, &val); + return val; +} + +ares_bool_t ares_htable_dict_remove(ares_htable_dict_t *htable, const char *key) +{ + if (htable == NULL) { + return ARES_FALSE; + } + + return ares_htable_remove(htable->hash, key); +} + +size_t ares_htable_dict_num_keys(const ares_htable_dict_t *htable) +{ + if (htable == NULL) { + return 0; + } + return ares_htable_num_keys(htable->hash); +} + +char **ares_htable_dict_keys(const ares_htable_dict_t *htable, size_t *num) +{ + const void **buckets = NULL; + size_t cnt = 0; + char **out = NULL; + size_t i; + + if (htable == NULL || num == NULL) { + return NULL; /* LCOV_EXCL_LINE: DefensiveCoding */ + } + + *num = 0; + + buckets = ares_htable_all_buckets(htable->hash, &cnt); + if (buckets == NULL || cnt == 0) { + return NULL; + } + + out = ares_malloc_zero(sizeof(*out) * cnt); + if (out == NULL) { + goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ + } + + for (i = 0; i < cnt; i++) { + out[i] = ares_strdup(((const ares_htable_dict_bucket_t *)buckets[i])->key); + if (out[i] == NULL) { + goto fail; + } + } + + ares_free(buckets); + *num = cnt; + return out; + +fail: + *num = 0; + ares_free_array(out, cnt, ares_free); + return NULL; +} diff --git a/deps/cares/src/lib/dsa/ares__htable_strvp.c b/deps/cares/src/lib/dsa/ares_htable_strvp.c similarity index 54% rename from deps/cares/src/lib/dsa/ares__htable_strvp.c rename to deps/cares/src/lib/dsa/ares_htable_strvp.c index d73a1928a75f95..daca117e80f3bb 100644 --- a/deps/cares/src/lib/dsa/ares__htable_strvp.c +++ b/deps/cares/src/lib/dsa/ares_htable_strvp.c @@ -24,46 +24,46 @@ * SPDX-License-Identifier: MIT */ #include "ares_private.h" -#include "ares__htable.h" -#include "ares__htable_strvp.h" +#include "ares_htable.h" +#include "ares_htable_strvp.h" -struct ares__htable_strvp { - ares__htable_strvp_val_free_t free_val; - ares__htable_t *hash; +struct ares_htable_strvp { + ares_htable_strvp_val_free_t free_val; + ares_htable_t *hash; }; typedef struct { - char *key; - void *val; - ares__htable_strvp_t *parent; -} ares__htable_strvp_bucket_t; + char *key; + void *val; + ares_htable_strvp_t *parent; +} ares_htable_strvp_bucket_t; -void ares__htable_strvp_destroy(ares__htable_strvp_t *htable) +void ares_htable_strvp_destroy(ares_htable_strvp_t *htable) { if (htable == NULL) { return; } - ares__htable_destroy(htable->hash); + ares_htable_destroy(htable->hash); ares_free(htable); } static unsigned int hash_func(const void *key, unsigned int seed) { const char *arg = key; - return ares__htable_hash_FNV1a_casecmp((const unsigned char *)arg, - ares_strlen(arg), seed); + return ares_htable_hash_FNV1a_casecmp((const unsigned char *)arg, + ares_strlen(arg), seed); } static const void *bucket_key(const void *bucket) { - const ares__htable_strvp_bucket_t *arg = bucket; + const ares_htable_strvp_bucket_t *arg = bucket; return arg->key; } static void bucket_free(void *bucket) { - ares__htable_strvp_bucket_t *arg = bucket; + ares_htable_strvp_bucket_t *arg = bucket; if (arg->parent->free_val) { arg->parent->free_val(arg->val); @@ -74,26 +74,18 @@ static void bucket_free(void *bucket) static ares_bool_t key_eq(const void *key1, const void *key2) { - const char *k1 = key1; - const char *k2 = key2; - - if (strcasecmp(k1, k2) == 0) { - return ARES_TRUE; - } - - return ARES_FALSE; + return ares_strcaseeq(key1, key2); } -ares__htable_strvp_t * - ares__htable_strvp_create(ares__htable_strvp_val_free_t val_free) +ares_htable_strvp_t * + ares_htable_strvp_create(ares_htable_strvp_val_free_t val_free) { - ares__htable_strvp_t *htable = ares_malloc(sizeof(*htable)); + ares_htable_strvp_t *htable = ares_malloc(sizeof(*htable)); if (htable == NULL) { goto fail; } - htable->hash = - ares__htable_create(hash_func, bucket_key, bucket_free, key_eq); + htable->hash = ares_htable_create(hash_func, bucket_key, bucket_free, key_eq); if (htable->hash == NULL) { goto fail; } @@ -104,16 +96,16 @@ ares__htable_strvp_t * fail: if (htable) { - ares__htable_destroy(htable->hash); + ares_htable_destroy(htable->hash); ares_free(htable); } return NULL; } -ares_bool_t ares__htable_strvp_insert(ares__htable_strvp_t *htable, - const char *key, void *val) +ares_bool_t ares_htable_strvp_insert(ares_htable_strvp_t *htable, + const char *key, void *val) { - ares__htable_strvp_bucket_t *bucket = NULL; + ares_htable_strvp_bucket_t *bucket = NULL; if (htable == NULL || key == NULL) { goto fail; @@ -131,7 +123,7 @@ ares_bool_t ares__htable_strvp_insert(ares__htable_strvp_t *htable, } bucket->val = val; - if (!ares__htable_insert(htable->hash, bucket)) { + if (!ares_htable_insert(htable->hash, bucket)) { goto fail; } @@ -145,10 +137,10 @@ ares_bool_t ares__htable_strvp_insert(ares__htable_strvp_t *htable, return ARES_FALSE; } -ares_bool_t ares__htable_strvp_get(const ares__htable_strvp_t *htable, - const char *key, void **val) +ares_bool_t ares_htable_strvp_get(const ares_htable_strvp_t *htable, + const char *key, void **val) { - ares__htable_strvp_bucket_t *bucket = NULL; + ares_htable_strvp_bucket_t *bucket = NULL; if (val) { *val = NULL; @@ -158,7 +150,7 @@ ares_bool_t ares__htable_strvp_get(const ares__htable_strvp_t *htable, return ARES_FALSE; } - bucket = ares__htable_get(htable->hash, key); + bucket = ares_htable_get(htable->hash, key); if (bucket == NULL) { return ARES_FALSE; } @@ -169,28 +161,50 @@ ares_bool_t ares__htable_strvp_get(const ares__htable_strvp_t *htable, return ARES_TRUE; } -void *ares__htable_strvp_get_direct(const ares__htable_strvp_t *htable, - const char *key) +void *ares_htable_strvp_get_direct(const ares_htable_strvp_t *htable, + const char *key) { void *val = NULL; - ares__htable_strvp_get(htable, key, &val); + ares_htable_strvp_get(htable, key, &val); return val; } -ares_bool_t ares__htable_strvp_remove(ares__htable_strvp_t *htable, - const char *key) +ares_bool_t ares_htable_strvp_remove(ares_htable_strvp_t *htable, + const char *key) { if (htable == NULL) { return ARES_FALSE; } - return ares__htable_remove(htable->hash, key); + return ares_htable_remove(htable->hash, key); +} + +void *ares_htable_strvp_claim(ares_htable_strvp_t *htable, const char *key) +{ + ares_htable_strvp_bucket_t *bucket = NULL; + void *val; + + if (htable == NULL || key == NULL) { + return NULL; + } + + bucket = ares_htable_get(htable->hash, key); + if (bucket == NULL) { + return NULL; + } + + /* Unassociate value from bucket */ + val = bucket->val; + bucket->val = NULL; + + ares_htable_strvp_remove(htable, key); + return val; } -size_t ares__htable_strvp_num_keys(const ares__htable_strvp_t *htable) +size_t ares_htable_strvp_num_keys(const ares_htable_strvp_t *htable) { if (htable == NULL) { return 0; } - return ares__htable_num_keys(htable->hash); + return ares_htable_num_keys(htable->hash); } diff --git a/deps/cares/src/lib/dsa/ares__htable_szvp.c b/deps/cares/src/lib/dsa/ares_htable_szvp.c similarity index 61% rename from deps/cares/src/lib/dsa/ares__htable_szvp.c rename to deps/cares/src/lib/dsa/ares_htable_szvp.c index b3e88d8b9a434a..fdaae0a571c80c 100644 --- a/deps/cares/src/lib/dsa/ares__htable_szvp.c +++ b/deps/cares/src/lib/dsa/ares_htable_szvp.c @@ -24,46 +24,45 @@ * SPDX-License-Identifier: MIT */ #include "ares_private.h" -#include "ares__htable.h" -#include "ares__htable_szvp.h" +#include "ares_htable.h" +#include "ares_htable_szvp.h" -struct ares__htable_szvp { - ares__htable_szvp_val_free_t free_val; - ares__htable_t *hash; +struct ares_htable_szvp { + ares_htable_szvp_val_free_t free_val; + ares_htable_t *hash; }; typedef struct { - size_t key; - void *val; - ares__htable_szvp_t *parent; -} ares__htable_szvp_bucket_t; + size_t key; + void *val; + ares_htable_szvp_t *parent; +} ares_htable_szvp_bucket_t; -void ares__htable_szvp_destroy(ares__htable_szvp_t *htable) +void ares_htable_szvp_destroy(ares_htable_szvp_t *htable) { if (htable == NULL) { return; } - ares__htable_destroy(htable->hash); + ares_htable_destroy(htable->hash); ares_free(htable); } static unsigned int hash_func(const void *key, unsigned int seed) { const size_t *arg = key; - return ares__htable_hash_FNV1a((const unsigned char *)arg, sizeof(*arg), - seed); + return ares_htable_hash_FNV1a((const unsigned char *)arg, sizeof(*arg), seed); } static const void *bucket_key(const void *bucket) { - const ares__htable_szvp_bucket_t *arg = bucket; + const ares_htable_szvp_bucket_t *arg = bucket; return &arg->key; } static void bucket_free(void *bucket) { - ares__htable_szvp_bucket_t *arg = bucket; + ares_htable_szvp_bucket_t *arg = bucket; if (arg->parent->free_val) { arg->parent->free_val(arg->val); @@ -84,16 +83,15 @@ static ares_bool_t key_eq(const void *key1, const void *key2) return ARES_FALSE; } -ares__htable_szvp_t * - ares__htable_szvp_create(ares__htable_szvp_val_free_t val_free) +ares_htable_szvp_t * + ares_htable_szvp_create(ares_htable_szvp_val_free_t val_free) { - ares__htable_szvp_t *htable = ares_malloc(sizeof(*htable)); + ares_htable_szvp_t *htable = ares_malloc(sizeof(*htable)); if (htable == NULL) { goto fail; } - htable->hash = - ares__htable_create(hash_func, bucket_key, bucket_free, key_eq); + htable->hash = ares_htable_create(hash_func, bucket_key, bucket_free, key_eq); if (htable->hash == NULL) { goto fail; } @@ -104,16 +102,16 @@ ares__htable_szvp_t * fail: if (htable) { - ares__htable_destroy(htable->hash); + ares_htable_destroy(htable->hash); ares_free(htable); } return NULL; } -ares_bool_t ares__htable_szvp_insert(ares__htable_szvp_t *htable, size_t key, - void *val) +ares_bool_t ares_htable_szvp_insert(ares_htable_szvp_t *htable, size_t key, + void *val) { - ares__htable_szvp_bucket_t *bucket = NULL; + ares_htable_szvp_bucket_t *bucket = NULL; if (htable == NULL) { goto fail; @@ -128,7 +126,7 @@ ares_bool_t ares__htable_szvp_insert(ares__htable_szvp_t *htable, size_t key, bucket->key = key; bucket->val = val; - if (!ares__htable_insert(htable->hash, bucket)) { + if (!ares_htable_insert(htable->hash, bucket)) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -141,10 +139,10 @@ ares_bool_t ares__htable_szvp_insert(ares__htable_szvp_t *htable, size_t key, return ARES_FALSE; } -ares_bool_t ares__htable_szvp_get(const ares__htable_szvp_t *htable, size_t key, - void **val) +ares_bool_t ares_htable_szvp_get(const ares_htable_szvp_t *htable, size_t key, + void **val) { - ares__htable_szvp_bucket_t *bucket = NULL; + ares_htable_szvp_bucket_t *bucket = NULL; if (val) { *val = NULL; @@ -154,7 +152,7 @@ ares_bool_t ares__htable_szvp_get(const ares__htable_szvp_t *htable, size_t key, return ARES_FALSE; } - bucket = ares__htable_get(htable->hash, &key); + bucket = ares_htable_get(htable->hash, &key); if (bucket == NULL) { return ARES_FALSE; } @@ -165,27 +163,26 @@ ares_bool_t ares__htable_szvp_get(const ares__htable_szvp_t *htable, size_t key, return ARES_TRUE; } -void *ares__htable_szvp_get_direct(const ares__htable_szvp_t *htable, - size_t key) +void *ares_htable_szvp_get_direct(const ares_htable_szvp_t *htable, size_t key) { void *val = NULL; - ares__htable_szvp_get(htable, key, &val); + ares_htable_szvp_get(htable, key, &val); return val; } -ares_bool_t ares__htable_szvp_remove(ares__htable_szvp_t *htable, size_t key) +ares_bool_t ares_htable_szvp_remove(ares_htable_szvp_t *htable, size_t key) { if (htable == NULL) { return ARES_FALSE; } - return ares__htable_remove(htable->hash, &key); + return ares_htable_remove(htable->hash, &key); } -size_t ares__htable_szvp_num_keys(const ares__htable_szvp_t *htable) +size_t ares_htable_szvp_num_keys(const ares_htable_szvp_t *htable) { if (htable == NULL) { return 0; } - return ares__htable_num_keys(htable->hash); + return ares_htable_num_keys(htable->hash); } diff --git a/deps/cares/src/lib/dsa/ares_htable_vpstr.c b/deps/cares/src/lib/dsa/ares_htable_vpstr.c new file mode 100644 index 00000000000000..86c881f768613b --- /dev/null +++ b/deps/cares/src/lib/dsa/ares_htable_vpstr.c @@ -0,0 +1,186 @@ +/* MIT License + * + * Copyright (c) 2024 Brad House + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ +#include "ares_private.h" +#include "ares_htable.h" +#include "ares_htable_vpstr.h" + +struct ares_htable_vpstr { + ares_htable_t *hash; +}; + +typedef struct { + void *key; + char *val; + ares_htable_vpstr_t *parent; +} ares_htable_vpstr_bucket_t; + +void ares_htable_vpstr_destroy(ares_htable_vpstr_t *htable) +{ + if (htable == NULL) { + return; /* LCOV_EXCL_LINE: DefensiveCoding */ + } + + ares_htable_destroy(htable->hash); + ares_free(htable); +} + +static unsigned int hash_func(const void *key, unsigned int seed) +{ + return ares_htable_hash_FNV1a((const unsigned char *)&key, sizeof(key), seed); +} + +static const void *bucket_key(const void *bucket) +{ + const ares_htable_vpstr_bucket_t *arg = bucket; + return arg->key; +} + +static void bucket_free(void *bucket) +{ + ares_htable_vpstr_bucket_t *arg = bucket; + + ares_free(arg->val); + + ares_free(arg); +} + +static ares_bool_t key_eq(const void *key1, const void *key2) +{ + if (key1 == key2) { + return ARES_TRUE; + } + + return ARES_FALSE; +} + +ares_htable_vpstr_t *ares_htable_vpstr_create(void) +{ + ares_htable_vpstr_t *htable = ares_malloc(sizeof(*htable)); + if (htable == NULL) { + goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ + } + + htable->hash = ares_htable_create(hash_func, bucket_key, bucket_free, key_eq); + if (htable->hash == NULL) { + goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ + } + + return htable; + +/* LCOV_EXCL_START: OutOfMemory */ +fail: + if (htable) { + ares_htable_destroy(htable->hash); + ares_free(htable); + } + return NULL; + /* LCOV_EXCL_STOP */ +} + +ares_bool_t ares_htable_vpstr_insert(ares_htable_vpstr_t *htable, void *key, + const char *val) +{ + ares_htable_vpstr_bucket_t *bucket = NULL; + + if (htable == NULL) { + goto fail; + } + + bucket = ares_malloc(sizeof(*bucket)); + if (bucket == NULL) { + goto fail; + } + + bucket->parent = htable; + bucket->key = key; + bucket->val = ares_strdup(val); + if (bucket->val == NULL) { + goto fail; + } + + if (!ares_htable_insert(htable->hash, bucket)) { + goto fail; + } + + return ARES_TRUE; + +fail: + if (bucket) { + ares_free(bucket->val); + ares_free(bucket); + } + return ARES_FALSE; +} + +ares_bool_t ares_htable_vpstr_get(const ares_htable_vpstr_t *htable, + const void *key, const char **val) +{ + const ares_htable_vpstr_bucket_t *bucket = NULL; + + if (val) { + *val = NULL; + } + + if (htable == NULL) { + return ARES_FALSE; + } + + bucket = ares_htable_get(htable->hash, key); + if (bucket == NULL) { + return ARES_FALSE; + } + + if (val) { + *val = bucket->val; + } + return ARES_TRUE; +} + +const char *ares_htable_vpstr_get_direct(const ares_htable_vpstr_t *htable, + const void *key) +{ + const char *val = NULL; + ares_htable_vpstr_get(htable, key, &val); + return val; +} + +ares_bool_t ares_htable_vpstr_remove(ares_htable_vpstr_t *htable, + const void *key) +{ + if (htable == NULL) { + return ARES_FALSE; + } + + return ares_htable_remove(htable->hash, key); +} + +size_t ares_htable_vpstr_num_keys(const ares_htable_vpstr_t *htable) +{ + if (htable == NULL) { + return 0; + } + return ares_htable_num_keys(htable->hash); +} diff --git a/deps/cares/src/lib/dsa/ares__htable_vpvp.c b/deps/cares/src/lib/dsa/ares_htable_vpvp.c similarity index 60% rename from deps/cares/src/lib/dsa/ares__htable_vpvp.c rename to deps/cares/src/lib/dsa/ares_htable_vpvp.c index 9042c48dd7fba2..14fd6e9da097ed 100644 --- a/deps/cares/src/lib/dsa/ares__htable_vpvp.c +++ b/deps/cares/src/lib/dsa/ares_htable_vpvp.c @@ -24,46 +24,45 @@ * SPDX-License-Identifier: MIT */ #include "ares_private.h" -#include "ares__htable.h" -#include "ares__htable_vpvp.h" +#include "ares_htable.h" +#include "ares_htable_vpvp.h" -struct ares__htable_vpvp { - ares__htable_vpvp_key_free_t free_key; - ares__htable_vpvp_val_free_t free_val; - ares__htable_t *hash; +struct ares_htable_vpvp { + ares_htable_vpvp_key_free_t free_key; + ares_htable_vpvp_val_free_t free_val; + ares_htable_t *hash; }; typedef struct { - void *key; - void *val; - ares__htable_vpvp_t *parent; -} ares__htable_vpvp_bucket_t; + void *key; + void *val; + ares_htable_vpvp_t *parent; +} ares_htable_vpvp_bucket_t; -void ares__htable_vpvp_destroy(ares__htable_vpvp_t *htable) +void ares_htable_vpvp_destroy(ares_htable_vpvp_t *htable) { if (htable == NULL) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ } - ares__htable_destroy(htable->hash); + ares_htable_destroy(htable->hash); ares_free(htable); } static unsigned int hash_func(const void *key, unsigned int seed) { - return ares__htable_hash_FNV1a((const unsigned char *)&key, sizeof(key), - seed); + return ares_htable_hash_FNV1a((const unsigned char *)&key, sizeof(key), seed); } static const void *bucket_key(const void *bucket) { - const ares__htable_vpvp_bucket_t *arg = bucket; + const ares_htable_vpvp_bucket_t *arg = bucket; return arg->key; } static void bucket_free(void *bucket) { - ares__htable_vpvp_bucket_t *arg = bucket; + ares_htable_vpvp_bucket_t *arg = bucket; if (arg->parent->free_key) { arg->parent->free_key(arg->key); @@ -85,17 +84,16 @@ static ares_bool_t key_eq(const void *key1, const void *key2) return ARES_FALSE; } -ares__htable_vpvp_t * - ares__htable_vpvp_create(ares__htable_vpvp_key_free_t key_free, - ares__htable_vpvp_val_free_t val_free) +ares_htable_vpvp_t * + ares_htable_vpvp_create(ares_htable_vpvp_key_free_t key_free, + ares_htable_vpvp_val_free_t val_free) { - ares__htable_vpvp_t *htable = ares_malloc(sizeof(*htable)); + ares_htable_vpvp_t *htable = ares_malloc(sizeof(*htable)); if (htable == NULL) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } - htable->hash = - ares__htable_create(hash_func, bucket_key, bucket_free, key_eq); + htable->hash = ares_htable_create(hash_func, bucket_key, bucket_free, key_eq); if (htable->hash == NULL) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -108,17 +106,17 @@ ares__htable_vpvp_t * /* LCOV_EXCL_START: OutOfMemory */ fail: if (htable) { - ares__htable_destroy(htable->hash); + ares_htable_destroy(htable->hash); ares_free(htable); } return NULL; /* LCOV_EXCL_STOP */ } -ares_bool_t ares__htable_vpvp_insert(ares__htable_vpvp_t *htable, void *key, - void *val) +ares_bool_t ares_htable_vpvp_insert(ares_htable_vpvp_t *htable, void *key, + void *val) { - ares__htable_vpvp_bucket_t *bucket = NULL; + ares_htable_vpvp_bucket_t *bucket = NULL; if (htable == NULL) { goto fail; @@ -133,7 +131,7 @@ ares_bool_t ares__htable_vpvp_insert(ares__htable_vpvp_t *htable, void *key, bucket->key = key; bucket->val = val; - if (!ares__htable_insert(htable->hash, bucket)) { + if (!ares_htable_insert(htable->hash, bucket)) { goto fail; } @@ -146,10 +144,10 @@ ares_bool_t ares__htable_vpvp_insert(ares__htable_vpvp_t *htable, void *key, return ARES_FALSE; } -ares_bool_t ares__htable_vpvp_get(const ares__htable_vpvp_t *htable, - const void *key, void **val) +ares_bool_t ares_htable_vpvp_get(const ares_htable_vpvp_t *htable, + const void *key, void **val) { - ares__htable_vpvp_bucket_t *bucket = NULL; + ares_htable_vpvp_bucket_t *bucket = NULL; if (val) { *val = NULL; @@ -159,7 +157,7 @@ ares_bool_t ares__htable_vpvp_get(const ares__htable_vpvp_t *htable, return ARES_FALSE; } - bucket = ares__htable_get(htable->hash, key); + bucket = ares_htable_get(htable->hash, key); if (bucket == NULL) { return ARES_FALSE; } @@ -170,28 +168,27 @@ ares_bool_t ares__htable_vpvp_get(const ares__htable_vpvp_t *htable, return ARES_TRUE; } -void *ares__htable_vpvp_get_direct(const ares__htable_vpvp_t *htable, - const void *key) +void *ares_htable_vpvp_get_direct(const ares_htable_vpvp_t *htable, + const void *key) { void *val = NULL; - ares__htable_vpvp_get(htable, key, &val); + ares_htable_vpvp_get(htable, key, &val); return val; } -ares_bool_t ares__htable_vpvp_remove(ares__htable_vpvp_t *htable, - const void *key) +ares_bool_t ares_htable_vpvp_remove(ares_htable_vpvp_t *htable, const void *key) { if (htable == NULL) { return ARES_FALSE; } - return ares__htable_remove(htable->hash, key); + return ares_htable_remove(htable->hash, key); } -size_t ares__htable_vpvp_num_keys(const ares__htable_vpvp_t *htable) +size_t ares_htable_vpvp_num_keys(const ares_htable_vpvp_t *htable) { if (htable == NULL) { return 0; } - return ares__htable_num_keys(htable->hash); + return ares_htable_num_keys(htable->hash); } diff --git a/deps/cares/src/lib/dsa/ares__llist.c b/deps/cares/src/lib/dsa/ares_llist.c similarity index 52% rename from deps/cares/src/lib/dsa/ares__llist.c rename to deps/cares/src/lib/dsa/ares_llist.c index 96936c1abe7c07..6bd7de269a43fb 100644 --- a/deps/cares/src/lib/dsa/ares__llist.c +++ b/deps/cares/src/lib/dsa/ares_llist.c @@ -24,25 +24,25 @@ * SPDX-License-Identifier: MIT */ #include "ares_private.h" -#include "ares__llist.h" +#include "ares_llist.h" -struct ares__llist { - ares__llist_node_t *head; - ares__llist_node_t *tail; - ares__llist_destructor_t destruct; - size_t cnt; +struct ares_llist { + ares_llist_node_t *head; + ares_llist_node_t *tail; + ares_llist_destructor_t destruct; + size_t cnt; }; -struct ares__llist_node { - void *data; - ares__llist_node_t *prev; - ares__llist_node_t *next; - ares__llist_t *parent; +struct ares_llist_node { + void *data; + ares_llist_node_t *prev; + ares_llist_node_t *next; + ares_llist_t *parent; }; -ares__llist_t *ares__llist_create(ares__llist_destructor_t destruct) +ares_llist_t *ares_llist_create(ares_llist_destructor_t destruct) { - ares__llist_t *list = ares_malloc_zero(sizeof(*list)); + ares_llist_t *list = ares_malloc_zero(sizeof(*list)); if (list == NULL) { return NULL; @@ -53,8 +53,8 @@ ares__llist_t *ares__llist_create(ares__llist_destructor_t destruct) return list; } -void ares__llist_replace_destructor(ares__llist_t *list, - ares__llist_destructor_t destruct) +void ares_llist_replace_destructor(ares_llist_t *list, + ares_llist_destructor_t destruct) { if (list == NULL) { return; @@ -67,12 +67,11 @@ typedef enum { ARES__LLIST_INSERT_HEAD, ARES__LLIST_INSERT_TAIL, ARES__LLIST_INSERT_BEFORE -} ares__llist_insert_type_t; +} ares_llist_insert_type_t; -static void ares__llist_attach_at(ares__llist_t *list, - ares__llist_insert_type_t type, - ares__llist_node_t *at, - ares__llist_node_t *node) +static void ares_llist_attach_at(ares_llist_t *list, + ares_llist_insert_type_t type, + ares_llist_node_t *at, ares_llist_node_t *node) { if (list == NULL || node == NULL) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ @@ -117,12 +116,11 @@ static void ares__llist_attach_at(ares__llist_t *list, list->cnt++; } -static ares__llist_node_t *ares__llist_insert_at(ares__llist_t *list, - ares__llist_insert_type_t type, - ares__llist_node_t *at, - void *val) +static ares_llist_node_t *ares_llist_insert_at(ares_llist_t *list, + ares_llist_insert_type_t type, + ares_llist_node_t *at, void *val) { - ares__llist_node_t *node = NULL; + ares_llist_node_t *node = NULL; if (list == NULL || val == NULL) { return NULL; /* LCOV_EXCL_LINE: DefensiveCoding */ @@ -135,48 +133,46 @@ static ares__llist_node_t *ares__llist_insert_at(ares__llist_t *list, } node->data = val; - ares__llist_attach_at(list, type, at, node); + ares_llist_attach_at(list, type, at, node); return node; } -ares__llist_node_t *ares__llist_insert_first(ares__llist_t *list, void *val) +ares_llist_node_t *ares_llist_insert_first(ares_llist_t *list, void *val) { - return ares__llist_insert_at(list, ARES__LLIST_INSERT_HEAD, NULL, val); + return ares_llist_insert_at(list, ARES__LLIST_INSERT_HEAD, NULL, val); } -ares__llist_node_t *ares__llist_insert_last(ares__llist_t *list, void *val) +ares_llist_node_t *ares_llist_insert_last(ares_llist_t *list, void *val) { - return ares__llist_insert_at(list, ARES__LLIST_INSERT_TAIL, NULL, val); + return ares_llist_insert_at(list, ARES__LLIST_INSERT_TAIL, NULL, val); } -ares__llist_node_t *ares__llist_insert_before(ares__llist_node_t *node, - void *val) +ares_llist_node_t *ares_llist_insert_before(ares_llist_node_t *node, void *val) { if (node == NULL) { return NULL; } - return ares__llist_insert_at(node->parent, ARES__LLIST_INSERT_BEFORE, node, - val); + return ares_llist_insert_at(node->parent, ARES__LLIST_INSERT_BEFORE, node, + val); } -ares__llist_node_t *ares__llist_insert_after(ares__llist_node_t *node, - void *val) +ares_llist_node_t *ares_llist_insert_after(ares_llist_node_t *node, void *val) { if (node == NULL) { return NULL; } if (node->next == NULL) { - return ares__llist_insert_last(node->parent, val); + return ares_llist_insert_last(node->parent, val); } - return ares__llist_insert_at(node->parent, ARES__LLIST_INSERT_BEFORE, - node->next, val); + return ares_llist_insert_at(node->parent, ARES__LLIST_INSERT_BEFORE, + node->next, val); } -ares__llist_node_t *ares__llist_node_first(ares__llist_t *list) +ares_llist_node_t *ares_llist_node_first(ares_llist_t *list) { if (list == NULL) { return NULL; @@ -184,10 +180,10 @@ ares__llist_node_t *ares__llist_node_first(ares__llist_t *list) return list->head; } -ares__llist_node_t *ares__llist_node_idx(ares__llist_t *list, size_t idx) +ares_llist_node_t *ares_llist_node_idx(ares_llist_t *list, size_t idx) { - ares__llist_node_t *node; - size_t cnt; + ares_llist_node_t *node; + size_t cnt; if (list == NULL) { return NULL; @@ -204,7 +200,7 @@ ares__llist_node_t *ares__llist_node_idx(ares__llist_t *list, size_t idx) return node; } -ares__llist_node_t *ares__llist_node_last(ares__llist_t *list) +ares_llist_node_t *ares_llist_node_last(ares_llist_t *list) { if (list == NULL) { return NULL; @@ -212,7 +208,7 @@ ares__llist_node_t *ares__llist_node_last(ares__llist_t *list) return list->tail; } -ares__llist_node_t *ares__llist_node_next(ares__llist_node_t *node) +ares_llist_node_t *ares_llist_node_next(ares_llist_node_t *node) { if (node == NULL) { return NULL; @@ -220,7 +216,7 @@ ares__llist_node_t *ares__llist_node_next(ares__llist_node_t *node) return node->next; } -ares__llist_node_t *ares__llist_node_prev(ares__llist_node_t *node) +ares_llist_node_t *ares_llist_node_prev(ares_llist_node_t *node) { if (node == NULL) { return NULL; @@ -228,7 +224,7 @@ ares__llist_node_t *ares__llist_node_prev(ares__llist_node_t *node) return node->prev; } -void *ares__llist_node_val(ares__llist_node_t *node) +void *ares_llist_node_val(ares_llist_node_t *node) { if (node == NULL) { return NULL; @@ -237,7 +233,7 @@ void *ares__llist_node_val(ares__llist_node_t *node) return node->data; } -size_t ares__llist_len(const ares__llist_t *list) +size_t ares_llist_len(const ares_llist_t *list) { if (list == NULL) { return 0; @@ -245,7 +241,7 @@ size_t ares__llist_len(const ares__llist_t *list) return list->cnt; } -ares__llist_t *ares__llist_node_parent(ares__llist_node_t *node) +ares_llist_t *ares_llist_node_parent(ares_llist_node_t *node) { if (node == NULL) { return NULL; @@ -253,19 +249,19 @@ ares__llist_t *ares__llist_node_parent(ares__llist_node_t *node) return node->parent; } -void *ares__llist_first_val(ares__llist_t *list) +void *ares_llist_first_val(ares_llist_t *list) { - return ares__llist_node_val(ares__llist_node_first(list)); + return ares_llist_node_val(ares_llist_node_first(list)); } -void *ares__llist_last_val(ares__llist_t *list) +void *ares_llist_last_val(ares_llist_t *list) { - return ares__llist_node_val(ares__llist_node_last(list)); + return ares_llist_node_val(ares_llist_node_last(list)); } -static void ares__llist_node_detach(ares__llist_node_t *node) +static void ares_llist_node_detach(ares_llist_node_t *node) { - ares__llist_t *list; + ares_llist_t *list; if (node == NULL) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ @@ -293,7 +289,7 @@ static void ares__llist_node_detach(ares__llist_node_t *node) list->cnt--; } -void *ares__llist_node_claim(ares__llist_node_t *node) +void *ares_llist_node_claim(ares_llist_node_t *node) { void *val; @@ -302,16 +298,16 @@ void *ares__llist_node_claim(ares__llist_node_t *node) } val = node->data; - ares__llist_node_detach(node); + ares_llist_node_detach(node); ares_free(node); return val; } -void ares__llist_node_destroy(ares__llist_node_t *node) +void ares_llist_node_destroy(ares_llist_node_t *node) { - ares__llist_destructor_t destruct; - void *val; + ares_llist_destructor_t destruct; + void *val; if (node == NULL) { return; @@ -319,15 +315,15 @@ void ares__llist_node_destroy(ares__llist_node_t *node) destruct = node->parent->destruct; - val = ares__llist_node_claim(node); + val = ares_llist_node_claim(node); if (val != NULL && destruct != NULL) { destruct(val); } } -void ares__llist_node_replace(ares__llist_node_t *node, void *val) +void ares_llist_node_replace(ares_llist_node_t *node, void *val) { - ares__llist_destructor_t destruct; + ares_llist_destructor_t destruct; if (node == NULL) { return; @@ -341,46 +337,46 @@ void ares__llist_node_replace(ares__llist_node_t *node, void *val) node->data = val; } -void ares__llist_clear(ares__llist_t *list) +void ares_llist_clear(ares_llist_t *list) { - ares__llist_node_t *node; + ares_llist_node_t *node; if (list == NULL) { return; } - while ((node = ares__llist_node_first(list)) != NULL) { - ares__llist_node_destroy(node); + while ((node = ares_llist_node_first(list)) != NULL) { + ares_llist_node_destroy(node); } } -void ares__llist_destroy(ares__llist_t *list) +void ares_llist_destroy(ares_llist_t *list) { if (list == NULL) { return; } - ares__llist_clear(list); + ares_llist_clear(list); ares_free(list); } -void ares__llist_node_move_parent_last(ares__llist_node_t *node, - ares__llist_t *new_parent) +void ares_llist_node_mvparent_last(ares_llist_node_t *node, + ares_llist_t *new_parent) { if (node == NULL || new_parent == NULL) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ } - ares__llist_node_detach(node); - ares__llist_attach_at(new_parent, ARES__LLIST_INSERT_TAIL, NULL, node); + ares_llist_node_detach(node); + ares_llist_attach_at(new_parent, ARES__LLIST_INSERT_TAIL, NULL, node); } -void ares__llist_node_move_parent_first(ares__llist_node_t *node, - ares__llist_t *new_parent) +void ares_llist_node_mvparent_first(ares_llist_node_t *node, + ares_llist_t *new_parent) { if (node == NULL || new_parent == NULL) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ } - ares__llist_node_detach(node); - ares__llist_attach_at(new_parent, ARES__LLIST_INSERT_HEAD, NULL, node); + ares_llist_node_detach(node); + ares_llist_attach_at(new_parent, ARES__LLIST_INSERT_HEAD, NULL, node); } diff --git a/deps/cares/src/lib/dsa/ares__slist.c b/deps/cares/src/lib/dsa/ares_slist.c similarity index 70% rename from deps/cares/src/lib/dsa/ares__slist.c rename to deps/cares/src/lib/dsa/ares_slist.c index f0e3f8b14a9885..7e68347994ce4c 100644 --- a/deps/cares/src/lib/dsa/ares__slist.c +++ b/deps/cares/src/lib/dsa/ares_slist.c @@ -24,39 +24,39 @@ * SPDX-License-Identifier: MIT */ #include "ares_private.h" -#include "ares__slist.h" +#include "ares_slist.h" /* SkipList implementation */ #define ARES__SLIST_START_LEVELS 4 -struct ares__slist { - ares_rand_state *rand_state; - unsigned char rand_data[8]; - size_t rand_bits; +struct ares_slist { + ares_rand_state *rand_state; + unsigned char rand_data[8]; + size_t rand_bits; - ares__slist_node_t **head; - size_t levels; - ares__slist_node_t *tail; + ares_slist_node_t **head; + size_t levels; + ares_slist_node_t *tail; - ares__slist_cmp_t cmp; - ares__slist_destructor_t destruct; - size_t cnt; + ares_slist_cmp_t cmp; + ares_slist_destructor_t destruct; + size_t cnt; }; -struct ares__slist_node { - void *data; - ares__slist_node_t **prev; - ares__slist_node_t **next; - size_t levels; - ares__slist_t *parent; +struct ares_slist_node { + void *data; + ares_slist_node_t **prev; + ares_slist_node_t **next; + size_t levels; + ares_slist_t *parent; }; -ares__slist_t *ares__slist_create(ares_rand_state *rand_state, - ares__slist_cmp_t cmp, - ares__slist_destructor_t destruct) +ares_slist_t *ares_slist_create(ares_rand_state *rand_state, + ares_slist_cmp_t cmp, + ares_slist_destructor_t destruct) { - ares__slist_t *list; + ares_slist_t *list; if (rand_state == NULL || cmp == NULL) { return NULL; @@ -82,18 +82,17 @@ ares__slist_t *ares__slist_create(ares_rand_state *rand_state, return list; } -static ares_bool_t ares__slist_coin_flip(ares__slist_t *list) +static ares_bool_t ares_slist_coin_flip(ares_slist_t *list) { size_t total_bits = sizeof(list->rand_data) * 8; size_t bit; /* Refill random data used for coin flips. We pull this in 8 byte chunks. - * ares__rand_bytes() has some built-in caching of its own so we don't need + * ares_rand_bytes() has some built-in caching of its own so we don't need * to be excessive in caching ourselves. Prefer to require less memory per * skiplist */ if (list->rand_bits == 0) { - ares__rand_bytes(list->rand_state, list->rand_data, - sizeof(list->rand_data)); + ares_rand_bytes(list->rand_state, list->rand_data, sizeof(list->rand_data)); list->rand_bits = total_bits; } @@ -103,8 +102,8 @@ static ares_bool_t ares__slist_coin_flip(ares__slist_t *list) return (list->rand_data[bit / 8] & (1 << (bit % 8))) ? ARES_TRUE : ARES_FALSE; } -void ares__slist_replace_destructor(ares__slist_t *list, - ares__slist_destructor_t destruct) +void ares_slist_replace_destructor(ares_slist_t *list, + ares_slist_destructor_t destruct) { if (list == NULL) { return; @@ -113,14 +112,14 @@ void ares__slist_replace_destructor(ares__slist_t *list, list->destruct = destruct; } -static size_t ares__slist_max_level(const ares__slist_t *list) +static size_t ares_slist_max_level(const ares_slist_t *list) { size_t max_level = 0; if (list->cnt + 1 <= (1 << ARES__SLIST_START_LEVELS)) { max_level = ARES__SLIST_START_LEVELS; } else { - max_level = ares__log2(ares__round_up_pow2(list->cnt + 1)); + max_level = ares_log2(ares_round_up_pow2(list->cnt + 1)); } if (list->levels > max_level) { @@ -130,21 +129,21 @@ static size_t ares__slist_max_level(const ares__slist_t *list) return max_level; } -static size_t ares__slist_calc_level(ares__slist_t *list) +static size_t ares_slist_calc_level(ares_slist_t *list) { - size_t max_level = ares__slist_max_level(list); + size_t max_level = ares_slist_max_level(list); size_t level; - for (level = 1; ares__slist_coin_flip(list) && level < max_level; level++) + for (level = 1; ares_slist_coin_flip(list) && level < max_level; level++) ; return level; } -static void ares__slist_node_push(ares__slist_t *list, ares__slist_node_t *node) +static void ares_slist_node_push(ares_slist_t *list, ares_slist_node_t *node) { - size_t i; - ares__slist_node_t *left = NULL; + size_t i; + ares_slist_node_t *left = NULL; /* Scan from highest level in the slist, even if we're not using that number * of levels for this entry as this is what makes it O(log n) */ @@ -193,9 +192,9 @@ static void ares__slist_node_push(ares__slist_t *list, ares__slist_node_t *node) } } -ares__slist_node_t *ares__slist_insert(ares__slist_t *list, void *val) +ares_slist_node_t *ares_slist_insert(ares_slist_t *list, void *val) { - ares__slist_node_t *node = NULL; + ares_slist_node_t *node = NULL; if (list == NULL || val == NULL) { return NULL; @@ -211,7 +210,7 @@ ares__slist_node_t *ares__slist_insert(ares__slist_t *list, void *val) node->parent = list; /* Randomly determine the number of levels we want to use */ - node->levels = ares__slist_calc_level(list); + node->levels = ares_slist_calc_level(list); /* Allocate array of next and prev nodes for linking each level */ node->next = ares_malloc_zero(sizeof(*node->next) * node->levels); @@ -238,7 +237,7 @@ ares__slist_node_t *ares__slist_insert(ares__slist_t *list, void *val) list->levels = node->levels; } - ares__slist_node_push(list, node); + ares_slist_node_push(list, node); list->cnt++; @@ -255,10 +254,10 @@ ares__slist_node_t *ares__slist_insert(ares__slist_t *list, void *val) /* LCOV_EXCL_STOP */ } -static void ares__slist_node_pop(ares__slist_node_t *node) +static void ares_slist_node_pop(ares_slist_node_t *node) { - ares__slist_t *list = node->parent; - size_t i; + ares_slist_t *list = node->parent; + size_t i; /* relink each node at each level */ for (i = node->levels; i-- > 0;) { @@ -281,10 +280,10 @@ static void ares__slist_node_pop(ares__slist_node_t *node) memset(node->prev, 0, sizeof(*node->prev) * node->levels); } -void *ares__slist_node_claim(ares__slist_node_t *node) +void *ares_slist_node_claim(ares_slist_node_t *node) { - ares__slist_t *list; - void *val; + ares_slist_t *list; + void *val; if (node == NULL) { return NULL; @@ -293,7 +292,7 @@ void *ares__slist_node_claim(ares__slist_node_t *node) list = node->parent; val = node->data; - ares__slist_node_pop(node); + ares_slist_node_pop(node); ares_free(node->next); ares_free(node->prev); @@ -304,9 +303,9 @@ void *ares__slist_node_claim(ares__slist_node_t *node) return val; } -void ares__slist_node_reinsert(ares__slist_node_t *node) +void ares_slist_node_reinsert(ares_slist_node_t *node) { - ares__slist_t *list; + ares_slist_t *list; if (node == NULL) { return; @@ -314,15 +313,16 @@ void ares__slist_node_reinsert(ares__slist_node_t *node) list = node->parent; - ares__slist_node_pop(node); - ares__slist_node_push(list, node); + ares_slist_node_pop(node); + ares_slist_node_push(list, node); } -ares__slist_node_t *ares__slist_node_find(ares__slist_t *list, const void *val) +ares_slist_node_t *ares_slist_node_find(const ares_slist_t *list, + const void *val) { - size_t i; - ares__slist_node_t *node = NULL; - int rv = -1; + size_t i; + ares_slist_node_t *node = NULL; + int rv = -1; if (list == NULL || val == NULL) { return NULL; @@ -377,7 +377,7 @@ ares__slist_node_t *ares__slist_node_find(ares__slist_t *list, const void *val) return node; } -ares__slist_node_t *ares__slist_node_first(ares__slist_t *list) +ares_slist_node_t *ares_slist_node_first(const ares_slist_t *list) { if (list == NULL) { return NULL; @@ -386,7 +386,7 @@ ares__slist_node_t *ares__slist_node_first(ares__slist_t *list) return list->head[0]; } -ares__slist_node_t *ares__slist_node_last(ares__slist_t *list) +ares_slist_node_t *ares_slist_node_last(const ares_slist_t *list) { if (list == NULL) { return NULL; @@ -394,7 +394,7 @@ ares__slist_node_t *ares__slist_node_last(ares__slist_t *list) return list->tail; } -ares__slist_node_t *ares__slist_node_next(ares__slist_node_t *node) +ares_slist_node_t *ares_slist_node_next(const ares_slist_node_t *node) { if (node == NULL) { return NULL; @@ -402,7 +402,7 @@ ares__slist_node_t *ares__slist_node_next(ares__slist_node_t *node) return node->next[0]; } -ares__slist_node_t *ares__slist_node_prev(ares__slist_node_t *node) +ares_slist_node_t *ares_slist_node_prev(const ares_slist_node_t *node) { if (node == NULL) { return NULL; @@ -410,7 +410,7 @@ ares__slist_node_t *ares__slist_node_prev(ares__slist_node_t *node) return node->prev[0]; } -void *ares__slist_node_val(ares__slist_node_t *node) +void *ares_slist_node_val(ares_slist_node_t *node) { if (node == NULL) { return NULL; @@ -419,7 +419,7 @@ void *ares__slist_node_val(ares__slist_node_t *node) return node->data; } -size_t ares__slist_len(const ares__slist_t *list) +size_t ares_slist_len(const ares_slist_t *list) { if (list == NULL) { return 0; @@ -427,7 +427,7 @@ size_t ares__slist_len(const ares__slist_t *list) return list->cnt; } -ares__slist_t *ares__slist_node_parent(ares__slist_node_t *node) +ares_slist_t *ares_slist_node_parent(ares_slist_node_t *node) { if (node == NULL) { return NULL; @@ -435,43 +435,43 @@ ares__slist_t *ares__slist_node_parent(ares__slist_node_t *node) return node->parent; } -void *ares__slist_first_val(ares__slist_t *list) +void *ares_slist_first_val(const ares_slist_t *list) { - return ares__slist_node_val(ares__slist_node_first(list)); + return ares_slist_node_val(ares_slist_node_first(list)); } -void *ares__slist_last_val(ares__slist_t *list) +void *ares_slist_last_val(const ares_slist_t *list) { - return ares__slist_node_val(ares__slist_node_last(list)); + return ares_slist_node_val(ares_slist_node_last(list)); } -void ares__slist_node_destroy(ares__slist_node_t *node) +void ares_slist_node_destroy(ares_slist_node_t *node) { - ares__slist_destructor_t destruct; - void *val; + ares_slist_destructor_t destruct; + void *val; if (node == NULL) { return; } destruct = node->parent->destruct; - val = ares__slist_node_claim(node); + val = ares_slist_node_claim(node); if (val != NULL && destruct != NULL) { destruct(val); } } -void ares__slist_destroy(ares__slist_t *list) +void ares_slist_destroy(ares_slist_t *list) { - ares__slist_node_t *node; + ares_slist_node_t *node; if (list == NULL) { return; } - while ((node = ares__slist_node_first(list)) != NULL) { - ares__slist_node_destroy(node); + while ((node = ares_slist_node_first(list)) != NULL) { + ares_slist_node_destroy(node); } ares_free(list->head); diff --git a/deps/cares/src/lib/dsa/ares__slist.h b/deps/cares/src/lib/dsa/ares_slist.h similarity index 75% rename from deps/cares/src/lib/dsa/ares__slist.h rename to deps/cares/src/lib/dsa/ares_slist.h index 26af88fa782499..a89c2652f2d4d4 100644 --- a/deps/cares/src/lib/dsa/ares__slist.h +++ b/deps/cares/src/lib/dsa/ares_slist.h @@ -27,7 +27,7 @@ #define __ARES__SLIST_H -/*! \addtogroup ares__slist SkipList Data Structure +/*! \addtogroup ares_slist SkipList Data Structure * * This data structure is known as a Skip List, which in essence is a sorted * linked list with multiple levels of linkage to gain some algorithmic @@ -49,21 +49,21 @@ * * @{ */ -struct ares__slist; +struct ares_slist; /*! SkipList Object, opaque */ -typedef struct ares__slist ares__slist_t; +typedef struct ares_slist ares_slist_t; -struct ares__slist_node; +struct ares_slist_node; /*! SkipList Node Object, opaque */ -typedef struct ares__slist_node ares__slist_node_t; +typedef struct ares_slist_node ares_slist_node_t; /*! SkipList Node Value destructor callback * * \param[in] data User-defined data to destroy */ -typedef void (*ares__slist_destructor_t)(void *data); +typedef void (*ares_slist_destructor_t)(void *data); /*! SkipList comparison function * @@ -71,7 +71,7 @@ typedef void (*ares__slist_destructor_t)(void *data); * \param[in] data2 Second user-defined data object * \return < 0 if data1 < data1, > 0 if data1 > data2, 0 if data1 == data2 */ -typedef int (*ares__slist_cmp_t)(const void *data1, const void *data2); +typedef int (*ares_slist_cmp_t)(const void *data1, const void *data2); /*! Create SkipList * @@ -80,17 +80,17 @@ typedef int (*ares__slist_cmp_t)(const void *data1, const void *data2); * \param[in] destruct SkipList Node Value Destructor. Optional, use NULL. * \return Initialized SkipList Object or NULL on misuse or ENOMEM */ -ares__slist_t *ares__slist_create(ares_rand_state *rand_state, - ares__slist_cmp_t cmp, - ares__slist_destructor_t destruct); +ares_slist_t *ares_slist_create(ares_rand_state *rand_state, + ares_slist_cmp_t cmp, + ares_slist_destructor_t destruct); /*! Replace SkipList Node Value Destructor * * \param[in] list Initialized SkipList Object * \param[in] destruct Replacement destructor. May be NULL. */ -void ares__slist_replace_destructor(ares__slist_t *list, - ares__slist_destructor_t destruct); +void ares_slist_replace_destructor(ares_slist_t *list, + ares_slist_destructor_t destruct); /*! Insert Value into SkipList * @@ -99,35 +99,35 @@ void ares__slist_replace_destructor(ares__slist_t *list * and will have destructor called. * \return SkipList Node Object or NULL on misuse or ENOMEM */ -ares__slist_node_t *ares__slist_insert(ares__slist_t *list, void *val); +ares_slist_node_t *ares_slist_insert(ares_slist_t *list, void *val); /*! Fetch first node in SkipList * * \param[in] list Initialized SkipList Object * \return SkipList Node Object or NULL if none */ -ares__slist_node_t *ares__slist_node_first(ares__slist_t *list); +ares_slist_node_t *ares_slist_node_first(const ares_slist_t *list); /*! Fetch last node in SkipList * * \param[in] list Initialized SkipList Object * \return SkipList Node Object or NULL if none */ -ares__slist_node_t *ares__slist_node_last(ares__slist_t *list); +ares_slist_node_t *ares_slist_node_last(const ares_slist_t *list); /*! Fetch next node in SkipList * * \param[in] node SkipList Node Object * \return SkipList Node Object or NULL if none */ -ares__slist_node_t *ares__slist_node_next(ares__slist_node_t *node); +ares_slist_node_t *ares_slist_node_next(const ares_slist_node_t *node); /*! Fetch previous node in SkipList * * \param[in] node SkipList Node Object * \return SkipList Node Object or NULL if none */ -ares__slist_node_t *ares__slist_node_prev(ares__slist_node_t *node); +ares_slist_node_t *ares_slist_node_prev(const ares_slist_node_t *node); /*! Fetch SkipList Node Object by Value * @@ -135,7 +135,8 @@ ares__slist_node_t *ares__slist_node_prev(ares__slist_node_t *node); * \param[in] val Object to use for comparison * \return SkipList Node Object or NULL if not found */ -ares__slist_node_t *ares__slist_node_find(ares__slist_t *list, const void *val); +ares_slist_node_t *ares_slist_node_find(const ares_slist_t *list, + const void *val); /*! Fetch Node Value @@ -143,42 +144,42 @@ ares__slist_node_t *ares__slist_node_find(ares__slist_t *list, const void *val); * \param[in] node SkipList Node Object * \return user defined node value */ -void *ares__slist_node_val(ares__slist_node_t *node); +void *ares_slist_node_val(ares_slist_node_t *node); /*! Fetch number of entries in SkipList Object * * \param[in] list Initialized SkipList Object * \return number of entries */ -size_t ares__slist_len(const ares__slist_t *list); +size_t ares_slist_len(const ares_slist_t *list); /*! Fetch SkipList Object from SkipList Node * * \param[in] node SkipList Node Object * \return SkipList Object */ -ares__slist_t *ares__slist_node_parent(ares__slist_node_t *node); +ares_slist_t *ares_slist_node_parent(ares_slist_node_t *node); /*! Fetch first Node Value in SkipList * * \param[in] list Initialized SkipList Object * \return user defined node value or NULL if none */ -void *ares__slist_first_val(ares__slist_t *list); +void *ares_slist_first_val(const ares_slist_t *list); /*! Fetch last Node Value in SkipList * * \param[in] list Initialized SkipList Object * \return user defined node value or NULL if none */ -void *ares__slist_last_val(ares__slist_t *list); +void *ares_slist_last_val(const ares_slist_t *list); /*! Take back ownership of Node Value in SkipList, remove from SkipList. * * \param[in] node SkipList Node Object * \return user defined node value */ -void *ares__slist_node_claim(ares__slist_node_t *node); +void *ares_slist_node_claim(ares_slist_node_t *node); /*! The internals of the node have changed, thus its position in the sorted * list is no longer valid. This function will remove it and re-add it to @@ -187,19 +188,19 @@ void *ares__slist_node_claim(ares__slist_node_t *node); * * \param[in] node SkipList Node Object */ -void ares__slist_node_reinsert(ares__slist_node_t *node); +void ares_slist_node_reinsert(ares_slist_node_t *node); /*! Remove Node from SkipList, calling destructor for Node Value. * * \param[in] node SkipList Node Object */ -void ares__slist_node_destroy(ares__slist_node_t *node); +void ares_slist_node_destroy(ares_slist_node_t *node); /*! Destroy SkipList Object. If there are any nodes, they will be destroyed. * * \param[in] list Initialized SkipList Object */ -void ares__slist_destroy(ares__slist_t *list); +void ares_slist_destroy(ares_slist_t *list); /*! @} */ diff --git a/deps/cares/src/lib/event/ares_event.h b/deps/cares/src/lib/event/ares_event.h index 317731fc4289ad..36cd10dcf89152 100644 --- a/deps/cares/src/lib/event/ares_event.h +++ b/deps/cares/src/lib/event/ares_event.h @@ -90,21 +90,23 @@ struct ares_event_thread { * event before sleeping. */ ares_bool_t isup; /*! Handle to the thread for joining during shutdown */ - ares__thread_t *thread; + ares_thread_t *thread; /*! Lock to protect the data contained within the event thread itself */ - ares__thread_mutex_t *mutex; + ares_thread_mutex_t *mutex; /*! Reference to the ares channel, for being able to call things like * ares_timeout() and ares_process_fd(). */ ares_channel_t *channel; + /*! Whether or not on the next loop we should process a pending write */ + ares_bool_t process_pending_write; /*! Not-yet-processed event handle updates. These will get enqueued by a * thread other than the event thread itself. The event thread will then * be woken then process these updates itself */ - ares__llist_t *ev_updates; + ares_llist_t *ev_updates; /*! Registered socket event handles */ - ares__htable_asvp_t *ev_sock_handles; + ares_htable_asvp_t *ev_sock_handles; /*! Registered custom event handles. Typically used for external triggering. */ - ares__htable_vpvp_t *ev_cust_handles; + ares_htable_vpvp_t *ev_cust_handles; /*! Pointer to the event handle which is used to signal and wake the event * thread itself. This is needed to be able to do things like update the * file descriptors being waited on and to wake the event subsystem during diff --git a/deps/cares/src/lib/event/ares_event_configchg.c b/deps/cares/src/lib/event/ares_event_configchg.c index 10f0e21dde77fa..e3e665bd165523 100644 --- a/deps/cares/src/lib/event/ares_event_configchg.c +++ b/deps/cares/src/lib/event/ares_event_configchg.c @@ -116,8 +116,8 @@ static void ares_event_configchg_cb(ares_event_thread_t *e, ares_socket_t fd, continue; } - if (strcasecmp(event->name, "resolv.conf") == 0 || - strcasecmp(event->name, "nsswitch.conf") == 0) { + if (ares_strcaseeq(event->name, "resolv.conf") || + ares_strcaseeq(event->name, "nsswitch.conf")) { triggered = ARES_TRUE; } } @@ -545,17 +545,17 @@ typedef struct { } fileinfo_t; struct ares_event_configchg { - ares_bool_t isup; - ares__thread_t *thread; - ares__htable_strvp_t *filestat; - ares__thread_mutex_t *lock; - ares__thread_cond_t *wake; - const char *resolvconf_path; - ares_event_thread_t *e; + ares_bool_t isup; + ares_thread_t *thread; + ares_htable_strvp_t *filestat; + ares_thread_mutex_t *lock; + ares_thread_cond_t *wake; + const char *resolvconf_path; + ares_event_thread_t *e; }; -static ares_status_t config_change_check(ares__htable_strvp_t *filestat, - const char *resolvconf_path) +static ares_status_t config_change_check(ares_htable_strvp_t *filestat, + const char *resolvconf_path) { size_t i; const char *configfiles[5]; @@ -568,7 +568,7 @@ static ares_status_t config_change_check(ares__htable_strvp_t *filestat, configfiles[4] = NULL; for (i = 0; configfiles[i] != NULL; i++) { - fileinfo_t *fi = ares__htable_strvp_get_direct(filestat, configfiles[i]); + fileinfo_t *fi = ares_htable_strvp_get_direct(filestat, configfiles[i]); struct stat st; if (stat(configfiles[i], &st) == 0) { @@ -577,7 +577,7 @@ static ares_status_t config_change_check(ares__htable_strvp_t *filestat, if (fi == NULL) { return ARES_ENOMEM; } - if (!ares__htable_strvp_insert(filestat, configfiles[i], fi)) { + if (!ares_htable_strvp_insert(filestat, configfiles[i], fi)) { ares_free(fi); return ARES_ENOMEM; } @@ -589,7 +589,7 @@ static ares_status_t config_change_check(ares__htable_strvp_t *filestat, fi->mtime = (time_t)st.st_mtime; } else if (fi != NULL) { /* File no longer exists, remove */ - ares__htable_strvp_remove(filestat, configfiles[i]); + ares_htable_strvp_remove(filestat, configfiles[i]); changed = ARES_TRUE; } } @@ -604,11 +604,11 @@ static void *ares_event_configchg_thread(void *arg) { ares_event_configchg_t *c = arg; - ares__thread_mutex_lock(c->lock); + ares_thread_mutex_lock(c->lock); while (c->isup) { ares_status_t status; - if (ares__thread_cond_timedwait(c->wake, c->lock, 30000) != ARES_ETIMEOUT) { + if (ares_thread_cond_timedwait(c->wake, c->lock, 30000) != ARES_ETIMEOUT) { continue; } @@ -623,7 +623,7 @@ static void *ares_event_configchg_thread(void *arg) } } - ares__thread_mutex_unlock(c->lock); + ares_thread_mutex_unlock(c->lock); return NULL; } @@ -643,13 +643,13 @@ ares_status_t ares_event_configchg_init(ares_event_configchg_t **configchg, c->e = e; - c->filestat = ares__htable_strvp_create(ares_free); + c->filestat = ares_htable_strvp_create(ares_free); if (c->filestat == NULL) { status = ARES_ENOMEM; goto done; } - c->wake = ares__thread_cond_create(); + c->wake = ares_thread_cond_create(); if (c->wake == NULL) { status = ARES_ENOMEM; goto done; @@ -666,7 +666,7 @@ ares_status_t ares_event_configchg_init(ares_event_configchg_t **configchg, } c->isup = ARES_TRUE; - status = ares__thread_create(&c->thread, ares_event_configchg_thread, c); + status = ares_thread_create(&c->thread, ares_event_configchg_thread, c); done: if (status != ARES_SUCCESS) { @@ -684,26 +684,26 @@ void ares_event_configchg_destroy(ares_event_configchg_t *configchg) } if (configchg->lock) { - ares__thread_mutex_lock(configchg->lock); + ares_thread_mutex_lock(configchg->lock); } configchg->isup = ARES_FALSE; if (configchg->wake) { - ares__thread_cond_signal(configchg->wake); + ares_thread_cond_signal(configchg->wake); } if (configchg->lock) { - ares__thread_mutex_unlock(configchg->lock); + ares_thread_mutex_unlock(configchg->lock); } if (configchg->thread) { void *rv = NULL; - ares__thread_join(configchg->thread, &rv); + ares_thread_join(configchg->thread, &rv); } - ares__thread_mutex_destroy(configchg->lock); - ares__thread_cond_destroy(configchg->wake); - ares__htable_strvp_destroy(configchg->filestat); + ares_thread_mutex_destroy(configchg->lock); + ares_thread_cond_destroy(configchg->wake); + ares_htable_strvp_destroy(configchg->filestat); ares_free(configchg); } diff --git a/deps/cares/src/lib/event/ares_event_epoll.c b/deps/cares/src/lib/event/ares_event_epoll.c index 5eb25cccc9ed2a..538c38b4f94ab4 100644 --- a/deps/cares/src/lib/event/ares_event_epoll.c +++ b/deps/cares/src/lib/event/ares_event_epoll.c @@ -161,8 +161,8 @@ static size_t ares_evsys_epoll_wait(ares_event_thread_t *e, ares_event_t *ev; ares_event_flags_t flags = 0; - ev = ares__htable_asvp_get_direct(e->ev_sock_handles, - (ares_socket_t)events[i].data.fd); + ev = ares_htable_asvp_get_direct(e->ev_sock_handles, + (ares_socket_t)events[i].data.fd); if (ev == NULL || ev->cb == NULL) { continue; /* LCOV_EXCL_LINE: DefensiveCoding */ } diff --git a/deps/cares/src/lib/event/ares_event_kqueue.c b/deps/cares/src/lib/event/ares_event_kqueue.c index 1c35c14f165690..dbbd0dbd9f76a6 100644 --- a/deps/cares/src/lib/event/ares_event_kqueue.c +++ b/deps/cares/src/lib/event/ares_event_kqueue.c @@ -217,8 +217,8 @@ static size_t ares_evsys_kqueue_wait(ares_event_thread_t *e, ares_event_t *ev; ares_event_flags_t flags = 0; - ev = ares__htable_asvp_get_direct(e->ev_sock_handles, - (ares_socket_t)events[i].ident); + ev = ares_htable_asvp_get_direct(e->ev_sock_handles, + (ares_socket_t)events[i].ident); if (ev == NULL || ev->cb == NULL) { continue; } diff --git a/deps/cares/src/lib/event/ares_event_poll.c b/deps/cares/src/lib/event/ares_event_poll.c index 42ffd912e95c4b..c6ab4b62072b36 100644 --- a/deps/cares/src/lib/event/ares_event_poll.c +++ b/deps/cares/src/lib/event/ares_event_poll.c @@ -67,7 +67,7 @@ static size_t ares_evsys_poll_wait(ares_event_thread_t *e, unsigned long timeout_ms) { size_t num_fds = 0; - ares_socket_t *fdlist = ares__htable_asvp_keys(e->ev_sock_handles, &num_fds); + ares_socket_t *fdlist = ares_htable_asvp_keys(e->ev_sock_handles, &num_fds); struct pollfd *pollfd = NULL; int rv; size_t cnt = 0; @@ -80,7 +80,7 @@ static size_t ares_evsys_poll_wait(ares_event_thread_t *e, } for (i = 0; i < num_fds; i++) { const ares_event_t *ev = - ares__htable_asvp_get_direct(e->ev_sock_handles, fdlist[i]); + ares_htable_asvp_get_direct(e->ev_sock_handles, fdlist[i]); pollfd[i].fd = ev->fd; if (ev->flags & ARES_EVENT_FLAG_READ) { pollfd[i].events |= POLLIN; @@ -107,7 +107,7 @@ static size_t ares_evsys_poll_wait(ares_event_thread_t *e, cnt++; - ev = ares__htable_asvp_get_direct(e->ev_sock_handles, pollfd[i].fd); + ev = ares_htable_asvp_get_direct(e->ev_sock_handles, pollfd[i].fd); if (ev == NULL || ev->cb == NULL) { continue; /* LCOV_EXCL_LINE: DefensiveCoding */ } diff --git a/deps/cares/src/lib/event/ares_event_select.c b/deps/cares/src/lib/event/ares_event_select.c index e1266ea99056a3..4d7c085d872088 100644 --- a/deps/cares/src/lib/event/ares_event_select.c +++ b/deps/cares/src/lib/event/ares_event_select.c @@ -75,7 +75,7 @@ static size_t ares_evsys_select_wait(ares_event_thread_t *e, unsigned long timeout_ms) { size_t num_fds = 0; - ares_socket_t *fdlist = ares__htable_asvp_keys(e->ev_sock_handles, &num_fds); + ares_socket_t *fdlist = ares_htable_asvp_keys(e->ev_sock_handles, &num_fds); int rv; size_t cnt = 0; size_t i; @@ -92,7 +92,7 @@ static size_t ares_evsys_select_wait(ares_event_thread_t *e, for (i = 0; i < num_fds; i++) { const ares_event_t *ev = - ares__htable_asvp_get_direct(e->ev_sock_handles, fdlist[i]); + ares_htable_asvp_get_direct(e->ev_sock_handles, fdlist[i]); if (ev->flags & ARES_EVENT_FLAG_READ) { FD_SET(ev->fd, &read_fds); } @@ -117,7 +117,7 @@ static size_t ares_evsys_select_wait(ares_event_thread_t *e, ares_event_t *ev; ares_event_flags_t flags = 0; - ev = ares__htable_asvp_get_direct(e->ev_sock_handles, fdlist[i]); + ev = ares_htable_asvp_get_direct(e->ev_sock_handles, fdlist[i]); if (ev == NULL || ev->cb == NULL) { continue; /* LCOV_EXCL_LINE: DefensiveCoding */ } diff --git a/deps/cares/src/lib/event/ares_event_thread.c b/deps/cares/src/lib/event/ares_event_thread.c index 8b332e9b0193b7..24b55d6945728f 100644 --- a/deps/cares/src/lib/event/ares_event_thread.c +++ b/deps/cares/src/lib/event/ares_event_thread.c @@ -77,11 +77,11 @@ static void ares_event_thread_wake(const ares_event_thread_t *e) static ares_event_t *ares_event_update_find(ares_event_thread_t *e, ares_socket_t fd, const void *data) { - ares__llist_node_t *node; + ares_llist_node_t *node; - for (node = ares__llist_node_first(e->ev_updates); node != NULL; - node = ares__llist_node_next(node)) { - ares_event_t *ev = ares__llist_node_val(node); + for (node = ares_llist_node_first(e->ev_updates); node != NULL; + node = ares_llist_node_next(node)) { + ares_event_t *ev = ares_llist_node_val(node); if (fd != ARES_SOCKET_BAD && fd == ev->fd && ev->flags != 0) { return ev; @@ -134,7 +134,7 @@ ares_status_t ares_event_update(ares_event_t **event, ares_event_thread_t *e, /* That's all the validation we can really do */ - ares__thread_mutex_lock(e->mutex); + ares_thread_mutex_lock(e->mutex); /* See if we have a queued update already */ ev = ares_event_update_find(e, fd, data); @@ -146,7 +146,7 @@ ares_status_t ares_event_update(ares_event_t **event, ares_event_thread_t *e, goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - if (ares__llist_insert_last(e->ev_updates, ev) == NULL) { + if (ares_llist_insert_last(e->ev_updates, ev) == NULL) { ares_free(ev); /* LCOV_EXCL_LINE: OutOfMemory */ status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto done; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -180,7 +180,7 @@ ares_status_t ares_event_update(ares_event_t **event, ares_event_thread_t *e, ares_event_thread_wake(e); } - ares__thread_mutex_unlock(e->mutex); + ares_thread_mutex_unlock(e->mutex); return status; } @@ -189,11 +189,18 @@ static void ares_event_thread_process_fd(ares_event_thread_t *e, ares_socket_t fd, void *data, ares_event_flags_t flags) { + ares_fd_events_t event; (void)data; - ares_process_fd(e->channel, - (flags & ARES_EVENT_FLAG_READ) ? fd : ARES_SOCKET_BAD, - (flags & ARES_EVENT_FLAG_WRITE) ? fd : ARES_SOCKET_BAD); + event.fd = fd; + event.events = 0; + if (flags & ARES_EVENT_FLAG_READ) { + event.events |= ARES_FD_EVENT_READ; + } + if (flags & ARES_EVENT_FLAG_WRITE) { + event.events |= ARES_FD_EVENT_WRITE; + } + ares_process_fds(e->channel, &event, 1, ARES_PROCESS_FLAG_SKIP_NON_FD); } static void ares_event_thread_sockstate_cb(void *data, ares_socket_t socket_fd, @@ -216,20 +223,31 @@ static void ares_event_thread_sockstate_cb(void *data, ares_socket_t socket_fd, NULL, NULL, NULL); } +static void notifywrite_cb(void *data) +{ + ares_event_thread_t *e = data; + + ares_thread_mutex_lock(e->mutex); + e->process_pending_write = ARES_TRUE; + ares_thread_mutex_unlock(e->mutex); + + ares_event_thread_wake(e); +} + static void ares_event_process_updates(ares_event_thread_t *e) { - ares__llist_node_t *node; + ares_llist_node_t *node; /* Iterate across all updates and apply to internal list, removing from update * list */ - while ((node = ares__llist_node_first(e->ev_updates)) != NULL) { - ares_event_t *newev = ares__llist_node_claim(node); + while ((node = ares_llist_node_first(e->ev_updates)) != NULL) { + ares_event_t *newev = ares_llist_node_claim(node); ares_event_t *oldev; if (newev->fd == ARES_SOCKET_BAD) { - oldev = ares__htable_vpvp_get_direct(e->ev_cust_handles, newev->data); + oldev = ares_htable_vpvp_get_direct(e->ev_cust_handles, newev->data); } else { - oldev = ares__htable_asvp_get_direct(e->ev_sock_handles, newev->fd); + oldev = ares_htable_asvp_get_direct(e->ev_sock_handles, newev->fd); } /* Adding new */ @@ -244,9 +262,9 @@ static void ares_event_process_updates(ares_event_thread_t *e) ares_event_destroy_cb(newev); } else { if (newev->fd == ARES_SOCKET_BAD) { - ares__htable_vpvp_insert(e->ev_cust_handles, newev->data, newev); + ares_htable_vpvp_insert(e->ev_cust_handles, newev->data, newev); } else { - ares__htable_asvp_insert(e->ev_sock_handles, newev->fd, newev); + ares_htable_asvp_insert(e->ev_sock_handles, newev->fd, newev); } } continue; @@ -257,9 +275,9 @@ static void ares_event_process_updates(ares_event_thread_t *e) /* the callback for the removal will call e->ev_sys->event_del(e, event) */ if (newev->fd == ARES_SOCKET_BAD) { - ares__htable_vpvp_remove(e->ev_cust_handles, newev->data); + ares_htable_vpvp_remove(e->ev_cust_handles, newev->data); } else { - ares__htable_asvp_remove(e->ev_sock_handles, newev->fd); + ares_htable_asvp_remove(e->ev_sock_handles, newev->fd); } ares_free(newev); continue; @@ -276,22 +294,22 @@ static void ares_event_thread_cleanup(ares_event_thread_t *e) { /* Manually free any updates that weren't processed */ if (e->ev_updates != NULL) { - ares__llist_node_t *node; + ares_llist_node_t *node; - while ((node = ares__llist_node_first(e->ev_updates)) != NULL) { - ares_event_destroy_cb(ares__llist_node_claim(node)); + while ((node = ares_llist_node_first(e->ev_updates)) != NULL) { + ares_event_destroy_cb(ares_llist_node_claim(node)); } - ares__llist_destroy(e->ev_updates); + ares_llist_destroy(e->ev_updates); e->ev_updates = NULL; } if (e->ev_sock_handles != NULL) { - ares__htable_asvp_destroy(e->ev_sock_handles); + ares_htable_asvp_destroy(e->ev_sock_handles); e->ev_sock_handles = NULL; } if (e->ev_cust_handles != NULL) { - ares__htable_vpvp_destroy(e->ev_cust_handles); + ares_htable_vpvp_destroy(e->ev_cust_handles); e->ev_cust_handles = NULL; } @@ -304,19 +322,20 @@ static void ares_event_thread_cleanup(ares_event_thread_t *e) static void *ares_event_thread(void *arg) { ares_event_thread_t *e = arg; - ares__thread_mutex_lock(e->mutex); + ares_thread_mutex_lock(e->mutex); while (e->isup) { struct timeval tv; const struct timeval *tvout; unsigned long timeout_ms = 0; /* 0 = unlimited */ + ares_bool_t process_pending_write; ares_event_process_updates(e); /* Don't hold a mutex while waiting on events or calling into anything * that might require a c-ares channel lock since a callback could be * triggered cross-thread */ - ares__thread_mutex_unlock(e->mutex); + ares_thread_mutex_unlock(e->mutex); tvout = ares_timeout(e->channel, NULL, &tv); if (tvout != NULL) { @@ -326,19 +345,29 @@ static void *ares_event_thread(void *arg) e->ev_sys->wait(e, timeout_ms); - /* Each iteration should do timeout processing */ + /* Process pending write operation */ + ares_thread_mutex_lock(e->mutex); + process_pending_write = e->process_pending_write; + e->process_pending_write = ARES_FALSE; + ares_thread_mutex_unlock(e->mutex); + if (process_pending_write) { + ares_process_pending_write(e->channel); + } + + /* Each iteration should do timeout processing and any other cleanup + * that may not have been performed */ if (e->isup) { - ares_process_fd(e->channel, ARES_SOCKET_BAD, ARES_SOCKET_BAD); + ares_process_fds(e->channel, NULL, 0, ARES_PROCESS_FLAG_NONE); } /* Relock before we loop again */ - ares__thread_mutex_lock(e->mutex); + ares_thread_mutex_lock(e->mutex); } /* Lets cleanup while we're in the thread itself */ ares_event_thread_cleanup(e); - ares__thread_mutex_unlock(e->mutex); + ares_thread_mutex_unlock(e->mutex); return NULL; } @@ -346,17 +375,17 @@ static void *ares_event_thread(void *arg) static void ares_event_thread_destroy_int(ares_event_thread_t *e) { /* Wake thread and tell it to shutdown if it exists */ - ares__thread_mutex_lock(e->mutex); + ares_thread_mutex_lock(e->mutex); if (e->isup) { e->isup = ARES_FALSE; ares_event_thread_wake(e); } - ares__thread_mutex_unlock(e->mutex); + ares_thread_mutex_unlock(e->mutex); /* Wait for thread to shutdown */ if (e->thread) { void *rv = NULL; - ares__thread_join(e->thread, &rv); + ares_thread_join(e->thread, &rv); e->thread = NULL; } @@ -364,7 +393,7 @@ static void ares_event_thread_destroy_int(ares_event_thread_t *e) * as it runs this same cleanup when it shuts down */ ares_event_thread_cleanup(e); - ares__thread_mutex_destroy(e->mutex); + ares_thread_mutex_destroy(e->mutex); e->mutex = NULL; ares_free(e); @@ -379,8 +408,10 @@ void ares_event_thread_destroy(ares_channel_t *channel) } ares_event_thread_destroy_int(e); - channel->sock_state_cb_data = NULL; - channel->sock_state_cb = NULL; + channel->sock_state_cb_data = NULL; + channel->sock_state_cb = NULL; + channel->notify_pending_write_cb = NULL; + channel->notify_pending_write_cb_data = NULL; } static const ares_event_sys_t *ares_event_fetch_sys(ares_evsys_t evsys) @@ -451,25 +482,25 @@ ares_status_t ares_event_thread_init(ares_channel_t *channel) return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ } - e->mutex = ares__thread_mutex_create(); + e->mutex = ares_thread_mutex_create(); if (e->mutex == NULL) { ares_event_thread_destroy_int(e); /* LCOV_EXCL_LINE: OutOfMemory */ return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ } - e->ev_updates = ares__llist_create(NULL); + e->ev_updates = ares_llist_create(NULL); if (e->ev_updates == NULL) { ares_event_thread_destroy_int(e); /* LCOV_EXCL_LINE: OutOfMemory */ return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ } - e->ev_sock_handles = ares__htable_asvp_create(ares_event_destroy_cb); + e->ev_sock_handles = ares_htable_asvp_create(ares_event_destroy_cb); if (e->ev_sock_handles == NULL) { ares_event_thread_destroy_int(e); /* LCOV_EXCL_LINE: OutOfMemory */ return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ } - e->ev_cust_handles = ares__htable_vpvp_create(NULL, ares_event_destroy_cb); + e->ev_cust_handles = ares_htable_vpvp_create(NULL, ares_event_destroy_cb); if (e->ev_cust_handles == NULL) { ares_event_thread_destroy_int(e); /* LCOV_EXCL_LINE: OutOfMemory */ return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -483,8 +514,10 @@ ares_status_t ares_event_thread_init(ares_channel_t *channel) return ARES_ENOTIMP; /* LCOV_EXCL_LINE: UntestablePath */ } - channel->sock_state_cb = ares_event_thread_sockstate_cb; - channel->sock_state_cb_data = e; + channel->sock_state_cb = ares_event_thread_sockstate_cb; + channel->sock_state_cb_data = e; + channel->notify_pending_write_cb = notifywrite_cb; + channel->notify_pending_write_cb_data = e; if (!e->ev_sys->init(e)) { /* LCOV_EXCL_START: UntestablePath */ @@ -503,7 +536,7 @@ ares_status_t ares_event_thread_init(ares_channel_t *channel) ares_event_process_updates(e); /* Start thread */ - if (ares__thread_create(&e->thread, ares_event_thread, e) != ARES_SUCCESS) { + if (ares_thread_create(&e->thread, ares_event_thread, e) != ARES_SUCCESS) { /* LCOV_EXCL_START: UntestablePath */ ares_event_thread_destroy_int(e); channel->sock_state_cb = NULL; diff --git a/deps/cares/src/lib/event/ares_event_win32.c b/deps/cares/src/lib/event/ares_event_win32.c index 0b7e535bbbf538..1531b6d81ddca4 100644 --- a/deps/cares/src/lib/event/ares_event_win32.c +++ b/deps/cares/src/lib/event/ares_event_win32.c @@ -204,14 +204,14 @@ typedef struct { NtCancelIoFileEx_t NtCancelIoFileEx; /* Implementation details */ - ares__slist_t *afd_handles; + ares_slist_t *afd_handles; HANDLE iocp_handle; /* IO_STATUS_BLOCK * -> ares_evsys_win32_eventdata_t * mapping. There is * no completion key passed to IOCP with this method so we have to look * up based on the lpOverlapped returned (which is mapped to IO_STATUS_BLOCK) */ - ares__htable_vpvp_t *sockets; + ares_htable_vpvp_t *sockets; /* Flag about whether or not we are shutting down */ ares_bool_t is_shutdown; @@ -226,24 +226,24 @@ typedef enum { typedef struct { /*! Pointer to parent event container */ - ares_event_t *event; + ares_event_t *event; /*! Socket passed in to monitor */ - SOCKET socket; + SOCKET socket; /*! Base socket derived from provided socket */ - SOCKET base_socket; + SOCKET base_socket; /*! Structure for submitting AFD POLL requests (Internals!) */ - AFD_POLL_INFO afd_poll_info; + AFD_POLL_INFO afd_poll_info; /*! Status of current polling operation */ - poll_status_t poll_status; + poll_status_t poll_status; /*! IO Status Block structure submitted with AFD POLL requests and returned * with IOCP results as lpOverlapped (even though its a different structure) */ - IO_STATUS_BLOCK iosb; + IO_STATUS_BLOCK iosb; /*! AFD handle node an outstanding poll request is associated with */ - ares__slist_node_t *afd_handle_node; + ares_slist_node_t *afd_handle_node; /* Lock is only for PostQueuedCompletionStatus() to prevent multiple * signals. Tracking via POLL_STATUS_PENDING/POLL_STATUS_NONE */ - ares__thread_mutex_t *lock; + ares_thread_mutex_t *lock; } ares_evsys_win32_eventdata_t; static size_t ares_evsys_win32_wait(ares_event_thread_t *e, @@ -256,12 +256,12 @@ static void ares_iocpevent_signal(const ares_event_t *event) ares_evsys_win32_eventdata_t *ed = event->data; ares_bool_t queue_event = ARES_FALSE; - ares__thread_mutex_lock(ed->lock); + ares_thread_mutex_lock(ed->lock); if (ed->poll_status != POLL_STATUS_PENDING) { ed->poll_status = POLL_STATUS_PENDING; queue_event = ARES_TRUE; } - ares__thread_mutex_unlock(ed->lock); + ares_thread_mutex_unlock(ed->lock); if (!queue_event) { return; @@ -277,9 +277,9 @@ static void ares_iocpevent_cb(ares_event_thread_t *e, ares_socket_t fd, (void)e; (void)fd; (void)flags; - ares__thread_mutex_lock(ed->lock); + ares_thread_mutex_lock(ed->lock); ed->poll_status = POLL_STATUS_NONE; - ares__thread_mutex_unlock(ed->lock); + ares_thread_mutex_unlock(ed->lock); } static ares_event_t *ares_iocpevent_create(ares_event_thread_t *e) @@ -314,8 +314,8 @@ static void ares_evsys_win32_destroy(ares_event_thread_t *e) ew->is_shutdown = ARES_TRUE; CARES_DEBUG_LOG(" ** waiting on %lu remaining sockets to be destroyed\n", - (unsigned long)ares__htable_vpvp_num_keys(ew->sockets)); - while (ares__htable_vpvp_num_keys(ew->sockets)) { + (unsigned long)ares_htable_vpvp_num_keys(ew->sockets)); + while (ares_htable_vpvp_num_keys(ew->sockets)) { ares_evsys_win32_wait(e, 0); } CARES_DEBUG_LOG(" ** all sockets cleaned up\n"); @@ -325,9 +325,9 @@ static void ares_evsys_win32_destroy(ares_event_thread_t *e) CloseHandle(ew->iocp_handle); } - ares__slist_destroy(ew->afd_handles); + ares_slist_destroy(ew->afd_handles); - ares__htable_vpvp_destroy(ew->sockets); + ares_htable_vpvp_destroy(ew->sockets); ares_free(ew); e->ev_sys_data = NULL; @@ -373,14 +373,14 @@ static void fill_object_attributes(OBJECT_ATTRIBUTES *attr, # define UNICODE_STRING_CONSTANT(s) \ { (sizeof(s) - 1) * sizeof(wchar_t), sizeof(s) * sizeof(wchar_t), L##s } -static ares__slist_node_t *ares_afd_handle_create(ares_evsys_win32_t *ew) +static ares_slist_node_t *ares_afd_handle_create(ares_evsys_win32_t *ew) { UNICODE_STRING afd_device_name = UNICODE_STRING_CONSTANT("\\Device\\Afd"); OBJECT_ATTRIBUTES afd_attributes; NTSTATUS status; IO_STATUS_BLOCK iosb; - ares_afd_handle_t *afd = ares_malloc_zero(sizeof(*afd)); - ares__slist_node_t *node = NULL; + ares_afd_handle_t *afd = ares_malloc_zero(sizeof(*afd)); + ares_slist_node_t *node = NULL; if (afd == NULL) { goto fail; } @@ -407,7 +407,7 @@ static ares__slist_node_t *ares_afd_handle_create(ares_evsys_win32_t *ew) goto fail; } - node = ares__slist_insert(ew->afd_handles, afd); + node = ares_slist_insert(ew->afd_handles, afd); if (node == NULL) { goto fail; } @@ -422,10 +422,10 @@ static ares__slist_node_t *ares_afd_handle_create(ares_evsys_win32_t *ew) /* Fetch the lowest poll count entry, but if it exceeds the limit, create a * new one and return that */ -static ares__slist_node_t *ares_afd_handle_fetch(ares_evsys_win32_t *ew) +static ares_slist_node_t *ares_afd_handle_fetch(ares_evsys_win32_t *ew) { - ares__slist_node_t *node = ares__slist_node_first(ew->afd_handles); - ares_afd_handle_t *afd = ares__slist_node_val(node); + ares_slist_node_t *node = ares_slist_node_first(ew->afd_handles); + ares_afd_handle_t *afd = ares_slist_node_val(node); if (afd != NULL && afd->poll_cnt < AFD_POLL_PER_HANDLE) { return node; @@ -488,7 +488,7 @@ static ares_bool_t ares_evsys_win32_init(ares_event_thread_t *e) goto fail; } - ew->afd_handles = ares__slist_create( + ew->afd_handles = ares_slist_create( e->channel->rand_state, ares_afd_handle_cmp, ares_afd_handle_destroy); if (ew->afd_handles == NULL) { goto fail; @@ -505,7 +505,7 @@ static ares_bool_t ares_evsys_win32_init(ares_event_thread_t *e) goto fail; } - ew->sockets = ares__htable_vpvp_create(NULL, NULL); + ew->sockets = ares_htable_vpvp_create(NULL, NULL); if (ew->sockets == NULL) { goto fail; } @@ -582,7 +582,7 @@ static ares_bool_t ares_evsys_win32_afd_enqueue(ares_event_t *event, return ARES_FALSE; } - afd = ares__slist_node_val(ed->afd_handle_node); + afd = ares_slist_node_val(ed->afd_handle_node); /* Enqueue AFD Poll */ ed->afd_poll_info.Exclusive = FALSE; @@ -621,7 +621,7 @@ static ares_bool_t ares_evsys_win32_afd_enqueue(ares_event_t *event, /* Record that we submitted a poll request to this handle and tell it to * re-sort the node since we changed its sort value */ afd->poll_cnt++; - ares__slist_node_reinsert(ed->afd_handle_node); + ares_slist_node_reinsert(ed->afd_handle_node); ed->poll_status = POLL_STATUS_PENDING; CARES_DEBUG_LOG("++ afd_enqueue ed=%p flags=%X\n", (void *)ed, @@ -643,7 +643,7 @@ static ares_bool_t ares_evsys_win32_afd_cancel(ares_evsys_win32_eventdata_t *ed) return ARES_FALSE; } - afd = ares__slist_node_val(ed->afd_handle_node); + afd = ares_slist_node_val(ed->afd_handle_node); /* Misuse */ if (afd == NULL) { @@ -685,10 +685,10 @@ static void ares_evsys_win32_eventdata_destroy(ares_evsys_win32_t *ew, (ed->socket == ARES_SOCKET_BAD) ? "data" : "socket"); /* These type of handles are deferred destroy. Update tracking. */ if (ed->socket != ARES_SOCKET_BAD) { - ares__htable_vpvp_remove(ew->sockets, &ed->iosb); + ares_htable_vpvp_remove(ew->sockets, &ed->iosb); } - ares__thread_mutex_destroy(ed->lock); + ares_thread_mutex_destroy(ed->lock); if (ed->event != NULL) { ed->event->data = NULL; @@ -718,7 +718,7 @@ static ares_bool_t ares_evsys_win32_event_add(ares_event_t *event) * the ares_evsys_win32_eventdata_t as the placeholder to use as the * IOCP Completion Key */ if (ed->socket == ARES_SOCKET_BAD) { - ed->lock = ares__thread_mutex_create(); + ed->lock = ares_thread_mutex_create(); if (ed->lock == NULL) { goto done; } @@ -731,7 +731,7 @@ static ares_bool_t ares_evsys_win32_event_add(ares_event_t *event) goto done; } - if (!ares__htable_vpvp_insert(ew->sockets, &ed->iosb, ed)) { + if (!ares_htable_vpvp_insert(ew->sockets, &ed->iosb, ed)) { goto done; } @@ -859,9 +859,9 @@ static ares_bool_t ares_evsys_win32_process_socket_event( /* Decrement poll count for AFD handle then resort, also disassociate * with socket */ - afd = ares__slist_node_val(ed->afd_handle_node); + afd = ares_slist_node_val(ed->afd_handle_node); afd->poll_cnt--; - ares__slist_node_reinsert(ed->afd_handle_node); + ares_slist_node_reinsert(ed->afd_handle_node); ed->afd_handle_node = NULL; /* Pending destroy, go ahead and kill it */ @@ -946,7 +946,7 @@ static size_t ares_evsys_win32_wait(ares_event_thread_t *e, ed = (ares_evsys_win32_eventdata_t *)entries[i].lpCompletionKey; rc = ares_evsys_win32_process_other_event(ew, ed, i); } else { - ed = ares__htable_vpvp_get_direct(ew->sockets, entries[i].lpOverlapped); + ed = ares_htable_vpvp_get_direct(ew->sockets, entries[i].lpOverlapped); rc = ares_evsys_win32_process_socket_event(ew, ed, i); } diff --git a/deps/cares/src/lib/dsa/ares__array.h b/deps/cares/src/lib/include/ares_array.h similarity index 61% rename from deps/cares/src/lib/dsa/ares__array.h rename to deps/cares/src/lib/include/ares_array.h index 6fa1c0e15e9301..f1a2e155f37f82 100644 --- a/deps/cares/src/lib/dsa/ares__array.h +++ b/deps/cares/src/lib/include/ares_array.h @@ -26,7 +26,9 @@ #ifndef __ARES__ARRAY_H #define __ARES__ARRAY_H -/*! \addtogroup ares__array Array Data Structure +#include "ares.h" + +/*! \addtogroup ares_array Array Data Structure * * This is an array with helpers. It is meant to have as little overhead * as possible over direct array management by applications but to provide @@ -36,17 +38,17 @@ * @{ */ -struct ares__array; +struct ares_array; /*! Opaque data structure for array */ -typedef struct ares__array ares__array_t; +typedef struct ares_array ares_array_t; /*! Callback to free user-defined member data * * \param[in] data pointer to member of array to be destroyed. The pointer * itself must not be destroyed, just the data it contains. */ -typedef void (*ares__array_destructor_t)(void *data); +typedef void (*ares_array_destructor_t)(void *data); /*! Callback to compare two array elements used for sorting * @@ -54,7 +56,7 @@ typedef void (*ares__array_destructor_t)(void *data); * \param[in] data2 array member 2 * \return < 0 if data1 < data2, > 0 if data1 > data2, 0 if data1 == data2 */ -typedef int (*ares__array_cmp_t)(const void *data1, const void *data2); +typedef int (*ares_array_cmp_t)(const void *data1, const void *data2); /*! Create an array object * @@ -72,8 +74,8 @@ typedef int (*ares__array_cmp_t)(const void *data1, const void *data2); * * \return array object or NULL on out of memory */ -ares__array_t *ares__array_create(size_t member_size, - ares__array_destructor_t destruct); +CARES_EXTERN ares_array_t *ares_array_create(size_t member_size, + ares_array_destructor_t destruct); /*! Request the array be at least the requested size. Useful if the desired @@ -83,7 +85,7 @@ ares__array_t *ares__array_create(size_t member_size, * \param[in] size Minimum number of members * \return ARES_SUCCESS on success, ARES_EFORMERR on misuse, * ARES_ENOMEM on out of memory */ -ares_status_t ares__array_set_size(ares__array_t *arr, size_t size); +CARES_EXTERN ares_status_t ares_array_set_size(ares_array_t *arr, size_t size); /*! Sort the array using the given comparison function. This is not * persistent, any future elements inserted will not maintain this sort. @@ -92,14 +94,15 @@ ares_status_t ares__array_set_size(ares__array_t *arr, size_t size); * \param[in] cb Sort callback * \return ARES_SUCCESS on success */ -ares_status_t ares__array_sort(ares__array_t *arr, ares__array_cmp_t cmp); +CARES_EXTERN ares_status_t ares_array_sort(ares_array_t *arr, + ares_array_cmp_t cmp); /*! Destroy an array object. If a destructor is set, will be called on each * member of the array. * * \param[in] arr Initialized array object. */ -void ares__array_destroy(ares__array_t *arr); +CARES_EXTERN void ares_array_destroy(ares_array_t *arr); /*! Retrieve the array in the native format. This will also destroy the * container. It is the responsibility of the caller to free the returned @@ -109,14 +112,14 @@ void ares__array_destroy(ares__array_t *arr); * \param[out] num_members the number of members in the returned array * \return pointer to native array on success, NULL on failure. */ -void *ares__array_finish(ares__array_t *arr, size_t *num_members); +CARES_EXTERN void *ares_array_finish(ares_array_t *arr, size_t *num_members); /*! Retrieve the number of members in the array * * \param[in] arr Initialized array object. * \return numbrer of members */ -size_t ares__array_len(const ares__array_t *arr); +CARES_EXTERN size_t ares_array_len(const ares_array_t *arr); /*! Insert a new array member at the given index * @@ -127,8 +130,8 @@ size_t ares__array_len(const ares__array_t *arr); * \return ARES_SUCCESS on success, ARES_EFORMERR on bad index, * ARES_ENOMEM on out of memory. */ -ares_status_t ares__array_insert_at(void **elem_ptr, ares__array_t *arr, - size_t idx); +CARES_EXTERN ares_status_t ares_array_insert_at(void **elem_ptr, + ares_array_t *arr, size_t idx); /*! Insert a new array member at the end of the array * @@ -136,7 +139,8 @@ ares_status_t ares__array_insert_at(void **elem_ptr, ares__array_t *arr, * \param[in] arr Initialized array object. * \return ARES_SUCCESS on success, ARES_ENOMEM on out of memory. */ -ares_status_t ares__array_insert_last(void **elem_ptr, ares__array_t *arr); +CARES_EXTERN ares_status_t ares_array_insert_last(void **elem_ptr, + ares_array_t *arr); /*! Insert a new array member at the beginning of the array * @@ -144,39 +148,87 @@ ares_status_t ares__array_insert_last(void **elem_ptr, ares__array_t *arr); * \param[in] arr Initialized array object. * \return ARES_SUCCESS on success, ARES_ENOMEM on out of memory. */ -ares_status_t ares__array_insert_first(void **elem_ptr, ares__array_t *arr); +CARES_EXTERN ares_status_t ares_array_insert_first(void **elem_ptr, + ares_array_t *arr); + + +/*! Insert a new array member at the given index and copy the data pointed + * to by the data pointer into the array. This will copy member_size bytes + * from the provided pointer, this may not be safe for some data types + * that may have a smaller size than the provided member_size which includes + * padding as discussed in ares_array_create(). + * + * \param[in] arr Initialized array object. + * \param[in] idx Index in array to place new element, will shift any + * elements down that exist after this point. + * \param[in] data_ptr Pointer to data to copy into array. + * \return ARES_SUCCESS on success, ARES_EFORMERR on bad index or null data + * ptr, ARES_ENOMEM on out of memory. + */ +CARES_EXTERN ares_status_t ares_array_insertdata_at(ares_array_t *arr, + size_t idx, + const void *data_ptr); + +/*! Insert a new array member at the end of the array and copy the data pointed + * to by the data pointer into the array. This will copy member_size bytes + * from the provided pointer, this may not be safe for some data types + * that may have a smaller size than the provided member_size which includes + * padding as discussed in ares_array_create(). + * + * \param[in] arr Initialized array object. + * \param[in] data_ptr Pointer to data to copy into array. + * \return ARES_SUCCESS on success, ARES_EFORMERR on bad index or null data + * ptr, ARES_ENOMEM on out of memory. + */ +CARES_EXTERN ares_status_t ares_array_insertdata_last(ares_array_t *arr, + const void *data_ptr); + +/*! Insert a new array member at the beginning of the array and copy the data + * pointed to by the data pointer into the array. This will copy member_size + * bytes from the provided pointer, this may not be safe for some data types + * that may have a smaller size than the provided member_size which includes + * padding as discussed in ares_array_create(). + * + * \param[in] arr Initialized array object. + * \param[in] data_ptr Pointer to data to copy into array. + * \return ARES_SUCCESS on success, ARES_EFORMERR on bad index or null data + * ptr, ARES_ENOMEM on out of memory. + */ +CARES_EXTERN ares_status_t ares_array_insertdata_first(ares_array_t *arr, + const void *data_ptr); /*! Fetch a pointer to the given element in the array * \param[in] array Initialized array object * \param[in] idx Index to fetch * \return pointer on success, NULL on failure */ -void *ares__array_at(ares__array_t *arr, size_t idx); +CARES_EXTERN void *ares_array_at(ares_array_t *arr, size_t idx); /*! Fetch a pointer to the first element in the array * \param[in] array Initialized array object * \return pointer on success, NULL on failure */ -void *ares__array_first(ares__array_t *arr); +CARES_EXTERN void *ares_array_first(ares_array_t *arr); /*! Fetch a pointer to the last element in the array * \param[in] array Initialized array object * \return pointer on success, NULL on failure */ -void *ares__array_last(ares__array_t *arr); +CARES_EXTERN void *ares_array_last(ares_array_t *arr); /*! Fetch a constant pointer to the given element in the array * \param[in] array Initialized array object * \param[in] idx Index to fetch * \return pointer on success, NULL on failure */ -const void *ares__array_at_const(const ares__array_t *arr, size_t idx); +CARES_EXTERN const void *ares_array_at_const(const ares_array_t *arr, + size_t idx); /*! Fetch a constant pointer to the first element in the array * \param[in] array Initialized array object * \return pointer on success, NULL on failure */ -const void *ares__array_first_const(const ares__array_t *arr); +CARES_EXTERN const void *ares_array_first_const(const ares_array_t *arr); /*! Fetch a constant pointer to the last element in the array * \param[in] array Initialized array object * \return pointer on success, NULL on failure */ -const void *ares__array_last_const(const ares__array_t *arr); +CARES_EXTERN const void *ares_array_last_const(const ares_array_t *arr); /*! Claim the data from the specified array index, copying it to the buffer * provided by the caller. The index specified in the array will then be @@ -187,13 +239,13 @@ const void *ares__array_last_const(const ares__array_t *arr); * member needs destructor if not provided. * \param[in] dest_size Size of buffer provided, used as a sanity check. * Must match member_size provided to - * ares__array_create() if dest_size specified. + * ares_array_create() if dest_size specified. * \param[in] arr Initialized array object * \param[in] idx Index to claim * \return ARES_SUCCESS on success, ARES_EFORMERR on usage failure. */ -ares_status_t ares__array_claim_at(void *dest, size_t dest_size, - ares__array_t *arr, size_t idx); +CARES_EXTERN ares_status_t ares_array_claim_at(void *dest, size_t dest_size, + ares_array_t *arr, size_t idx); /*! Remove the member at the specified array index. The destructor will be * called. @@ -202,21 +254,22 @@ ares_status_t ares__array_claim_at(void *dest, size_t dest_size, * \param[in] idx Index to remove * \return ARES_SUCCESS if removed, ARES_EFORMERR on invalid use */ -ares_status_t ares__array_remove_at(ares__array_t *arr, size_t idx); +CARES_EXTERN ares_status_t ares_array_remove_at(ares_array_t *arr, size_t idx); /*! Remove the first member of the array. * * \param[in] arr Initialized array object * \return ARES_SUCCESS if removed, ARES_EFORMERR on invalid use */ -ares_status_t ares__array_remove_first(ares__array_t *arr); +CARES_EXTERN ares_status_t ares_array_remove_first(ares_array_t *arr); /*! Remove the last member of the array. * * \param[in] arr Initialized array object * \return ARES_SUCCESS if removed, ARES_EFORMERR on invalid use */ -ares_status_t ares__array_remove_last(ares__array_t *arr); +CARES_EXTERN ares_status_t ares_array_remove_last(ares_array_t *arr); + /*! @} */ diff --git a/deps/cares/src/lib/str/ares__buf.h b/deps/cares/src/lib/include/ares_buf.h similarity index 60% rename from deps/cares/src/lib/str/ares__buf.h rename to deps/cares/src/lib/include/ares_buf.h index cb887aa27edcdf..7836a313e066d1 100644 --- a/deps/cares/src/lib/str/ares__buf.h +++ b/deps/cares/src/lib/include/ares_buf.h @@ -26,7 +26,10 @@ #ifndef __ARES__BUF_H #define __ARES__BUF_H -/*! \addtogroup ares__buf Safe Data Builder and buffer +#include "ares.h" +#include "ares_array.h" + +/*! \addtogroup ares_buf Safe Data Builder and buffer * * This is a buffer building and parsing framework with a focus on security over * performance. All data to be read from the buffer will perform explicit length @@ -42,16 +45,16 @@ * * @{ */ -struct ares__buf; +struct ares_buf; /*! Opaque data type for generic hash table implementation */ -typedef struct ares__buf ares__buf_t; +typedef struct ares_buf ares_buf_t; /*! Create a new buffer object that dynamically allocates buffers for data. * * \return initialized buffer object or NULL if out of memory. */ -ares__buf_t *ares__buf_create(void); +CARES_EXTERN ares_buf_t *ares_buf_create(void); /*! Create a new buffer object that uses a user-provided data pointer. The * data provided will not be manipulated, and cannot be appended to. This @@ -62,14 +65,15 @@ ares__buf_t *ares__buf_create(void); * * \return initialized buffer object or NULL if out of memory or misuse. */ -ares__buf_t *ares__buf_create_const(const unsigned char *data, size_t data_len); +CARES_EXTERN ares_buf_t *ares_buf_create_const(const unsigned char *data, + size_t data_len); /*! Destroy an initialized buffer object. * * \param[in] buf Initialized buf object */ -void ares__buf_destroy(ares__buf_t *buf); +CARES_EXTERN void ares_buf_destroy(ares_buf_t *buf); /*! Append multiple bytes to a dynamic buffer object @@ -79,8 +83,9 @@ void ares__buf_destroy(ares__buf_t *buf); * \param[in] data_len Length of data to copy to buffer object. * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_append(ares__buf_t *buf, const unsigned char *data, - size_t data_len); +CARES_EXTERN ares_status_t ares_buf_append(ares_buf_t *buf, + const unsigned char *data, + size_t data_len); /*! Append a single byte to the dynamic buffer object * @@ -88,7 +93,8 @@ ares_status_t ares__buf_append(ares__buf_t *buf, const unsigned char *data, * \param[in] b Single byte to append to buffer object. * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_append_byte(ares__buf_t *buf, unsigned char b); +CARES_EXTERN ares_status_t ares_buf_append_byte(ares_buf_t *buf, + unsigned char b); /*! Append a null-terminated string to the dynamic buffer object * @@ -96,7 +102,8 @@ ares_status_t ares__buf_append_byte(ares__buf_t *buf, unsigned char b); * \param[in] str String to append to buffer object. * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_append_str(ares__buf_t *buf, const char *str); +CARES_EXTERN ares_status_t ares_buf_append_str(ares_buf_t *buf, + const char *str); /*! Append a 16bit Big Endian number to the buffer. * @@ -104,7 +111,8 @@ ares_status_t ares__buf_append_str(ares__buf_t *buf, const char *str); * \param[out] u16 16bit integer * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_append_be16(ares__buf_t *buf, unsigned short u16); +CARES_EXTERN ares_status_t ares_buf_append_be16(ares_buf_t *buf, + unsigned short u16); /*! Append a 32bit Big Endian number to the buffer. * @@ -112,7 +120,8 @@ ares_status_t ares__buf_append_be16(ares__buf_t *buf, unsigned short u16); * \param[out] u32 32bit integer * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_append_be32(ares__buf_t *buf, unsigned int u32); +CARES_EXTERN ares_status_t ares_buf_append_be32(ares_buf_t *buf, + unsigned int u32); /*! Append a number in ASCII decimal form. * @@ -121,8 +130,8 @@ ares_status_t ares__buf_append_be32(ares__buf_t *buf, unsigned int u32); * \param[in] len Length to output, use 0 for no padding * \return ARES_SUCCESS on success */ -ares_status_t ares__buf_append_num_dec(ares__buf_t *buf, size_t num, - size_t len); +CARES_EXTERN ares_status_t ares_buf_append_num_dec(ares_buf_t *buf, size_t num, + size_t len); /*! Append a number in ASCII hexadecimal form. * @@ -131,8 +140,8 @@ ares_status_t ares__buf_append_num_dec(ares__buf_t *buf, size_t num, * \param[in] len Length to output, use 0 for no padding * \return ARES_SUCCESS on success */ -ares_status_t ares__buf_append_num_hex(ares__buf_t *buf, size_t num, - size_t len); +CARES_EXTERN ares_status_t ares_buf_append_num_hex(ares_buf_t *buf, size_t num, + size_t len); /*! Sets the current buffer length. This *may* be used if there is a need to * override a prior position in the buffer, such as if there is a length @@ -147,13 +156,13 @@ ares_status_t ares__buf_append_num_hex(ares__buf_t *buf, size_t num, * \param[in] len Length to set * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_set_length(ares__buf_t *buf, size_t len); +CARES_EXTERN ares_status_t ares_buf_set_length(ares_buf_t *buf, size_t len); /*! Start a dynamic append operation that returns a buffer suitable for * writing. A desired minimum length is passed in, and the actual allocated * buffer size is returned which may be greater than the requested size. - * No operation other than ares__buf_append_finish() is allowed on the + * No operation other than ares_buf_append_finish() is allowed on the * buffer after this request. * * \param[in] buf Initialized buffer object @@ -161,17 +170,17 @@ ares_status_t ares__buf_set_length(ares__buf_t *buf, size_t len); * returned. * \return Pointer to writable buffer or NULL on failure (usage, out of mem) */ -unsigned char *ares__buf_append_start(ares__buf_t *buf, size_t *len); +CARES_EXTERN unsigned char *ares_buf_append_start(ares_buf_t *buf, size_t *len); /*! Finish a dynamic append operation. Called after - * ares__buf_append_start() once desired data is written. + * ares_buf_append_start() once desired data is written. * * \param[in] buf Initialized buffer object. * \param[in] len Length of data written. May be zero to terminate * operation. Must not be greater than returned from - * ares__buf_append_start(). + * ares_buf_append_start(). */ -void ares__buf_append_finish(ares__buf_t *buf, size_t len); +CARES_EXTERN void ares_buf_append_finish(ares_buf_t *buf, size_t len); /*! Write the data provided to the buffer in a hexdump format. * @@ -180,10 +189,11 @@ void ares__buf_append_finish(ares__buf_t *buf, size_t len); * \param[in] len Length of data to hexdump * \return ARES_SUCCESS on success. */ -ares_status_t ares__buf_hexdump(ares__buf_t *buf, const unsigned char *data, - size_t len); +CARES_EXTERN ares_status_t ares_buf_hexdump(ares_buf_t *buf, + const unsigned char *data, + size_t len); -/*! Clean up ares__buf_t and return allocated pointer to unprocessed data. It +/*! Clean up ares_buf_t and return allocated pointer to unprocessed data. It * is the responsibility of the caller to ares_free() the returned buffer. * The passed in buf parameter is invalidated by this call. * @@ -191,9 +201,9 @@ ares_status_t ares__buf_hexdump(ares__buf_t *buf, const unsigned char *data, * \param[out] len Length of data returned * \return pointer to unprocessed data (may be zero length) or NULL on error. */ -unsigned char *ares__buf_finish_bin(ares__buf_t *buf, size_t *len); +CARES_EXTERN unsigned char *ares_buf_finish_bin(ares_buf_t *buf, size_t *len); -/*! Clean up ares__buf_t and return allocated pointer to unprocessed data and +/*! Clean up ares_buf_t and return allocated pointer to unprocessed data and * return it as a string (null terminated). It is the responsibility of the * caller to ares_free() the returned buffer. The passed in buf parameter is * invalidated by this call. @@ -207,7 +217,7 @@ unsigned char *ares__buf_finish_bin(ares__buf_t *buf, size_t *len); * \param[out] len Optional. Length of data returned, or NULL if not needed. * \return pointer to unprocessed data or NULL on error. */ -char *ares__buf_finish_str(ares__buf_t *buf, size_t *len); +CARES_EXTERN char *ares_buf_finish_str(ares_buf_t *buf, size_t *len); /*! Tag a position to save in the buffer in case parsing needs to rollback, * such as if insufficient data is available, but more data may be added in @@ -216,14 +226,14 @@ char *ares__buf_finish_str(ares__buf_t *buf, size_t *len); * * \param[in] buf Initialized buffer object */ -void ares__buf_tag(ares__buf_t *buf); +CARES_EXTERN void ares_buf_tag(ares_buf_t *buf); /*! Rollback to a tagged position. Will automatically clear the tag. * * \param[in] buf Initialized buffer object * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_tag_rollback(ares__buf_t *buf); +CARES_EXTERN ares_status_t ares_buf_tag_rollback(ares_buf_t *buf); /*! Clear the tagged position without rolling back. You should do this any * time a tag is no longer needed as future append operations can reclaim @@ -232,25 +242,26 @@ ares_status_t ares__buf_tag_rollback(ares__buf_t *buf); * \param[in] buf Initialized buffer object * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_tag_clear(ares__buf_t *buf); +CARES_EXTERN ares_status_t ares_buf_tag_clear(ares_buf_t *buf); /*! Fetch the buffer and length of data starting from the tagged position up * to the _current_ position. It will not unset the tagged position. The - * data may be invalidated by any future ares__buf_*() calls. + * data may be invalidated by any future ares_buf_*() calls. * * \param[in] buf Initialized buffer object * \param[out] len Length between tag and current offset in buffer * \return NULL on failure (such as no tag), otherwise pointer to start of * buffer */ -const unsigned char *ares__buf_tag_fetch(const ares__buf_t *buf, size_t *len); +CARES_EXTERN const unsigned char *ares_buf_tag_fetch(const ares_buf_t *buf, + size_t *len); /*! Get the length of the current tag offset to the current position. * * \param[in] buf Initialized buffer object * \return length */ -size_t ares__buf_tag_length(const ares__buf_t *buf); +CARES_EXTERN size_t ares_buf_tag_length(const ares_buf_t *buf); /*! Fetch the bytes starting from the tagged position up to the _current_ * position using the provided buffer. It will not unset the tagged position. @@ -261,23 +272,50 @@ size_t ares__buf_tag_length(const ares__buf_t *buf); * buffer. * \return ARES_SUCCESS if fetched, ARES_EFORMERR if insufficient buffer size */ -ares_status_t ares__buf_tag_fetch_bytes(const ares__buf_t *buf, - unsigned char *bytes, size_t *len); +CARES_EXTERN ares_status_t ares_buf_tag_fetch_bytes(const ares_buf_t *buf, + unsigned char *bytes, + size_t *len); /*! Fetch the bytes starting from the tagged position up to the _current_ * position as a NULL-terminated string using the provided buffer. The data * is validated to be ASCII-printable data. It will not unset the tagged - * poition. + * position. * * \param[in] buf Initialized buffer object * \param[in,out] str Buffer to hold data - * \param[in] len On input, buffer size, on output, bytes place in - * buffer. + * \param[in] len buffer size + * \return ARES_SUCCESS if fetched, ARES_EFORMERR if insufficient buffer size, + * ARES_EBADSTR if not printable ASCII + */ +CARES_EXTERN ares_status_t ares_buf_tag_fetch_string(const ares_buf_t *buf, + char *str, size_t len); + +/*! Fetch the bytes starting from the tagged position up to the _current_ + * position as a NULL-terminated string and placed into a newly allocated + * buffer. The data is validated to be ASCII-printable data. It will not + * unset the tagged position. + * + * \param[in] buf Initialized buffer object + * \param[out] str New buffer to hold output, free with ares_free() + * * \return ARES_SUCCESS if fetched, ARES_EFORMERR if insufficient buffer size, * ARES_EBADSTR if not printable ASCII */ -ares_status_t ares__buf_tag_fetch_string(const ares__buf_t *buf, char *str, - size_t len); +CARES_EXTERN ares_status_t ares_buf_tag_fetch_strdup(const ares_buf_t *buf, + char **str); + +/*! Fetch the bytes starting from the tagged position up to the _current_ + * position as const buffer. Care must be taken to not append or destroy the + * passed in buffer until the newly fetched buffer is no longer needed since + * it points to memory inside the passed in buffer which could be invalidated. + * + * \param[in] buf Initialized buffer object + * \param[out] newbuf New const buffer object, must be destroyed when done. + + * \return ARES_SUCCESS if fetched + */ +CARES_EXTERN ares_status_t ares_buf_tag_fetch_constbuf(const ares_buf_t *buf, + ares_buf_t **newbuf); /*! Consume the given number of bytes without reading them. * @@ -285,7 +323,7 @@ ares_status_t ares__buf_tag_fetch_string(const ares__buf_t *buf, char *str, * \param[in] len Length to consume * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_consume(ares__buf_t *buf, size_t len); +CARES_EXTERN ares_status_t ares_buf_consume(ares_buf_t *buf, size_t len); /*! Fetch a 16bit Big Endian number from the buffer. * @@ -293,7 +331,8 @@ ares_status_t ares__buf_consume(ares__buf_t *buf, size_t len); * \param[out] u16 Buffer to hold 16bit integer * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_fetch_be16(ares__buf_t *buf, unsigned short *u16); +CARES_EXTERN ares_status_t ares_buf_fetch_be16(ares_buf_t *buf, + unsigned short *u16); /*! Fetch a 32bit Big Endian number from the buffer. * @@ -301,7 +340,8 @@ ares_status_t ares__buf_fetch_be16(ares__buf_t *buf, unsigned short *u16); * \param[out] u32 Buffer to hold 32bit integer * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_fetch_be32(ares__buf_t *buf, unsigned int *u32); +CARES_EXTERN ares_status_t ares_buf_fetch_be32(ares_buf_t *buf, + unsigned int *u32); /*! Fetch the requested number of bytes into the provided buffer @@ -311,8 +351,9 @@ ares_status_t ares__buf_fetch_be32(ares__buf_t *buf, unsigned int *u32); * \param[in] len Requested number of bytes (must be > 0) * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_fetch_bytes(ares__buf_t *buf, unsigned char *bytes, - size_t len); +CARES_EXTERN ares_status_t ares_buf_fetch_bytes(ares_buf_t *buf, + unsigned char *bytes, + size_t len); /*! Fetch the requested number of bytes and return a new buffer that must be @@ -326,9 +367,9 @@ ares_status_t ares__buf_fetch_bytes(ares__buf_t *buf, unsigned char *bytes, * \param[out] bytes Pointer passed by reference. Will be allocated. * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_fetch_bytes_dup(ares__buf_t *buf, size_t len, - ares_bool_t null_term, - unsigned char **bytes); +CARES_EXTERN ares_status_t ares_buf_fetch_bytes_dup(ares_buf_t *buf, size_t len, + ares_bool_t null_term, + unsigned char **bytes); /*! Fetch the requested number of bytes and place them into the provided * dest buffer object. @@ -338,19 +379,21 @@ ares_status_t ares__buf_fetch_bytes_dup(ares__buf_t *buf, size_t len, * \param[in] len Requested number of bytes (must be > 0) * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_fetch_bytes_into_buf(ares__buf_t *buf, - ares__buf_t *dest, size_t len); +CARES_EXTERN ares_status_t ares_buf_fetch_bytes_into_buf(ares_buf_t *buf, + ares_buf_t *dest, + size_t len); /*! Fetch the requested number of bytes and return a new buffer that must be * ares_free()'d by the caller. The returned buffer is a null terminated - * string. + * string. The data is validated to be ASCII-printable. * * \param[in] buf Initialized buffer object * \param[in] len Requested number of bytes (must be > 0) * \param[out] str Pointer passed by reference. Will be allocated. * \return ARES_SUCCESS or one of the c-ares error codes */ -ares_status_t ares__buf_fetch_str_dup(ares__buf_t *buf, size_t len, char **str); +CARES_EXTERN ares_status_t ares_buf_fetch_str_dup(ares_buf_t *buf, size_t len, + char **str); /*! Consume whitespace characters (0x09, 0x0B, 0x0C, 0x0D, 0x20, and optionally * 0x0A). @@ -360,8 +403,8 @@ ares_status_t ares__buf_fetch_str_dup(ares__buf_t *buf, size_t len, char **str); * ARES_FALSE otherwise. * \return number of whitespace characters consumed */ -size_t ares__buf_consume_whitespace(ares__buf_t *buf, - ares_bool_t include_linefeed); +CARES_EXTERN size_t ares_buf_consume_whitespace(ares_buf_t *buf, + ares_bool_t include_linefeed); /*! Consume any non-whitespace character (anything other than 0x09, 0x0B, 0x0C, @@ -370,7 +413,7 @@ size_t ares__buf_consume_whitespace(ares__buf_t *buf, * \param[in] buf Initialized buffer object * \return number of characters consumed */ -size_t ares__buf_consume_nonwhitespace(ares__buf_t *buf); +CARES_EXTERN size_t ares_buf_consume_nonwhitespace(ares_buf_t *buf); /*! Consume until a character in the character set provided is reached. Does @@ -382,13 +425,31 @@ size_t ares__buf_consume_nonwhitespace(ares__buf_t *buf); * \param[in] require_charset require we find a character from the charset. * if ARES_FALSE it will simply consume the * rest of the buffer. If ARES_TRUE will return - * 0 if not found. + * SIZE_MAX if not found. * \return number of characters consumed */ -size_t ares__buf_consume_until_charset(ares__buf_t *buf, - const unsigned char *charset, size_t len, - ares_bool_t require_charset); +CARES_EXTERN size_t ares_buf_consume_until_charset(ares_buf_t *buf, + const unsigned char *charset, + size_t len, + ares_bool_t require_charset); + +/*! Consume until a sequence of bytes is encountered. Does not include the + * sequence of characters itself. + * + * \param[in] buf Initialized buffer object + * \param[in] seq sequence of bytes + * \param[in] len length of sequence + * \param[in] require_charset require we find the sequence. + * if ARES_FALSE it will simply consume the + * rest of the buffer. If ARES_TRUE will return + * SIZE_MAX if not found. + * \return number of characters consumed + */ +CARES_EXTERN size_t ares_buf_consume_until_seq(ares_buf_t *buf, + const unsigned char *seq, + size_t len, + ares_bool_t require_seq); /*! Consume while the characters match the characters in the provided set. * @@ -397,8 +458,9 @@ size_t ares__buf_consume_until_charset(ares__buf_t *buf, * \param[in] len length of character set * \return number of characters consumed */ -size_t ares__buf_consume_charset(ares__buf_t *buf, const unsigned char *charset, - size_t len); +CARES_EXTERN size_t ares_buf_consume_charset(ares_buf_t *buf, + const unsigned char *charset, + size_t len); /*! Consume from the current position until the end of the line, and optionally @@ -409,7 +471,8 @@ size_t ares__buf_consume_charset(ares__buf_t *buf, const unsigned char *charset, * ARES_FALSE otherwise. * \return number of characters consumed */ -size_t ares__buf_consume_line(ares__buf_t *buf, ares_bool_t include_linefeed); +CARES_EXTERN size_t ares_buf_consume_line(ares_buf_t *buf, + ares_bool_t include_linefeed); typedef enum { /*! No flags */ @@ -419,9 +482,9 @@ typedef enum { * incompatible with ARES_BUF_SPLIT_LTRIM since the delimiter is always * the first character. */ - ARES_BUF_SPLIT_DONT_CONSUME_DELIMS = 1 << 0, + ARES_BUF_SPLIT_KEEP_DELIMS = 1 << 0, /*! Allow blank sections, by default blank sections are not emitted. If using - * ARES_BUF_SPLIT_DONT_CONSUME_DELIMS, the delimiter is not counted as part + * ARES_BUF_SPLIT_KEEP_DELIMS, the delimiter is not counted as part * of the section */ ARES_BUF_SPLIT_ALLOW_BLANK = 1 << 1, /*! Remove duplicate entries */ @@ -434,7 +497,7 @@ typedef enum { ARES_BUF_SPLIT_RTRIM = 1 << 5, /*! Trim leading and trailing whitespace from buffer */ ARES_BUF_SPLIT_TRIM = (ARES_BUF_SPLIT_LTRIM | ARES_BUF_SPLIT_RTRIM) -} ares__buf_split_t; +} ares_buf_split_t; /*! Split the provided buffer into multiple sub-buffers stored in the variable * pointed to by the linked list. The sub buffers are const buffers pointing @@ -450,17 +513,60 @@ typedef enum { * character in the value. A value of 1 would * have little usefulness and would effectively * ignore the delimiter itself. - * \param[out] list Result. Depending on flags, this may be a - * valid list with no elements. Use - * ares__llist_destroy() to free the memory which - * will also free the contained ares__buf_t - * objects. + * \param[out] arr Result. Depending on flags, this may be a + * valid array with no elements. Use + * ares_array_destroy() to free the memory which + * will also free the contained ares_buf_t * + * objects. Each buf object returned by + * ares_array_at() or similar is a pointer to + * an ares_buf_t * object, meaning you need to + * accept it as "ares_buf_t **" then dereference. + * \return ARES_SUCCESS on success, or error like ARES_ENOMEM. + */ +CARES_EXTERN ares_status_t ares_buf_split( + ares_buf_t *buf, const unsigned char *delims, size_t delims_len, + ares_buf_split_t flags, size_t max_sections, ares_array_t **arr); + +/*! Split the provided buffer into an ares_array_t of C strings. + * + * \param[in] buf Initialized buffer object + * \param[in] delims Possible delimiters + * \param[in] delims_len Length of possible delimiters + * \param[in] flags One more more flags + * \param[in] max_sections Maximum number of sections. Use 0 for + * unlimited. Useful for splitting key/value + * pairs where the delimiter may be a valid + * character in the value. A value of 1 would + * have little usefulness and would effectively + * ignore the delimiter itself. + * \param[out] arr Array of strings. Free using + * ares_array_destroy(). * \return ARES_SUCCESS on success, or error like ARES_ENOMEM. */ -ares_status_t ares__buf_split(ares__buf_t *buf, const unsigned char *delims, - size_t delims_len, ares__buf_split_t flags, - size_t max_sections, ares__llist_t **list); +CARES_EXTERN ares_status_t ares_buf_split_str_array( + ares_buf_t *buf, const unsigned char *delims, size_t delims_len, + ares_buf_split_t flags, size_t max_sections, ares_array_t **arr); +/*! Split the provided buffer into a C array of C strings. + * + * \param[in] buf Initialized buffer object + * \param[in] delims Possible delimiters + * \param[in] delims_len Length of possible delimiters + * \param[in] flags One more more flags + * \param[in] max_sections Maximum number of sections. Use 0 for + * unlimited. Useful for splitting key/value + * pairs where the delimiter may be a valid + * character in the value. A value of 1 would + * have little usefulness and would effectively + * ignore the delimiter itself. + * \param[out] strs Array of strings. Free using + * ares_free_array(strs, nstrs, ares_free) + * \param[out] nstrs Number of elements in the array. + * \return ARES_SUCCESS on success, or error like ARES_ENOMEM. + */ +CARES_EXTERN ares_status_t ares_buf_split_str( + ares_buf_t *buf, const unsigned char *delims, size_t delims_len, + ares_buf_split_t flags, size_t max_sections, char ***strs, size_t *nstrs); /*! Check the unprocessed buffer to see if it begins with the sequence of * characters provided. @@ -470,8 +576,9 @@ ares_status_t ares__buf_split(ares__buf_t *buf, const unsigned char *delims, * \param[in] data_len Length of data to compare. * \return ARES_TRUE on match, ARES_FALSE otherwise. */ -ares_bool_t ares__buf_begins_with(const ares__buf_t *buf, - const unsigned char *data, size_t data_len); +CARES_EXTERN ares_bool_t ares_buf_begins_with(const ares_buf_t *buf, + const unsigned char *data, + size_t data_len); /*! Size of unprocessed remaining data length @@ -479,18 +586,27 @@ ares_bool_t ares__buf_begins_with(const ares__buf_t *buf, * \param[in] buf Initialized buffer object * \return length remaining */ -size_t ares__buf_len(const ares__buf_t *buf); +CARES_EXTERN size_t ares_buf_len(const ares_buf_t *buf); /*! Retrieve a pointer to the currently unprocessed data. Generally this isn't * recommended to be used in practice. The returned pointer may be invalidated - * by any future ares__buf_*() calls. + * by any future ares_buf_*() calls. * * \param[in] buf Initialized buffer object * \param[out] len Length of available data * \return Pointer to buffer of unprocessed data */ -const unsigned char *ares__buf_peek(const ares__buf_t *buf, size_t *len); +CARES_EXTERN const unsigned char *ares_buf_peek(const ares_buf_t *buf, + size_t *len); +/*! Retrieve the next byte in the buffer without moving forward. + * + * \param[in] buf Initialized buffer object + * \param[out] b Single byte + * \return \return ARES_SUCCESS on success, or error + */ +CARES_EXTERN ares_status_t ares_buf_peek_byte(const ares_buf_t *buf, + unsigned char *b); /*! Wipe any processed data from the beginning of the buffer. This will * move any remaining data to the front of the internally allocated buffer. @@ -503,46 +619,46 @@ const unsigned char *ares__buf_peek(const ares__buf_t *buf, size_t *len); * * It may be useful to call in order to ensure the current message being * processed is in the beginning of the buffer if there is an intent to use - * ares__buf_set_position() and ares__buf_get_position() as may be necessary + * ares_buf_set_position() and ares_buf_get_position() as may be necessary * when processing DNS compressed names. * * If there is an active tag, it will NOT clear the tag, it will use the tag * as the start of the unprocessed data rather than the current offset. If - * a prior tag is no longer needed, may be wise to call ares__buf_tag_clear(). + * a prior tag is no longer needed, may be wise to call ares_buf_tag_clear(). * * \param[in] buf Initialized buffer object */ -void ares__buf_reclaim(ares__buf_t *buf); +CARES_EXTERN void ares_buf_reclaim(ares_buf_t *buf); /*! Set the current offset within the internal buffer. * - * Typically this should not be used, if possible, use the ares__buf_tag*() + * Typically this should not be used, if possible, use the ares_buf_tag*() * operations instead. * * One exception is DNS name compression which may backwards reference to * an index in the message. It may be necessary in such a case to call - * ares__buf_reclaim() if using a dynamic (non-const) buffer before processing + * ares_buf_reclaim() if using a dynamic (non-const) buffer before processing * such a message. * * \param[in] buf Initialized buffer object * \param[in] idx Index to set position * \return ARES_SUCCESS if valid index */ -ares_status_t ares__buf_set_position(ares__buf_t *buf, size_t idx); +CARES_EXTERN ares_status_t ares_buf_set_position(ares_buf_t *buf, size_t idx); /*! Get the current offset within the internal buffer. * - * Typically this should not be used, if possible, use the ares__buf_tag*() + * Typically this should not be used, if possible, use the ares_buf_tag*() * operations instead. * * This can be used to get the current position, useful for saving if a - * jump via ares__buf_set_position() is performed and need to restore the + * jump via ares_buf_set_position() is performed and need to restore the * current position for future operations. * * \param[in] buf Initialized buffer object * \return index of current position */ -size_t ares__buf_get_position(const ares__buf_t *buf); +CARES_EXTERN size_t ares_buf_get_position(const ares_buf_t *buf); /*! Parse a character-string as defined in RFC1035, as a null-terminated * string. @@ -556,29 +672,9 @@ size_t ares__buf_get_position(const ares__buf_t *buf); * ares_free()'d by the caller. * \return ARES_SUCCESS on success */ -ares_status_t ares__buf_parse_dns_str(ares__buf_t *buf, size_t remaining_len, - char **name); - -/*! Parse an array of character strings as defined in RFC1035, as binary, - * however, for convenience this does guarantee a NULL terminator (that is - * not included in the length for each value). - * - * \param[in] buf initialized buffer object - * \param[in] remaining_len maximum length that should be used for - * parsing the string, this is often less than - * the remaining buffer and is based on the RR - * record length. - * \param[out] strs Pointer passed by reference to be filled in - * with - * the array of values. - * \param[out] validate_printable Validate the strings contain only printable - * data. - * \return ARES_SUCCESS on success - */ -ares_status_t ares__buf_parse_dns_abinstr(ares__buf_t *buf, - size_t remaining_len, - ares__dns_multistring_t **strs, - ares_bool_t validate_printable); +CARES_EXTERN ares_status_t ares_buf_parse_dns_str(ares_buf_t *buf, + size_t remaining_len, + char **name); /*! Parse a character-string as defined in RFC1035, as binary, however for * convenience this does guarantee a NULL terminator (that is not included @@ -594,8 +690,10 @@ ares_status_t ares__buf_parse_dns_abinstr(ares__buf_t *buf, * \param[out] bin_len Length of returned string. * \return ARES_SUCCESS on success */ -ares_status_t ares__buf_parse_dns_binstr(ares__buf_t *buf, size_t remaining_len, - unsigned char **bin, size_t *bin_len); +CARES_EXTERN ares_status_t ares_buf_parse_dns_binstr(ares_buf_t *buf, + size_t remaining_len, + unsigned char **bin, + size_t *bin_len); /*! Load data from specified file path into provided buffer. The entire file * is loaded into memory. @@ -606,7 +704,8 @@ ares_status_t ares__buf_parse_dns_binstr(ares__buf_t *buf, size_t remaining_len, * \return ARES_ENOTFOUND if file not found, ARES_EFILE if issues reading * file, ARES_ENOMEM if out of memory, ARES_SUCCESS on success. */ -ares_status_t ares__buf_load_file(const char *filename, ares__buf_t *buf); +CARES_EXTERN ares_status_t ares_buf_load_file(const char *filename, + ares_buf_t *buf); /*! @} */ diff --git a/deps/cares/src/lib/dsa/ares__htable_asvp.h b/deps/cares/src/lib/include/ares_htable_asvp.h similarity index 72% rename from deps/cares/src/lib/dsa/ares__htable_asvp.h rename to deps/cares/src/lib/include/ares_htable_asvp.h index 49a766d023091e..89a99fc9eec541 100644 --- a/deps/cares/src/lib/dsa/ares__htable_asvp.h +++ b/deps/cares/src/lib/include/ares_htable_asvp.h @@ -26,10 +26,10 @@ #ifndef __ARES__HTABLE_ASVP_H #define __ARES__HTABLE_ASVP_H -/*! \addtogroup ares__htable_asvp HashTable with ares_socket_t Key and +/*! \addtogroup ares_htable_asvp HashTable with ares_socket_t Key and * void pointer Value * - * This data structure wraps the base ares__htable data structure in order to + * This data structure wraps the base ares_htable data structure in order to * split the key and value data types as ares_socket_t and void pointer, * respectively. * @@ -41,23 +41,23 @@ * @{ */ -struct ares__htable_asvp; +struct ares_htable_asvp; /*! Opaque data type for ares_socket_t key, void pointer hash table * implementation */ -typedef struct ares__htable_asvp ares__htable_asvp_t; +typedef struct ares_htable_asvp ares_htable_asvp_t; /*! Callback to free value stored in hashtable * * \param[in] val user-supplied value */ -typedef void (*ares__htable_asvp_val_free_t)(void *val); +typedef void (*ares_htable_asvp_val_free_t)(void *val); /*! Destroy hashtable * * \param[in] htable Initialized hashtable */ -void ares__htable_asvp_destroy(ares__htable_asvp_t *htable); +CARES_EXTERN void ares_htable_asvp_destroy(ares_htable_asvp_t *htable); /*! Create size_t key, void pointer value hash table * @@ -65,8 +65,8 @@ void ares__htable_asvp_destroy(ares__htable_asvp_t *htable); * NULL it is expected the caller will clean up any user * supplied values. */ -ares__htable_asvp_t * - ares__htable_asvp_create(ares__htable_asvp_val_free_t val_free); +CARES_EXTERN ares_htable_asvp_t * + ares_htable_asvp_create(ares_htable_asvp_val_free_t val_free); /*! Retrieve an array of keys from the hashtable. * @@ -74,8 +74,8 @@ ares__htable_asvp_t * * \param[out] num Count of returned keys * \return Array of keys in the hashtable. Must be free'd with ares_free(). */ -ares_socket_t *ares__htable_asvp_keys(const ares__htable_asvp_t *htable, - size_t *num); +CARES_EXTERN ares_socket_t * + ares_htable_asvp_keys(const ares_htable_asvp_t *htable, size_t *num); /*! Insert key/value into hash table @@ -85,8 +85,8 @@ ares_socket_t *ares__htable_asvp_keys(const ares__htable_asvp_t *htable, * \param[in] val value to store (takes ownership). May be NULL. * \return ARES_TRUE on success, ARES_FALSE on out of memory or misuse */ -ares_bool_t ares__htable_asvp_insert(ares__htable_asvp_t *htable, - ares_socket_t key, void *val); +CARES_EXTERN ares_bool_t ares_htable_asvp_insert(ares_htable_asvp_t *htable, + ares_socket_t key, void *val); /*! Retrieve value from hashtable based on key * @@ -95,19 +95,19 @@ ares_bool_t ares__htable_asvp_insert(ares__htable_asvp_t *htable, * \param[out] val Optional. Pointer to store value. * \return ARES_TRUE on success, ARES_FALSE on failure */ -ares_bool_t ares__htable_asvp_get(const ares__htable_asvp_t *htable, - ares_socket_t key, void **val); +CARES_EXTERN ares_bool_t ares_htable_asvp_get(const ares_htable_asvp_t *htable, + ares_socket_t key, void **val); /*! Retrieve value from hashtable directly as return value. Caveat to this - * function over ares__htable_asvp_get() is that if a NULL value is stored + * function over ares_htable_asvp_get() is that if a NULL value is stored * you cannot determine if the key is not found or the value is NULL. * * \param[in] htable Initialized hash table * \param[in] key key to use to search * \return value associated with key in hashtable or NULL */ -void *ares__htable_asvp_get_direct(const ares__htable_asvp_t *htable, - ares_socket_t key); +CARES_EXTERN void *ares_htable_asvp_get_direct(const ares_htable_asvp_t *htable, + ares_socket_t key); /*! Remove a value from the hashtable by key * @@ -115,15 +115,15 @@ void *ares__htable_asvp_get_direct(const ares__htable_asvp_t *htable, * \param[in] key key to use to search * \return ARES_TRUE if found, ARES_FALSE if not found */ -ares_bool_t ares__htable_asvp_remove(ares__htable_asvp_t *htable, - ares_socket_t key); +CARES_EXTERN ares_bool_t ares_htable_asvp_remove(ares_htable_asvp_t *htable, + ares_socket_t key); /*! Retrieve the number of keys stored in the hash table * * \param[in] htable Initialized hash table * \return count */ -size_t ares__htable_asvp_num_keys(const ares__htable_asvp_t *htable); +CARES_EXTERN size_t ares_htable_asvp_num_keys(const ares_htable_asvp_t *htable); /*! @} */ diff --git a/deps/cares/src/lib/include/ares_htable_dict.h b/deps/cares/src/lib/include/ares_htable_dict.h new file mode 100644 index 00000000000000..cb6f1f048ca023 --- /dev/null +++ b/deps/cares/src/lib/include/ares_htable_dict.h @@ -0,0 +1,123 @@ +/* MIT License + * + * Copyright (c) 2024 Brad House + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ +#ifndef __ARES__HTABLE_DICT_H +#define __ARES__HTABLE_DICT_H + +/*! \addtogroup ares_htable_dict HashTable with case-insensitive string Key and + * string value + * + * This data structure wraps the base ares_htable data structure in order to + * split the key and value data types as string and string, respectively. + * + * Average time complexity: + * - Insert: O(1) + * - Search: O(1) + * - Delete: O(1) + * + * @{ + */ + +struct ares_htable_dict; + +/*! Opaque data type for string key, string value hash table + * implementation */ +typedef struct ares_htable_dict ares_htable_dict_t; + +/*! Destroy hashtable + * + * \param[in] htable Initialized hashtable + */ +CARES_EXTERN void ares_htable_dict_destroy(ares_htable_dict_t *htable); + +/*! Create void pointer key, string value hash table + * + */ +CARES_EXTERN ares_htable_dict_t *ares_htable_dict_create(void); + +/*! Insert key/value into hash table + * + * \param[in] htable Initialized hash table + * \param[in] key key to associate with value + * \param[in] val value to store (duplicates). + * \return ARES_TRUE on success, ARES_FALSE on failure or out of memory + */ +CARES_EXTERN ares_bool_t ares_htable_dict_insert(ares_htable_dict_t *htable, + const char *key, + const char *val); + +/*! Retrieve value from hashtable based on key + * + * \param[in] htable Initialized hash table + * \param[in] key key to use to search + * \param[out] val Optional. Pointer to store value. + * \return ARES_TRUE on success, ARES_FALSE on failure + */ +CARES_EXTERN ares_bool_t ares_htable_dict_get(const ares_htable_dict_t *htable, + const char *key, + const char **val); + +/*! Retrieve value from hashtable directly as return value. Caveat to this + * function over ares_htable_dict_get() is that if a NULL value is stored + * you cannot determine if the key is not found or the value is NULL. + * + * \param[in] htable Initialized hash table + * \param[in] key key to use to search + * \return value associated with key in hashtable or NULL + */ +CARES_EXTERN const char * + ares_htable_dict_get_direct(const ares_htable_dict_t *htable, + const char *key); + +/*! Remove a value from the hashtable by key + * + * \param[in] htable Initialized hash table + * \param[in] key key to use to search + * \return ARES_TRUE if found, ARES_FALSE if not + */ +CARES_EXTERN ares_bool_t ares_htable_dict_remove(ares_htable_dict_t *htable, + const char *key); + +/*! Retrieve the number of keys stored in the hash table + * + * \param[in] htable Initialized hash table + * \return count + */ +CARES_EXTERN size_t ares_htable_dict_num_keys(const ares_htable_dict_t *htable); + +/*! Retrieve an array of keys from the hashtable. + * + * \param[in] htable Initialized hashtable + * \param[out] num Count of returned keys + * \return Array of keys in the hashtable. Must be free'd with + * ares_free_array(strs, num, ares_free); + */ +CARES_EXTERN char **ares_htable_dict_keys(const ares_htable_dict_t *htable, + size_t *num); + + +/*! @} */ + +#endif /* __ARES__HTABLE_DICT_H */ diff --git a/deps/cares/src/lib/dsa/ares__htable_strvp.h b/deps/cares/src/lib/include/ares_htable_strvp.h similarity index 66% rename from deps/cares/src/lib/dsa/ares__htable_strvp.h rename to deps/cares/src/lib/include/ares_htable_strvp.h index 878c71869a92dc..eaaf6d3be0d188 100644 --- a/deps/cares/src/lib/dsa/ares__htable_strvp.h +++ b/deps/cares/src/lib/include/ares_htable_strvp.h @@ -26,10 +26,10 @@ #ifndef __ARES__HTABLE_STRVP_H #define __ARES__HTABLE_STRVP_H -/*! \addtogroup ares__htable_strvp HashTable with string Key and void pointer +/*! \addtogroup ares_htable_strvp HashTable with string Key and void pointer * Value * - * This data structure wraps the base ares__htable data structure in order to + * This data structure wraps the base ares_htable data structure in order to * split the key and value data types as string and void pointer, respectively. * * Average time complexity: @@ -40,22 +40,22 @@ * @{ */ -struct ares__htable_strvp; +struct ares_htable_strvp; /*! Opaque data type for size_t key, void pointer hash table implementation */ -typedef struct ares__htable_strvp ares__htable_strvp_t; +typedef struct ares_htable_strvp ares_htable_strvp_t; /*! Callback to free value stored in hashtable * * \param[in] val user-supplied value */ -typedef void (*ares__htable_strvp_val_free_t)(void *val); +typedef void (*ares_htable_strvp_val_free_t)(void *val); /*! Destroy hashtable * * \param[in] htable Initialized hashtable */ -void ares__htable_strvp_destroy(ares__htable_strvp_t *htable); +CARES_EXTERN void ares_htable_strvp_destroy(ares_htable_strvp_t *htable); /*! Create string, void pointer value hash table * @@ -63,8 +63,8 @@ void ares__htable_strvp_destroy(ares__htable_strvp_t *htable); * NULL it is expected the caller will clean up any user * supplied values. */ -ares__htable_strvp_t * - ares__htable_strvp_create(ares__htable_strvp_val_free_t val_free); +CARES_EXTERN ares_htable_strvp_t * + ares_htable_strvp_create(ares_htable_strvp_val_free_t val_free); /*! Insert key/value into hash table * @@ -73,8 +73,8 @@ ares__htable_strvp_t * * \param[in] val value to store (takes ownership). May be NULL. * \return ARES_TRUE on success, ARES_FALSE on failure or out of memory */ -ares_bool_t ares__htable_strvp_insert(ares__htable_strvp_t *htable, - const char *key, void *val); +CARES_EXTERN ares_bool_t ares_htable_strvp_insert(ares_htable_strvp_t *htable, + const char *key, void *val); /*! Retrieve value from hashtable based on key * @@ -83,19 +83,20 @@ ares_bool_t ares__htable_strvp_insert(ares__htable_strvp_t *htable, * \param[out] val Optional. Pointer to store value. * \return ARES_TRUE on success, ARES_FALSE on failure */ -ares_bool_t ares__htable_strvp_get(const ares__htable_strvp_t *htable, - const char *key, void **val); +CARES_EXTERN ares_bool_t ares_htable_strvp_get( + const ares_htable_strvp_t *htable, const char *key, void **val); /*! Retrieve value from hashtable directly as return value. Caveat to this - * function over ares__htable_strvp_get() is that if a NULL value is stored + * function over ares_htable_strvp_get() is that if a NULL value is stored * you cannot determine if the key is not found or the value is NULL. * * \param[in] htable Initialized hash table * \param[in] key key to use to search * \return value associated with key in hashtable or NULL */ -void *ares__htable_strvp_get_direct(const ares__htable_strvp_t *htable, - const char *key); +CARES_EXTERN void * + ares_htable_strvp_get_direct(const ares_htable_strvp_t *htable, + const char *key); /*! Remove a value from the hashtable by key * @@ -103,15 +104,26 @@ void *ares__htable_strvp_get_direct(const ares__htable_strvp_t *htable, * \param[in] key key to use to search * \return ARES_TRUE if found, ARES_FALSE if not */ -ares_bool_t ares__htable_strvp_remove(ares__htable_strvp_t *htable, - const char *key); +CARES_EXTERN ares_bool_t ares_htable_strvp_remove(ares_htable_strvp_t *htable, + const char *key); + +/*! Remove the value from the hashtable, and return the value instead of + * calling the val_free passed to ares_htable_strvp_create(). + * + * \param[in] htable Initialized hash table + * \param[in] key key to use to search + * \return value in hashtable or NULL on error + */ +CARES_EXTERN void *ares_htable_strvp_claim(ares_htable_strvp_t *htable, + const char *key); /*! Retrieve the number of keys stored in the hash table * * \param[in] htable Initialized hash table * \return count */ -size_t ares__htable_strvp_num_keys(const ares__htable_strvp_t *htable); +CARES_EXTERN size_t + ares_htable_strvp_num_keys(const ares_htable_strvp_t *htable); /*! @} */ diff --git a/deps/cares/src/lib/dsa/ares__htable_szvp.h b/deps/cares/src/lib/include/ares_htable_szvp.h similarity index 72% rename from deps/cares/src/lib/dsa/ares__htable_szvp.h rename to deps/cares/src/lib/include/ares_htable_szvp.h index 62b1776be92b5b..927b9a5ec9f780 100644 --- a/deps/cares/src/lib/dsa/ares__htable_szvp.h +++ b/deps/cares/src/lib/include/ares_htable_szvp.h @@ -26,10 +26,10 @@ #ifndef __ARES__HTABLE_STVP_H #define __ARES__HTABLE_STVP_H -/*! \addtogroup ares__htable_szvp HashTable with size_t Key and void pointer +/*! \addtogroup ares_htable_szvp HashTable with size_t Key and void pointer * Value * - * This data structure wraps the base ares__htable data structure in order to + * This data structure wraps the base ares_htable data structure in order to * split the key and value data types as size_t and void pointer, respectively. * * Average time complexity: @@ -40,22 +40,22 @@ * @{ */ -struct ares__htable_szvp; +struct ares_htable_szvp; /*! Opaque data type for size_t key, void pointer hash table implementation */ -typedef struct ares__htable_szvp ares__htable_szvp_t; +typedef struct ares_htable_szvp ares_htable_szvp_t; /*! Callback to free value stored in hashtable * * \param[in] val user-supplied value */ -typedef void (*ares__htable_szvp_val_free_t)(void *val); +typedef void (*ares_htable_szvp_val_free_t)(void *val); /*! Destroy hashtable * * \param[in] htable Initialized hashtable */ -void ares__htable_szvp_destroy(ares__htable_szvp_t *htable); +CARES_EXTERN void ares_htable_szvp_destroy(ares_htable_szvp_t *htable); /*! Create size_t key, void pointer value hash table * @@ -63,8 +63,8 @@ void ares__htable_szvp_destroy(ares__htable_szvp_t *htable); * NULL it is expected the caller will clean up any user * supplied values. */ -ares__htable_szvp_t * - ares__htable_szvp_create(ares__htable_szvp_val_free_t val_free); +CARES_EXTERN ares_htable_szvp_t * + ares_htable_szvp_create(ares_htable_szvp_val_free_t val_free); /*! Insert key/value into hash table * @@ -73,8 +73,8 @@ ares__htable_szvp_t * * \param[in] val value to store (takes ownership). May be NULL. * \return ARES_TRUE on success, ARES_FALSE on failure or out of memory */ -ares_bool_t ares__htable_szvp_insert(ares__htable_szvp_t *htable, size_t key, - void *val); +CARES_EXTERN ares_bool_t ares_htable_szvp_insert(ares_htable_szvp_t *htable, + size_t key, void *val); /*! Retrieve value from hashtable based on key * @@ -83,19 +83,19 @@ ares_bool_t ares__htable_szvp_insert(ares__htable_szvp_t *htable, size_t key, * \param[out] val Optional. Pointer to store value. * \return ARES_TRUE on success, ARES_FALSE on failure */ -ares_bool_t ares__htable_szvp_get(const ares__htable_szvp_t *htable, size_t key, - void **val); +CARES_EXTERN ares_bool_t ares_htable_szvp_get(const ares_htable_szvp_t *htable, + size_t key, void **val); /*! Retrieve value from hashtable directly as return value. Caveat to this - * function over ares__htable_szvp_get() is that if a NULL value is stored + * function over ares_htable_szvp_get() is that if a NULL value is stored * you cannot determine if the key is not found or the value is NULL. * * \param[in] htable Initialized hash table * \param[in] key key to use to search * \return value associated with key in hashtable or NULL */ -void *ares__htable_szvp_get_direct(const ares__htable_szvp_t *htable, - size_t key); +CARES_EXTERN void *ares_htable_szvp_get_direct(const ares_htable_szvp_t *htable, + size_t key); /*! Remove a value from the hashtable by key * @@ -103,14 +103,15 @@ void *ares__htable_szvp_get_direct(const ares__htable_szvp_t *htable, * \param[in] key key to use to search * \return ARES_TRUE if found, ARES_FALSE if not */ -ares_bool_t ares__htable_szvp_remove(ares__htable_szvp_t *htable, size_t key); +CARES_EXTERN ares_bool_t ares_htable_szvp_remove(ares_htable_szvp_t *htable, + size_t key); /*! Retrieve the number of keys stored in the hash table * * \param[in] htable Initialized hash table * \return count */ -size_t ares__htable_szvp_num_keys(const ares__htable_szvp_t *htable); +CARES_EXTERN size_t ares_htable_szvp_num_keys(const ares_htable_szvp_t *htable); /*! @} */ diff --git a/deps/cares/src/lib/include/ares_htable_vpstr.h b/deps/cares/src/lib/include/ares_htable_vpstr.h new file mode 100644 index 00000000000000..9f51b877452b72 --- /dev/null +++ b/deps/cares/src/lib/include/ares_htable_vpstr.h @@ -0,0 +1,111 @@ +/* MIT License + * + * Copyright (c) 2024 Brad House + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ +#ifndef __ARES__HTABLE_VPSTR_H +#define __ARES__HTABLE_VPSTR_H + +/*! \addtogroup ares_htable_vpstr HashTable with void pointer Key and string + * value + * + * This data structure wraps the base ares_htable data structure in order to + * split the key and value data types as void pointer and string, respectively. + * + * Average time complexity: + * - Insert: O(1) + * - Search: O(1) + * - Delete: O(1) + * + * @{ + */ + +struct ares_htable_vpstr; + +/*! Opaque data type for void pointer key, string value hash table + * implementation */ +typedef struct ares_htable_vpstr ares_htable_vpstr_t; + +/*! Destroy hashtable + * + * \param[in] htable Initialized hashtable + */ +CARES_EXTERN void ares_htable_vpstr_destroy(ares_htable_vpstr_t *htable); + +/*! Create void pointer key, string value hash table + * + */ +CARES_EXTERN ares_htable_vpstr_t *ares_htable_vpstr_create(void); + +/*! Insert key/value into hash table + * + * \param[in] htable Initialized hash table + * \param[in] key key to associate with value + * \param[in] val value to store (duplicates). + * \return ARES_TRUE on success, ARES_FALSE on failure or out of memory + */ +CARES_EXTERN ares_bool_t ares_htable_vpstr_insert(ares_htable_vpstr_t *htable, + void *key, const char *val); + +/*! Retrieve value from hashtable based on key + * + * \param[in] htable Initialized hash table + * \param[in] key key to use to search + * \param[out] val Optional. Pointer to store value. + * \return ARES_TRUE on success, ARES_FALSE on failure + */ +CARES_EXTERN ares_bool_t ares_htable_vpstr_get( + const ares_htable_vpstr_t *htable, const void *key, const char **val); + +/*! Retrieve value from hashtable directly as return value. Caveat to this + * function over ares_htable_vpstr_get() is that if a NULL value is stored + * you cannot determine if the key is not found or the value is NULL. + * + * \param[in] htable Initialized hash table + * \param[in] key key to use to search + * \return value associated with key in hashtable or NULL + */ +CARES_EXTERN const char * + ares_htable_vpstr_get_direct(const ares_htable_vpstr_t *htable, + const void *key); + +/*! Remove a value from the hashtable by key + * + * \param[in] htable Initialized hash table + * \param[in] key key to use to search + * \return ARES_TRUE if found, ARES_FALSE if not + */ +CARES_EXTERN ares_bool_t ares_htable_vpstr_remove(ares_htable_vpstr_t *htable, + const void *key); + +/*! Retrieve the number of keys stored in the hash table + * + * \param[in] htable Initialized hash table + * \return count + */ +CARES_EXTERN size_t + ares_htable_vpstr_num_keys(const ares_htable_vpstr_t *htable); + +/*! @} */ + +#endif /* __ARES__HTABLE_VPSTR_H */ diff --git a/deps/cares/src/lib/dsa/ares__htable_vpvp.h b/deps/cares/src/lib/include/ares_htable_vpvp.h similarity index 72% rename from deps/cares/src/lib/dsa/ares__htable_vpvp.h rename to deps/cares/src/lib/include/ares_htable_vpvp.h index 1e0c750d862c64..1ebe6145765793 100644 --- a/deps/cares/src/lib/dsa/ares__htable_vpvp.h +++ b/deps/cares/src/lib/include/ares_htable_vpvp.h @@ -26,10 +26,10 @@ #ifndef __ARES__HTABLE_VPVP_H #define __ARES__HTABLE_VPVP_H -/*! \addtogroup ares__htable_vpvp HashTable with void pointer Key and void +/*! \addtogroup ares_htable_vpvp HashTable with void pointer Key and void * pointer Value * - * This data structure wraps the base ares__htable data structure in order to + * This data structure wraps the base ares_htable data structure in order to * split the key and value data types as size_t and void pointer, respectively. * * Average time complexity: @@ -40,28 +40,28 @@ * @{ */ -struct ares__htable_vpvp; +struct ares_htable_vpvp; /*! Opaque data type for size_t key, void pointer hash table implementation */ -typedef struct ares__htable_vpvp ares__htable_vpvp_t; +typedef struct ares_htable_vpvp ares_htable_vpvp_t; /*! Callback to free key stored in hashtable * * \param[in] key user-supplied key */ -typedef void (*ares__htable_vpvp_key_free_t)(void *key); +typedef void (*ares_htable_vpvp_key_free_t)(void *key); /*! Callback to free value stored in hashtable * * \param[in] val user-supplied value */ -typedef void (*ares__htable_vpvp_val_free_t)(void *val); +typedef void (*ares_htable_vpvp_val_free_t)(void *val); /*! Destroy hashtable * * \param[in] htable Initialized hashtable */ -void ares__htable_vpvp_destroy(ares__htable_vpvp_t *htable); +CARES_EXTERN void ares_htable_vpvp_destroy(ares_htable_vpvp_t *htable); /*! Create size_t key, void pointer value hash table * @@ -72,9 +72,9 @@ void ares__htable_vpvp_destroy(ares__htable_vpvp_t *htable); * NULL it is expected the caller will clean up any user * supplied values. */ -ares__htable_vpvp_t * - ares__htable_vpvp_create(ares__htable_vpvp_key_free_t key_free, - ares__htable_vpvp_val_free_t val_free); +CARES_EXTERN ares_htable_vpvp_t * + ares_htable_vpvp_create(ares_htable_vpvp_key_free_t key_free, + ares_htable_vpvp_val_free_t val_free); /*! Insert key/value into hash table * @@ -83,8 +83,8 @@ ares__htable_vpvp_t * * \param[in] val value to store (takes ownership). May be NULL. * \return ARES_TRUE on success, ARES_FALSE on failure or out of memory */ -ares_bool_t ares__htable_vpvp_insert(ares__htable_vpvp_t *htable, void *key, - void *val); +CARES_EXTERN ares_bool_t ares_htable_vpvp_insert(ares_htable_vpvp_t *htable, + void *key, void *val); /*! Retrieve value from hashtable based on key * @@ -93,19 +93,19 @@ ares_bool_t ares__htable_vpvp_insert(ares__htable_vpvp_t *htable, void *key, * \param[out] val Optional. Pointer to store value. * \return ARES_TRUE on success, ARES_FALSE on failure */ -ares_bool_t ares__htable_vpvp_get(const ares__htable_vpvp_t *htable, - const void *key, void **val); +CARES_EXTERN ares_bool_t ares_htable_vpvp_get(const ares_htable_vpvp_t *htable, + const void *key, void **val); /*! Retrieve value from hashtable directly as return value. Caveat to this - * function over ares__htable_vpvp_get() is that if a NULL value is stored + * function over ares_htable_vpvp_get() is that if a NULL value is stored * you cannot determine if the key is not found or the value is NULL. * * \param[in] htable Initialized hash table * \param[in] key key to use to search * \return value associated with key in hashtable or NULL */ -void *ares__htable_vpvp_get_direct(const ares__htable_vpvp_t *htable, - const void *key); +CARES_EXTERN void *ares_htable_vpvp_get_direct(const ares_htable_vpvp_t *htable, + const void *key); /*! Remove a value from the hashtable by key * @@ -113,15 +113,15 @@ void *ares__htable_vpvp_get_direct(const ares__htable_vpvp_t *htable, * \param[in] key key to use to search * \return ARES_TRUE if found, ARES_FALSE if not */ -ares_bool_t ares__htable_vpvp_remove(ares__htable_vpvp_t *htable, - const void *key); +CARES_EXTERN ares_bool_t ares_htable_vpvp_remove(ares_htable_vpvp_t *htable, + const void *key); /*! Retrieve the number of keys stored in the hash table * * \param[in] htable Initialized hash table * \return count */ -size_t ares__htable_vpvp_num_keys(const ares__htable_vpvp_t *htable); +CARES_EXTERN size_t ares_htable_vpvp_num_keys(const ares_htable_vpvp_t *htable); /*! @} */ diff --git a/deps/cares/src/lib/dsa/ares__llist.h b/deps/cares/src/lib/include/ares_llist.h similarity index 68% rename from deps/cares/src/lib/dsa/ares__llist.h rename to deps/cares/src/lib/include/ares_llist.h index 213f54134bcb55..6aa0c78370401f 100644 --- a/deps/cares/src/lib/dsa/ares__llist.h +++ b/deps/cares/src/lib/include/ares_llist.h @@ -26,7 +26,7 @@ #ifndef __ARES__LLIST_H #define __ARES__LLIST_H -/*! \addtogroup ares__llist LinkedList Data Structure +/*! \addtogroup ares_llist LinkedList Data Structure * * This is a doubly-linked list data structure. * @@ -38,28 +38,28 @@ * @{ */ -struct ares__llist; +struct ares_llist; /*! Opaque data structure for linked list */ -typedef struct ares__llist ares__llist_t; +typedef struct ares_llist ares_llist_t; -struct ares__llist_node; +struct ares_llist_node; /*! Opaque data structure for a node in a linked list */ -typedef struct ares__llist_node ares__llist_node_t; +typedef struct ares_llist_node ares_llist_node_t; /*! Callback to free user-defined node data * * \param[in] data user supplied data */ -typedef void (*ares__llist_destructor_t)(void *data); +typedef void (*ares_llist_destructor_t)(void *data); /*! Create a linked list object * * \param[in] destruct Optional. Destructor to call on all removed nodes * \return linked list object or NULL on out of memory */ -ares__llist_t *ares__llist_create(ares__llist_destructor_t destruct); +CARES_EXTERN ares_llist_t *ares_llist_create(ares_llist_destructor_t destruct); /*! Replace destructor for linked list nodes. Typically this is used * when wanting to disable the destructor by using NULL. @@ -67,8 +67,9 @@ ares__llist_t *ares__llist_create(ares__llist_destructor_t destruct); * \param[in] list Initialized linked list object * \param[in] destruct replacement destructor, NULL is allowed */ -void ares__llist_replace_destructor(ares__llist_t *list, - ares__llist_destructor_t destruct); +CARES_EXTERN void + ares_llist_replace_destructor(ares_llist_t *list, + ares_llist_destructor_t destruct); /*! Insert value as the first node in the linked list * @@ -77,7 +78,8 @@ void ares__llist_replace_destructor(ares__llist_t *list * \return node object referencing place in list, or null if out of memory or * misuse */ -ares__llist_node_t *ares__llist_insert_first(ares__llist_t *list, void *val); +CARES_EXTERN ares_llist_node_t *ares_llist_insert_first(ares_llist_t *list, + void *val); /*! Insert value as the last node in the linked list * @@ -86,7 +88,8 @@ ares__llist_node_t *ares__llist_insert_first(ares__llist_t *list, void *val); * \return node object referencing place in list, or null if out of memory or * misuse */ -ares__llist_node_t *ares__llist_insert_last(ares__llist_t *list, void *val); +CARES_EXTERN ares_llist_node_t *ares_llist_insert_last(ares_llist_t *list, + void *val); /*! Insert value before specified node in the linked list * @@ -95,8 +98,8 @@ ares__llist_node_t *ares__llist_insert_last(ares__llist_t *list, void *val); * \return node object referencing place in list, or null if out of memory or * misuse */ -ares__llist_node_t *ares__llist_insert_before(ares__llist_node_t *node, - void *val); +CARES_EXTERN ares_llist_node_t * + ares_llist_insert_before(ares_llist_node_t *node, void *val); /*! Insert value after specified node in the linked list * @@ -105,22 +108,22 @@ ares__llist_node_t *ares__llist_insert_before(ares__llist_node_t *node, * \return node object referencing place in list, or null if out of memory or * misuse */ -ares__llist_node_t *ares__llist_insert_after(ares__llist_node_t *node, - void *val); +CARES_EXTERN ares_llist_node_t *ares_llist_insert_after(ares_llist_node_t *node, + void *val); /*! Obtain first node in list * * \param[in] list Initialized list object * \return first node in list or NULL if none */ -ares__llist_node_t *ares__llist_node_first(ares__llist_t *list); +CARES_EXTERN ares_llist_node_t *ares_llist_node_first(ares_llist_t *list); /*! Obtain last node in list * * \param[in] list Initialized list object * \return last node in list or NULL if none */ -ares__llist_node_t *ares__llist_node_last(ares__llist_t *list); +CARES_EXTERN ares_llist_node_t *ares_llist_node_last(ares_llist_t *list); /*! Obtain a node based on its index. This is an O(n) operation. * @@ -128,21 +131,22 @@ ares__llist_node_t *ares__llist_node_last(ares__llist_t *list); * \param[in] idx Index of node to retrieve * \return node at index or NULL if invalid index */ -ares__llist_node_t *ares__llist_node_idx(ares__llist_t *list, size_t idx); +CARES_EXTERN ares_llist_node_t *ares_llist_node_idx(ares_llist_t *list, + size_t idx); /*! Obtain next node in respect to specified node * * \param[in] node Node referenced * \return node or NULL if none */ -ares__llist_node_t *ares__llist_node_next(ares__llist_node_t *node); +CARES_EXTERN ares_llist_node_t *ares_llist_node_next(ares_llist_node_t *node); /*! Obtain previous node in respect to specified node * * \param[in] node Node referenced * \return node or NULL if none */ -ares__llist_node_t *ares__llist_node_prev(ares__llist_node_t *node); +CARES_EXTERN ares_llist_node_t *ares_llist_node_prev(ares_llist_node_t *node); /*! Obtain value from node @@ -150,41 +154,41 @@ ares__llist_node_t *ares__llist_node_prev(ares__llist_node_t *node); * \param[in] node Node referenced * \return user provided value from node */ -void *ares__llist_node_val(ares__llist_node_t *node); +CARES_EXTERN void *ares_llist_node_val(ares_llist_node_t *node); /*! Obtain the number of entries in the list * * \param[in] list Initialized list object * \return count */ -size_t ares__llist_len(const ares__llist_t *list); +CARES_EXTERN size_t ares_llist_len(const ares_llist_t *list); /*! Clear all entries in the list, but don't destroy the list object. * * \param[in] list Initialized list object */ -void ares__llist_clear(ares__llist_t *list); +CARES_EXTERN void ares_llist_clear(ares_llist_t *list); /*! Obtain list object from referenced node * * \param[in] node Node referenced * \return list object node belongs to */ -ares__llist_t *ares__llist_node_parent(ares__llist_node_t *node); +CARES_EXTERN ares_llist_t *ares_llist_node_parent(ares_llist_node_t *node); /*! Obtain the first user-supplied value in the list * * \param[in] list Initialized list object * \return first user supplied value or NULL if none */ -void *ares__llist_first_val(ares__llist_t *list); +CARES_EXTERN void *ares_llist_first_val(ares_llist_t *list); /*! Obtain the last user-supplied value in the list * * \param[in] list Initialized list object * \return last user supplied value or NULL if none */ -void *ares__llist_last_val(ares__llist_t *list); +CARES_EXTERN void *ares_llist_last_val(ares_llist_t *list); /*! Take ownership of user-supplied value in list without calling destructor. * Will unchain entry from list. @@ -192,26 +196,26 @@ void *ares__llist_last_val(ares__llist_t *list); * \param[in] node Node referenced * \return user supplied value */ -void *ares__llist_node_claim(ares__llist_node_t *node); +CARES_EXTERN void *ares_llist_node_claim(ares_llist_node_t *node); /*! Replace user-supplied value for node * * \param[in] node Node referenced * \param[in] val new user-supplied value */ -void ares__llist_node_replace(ares__llist_node_t *node, void *val); +CARES_EXTERN void ares_llist_node_replace(ares_llist_node_t *node, void *val); /*! Destroy the node, removing it from the list and calling destructor. * * \param[in] node Node referenced */ -void ares__llist_node_destroy(ares__llist_node_t *node); +CARES_EXTERN void ares_llist_node_destroy(ares_llist_node_t *node); /*! Destroy the list object and all nodes in the list. * * \param[in] list Initialized list object */ -void ares__llist_destroy(ares__llist_t *list); +CARES_EXTERN void ares_llist_destroy(ares_llist_t *list); /*! Detach node from the current list and re-attach it to the new list as the * last entry. @@ -219,8 +223,8 @@ void ares__llist_destroy(ares__llist_t *list); * \param[in] node node to move * \param[in] new_parent new list */ -void ares__llist_node_move_parent_last(ares__llist_node_t *node, - ares__llist_t *new_parent); +CARES_EXTERN void ares_llist_node_mvparent_last(ares_llist_node_t *node, + ares_llist_t *new_parent); /*! Detach node from the current list and re-attach it to the new list as the * first entry. @@ -228,8 +232,8 @@ void ares__llist_node_move_parent_last(ares__llist_node_t *node, * \param[in] node node to move * \param[in] new_parent new list */ -void ares__llist_node_move_parent_first(ares__llist_node_t *node, - ares__llist_t *new_parent); +CARES_EXTERN void ares_llist_node_mvparent_first(ares_llist_node_t *node, + ares_llist_t *new_parent); /*! @} */ #endif /* __ARES__LLIST_H */ diff --git a/deps/cares/src/lib/str/ares_strcasecmp.h b/deps/cares/src/lib/include/ares_mem.h similarity index 75% rename from deps/cares/src/lib/str/ares_strcasecmp.h rename to deps/cares/src/lib/include/ares_mem.h index a8097d2219e309..371cd4266dc720 100644 --- a/deps/cares/src/lib/str/ares_strcasecmp.h +++ b/deps/cares/src/lib/include/ares_mem.h @@ -1,6 +1,5 @@ /* MIT License * - * Copyright (c) 1998 Massachusetts Institute of Technology * Copyright (c) The c-ares project and its contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -24,15 +23,16 @@ * * SPDX-License-Identifier: MIT */ -#ifndef HEADER_CARES_STRCASECMP_H -#define HEADER_CARES_STRCASECMP_H -#ifndef HAVE_STRCASECMP -extern int ares_strcasecmp(const char *a, const char *b); -#endif +#ifndef __ARES_MEM_H +#define __ARES_MEM_H -#ifndef HAVE_STRNCASECMP -extern int ares_strncasecmp(const char *a, const char *b, size_t n); -#endif +/* Memory management functions */ +CARES_EXTERN void *ares_malloc(size_t size); +CARES_EXTERN void *ares_realloc(void *ptr, size_t size); +CARES_EXTERN void ares_free(void *ptr); +CARES_EXTERN void *ares_malloc_zero(size_t size); +CARES_EXTERN void *ares_realloc_zero(void *ptr, size_t orig_size, + size_t new_size); -#endif /* HEADER_CARES_STRCASECMP_H */ +#endif diff --git a/deps/cares/src/lib/include/ares_str.h b/deps/cares/src/lib/include/ares_str.h new file mode 100644 index 00000000000000..ea75b3b3e7441d --- /dev/null +++ b/deps/cares/src/lib/include/ares_str.h @@ -0,0 +1,230 @@ +/* MIT License + * + * Copyright (c) 1998 Massachusetts Institute of Technology + * Copyright (c) The c-ares project and its contributors + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ +#ifndef __ARES_STR_H +#define __ARES_STR_H + +CARES_EXTERN char *ares_strdup(const char *s1); + +CARES_EXTERN size_t ares_strlen(const char *str); + +/*! Copy string from source to destination with destination buffer size + * provided. The destination is guaranteed to be null terminated, if the + * provided buffer isn't large enough, only those bytes from the source that + * will fit will be copied. + * + * \param[out] dest Destination buffer + * \param[in] src Source to copy + * \param[in] dest_size Size of destination buffer + * \return String length. Will be at most dest_size-1 + */ +CARES_EXTERN size_t ares_strcpy(char *dest, const char *src, size_t dest_size); + +CARES_EXTERN ares_bool_t ares_str_isnum(const char *str); +CARES_EXTERN ares_bool_t ares_str_isalnum(const char *str); + +CARES_EXTERN void ares_str_ltrim(char *str); +CARES_EXTERN void ares_str_rtrim(char *str); +CARES_EXTERN void ares_str_trim(char *str); +CARES_EXTERN void ares_str_lower(char *str); + +CARES_EXTERN unsigned char ares_tolower(unsigned char c); +CARES_EXTERN unsigned char *ares_memmem(const unsigned char *big, + size_t big_len, + const unsigned char *little, + size_t little_len); +CARES_EXTERN ares_bool_t ares_memeq(const unsigned char *ptr, + const unsigned char *val, size_t len); +CARES_EXTERN ares_bool_t ares_memeq_ci(const unsigned char *ptr, + const unsigned char *val, size_t len); +CARES_EXTERN ares_bool_t ares_is_hostname(const char *str); + +/*! Validate the string provided is printable. The length specified must be + * at least the size of the buffer provided. If a NULL-terminator is hit + * before the length provided is hit, this will not be considered a valid + * printable string. This does not validate that the string is actually + * NULL terminated. + * + * \param[in] str Buffer containing string to evaluate. + * \param[in] len Number of characters to evaluate within provided buffer. + * If 0, will return TRUE since it did not hit an exception. + * \return ARES_TRUE if the entire string is printable, ARES_FALSE if not. + */ +CARES_EXTERN ares_bool_t ares_str_isprint(const char *str, size_t len); + +/* We only care about ASCII rules */ +#define ares_isascii(x) (((unsigned char)x) <= 127) + +#define ares_isdigit(x) (((unsigned char)x) >= '0' && ((unsigned char)x) <= '9') + +#define ares_isxdigit(x) \ + (ares_isdigit(x) || \ + (((unsigned char)x) >= 'a' && ((unsigned char)x) <= 'f') || \ + (((unsigned char)x) >= 'A' && ((unsigned char)x) <= 'F')) + +#define ares_isupper(x) (((unsigned char)x) >= 'A' && ((unsigned char)x) <= 'Z') + +#define ares_islower(x) (((unsigned char)x) >= 'a' && ((unsigned char)x) <= 'z') + +#define ares_isalpha(x) (ares_islower(x) || ares_isupper(x)) + +#define ares_isspace(x) \ + (((unsigned char)(x)) == '\r' || ((unsigned char)(x)) == '\t' || \ + ((unsigned char)(x)) == ' ' || ((unsigned char)(x)) == '\v' || \ + ((unsigned char)(x)) == '\f' || ((unsigned char)(x)) == '\n') + +#define ares_isprint(x) \ + (((unsigned char)(x)) >= 0x20 && ((unsigned char)(x)) <= 0x7E) + +/* Character set allowed by hostnames. This is to include the normal + * domain name character set plus: + * - underscores which are used in SRV records. + * - Forward slashes such as are used for classless in-addr.arpa + * delegation (CNAMEs) + * - Asterisks may be used for wildcard domains in CNAMEs as seen in the + * real world. + * While RFC 2181 section 11 does state not to do validation, + * that applies to servers, not clients. Vulnerabilities have been + * reported when this validation is not performed. Security is more + * important than edge-case compatibility (which is probably invalid + * anyhow). + * [A-Za-z0-9-*._/] + */ +#define ares_is_hostnamech(x) \ + (ares_isalpha(x) || ares_isdigit(x) || ((unsigned char)(x)) == '-' || \ + ((unsigned char)(x)) == '.' || ((unsigned char)(x)) == '_' || \ + ((unsigned char)(x)) == '/' || ((unsigned char)(x)) == '*') + + +/*! Compare two strings (for sorting) + * + * Treats NULL and "" strings as equivalent + * + * \param[in] a First String + * \param[in] b Second String + * \return < 0 if First String less than Second String, + * 0 if First String equal to Second String, + * > 0 if First String greater than Second String + */ +CARES_EXTERN int ares_strcmp(const char *a, const char *b); + +/*! Compare two strings up to specified length (for sorting) + * + * Treats NULL and "" strings as equivalent + * + * \param[in] a First String + * \param[in] b Second String + * \param[in] n Length + * \return < 0 if First String less than Second String, + * 0 if First String equal to Second String, + * > 0 if First String greater than Second String + */ +CARES_EXTERN int ares_strncmp(const char *a, const char *b, size_t n); + + +/*! Compare two strings in a case-insensitive manner (for sorting) + * + * Treats NULL and "" strings as equivalent + * + * \param[in] a First String + * \param[in] b Second String + * \return < 0 if First String less than Second String, + * 0 if First String equal to Second String, + * > 0 if First String greater than Second String + */ +CARES_EXTERN int ares_strcasecmp(const char *a, const char *b); + +/*! Compare two strings in a case-insensitive manner up to specified length + * (for sorting) + * + * Treats NULL and "" strings as equivalent + * + * \param[in] a First String + * \param[in] b Second String + * \param[in] n Length + * \return < 0 if First String less than Second String, + * 0 if First String equal to Second String, + * > 0 if First String greater than Second String + */ +CARES_EXTERN int ares_strncasecmp(const char *a, const char *b, size_t n); + +/*! Compare two strings for equality + * + * Treats NULL and "" strings as equivalent + * + * \param[in] a First String + * \param[in] b Second String + * \return ARES_TRUE on match, or ARES_FALSE if no match + */ +CARES_EXTERN ares_bool_t ares_streq(const char *a, const char *b); + +/*! Compare two strings for equality up to specified length + * + * Treats NULL and "" strings as equivalent + * + * \param[in] a First String + * \param[in] b Second String + * \param[in] n Length + * \return ARES_TRUE on match, or ARES_FALSE if no match + */ +CARES_EXTERN ares_bool_t ares_streq_max(const char *a, const char *b, size_t n); + +/*! Compare two strings for equality in a case insensitive manner + * + * Treats NULL and "" strings as equivalent + * + * \param[in] a First String + * \param[in] b Second String + * \return ARES_TRUE on match, or ARES_FALSE if no match + */ +CARES_EXTERN ares_bool_t ares_strcaseeq(const char *a, const char *b); + +/*! Compare two strings for equality up to specified length in a case + * insensitive manner + * + * Treats NULL and "" strings as equivalent + * + * \param[in] a First String + * \param[in] b Second String + * \param[in] n Length + * \return ARES_TRUE on match, or ARES_FALSE if no match + */ +CARES_EXTERN ares_bool_t ares_strcaseeq_max(const char *a, const char *b, + size_t n); + +/*! Free a C array, each element in the array will be freed by the provided + * free function. Both NULL-terminated arrays and known length arrays are + * supported. + * + * \param[in] arr Array to be freed. + * \param[in] nmembers Number of members in the array, or SIZE_MAX for + * NULL-terminated arrays + * \param[in] freefunc Function to call on each array member (e.g. ares_free) + */ +CARES_EXTERN void ares_free_array(void *arr, size_t nmembers, + void (*freefunc)(void *)); + +#endif /* __ARES_STR_H */ diff --git a/deps/cares/src/lib/inet_net_pton.c b/deps/cares/src/lib/inet_net_pton.c index 5356778c47b86f..e1f76ef834a6f9 100644 --- a/deps/cares/src/lib/inet_net_pton.c +++ b/deps/cares/src/lib/inet_net_pton.c @@ -32,6 +32,20 @@ #include "ares_ipv6.h" #include "ares_inet_net_pton.h" +#ifdef USE_WINSOCK +# define SOCKERRNO ((int)WSAGetLastError()) +# define SET_SOCKERRNO(x) (WSASetLastError((int)(x))) +# undef EMSGSIZE +# define EMSGSIZE WSAEMSGSIZE +# undef ENOENT +# define ENOENT WSA_INVALID_PARAMETER +# undef EAFNOSUPPORT +# define EAFNOSUPPORT WSAEAFNOSUPPORT +#else +# define SOCKERRNO (errno) +# define SET_SOCKERRNO(x) (errno = (x)) +#endif + const struct ares_in6_addr ares_in6addr_any = { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } }; @@ -69,17 +83,17 @@ static int ares_inet_net_pton_ipv4(const char *src, unsigned char *dst, const unsigned char *odst = dst; ch = *src++; - if (ch == '0' && (src[0] == 'x' || src[0] == 'X') && ares__isascii(src[1]) && - ares__isxdigit(src[1])) { + if (ch == '0' && (src[0] == 'x' || src[0] == 'X') && ares_isascii(src[1]) && + ares_isxdigit(src[1])) { /* Hexadecimal: Eat nybble string. */ if (!size) { goto emsgsize; } dirty = 0; src++; /* skip x or X. */ - while ((ch = *src++) != '\0' && ares__isascii(ch) && ares__isxdigit(ch)) { - if (ares__isupper(ch)) { - ch = ares__tolower((unsigned char)ch); + while ((ch = *src++) != '\0' && ares_isascii(ch) && ares_isxdigit(ch)) { + if (ares_isupper(ch)) { + ch = ares_tolower((unsigned char)ch); } n = (int)(strchr(xdigits, ch) - xdigits); if (dirty == 0) { @@ -101,7 +115,7 @@ static int ares_inet_net_pton_ipv4(const char *src, unsigned char *dst, } *dst++ = (unsigned char)(tmp << 4); } - } else if (ares__isascii(ch) && ares__isdigit(ch)) { + } else if (ares_isascii(ch) && ares_isdigit(ch)) { /* Decimal: eat dotted digit string. */ for (;;) { tmp = 0; @@ -112,7 +126,7 @@ static int ares_inet_net_pton_ipv4(const char *src, unsigned char *dst, if (tmp > 255) { goto enoent; } - } while ((ch = *src++) != '\0' && ares__isascii(ch) && ares__isdigit(ch)); + } while ((ch = *src++) != '\0' && ares_isascii(ch) && ares_isdigit(ch)); if (!size--) { goto emsgsize; } @@ -124,7 +138,7 @@ static int ares_inet_net_pton_ipv4(const char *src, unsigned char *dst, goto enoent; } ch = *src++; - if (!ares__isascii(ch) || !ares__isdigit(ch)) { + if (!ares_isascii(ch) || !ares_isdigit(ch)) { goto enoent; } } @@ -133,8 +147,7 @@ static int ares_inet_net_pton_ipv4(const char *src, unsigned char *dst, } bits = -1; - if (ch == '/' && ares__isascii(src[0]) && ares__isdigit(src[0]) && - dst > odst) { + if (ch == '/' && ares_isascii(src[0]) && ares_isdigit(src[0]) && dst > odst) { /* CIDR width specifier. Nothing can follow it. */ ch = *src++; /* Skip over the /. */ bits = 0; @@ -145,7 +158,7 @@ static int ares_inet_net_pton_ipv4(const char *src, unsigned char *dst, if (bits > 32) { goto enoent; } - } while ((ch = *src++) != '\0' && ares__isascii(ch) && ares__isdigit(ch)); + } while ((ch = *src++) != '\0' && ares_isascii(ch) && ares_isdigit(ch)); if (ch != '\0') { goto enoent; } @@ -195,11 +208,11 @@ static int ares_inet_net_pton_ipv4(const char *src, unsigned char *dst, return bits; enoent: - SET_ERRNO(ENOENT); + SET_SOCKERRNO(ENOENT); return -1; emsgsize: - SET_ERRNO(EMSGSIZE); + SET_SOCKERRNO(EMSGSIZE); return -1; } @@ -343,7 +356,7 @@ static int ares_inet_pton6(const char *src, unsigned char *dst) return 1; enoent: - SET_ERRNO(ENOENT); + SET_SOCKERRNO(ENOENT); return -1; } @@ -358,7 +371,7 @@ static int ares_inet_net_pton_ipv6(const char *src, unsigned char *dst, char *sep; if (ares_strlen(src) >= sizeof buf) { - SET_ERRNO(EMSGSIZE); + SET_SOCKERRNO(EMSGSIZE); return -1; } ares_strcpy(buf, src, sizeof buf); @@ -377,14 +390,14 @@ static int ares_inet_net_pton_ipv6(const char *src, unsigned char *dst, bits = 128; } else { if (!getbits(sep, &bits)) { - SET_ERRNO(ENOENT); + SET_SOCKERRNO(ENOENT); return -1; } } bytes = (bits + 7) / 8; if (bytes > size) { - SET_ERRNO(EMSGSIZE); + SET_SOCKERRNO(EMSGSIZE); return -1; } memcpy(dst, &in6, bytes); @@ -401,13 +414,9 @@ static int ares_inet_net_pton_ipv6(const char *src, unsigned char *dst, * number of bits, either imputed classfully or specified with /CIDR, * or -1 if some failure occurred (check errno). ENOENT means it was * not a valid network specification. - * note: - * On Windows we store the error in the thread errno, not - * in the winsock error code. This is to avoid losing the - * actual last winsock error. So use macro ERRNO to fetch the - * errno this function sets when returning (-1), not SOCKERRNO. * author: * Paul Vixie (ISC), June 1996 + * */ int ares_inet_net_pton(int af, const char *src, void *dst, size_t size) { @@ -417,7 +426,6 @@ int ares_inet_net_pton(int af, const char *src, void *dst, size_t size) case AF_INET6: return ares_inet_net_pton_ipv6(src, dst, size); default: - SET_ERRNO(EAFNOSUPPORT); return -1; } } @@ -432,11 +440,11 @@ int ares_inet_pton(int af, const char *src, void *dst) } else if (af == AF_INET6) { size = sizeof(struct ares_in6_addr); } else { - SET_ERRNO(EAFNOSUPPORT); + SET_SOCKERRNO(EAFNOSUPPORT); return -1; } result = ares_inet_net_pton(af, src, dst, size); - if (result == -1 && ERRNO == ENOENT) { + if (result == -1 && SOCKERRNO == ENOENT) { return 0; } return (result > -1) ? 1 : -1; diff --git a/deps/cares/src/lib/inet_ntop.c b/deps/cares/src/lib/inet_ntop.c index 6f96b92ccccd13..79b6c0fa9393d7 100644 --- a/deps/cares/src/lib/inet_ntop.c +++ b/deps/cares/src/lib/inet_ntop.c @@ -29,6 +29,22 @@ #include "ares_nameser.h" #include "ares_ipv6.h" +#ifdef USE_WINSOCK +# define SOCKERRNO ((int)WSAGetLastError()) +# define SET_SOCKERRNO(x) (WSASetLastError((int)(x))) +# undef EMSGSIZE +# define EMSGSIZE WSAEMSGSIZE +# undef ENOENT +# define ENOENT WSA_INVALID_PARAMETER +# undef EAFNOSUPPORT +# define EAFNOSUPPORT WSAEAFNOSUPPORT +# undef ENOSPC +# define ENOSPC WSA_INVALID_PARAMETER +#else +# define SOCKERRNO (errno) +# define SET_SOCKERRNO(x) (errno = (x)) +#endif + /* * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. @@ -42,11 +58,6 @@ static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size); * convert a network format address to presentation format. * return: * pointer to presentation format address (`dst'), or NULL (see errno). - * note: - * On Windows we store the error in the thread errno, not - * in the winsock error code. This is to avoid losing the - * actual last winsock error. So use macro ERRNO to fetch the - * errno this function sets when returning NULL, not SOCKERRNO. * author: * Paul Vixie, 1996. */ @@ -61,7 +72,7 @@ const char *ares_inet_ntop(int af, const void *src, char *dst, default: break; } - SET_ERRNO(EAFNOSUPPORT); + SET_SOCKERRNO(EAFNOSUPPORT); return NULL; } @@ -82,13 +93,13 @@ static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size) char tmp[sizeof("255.255.255.255")]; if (size < sizeof(tmp)) { - SET_ERRNO(ENOSPC); + SET_SOCKERRNO(ENOSPC); return NULL; } if ((size_t)snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]) >= size) { - SET_ERRNO(ENOSPC); + SET_SOCKERRNO(ENOSPC); return NULL; } ares_strcpy(dst, tmp, size); @@ -200,7 +211,7 @@ static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size) * Check for overflow, copy, and we're done. */ if ((size_t)(tp - tmp) > size) { - SET_ERRNO(ENOSPC); + SET_SOCKERRNO(ENOSPC); return NULL; } ares_strcpy(dst, tmp, size); diff --git a/deps/cares/src/lib/legacy/ares_expand_name.c b/deps/cares/src/lib/legacy/ares_expand_name.c index 63bd64516682e3..72668f4cb60a07 100644 --- a/deps/cares/src/lib/legacy/ares_expand_name.c +++ b/deps/cares/src/lib/legacy/ares_expand_name.c @@ -33,13 +33,13 @@ #include "ares_nameser.h" -ares_status_t ares__expand_name_validated(const unsigned char *encoded, - const unsigned char *abuf, - size_t alen, char **s, size_t *enclen, - ares_bool_t is_hostname) +ares_status_t ares_expand_name_validated(const unsigned char *encoded, + const unsigned char *abuf, size_t alen, + char **s, size_t *enclen, + ares_bool_t is_hostname) { ares_status_t status; - ares__buf_t *buf = NULL; + ares_buf_t *buf = NULL; size_t start_len; if (encoded == NULL || abuf == NULL || alen == 0 || enclen == NULL) { @@ -57,27 +57,27 @@ ares_status_t ares__expand_name_validated(const unsigned char *encoded, *s = NULL; } - buf = ares__buf_create_const(abuf, alen); + buf = ares_buf_create_const(abuf, alen); if (buf == NULL) { return ARES_ENOMEM; } - status = ares__buf_set_position(buf, (size_t)(encoded - abuf)); + status = ares_buf_set_position(buf, (size_t)(encoded - abuf)); if (status != ARES_SUCCESS) { goto done; } - start_len = ares__buf_len(buf); - status = ares__dns_name_parse(buf, s, is_hostname); + start_len = ares_buf_len(buf); + status = ares_dns_name_parse(buf, s, is_hostname); if (status != ARES_SUCCESS) { goto done; } - *enclen = start_len - ares__buf_len(buf); + *enclen = start_len - ares_buf_len(buf); done: - ares__buf_destroy(buf); + ares_buf_destroy(buf); return status; } @@ -92,8 +92,8 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf, return ARES_EBADNAME; } - status = ares__expand_name_validated(encoded, abuf, (size_t)alen, s, - &enclen_temp, ARES_FALSE); + status = ares_expand_name_validated(encoded, abuf, (size_t)alen, s, + &enclen_temp, ARES_FALSE); *enclen = (long)enclen_temp; return (int)status; } diff --git a/deps/cares/src/lib/legacy/ares_expand_string.c b/deps/cares/src/lib/legacy/ares_expand_string.c index b3e99daa54b325..e1deb1932f43b4 100644 --- a/deps/cares/src/lib/legacy/ares_expand_string.c +++ b/deps/cares/src/lib/legacy/ares_expand_string.c @@ -43,7 +43,7 @@ ares_status_t ares_expand_string_ex(const unsigned char *encoded, unsigned char **s, size_t *enclen) { ares_status_t status; - ares__buf_t *buf = NULL; + ares_buf_t *buf = NULL; size_t start_len; size_t len = 0; @@ -62,28 +62,28 @@ ares_status_t ares_expand_string_ex(const unsigned char *encoded, *s = NULL; } - buf = ares__buf_create_const(abuf, alen); + buf = ares_buf_create_const(abuf, alen); if (buf == NULL) { return ARES_ENOMEM; } - status = ares__buf_set_position(buf, (size_t)(encoded - abuf)); + status = ares_buf_set_position(buf, (size_t)(encoded - abuf)); if (status != ARES_SUCCESS) { goto done; } - start_len = ares__buf_len(buf); - status = ares__buf_parse_dns_binstr(buf, ares__buf_len(buf), s, &len); + start_len = ares_buf_len(buf); + status = ares_buf_parse_dns_binstr(buf, ares_buf_len(buf), s, &len); /* hrm, no way to pass back 'len' with the prototype */ if (status != ARES_SUCCESS) { goto done; } - *enclen = start_len - ares__buf_len(buf); + *enclen = start_len - ares_buf_len(buf); done: - ares__buf_destroy(buf); + ares_buf_destroy(buf); if (status == ARES_EBADNAME || status == ARES_EBADRESP) { status = ARES_EBADSTR; } diff --git a/deps/cares/src/lib/legacy/ares_fds.c b/deps/cares/src/lib/legacy/ares_fds.c index 3aedd2c90e23f3..112ebac60ad0a7 100644 --- a/deps/cares/src/lib/legacy/ares_fds.c +++ b/deps/cares/src/lib/legacy/ares_fds.c @@ -29,28 +29,28 @@ int ares_fds(const ares_channel_t *channel, fd_set *read_fds, fd_set *write_fds) { - ares_socket_t nfds; - ares__slist_node_t *snode; + ares_socket_t nfds; + ares_slist_node_t *snode; /* Are there any active queries? */ - size_t active_queries; + size_t active_queries; if (channel == NULL || read_fds == NULL || write_fds == NULL) { return 0; } - ares__channel_lock(channel); + ares_channel_lock(channel); - active_queries = ares__llist_len(channel->all_queries); + active_queries = ares_llist_len(channel->all_queries); nfds = 0; - for (snode = ares__slist_node_first(channel->servers); snode != NULL; - snode = ares__slist_node_next(snode)) { - ares_server_t *server = ares__slist_node_val(snode); - ares__llist_node_t *node; + for (snode = ares_slist_node_first(channel->servers); snode != NULL; + snode = ares_slist_node_next(snode)) { + ares_server_t *server = ares_slist_node_val(snode); + ares_llist_node_t *node; - for (node = ares__llist_node_first(server->connections); node != NULL; - node = ares__llist_node_next(node)) { - const ares_conn_t *conn = ares__llist_node_val(node); + for (node = ares_llist_node_first(server->connections); node != NULL; + node = ares_llist_node_next(node)) { + const ares_conn_t *conn = ares_llist_node_val(node); if (!active_queries && !(conn->flags & ARES_CONN_FLAG_TCP)) { continue; @@ -68,13 +68,13 @@ int ares_fds(const ares_channel_t *channel, fd_set *read_fds, fd_set *write_fds) nfds = conn->fd + 1; } - /* TCP only wait on write if we have buffered data */ - if (conn->flags & ARES_CONN_FLAG_TCP && ares__buf_len(server->tcp_send)) { + /* TCP only wait on write if we have the flag set */ + if (conn->state_flags & ARES_CONN_STATE_WRITE) { FD_SET(conn->fd, write_fds); } } } - ares__channel_unlock(channel); + ares_channel_unlock(channel); return (int)nfds; } diff --git a/deps/cares/src/lib/legacy/ares_getsock.c b/deps/cares/src/lib/legacy/ares_getsock.c index 8c8476fa95109e..cec9258abb095a 100644 --- a/deps/cares/src/lib/legacy/ares_getsock.c +++ b/deps/cares/src/lib/legacy/ares_getsock.c @@ -29,30 +29,30 @@ int ares_getsock(const ares_channel_t *channel, ares_socket_t *socks, int numsocks) /* size of the 'socks' array */ { - ares__slist_node_t *snode; - size_t sockindex = 0; - unsigned int bitmap = 0; - unsigned int setbits = 0xffffffff; + ares_slist_node_t *snode; + size_t sockindex = 0; + unsigned int bitmap = 0; + unsigned int setbits = 0xffffffff; /* Are there any active queries? */ - size_t active_queries; + size_t active_queries; if (channel == NULL || numsocks <= 0) { return 0; } - ares__channel_lock(channel); + ares_channel_lock(channel); - active_queries = ares__llist_len(channel->all_queries); + active_queries = ares_llist_len(channel->all_queries); - for (snode = ares__slist_node_first(channel->servers); snode != NULL; - snode = ares__slist_node_next(snode)) { - ares_server_t *server = ares__slist_node_val(snode); - ares__llist_node_t *node; + for (snode = ares_slist_node_first(channel->servers); snode != NULL; + snode = ares_slist_node_next(snode)) { + ares_server_t *server = ares_slist_node_val(snode); + ares_llist_node_t *node; - for (node = ares__llist_node_first(server->connections); node != NULL; - node = ares__llist_node_next(node)) { - const ares_conn_t *conn = ares__llist_node_val(node); + for (node = ares_llist_node_first(server->connections); node != NULL; + node = ares_llist_node_next(node)) { + const ares_conn_t *conn = ares_llist_node_val(node); if (sockindex >= (size_t)numsocks || sockindex >= ARES_GETSOCK_MAXNUM) { break; @@ -71,7 +71,7 @@ int ares_getsock(const ares_channel_t *channel, ares_socket_t *socks, bitmap |= ARES_GETSOCK_READABLE(setbits, sockindex); } - if (conn->flags & ARES_CONN_FLAG_TCP && ares__buf_len(server->tcp_send)) { + if (conn->state_flags & ARES_CONN_STATE_WRITE) { /* then the tcp socket is also writable! */ bitmap |= ARES_GETSOCK_WRITABLE(setbits, sockindex); } @@ -80,6 +80,6 @@ int ares_getsock(const ares_channel_t *channel, ares_socket_t *socks, } } - ares__channel_unlock(channel); + ares_channel_unlock(channel); return (int)bitmap; } diff --git a/deps/cares/src/lib/legacy/ares_parse_a_reply.c b/deps/cares/src/lib/legacy/ares_parse_a_reply.c index 0981b90eeaf595..870aaccf76c0a8 100644 --- a/deps/cares/src/lib/legacy/ares_parse_a_reply.c +++ b/deps/cares/src/lib/legacy/ares_parse_a_reply.c @@ -71,13 +71,13 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, goto fail; } - status = ares__parse_into_addrinfo(dnsrec, 0, 0, &ai); + status = ares_parse_into_addrinfo(dnsrec, 0, 0, &ai); if (status != ARES_SUCCESS && status != ARES_ENODATA) { goto fail; } if (host != NULL) { - status = ares__addrinfo2hostent(&ai, AF_INET, host); + status = ares_addrinfo2hostent(&ai, AF_INET, host); if (status != ARES_SUCCESS && status != ARES_ENODATA) { goto fail; /* LCOV_EXCL_LINE: DefensiveCoding */ } @@ -85,15 +85,15 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, if (addrttls != NULL && req_naddrttls) { size_t temp_naddrttls = 0; - ares__addrinfo2addrttl(&ai, AF_INET, req_naddrttls, addrttls, NULL, - &temp_naddrttls); + ares_addrinfo2addrttl(&ai, AF_INET, req_naddrttls, addrttls, NULL, + &temp_naddrttls); *naddrttls = (int)temp_naddrttls; } fail: - ares__freeaddrinfo_cnames(ai.cnames); - ares__freeaddrinfo_nodes(ai.nodes); + ares_freeaddrinfo_cnames(ai.cnames); + ares_freeaddrinfo_nodes(ai.nodes); ares_free(ai.name); ares_free(question_hostname); ares_dns_record_destroy(dnsrec); diff --git a/deps/cares/src/lib/legacy/ares_parse_aaaa_reply.c b/deps/cares/src/lib/legacy/ares_parse_aaaa_reply.c index 3f6932643b2474..278642f0b3e0af 100644 --- a/deps/cares/src/lib/legacy/ares_parse_aaaa_reply.c +++ b/deps/cares/src/lib/legacy/ares_parse_aaaa_reply.c @@ -74,13 +74,13 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, goto fail; } - status = ares__parse_into_addrinfo(dnsrec, 0, 0, &ai); + status = ares_parse_into_addrinfo(dnsrec, 0, 0, &ai); if (status != ARES_SUCCESS && status != ARES_ENODATA) { goto fail; } if (host != NULL) { - status = ares__addrinfo2hostent(&ai, AF_INET6, host); + status = ares_addrinfo2hostent(&ai, AF_INET6, host); if (status != ARES_SUCCESS && status != ARES_ENODATA) { goto fail; /* LCOV_EXCL_LINE: DefensiveCoding */ } @@ -88,14 +88,14 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, if (addrttls != NULL && req_naddrttls) { size_t temp_naddrttls = 0; - ares__addrinfo2addrttl(&ai, AF_INET6, req_naddrttls, NULL, addrttls, - &temp_naddrttls); + ares_addrinfo2addrttl(&ai, AF_INET6, req_naddrttls, NULL, addrttls, + &temp_naddrttls); *naddrttls = (int)temp_naddrttls; } fail: - ares__freeaddrinfo_cnames(ai.cnames); - ares__freeaddrinfo_nodes(ai.nodes); + ares_freeaddrinfo_cnames(ai.cnames); + ares_freeaddrinfo_nodes(ai.nodes); ares_free(question_hostname); ares_free(ai.name); ares_dns_record_destroy(dnsrec); diff --git a/deps/cares/src/lib/legacy/ares_parse_ptr_reply.c b/deps/cares/src/lib/legacy/ares_parse_ptr_reply.c index 56a7b5f94eb331..0e52f9db09bbc7 100644 --- a/deps/cares/src/lib/legacy/ares_parse_ptr_reply.c +++ b/deps/cares/src/lib/legacy/ares_parse_ptr_reply.c @@ -135,7 +135,7 @@ ares_status_t ares_parse_ptr_reply_dnsrec(const ares_dns_record_t *dnsrec, * status = ARES_EBADRESP; * goto done; * } - * if (strcasecmp(ptrname, rname) != 0) { + * if (!ares_strcaseeq(ptrname, rname)) { * continue; * } */ diff --git a/deps/cares/src/lib/legacy/ares_parse_txt_reply.c b/deps/cares/src/lib/legacy/ares_parse_txt_reply.c index 71ee0841119b8b..d276f6ab390753 100644 --- a/deps/cares/src/lib/legacy/ares_parse_txt_reply.c +++ b/deps/cares/src/lib/legacy/ares_parse_txt_reply.c @@ -27,8 +27,8 @@ #include "ares_private.h" #include "ares_data.h" -static int ares__parse_txt_reply(const unsigned char *abuf, size_t alen, - ares_bool_t ex, void **txt_out) +static int ares_parse_txt_reply_int(const unsigned char *abuf, size_t alen, + ares_bool_t ex, void **txt_out) { ares_status_t status; struct ares_txt_ext *txt_head = NULL; @@ -129,8 +129,8 @@ int ares_parse_txt_reply(const unsigned char *abuf, int alen, if (alen < 0) { return ARES_EBADRESP; } - return ares__parse_txt_reply(abuf, (size_t)alen, ARES_FALSE, - (void **)txt_out); + return ares_parse_txt_reply_int(abuf, (size_t)alen, ARES_FALSE, + (void **)txt_out); } int ares_parse_txt_reply_ext(const unsigned char *abuf, int alen, @@ -139,5 +139,6 @@ int ares_parse_txt_reply_ext(const unsigned char *abuf, int alen, if (alen < 0) { return ARES_EBADRESP; } - return ares__parse_txt_reply(abuf, (size_t)alen, ARES_TRUE, (void **)txt_out); + return ares_parse_txt_reply_int(abuf, (size_t)alen, ARES_TRUE, + (void **)txt_out); } diff --git a/deps/cares/src/lib/record/ares_dns_mapping.c b/deps/cares/src/lib/record/ares_dns_mapping.c index 738d2f3795ab3f..5a3ec28abf130b 100644 --- a/deps/cares/src/lib/record/ares_dns_mapping.c +++ b/deps/cares/src/lib/record/ares_dns_mapping.c @@ -111,7 +111,7 @@ ares_bool_t ares_dns_rec_type_isvalid(ares_dns_rec_type_t type, return is_query ? ARES_TRUE : ARES_FALSE; } -ares_bool_t ares_dns_rec_type_allow_name_compression(ares_dns_rec_type_t type) +ares_bool_t ares_dns_rec_allow_name_comp(ares_dns_rec_type_t type) { /* Only record types defined in RFC1035 allow name compression within the * RDATA. Otherwise nameservers that don't understand an RR may not be @@ -681,7 +681,7 @@ ares_bool_t ares_dns_class_fromstr(ares_dns_class_t *qclass, const char *str) } for (i = 0; list[i].name != NULL; i++) { - if (strcasecmp(list[i].name, str) == 0) { + if (ares_strcaseeq(list[i].name, str)) { *qclass = list[i].qclass; return ARES_TRUE; } @@ -726,7 +726,7 @@ ares_bool_t ares_dns_rec_type_fromstr(ares_dns_rec_type_t *qtype, } for (i = 0; list[i].name != NULL; i++) { - if (strcasecmp(list[i].name, str) == 0) { + if (ares_strcaseeq(list[i].name, str)) { *qtype = list[i].type; return ARES_TRUE; } diff --git a/deps/cares/src/lib/record/ares_dns_multistring.c b/deps/cares/src/lib/record/ares_dns_multistring.c index bff5afb9f2a00f..57c0d1c0a803ec 100644 --- a/deps/cares/src/lib/record/ares_dns_multistring.c +++ b/deps/cares/src/lib/record/ares_dns_multistring.c @@ -31,7 +31,7 @@ typedef struct { size_t len; } multistring_data_t; -struct ares__dns_multistring { +struct ares_dns_multistring { /*! whether or not cached concatenated string is valid */ ares_bool_t cache_invalidated; /*! combined/concatenated string cache */ @@ -39,10 +39,10 @@ struct ares__dns_multistring { /*! length of combined/concatenated string */ size_t cache_str_len; /*! Data making up strings */ - ares__array_t *strs; /*!< multistring_data_t type */ + ares_array_t *strs; /*!< multistring_data_t type */ }; -static void ares__dns_multistring_free_cb(void *arg) +static void ares_dns_multistring_free_cb(void *arg) { multistring_data_t *data = arg; if (data == NULL) { @@ -51,15 +51,15 @@ static void ares__dns_multistring_free_cb(void *arg) ares_free(data->data); } -ares__dns_multistring_t *ares__dns_multistring_create(void) +ares_dns_multistring_t *ares_dns_multistring_create(void) { - ares__dns_multistring_t *strs = ares_malloc_zero(sizeof(*strs)); + ares_dns_multistring_t *strs = ares_malloc_zero(sizeof(*strs)); if (strs == NULL) { return NULL; } - strs->strs = ares__array_create(sizeof(multistring_data_t), - ares__dns_multistring_free_cb); + strs->strs = + ares_array_create(sizeof(multistring_data_t), ares_dns_multistring_free_cb); if (strs->strs == NULL) { ares_free(strs); return NULL; @@ -68,31 +68,31 @@ ares__dns_multistring_t *ares__dns_multistring_create(void) return strs; } -void ares__dns_multistring_clear(ares__dns_multistring_t *strs) +void ares_dns_multistring_clear(ares_dns_multistring_t *strs) { if (strs == NULL) { return; } - while (ares__array_len(strs->strs)) { - ares__array_remove_last(strs->strs); + while (ares_array_len(strs->strs)) { + ares_array_remove_last(strs->strs); } } -void ares__dns_multistring_destroy(ares__dns_multistring_t *strs) +void ares_dns_multistring_destroy(ares_dns_multistring_t *strs) { if (strs == NULL) { return; } - ares__dns_multistring_clear(strs); - ares__array_destroy(strs->strs); + ares_dns_multistring_clear(strs); + ares_array_destroy(strs->strs); ares_free(strs->cache_str); ares_free(strs); } -ares_status_t ares__dns_multistring_replace_own(ares__dns_multistring_t *strs, - size_t idx, unsigned char *str, - size_t len) +ares_status_t ares_dns_multistring_swap_own(ares_dns_multistring_t *strs, + size_t idx, unsigned char *str, + size_t len) { multistring_data_t *data; @@ -102,7 +102,7 @@ ares_status_t ares__dns_multistring_replace_own(ares__dns_multistring_t *strs, strs->cache_invalidated = ARES_TRUE; - data = ares__array_at(strs->strs, idx); + data = ares_array_at(strs->strs, idx); if (data == NULL) { return ARES_EFORMERR; } @@ -113,8 +113,7 @@ ares_status_t ares__dns_multistring_replace_own(ares__dns_multistring_t *strs, return ARES_SUCCESS; } -ares_status_t ares__dns_multistring_del(ares__dns_multistring_t *strs, - size_t idx) +ares_status_t ares_dns_multistring_del(ares_dns_multistring_t *strs, size_t idx) { if (strs == NULL) { return ARES_EFORMERR; @@ -122,11 +121,11 @@ ares_status_t ares__dns_multistring_del(ares__dns_multistring_t *strs, strs->cache_invalidated = ARES_TRUE; - return ares__array_remove_at(strs->strs, idx); + return ares_array_remove_at(strs->strs, idx); } -ares_status_t ares__dns_multistring_add_own(ares__dns_multistring_t *strs, - unsigned char *str, size_t len) +ares_status_t ares_dns_multistring_add_own(ares_dns_multistring_t *strs, + unsigned char *str, size_t len) { multistring_data_t *data; ares_status_t status; @@ -142,7 +141,7 @@ ares_status_t ares__dns_multistring_add_own(ares__dns_multistring_t *strs, return ARES_EFORMERR; } - status = ares__array_insert_last((void **)&data, strs->strs); + status = ares_array_insert_last((void **)&data, strs->strs); if (status != ARES_SUCCESS) { return status; } @@ -153,17 +152,17 @@ ares_status_t ares__dns_multistring_add_own(ares__dns_multistring_t *strs, return ARES_SUCCESS; } -size_t ares__dns_multistring_cnt(const ares__dns_multistring_t *strs) +size_t ares_dns_multistring_cnt(const ares_dns_multistring_t *strs) { if (strs == NULL) { return 0; } - return ares__array_len(strs->strs); + return ares_array_len(strs->strs); } const unsigned char * - ares__dns_multistring_get(const ares__dns_multistring_t *strs, size_t idx, - size_t *len) + ares_dns_multistring_get(const ares_dns_multistring_t *strs, size_t idx, + size_t *len) { const multistring_data_t *data; @@ -171,7 +170,7 @@ const unsigned char * return NULL; } - data = ares__array_at_const(strs->strs, idx); + data = ares_array_at_const(strs->strs, idx); if (data == NULL) { return NULL; } @@ -180,11 +179,11 @@ const unsigned char * return data->data; } -const unsigned char * - ares__dns_multistring_get_combined(ares__dns_multistring_t *strs, size_t *len) +const unsigned char *ares_dns_multistring_combined(ares_dns_multistring_t *strs, + size_t *len) { - ares__buf_t *buf = NULL; - size_t i; + ares_buf_t *buf = NULL; + size_t i; if (strs == NULL || len == NULL) { return NULL; @@ -203,22 +202,92 @@ const unsigned char * strs->cache_str = NULL; strs->cache_str_len = 0; - buf = ares__buf_create(); + buf = ares_buf_create(); - for (i = 0; i < ares__array_len(strs->strs); i++) { - const multistring_data_t *data = ares__array_at_const(strs->strs, i); + for (i = 0; i < ares_array_len(strs->strs); i++) { + const multistring_data_t *data = ares_array_at_const(strs->strs, i); if (data == NULL || - ares__buf_append(buf, data->data, data->len) != ARES_SUCCESS) { - ares__buf_destroy(buf); + ares_buf_append(buf, data->data, data->len) != ARES_SUCCESS) { + ares_buf_destroy(buf); return NULL; } } strs->cache_str = - (unsigned char *)ares__buf_finish_str(buf, &strs->cache_str_len); + (unsigned char *)ares_buf_finish_str(buf, &strs->cache_str_len); if (strs->cache_str != NULL) { strs->cache_invalidated = ARES_FALSE; } *len = strs->cache_str_len; return strs->cache_str; } + +ares_status_t ares_dns_multistring_parse_buf(ares_buf_t *buf, + size_t remaining_len, + ares_dns_multistring_t **strs, + ares_bool_t validate_printable) +{ + unsigned char len; + ares_status_t status = ARES_EBADRESP; + size_t orig_len = ares_buf_len(buf); + + if (buf == NULL) { + return ARES_EFORMERR; + } + + if (remaining_len == 0) { + return ARES_EBADRESP; + } + + if (strs != NULL) { + *strs = ares_dns_multistring_create(); + if (*strs == NULL) { + return ARES_ENOMEM; + } + } + + while (orig_len - ares_buf_len(buf) < remaining_len) { + status = ares_buf_fetch_bytes(buf, &len, 1); + if (status != ARES_SUCCESS) { + break; /* LCOV_EXCL_LINE: DefensiveCoding */ + } + + if (len) { + /* When used by the _str() parser, it really needs to be validated to + * be a valid printable ascii string. Do that here */ + if (validate_printable && ares_buf_len(buf) >= len) { + size_t mylen; + const char *data = (const char *)ares_buf_peek(buf, &mylen); + if (!ares_str_isprint(data, len)) { + status = ARES_EBADSTR; + break; + } + } + + if (strs != NULL) { + unsigned char *data = NULL; + status = ares_buf_fetch_bytes_dup(buf, len, ARES_TRUE, &data); + if (status != ARES_SUCCESS) { + break; + } + status = ares_dns_multistring_add_own(*strs, data, len); + if (status != ARES_SUCCESS) { + ares_free(data); + break; + } + } else { + status = ares_buf_consume(buf, len); + if (status != ARES_SUCCESS) { + break; + } + } + } + } + + if (status != ARES_SUCCESS && strs != NULL) { + ares_dns_multistring_destroy(*strs); + *strs = NULL; + } + + return status; +} diff --git a/deps/cares/src/lib/record/ares_dns_multistring.h b/deps/cares/src/lib/record/ares_dns_multistring.h index d9aa7ae37847eb..70834491b52116 100644 --- a/deps/cares/src/lib/record/ares_dns_multistring.h +++ b/deps/cares/src/lib/record/ares_dns_multistring.h @@ -26,25 +26,47 @@ #ifndef __ARES_DNS_MULTISTRING_H #define __ARES_DNS_MULTISTRING_H -struct ares__dns_multistring; -typedef struct ares__dns_multistring ares__dns_multistring_t; +#include "ares_buf.h" -ares__dns_multistring_t *ares__dns_multistring_create(void); -void ares__dns_multistring_clear(ares__dns_multistring_t *strs); -void ares__dns_multistring_destroy(ares__dns_multistring_t *strs); -ares_status_t ares__dns_multistring_replace_own(ares__dns_multistring_t *strs, - size_t idx, unsigned char *str, - size_t len); -ares_status_t ares__dns_multistring_del(ares__dns_multistring_t *strs, - size_t idx); -ares_status_t ares__dns_multistring_add_own(ares__dns_multistring_t *strs, - unsigned char *str, size_t len); -size_t ares__dns_multistring_cnt(const ares__dns_multistring_t *strs); -const unsigned char * - ares__dns_multistring_get(const ares__dns_multistring_t *strs, size_t idx, - size_t *len); +struct ares_dns_multistring; +typedef struct ares_dns_multistring ares_dns_multistring_t; + +ares_dns_multistring_t *ares_dns_multistring_create(void); +void ares_dns_multistring_clear(ares_dns_multistring_t *strs); +void ares_dns_multistring_destroy(ares_dns_multistring_t *strs); +ares_status_t ares_dns_multistring_swap_own(ares_dns_multistring_t *strs, + size_t idx, unsigned char *str, + size_t len); +ares_status_t ares_dns_multistring_del(ares_dns_multistring_t *strs, + size_t idx); +ares_status_t ares_dns_multistring_add_own(ares_dns_multistring_t *strs, + unsigned char *str, size_t len); +size_t ares_dns_multistring_cnt(const ares_dns_multistring_t *strs); const unsigned char * - ares__dns_multistring_get_combined(ares__dns_multistring_t *strs, - size_t *len); + ares_dns_multistring_get(const ares_dns_multistring_t *strs, size_t idx, + size_t *len); +const unsigned char *ares_dns_multistring_combined(ares_dns_multistring_t *strs, + size_t *len); + +/*! Parse an array of character strings as defined in RFC1035, as binary, + * however, for convenience this does guarantee a NULL terminator (that is + * not included in the length for each value). + * + * \param[in] buf initialized buffer object + * \param[in] remaining_len maximum length that should be used for + * parsing the string, this is often less than + * the remaining buffer and is based on the RR + * record length. + * \param[out] strs Pointer passed by reference to be filled in + * with + * the array of values. + * \param[out] validate_printable Validate the strings contain only printable + * data. + * \return ARES_SUCCESS on success + */ +ares_status_t ares_dns_multistring_parse_buf(ares_buf_t *buf, + size_t remaining_len, + ares_dns_multistring_t **strs, + ares_bool_t validate_printable); #endif diff --git a/deps/cares/src/lib/record/ares_dns_name.c b/deps/cares/src/lib/record/ares_dns_name.c index a437553b0f2917..a9b92e03ca9353 100644 --- a/deps/cares/src/lib/record/ares_dns_name.c +++ b/deps/cares/src/lib/record/ares_dns_name.c @@ -31,7 +31,7 @@ typedef struct { size_t idx; } ares_nameoffset_t; -static void ares__nameoffset_free(void *arg) +static void ares_nameoffset_free(void *arg) { ares_nameoffset_t *off = arg; if (off == NULL) { @@ -41,8 +41,8 @@ static void ares__nameoffset_free(void *arg) ares_free(off); } -static ares_status_t ares__nameoffset_create(ares__llist_t **list, - const char *name, size_t idx) +static ares_status_t ares_nameoffset_create(ares_llist_t **list, + const char *name, size_t idx) { ares_status_t status; ares_nameoffset_t *off = NULL; @@ -53,7 +53,7 @@ static ares_status_t ares__nameoffset_create(ares__llist_t **list, } if (*list == NULL) { - *list = ares__llist_create(ares__nameoffset_free); + *list = ares_llist_create(ares_nameoffset_free); } if (*list == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -69,7 +69,7 @@ static ares_status_t ares__nameoffset_create(ares__llist_t **list, off->name_len = ares_strlen(off->name); off->idx = idx; - if (ares__llist_insert_last(*list, off) == NULL) { + if (ares_llist_insert_last(*list, off) == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -78,25 +78,25 @@ static ares_status_t ares__nameoffset_create(ares__llist_t **list, /* LCOV_EXCL_START: OutOfMemory */ fail: - ares__nameoffset_free(off); + ares_nameoffset_free(off); return status; /* LCOV_EXCL_STOP */ } -static const ares_nameoffset_t *ares__nameoffset_find(ares__llist_t *list, - const char *name) +static const ares_nameoffset_t *ares_nameoffset_find(ares_llist_t *list, + const char *name) { size_t name_len = ares_strlen(name); - ares__llist_node_t *node; + ares_llist_node_t *node; const ares_nameoffset_t *longest_match = NULL; if (list == NULL || name == NULL || name_len == 0) { return NULL; } - for (node = ares__llist_node_first(list); node != NULL; - node = ares__llist_node_next(node)) { - const ares_nameoffset_t *val = ares__llist_node_val(node); + for (node = ares_llist_node_first(list); node != NULL; + node = ares_llist_node_next(node)) { + const ares_nameoffset_t *val = ares_llist_node_val(node); size_t prefix_len; /* Can't be a match if the stored name is longer */ @@ -114,7 +114,7 @@ static const ares_nameoffset_t *ares__nameoffset_find(ares__llist_t *list, /* Due to DNS 0x20, lets not inadvertently mangle things, use case-sensitive * matching instead of case-insensitive. This may result in slightly * larger DNS queries overall. */ - if (strcmp(val->name, name + prefix_len) != 0) { + if (!ares_streq(val->name, name + prefix_len)) { continue; } @@ -133,38 +133,38 @@ static const ares_nameoffset_t *ares__nameoffset_find(ares__llist_t *list, static void ares_dns_labels_free_cb(void *arg) { - ares__buf_t **buf = arg; + ares_buf_t **buf = arg; if (buf == NULL) { return; } - ares__buf_destroy(*buf); + ares_buf_destroy(*buf); } -static ares__buf_t *ares_dns_labels_add(ares__array_t *labels) +static ares_buf_t *ares_dns_labels_add(ares_array_t *labels) { - ares__buf_t **buf; + ares_buf_t **buf; if (labels == NULL) { return NULL; /* LCOV_EXCL_LINE: DefensiveCoding */ } - if (ares__array_insert_last((void **)&buf, labels) != ARES_SUCCESS) { + if (ares_array_insert_last((void **)&buf, labels) != ARES_SUCCESS) { return NULL; } - *buf = ares__buf_create(); + *buf = ares_buf_create(); if (*buf == NULL) { - ares__array_remove_last(labels); + ares_array_remove_last(labels); return NULL; } return *buf; } -static ares__buf_t *ares_dns_labels_get_last(ares__array_t *labels) +static ares_buf_t *ares_dns_labels_get_last(ares_array_t *labels) { - ares__buf_t **buf = ares__array_last(labels); + ares_buf_t **buf = ares_array_last(labels); if (buf == NULL) { return NULL; @@ -173,9 +173,9 @@ static ares__buf_t *ares_dns_labels_get_last(ares__array_t *labels) return *buf; } -static ares__buf_t *ares_dns_labels_get_at(ares__array_t *labels, size_t idx) +static ares_buf_t *ares_dns_labels_get_at(ares_array_t *labels, size_t idx) { - ares__buf_t **buf = ares__array_at(labels, idx); + ares_buf_t **buf = ares_array_at(labels, idx); if (buf == NULL) { return NULL; @@ -184,37 +184,37 @@ static ares__buf_t *ares_dns_labels_get_at(ares__array_t *labels, size_t idx) return *buf; } -static void ares_dns_name_labels_del_last(ares__array_t *labels) +static void ares_dns_name_labels_del_last(ares_array_t *labels) { - ares__array_remove_last(labels); + ares_array_remove_last(labels); } -static ares_status_t ares_parse_dns_name_escape(ares__buf_t *namebuf, - ares__buf_t *label, - ares_bool_t validate_hostname) +static ares_status_t ares_parse_dns_name_escape(ares_buf_t *namebuf, + ares_buf_t *label, + ares_bool_t validate_hostname) { ares_status_t status; unsigned char c; - status = ares__buf_fetch_bytes(namebuf, &c, 1); + status = ares_buf_fetch_bytes(namebuf, &c, 1); if (status != ARES_SUCCESS) { return ARES_EBADNAME; } /* If next character is a digit, read 2 more digits */ - if (ares__isdigit(c)) { + if (ares_isdigit(c)) { size_t i; unsigned int val = 0; val = c - '0'; for (i = 0; i < 2; i++) { - status = ares__buf_fetch_bytes(namebuf, &c, 1); + status = ares_buf_fetch_bytes(namebuf, &c, 1); if (status != ARES_SUCCESS) { return ARES_EBADNAME; } - if (!ares__isdigit(c)) { + if (!ares_isdigit(c)) { return ARES_EBADNAME; } val *= 10; @@ -226,28 +226,28 @@ static ares_status_t ares_parse_dns_name_escape(ares__buf_t *namebuf, return ARES_EBADNAME; } - if (validate_hostname && !ares__is_hostnamech((unsigned char)val)) { + if (validate_hostname && !ares_is_hostnamech((unsigned char)val)) { return ARES_EBADNAME; } - return ares__buf_append_byte(label, (unsigned char)val); + return ares_buf_append_byte(label, (unsigned char)val); } /* We can just output the character */ - if (validate_hostname && !ares__is_hostnamech(c)) { + if (validate_hostname && !ares_is_hostnamech(c)) { return ARES_EBADNAME; } - return ares__buf_append_byte(label, c); + return ares_buf_append_byte(label, c); } -static ares_status_t ares_split_dns_name(ares__array_t *labels, - ares_bool_t validate_hostname, - const char *name) +static ares_status_t ares_split_dns_name(ares_array_t *labels, + ares_bool_t validate_hostname, + const char *name) { ares_status_t status; - ares__buf_t *label = NULL; - ares__buf_t *namebuf = NULL; + ares_buf_t *label = NULL; + ares_buf_t *namebuf = NULL; size_t i; size_t total_len = 0; unsigned char c; @@ -257,7 +257,7 @@ static ares_status_t ares_split_dns_name(ares__array_t *labels, } /* Put name into a buffer for parsing */ - namebuf = ares__buf_create(); + namebuf = ares_buf_create(); if (namebuf == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto done; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -265,7 +265,7 @@ static ares_status_t ares_split_dns_name(ares__array_t *labels, if (*name != '\0') { status = - ares__buf_append(namebuf, (const unsigned char *)name, ares_strlen(name)); + ares_buf_append(namebuf, (const unsigned char *)name, ares_strlen(name)); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -278,7 +278,7 @@ static ares_status_t ares_split_dns_name(ares__array_t *labels, goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - while (ares__buf_fetch_bytes(namebuf, &c, 1) == ARES_SUCCESS) { + while (ares_buf_fetch_bytes(namebuf, &c, 1) == ARES_SUCCESS) { /* New label */ if (c == '.') { label = ares_dns_labels_add(labels); @@ -299,33 +299,33 @@ static ares_status_t ares_split_dns_name(ares__array_t *labels, } /* Output direct character */ - if (validate_hostname && !ares__is_hostnamech(c)) { + if (validate_hostname && !ares_is_hostnamech(c)) { status = ARES_EBADNAME; goto done; } - status = ares__buf_append_byte(label, c); + status = ares_buf_append_byte(label, c); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } } /* Remove trailing blank label */ - if (ares__buf_len(ares_dns_labels_get_last(labels)) == 0) { + if (ares_buf_len(ares_dns_labels_get_last(labels)) == 0) { ares_dns_name_labels_del_last(labels); } /* If someone passed in "." there could have been 2 blank labels, check for * that */ - if (ares__array_len(labels) == 1 && - ares__buf_len(ares_dns_labels_get_last(labels)) == 0) { + if (ares_array_len(labels) == 1 && + ares_buf_len(ares_dns_labels_get_last(labels)) == 0) { ares_dns_name_labels_del_last(labels); } /* Scan to make sure label lengths are valid */ - for (i = 0; i < ares__array_len(labels); i++) { - const ares__buf_t *buf = ares_dns_labels_get_at(labels, i); - size_t len = ares__buf_len(buf); + for (i = 0; i < ares_array_len(labels); i++) { + const ares_buf_t *buf = ares_dns_labels_get_at(labels, i); + size_t len = ares_buf_len(buf); /* No 0-length labels, and no labels over 63 bytes */ if (len == 0 || len > 63) { status = ARES_EBADNAME; @@ -335,8 +335,7 @@ static ares_status_t ares_split_dns_name(ares__array_t *labels, } /* Can't exceed maximum (unescaped) length */ - if (ares__array_len(labels) && - total_len + ares__array_len(labels) - 1 > 255) { + if (ares_array_len(labels) && total_len + ares_array_len(labels) - 1 > 255) { status = ARES_EBADNAME; goto done; } @@ -344,19 +343,19 @@ static ares_status_t ares_split_dns_name(ares__array_t *labels, status = ARES_SUCCESS; done: - ares__buf_destroy(namebuf); + ares_buf_destroy(namebuf); return status; } -ares_status_t ares__dns_name_write(ares__buf_t *buf, ares__llist_t **list, - ares_bool_t validate_hostname, - const char *name) +ares_status_t ares_dns_name_write(ares_buf_t *buf, ares_llist_t **list, + ares_bool_t validate_hostname, + const char *name) { const ares_nameoffset_t *off = NULL; size_t name_len; size_t orig_name_len; - size_t pos = ares__buf_len(buf); - ares__array_t *labels = NULL; + size_t pos = ares_buf_len(buf); + ares_array_t *labels = NULL; char name_copy[512]; ares_status_t status; @@ -364,7 +363,7 @@ ares_status_t ares__dns_name_write(ares__buf_t *buf, ares__llist_t **list, return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ } - labels = ares__array_create(sizeof(ares__buf_t *), ares_dns_labels_free_cb); + labels = ares_array_create(sizeof(ares_buf_t *), ares_dns_labels_free_cb); if (labels == NULL) { return ARES_ENOMEM; } @@ -376,7 +375,7 @@ ares_status_t ares__dns_name_write(ares__buf_t *buf, ares__llist_t **list, /* Find longest match */ if (list != NULL) { - off = ares__nameoffset_find(*list, name_copy); + off = ares_nameoffset_find(*list, name_copy); if (off != NULL && off->name_len != name_len) { /* truncate */ name_len -= (off->name_len + 1); @@ -393,17 +392,17 @@ ares_status_t ares__dns_name_write(ares__buf_t *buf, ares__llist_t **list, goto done; } - for (i = 0; i < ares__array_len(labels); i++) { + for (i = 0; i < ares_array_len(labels); i++) { size_t len = 0; - const ares__buf_t *lbuf = ares_dns_labels_get_at(labels, i); - const unsigned char *ptr = ares__buf_peek(lbuf, &len); + const ares_buf_t *lbuf = ares_dns_labels_get_at(labels, i); + const unsigned char *ptr = ares_buf_peek(lbuf, &len); - status = ares__buf_append_byte(buf, (unsigned char)(len & 0xFF)); + status = ares_buf_append_byte(buf, (unsigned char)(len & 0xFF)); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_append(buf, ptr, len); + status = ares_buf_append(buf, ptr, len); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -411,7 +410,7 @@ ares_status_t ares__dns_name_write(ares__buf_t *buf, ares__llist_t **list, /* If we are NOT jumping to another label, output terminator */ if (off == NULL) { - status = ares__buf_append_byte(buf, 0); + status = ares_buf_append_byte(buf, 0); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -422,7 +421,7 @@ ares_status_t ares__dns_name_write(ares__buf_t *buf, ares__llist_t **list, if (off != NULL) { unsigned short u16 = (unsigned short)0xC000 | (unsigned short)(off->idx & 0x3FFF); - status = ares__buf_append_be16(buf, u16); + status = ares_buf_append_be16(buf, u16); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -432,7 +431,7 @@ ares_status_t ares__dns_name_write(ares__buf_t *buf, ares__llist_t **list, * a prior entry */ if (list != NULL && (off == NULL || off->name_len != orig_name_len) && name_len > 0) { - status = ares__nameoffset_create(list, name /* not truncated copy! */, pos); + status = ares_nameoffset_create(list, name /* not truncated copy! */, pos); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -441,7 +440,7 @@ ares_status_t ares__dns_name_write(ares__buf_t *buf, ares__llist_t **list, status = ARES_SUCCESS; done: - ares__array_destroy(labels); + ares_array_destroy(labels); return status; } @@ -465,12 +464,12 @@ static ares_bool_t is_reservedch(int ch) return ARES_FALSE; } -static ares_status_t ares__fetch_dnsname_into_buf(ares__buf_t *buf, - ares__buf_t *dest, size_t len, - ares_bool_t is_hostname) +static ares_status_t ares_fetch_dnsname_into_buf(ares_buf_t *buf, + ares_buf_t *dest, size_t len, + ares_bool_t is_hostname) { size_t remaining_len; - const unsigned char *ptr = ares__buf_peek(buf, &remaining_len); + const unsigned char *ptr = ares_buf_peek(buf, &remaining_len); ares_status_t status; size_t i; @@ -483,7 +482,7 @@ static ares_status_t ares__fetch_dnsname_into_buf(ares__buf_t *buf, /* Hostnames have a very specific allowed character set. Anything outside * of that (non-printable and reserved included) are disallowed */ - if (is_hostname && !ares__is_hostnamech(c)) { + if (is_hostname && !ares_is_hostnamech(c)) { status = ARES_EBADRESP; goto fail; } @@ -495,7 +494,7 @@ static ares_status_t ares__fetch_dnsname_into_buf(ares__buf_t *buf, } /* Non-printable characters need to be output as \DDD */ - if (!ares__isprint(c)) { + if (!ares_isprint(c)) { unsigned char escape[4]; escape[0] = '\\'; @@ -503,7 +502,7 @@ static ares_status_t ares__fetch_dnsname_into_buf(ares__buf_t *buf, escape[2] = '0' + ((c % 100) / 10); escape[3] = '0' + (c % 10); - status = ares__buf_append(dest, escape, sizeof(escape)); + status = ares_buf_append(dest, escape, sizeof(escape)); if (status != ARES_SUCCESS) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -513,39 +512,39 @@ static ares_status_t ares__fetch_dnsname_into_buf(ares__buf_t *buf, /* Reserved characters need to be escaped, otherwise normal */ if (is_reservedch(c)) { - status = ares__buf_append_byte(dest, '\\'); + status = ares_buf_append_byte(dest, '\\'); if (status != ARES_SUCCESS) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } } - status = ares__buf_append_byte(dest, c); + status = ares_buf_append_byte(dest, c); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } } - return ares__buf_consume(buf, len); + return ares_buf_consume(buf, len); fail: return status; } -ares_status_t ares__dns_name_parse(ares__buf_t *buf, char **name, - ares_bool_t is_hostname) +ares_status_t ares_dns_name_parse(ares_buf_t *buf, char **name, + ares_bool_t is_hostname) { size_t save_offset = 0; unsigned char c; ares_status_t status; - ares__buf_t *namebuf = NULL; - size_t label_start = ares__buf_get_position(buf); + ares_buf_t *namebuf = NULL; + size_t label_start = ares_buf_get_position(buf); if (buf == NULL) { return ARES_EFORMERR; } if (name != NULL) { - namebuf = ares__buf_create(); + namebuf = ares_buf_create(); if (namebuf == NULL) { status = ARES_ENOMEM; goto fail; @@ -562,11 +561,11 @@ ares_status_t ares__dns_name_parse(ares__buf_t *buf, char **name, while (1) { /* Keep track of the minimum label starting position to prevent forward * jumping */ - if (label_start > ares__buf_get_position(buf)) { - label_start = ares__buf_get_position(buf); + if (label_start > ares_buf_get_position(buf)) { + label_start = ares_buf_get_position(buf); } - status = ares__buf_fetch_bytes(buf, &c, 1); + status = ares_buf_fetch_bytes(buf, &c, 1); if (status != ARES_SUCCESS) { goto fail; } @@ -590,7 +589,7 @@ ares_status_t ares__dns_name_parse(ares__buf_t *buf, char **name, size_t offset = (size_t)((c & 0x3F) << 8); /* Fetch second byte of the redirect length */ - status = ares__buf_fetch_bytes(buf, &c, 1); + status = ares_buf_fetch_bytes(buf, &c, 1); if (status != ARES_SUCCESS) { goto fail; } @@ -612,10 +611,10 @@ ares_status_t ares__dns_name_parse(ares__buf_t *buf, char **name, /* First time we make a jump, save the current position */ if (save_offset == 0) { - save_offset = ares__buf_get_position(buf); + save_offset = ares_buf_get_position(buf); } - status = ares__buf_set_position(buf, offset); + status = ares_buf_set_position(buf, offset); if (status != ARES_SUCCESS) { status = ARES_EBADNAME; goto fail; @@ -634,14 +633,14 @@ ares_status_t ares__dns_name_parse(ares__buf_t *buf, char **name, /* New label */ /* Labels are separated by periods */ - if (ares__buf_len(namebuf) != 0 && name != NULL) { - status = ares__buf_append_byte(namebuf, '.'); + if (ares_buf_len(namebuf) != 0 && name != NULL) { + status = ares_buf_append_byte(namebuf, '.'); if (status != ARES_SUCCESS) { goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ } } - status = ares__fetch_dnsname_into_buf(buf, namebuf, c, is_hostname); + status = ares_fetch_dnsname_into_buf(buf, namebuf, c, is_hostname); if (status != ARES_SUCCESS) { goto fail; } @@ -650,11 +649,11 @@ ares_status_t ares__dns_name_parse(ares__buf_t *buf, char **name, /* Restore offset read after first redirect/pointer as this is where the DNS * message continues */ if (save_offset) { - ares__buf_set_position(buf, save_offset); + ares_buf_set_position(buf, save_offset); } if (name != NULL) { - *name = ares__buf_finish_str(namebuf, NULL); + *name = ares_buf_finish_str(namebuf, NULL); if (*name == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto fail; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -669,6 +668,6 @@ ares_status_t ares__dns_name_parse(ares__buf_t *buf, char **name, status = ARES_EBADNAME; } - ares__buf_destroy(namebuf); + ares_buf_destroy(namebuf); return status; } diff --git a/deps/cares/src/lib/record/ares_dns_parse.c b/deps/cares/src/lib/record/ares_dns_parse.c index 57cb0f714e12e1..0c545d7aa18ada 100644 --- a/deps/cares/src/lib/record/ares_dns_parse.c +++ b/deps/cares/src/lib/record/ares_dns_parse.c @@ -29,17 +29,17 @@ # include #endif -static size_t ares_dns_rr_remaining_len(const ares__buf_t *buf, size_t orig_len, +static size_t ares_dns_rr_remaining_len(const ares_buf_t *buf, size_t orig_len, size_t rdlength) { - size_t used_len = orig_len - ares__buf_len(buf); + size_t used_len = orig_len - ares_buf_len(buf); if (used_len >= rdlength) { return 0; } return rdlength - used_len; } -static ares_status_t ares_dns_parse_and_set_dns_name(ares__buf_t *buf, +static ares_status_t ares_dns_parse_and_set_dns_name(ares_buf_t *buf, ares_bool_t is_hostname, ares_dns_rr_t *rr, ares_dns_rr_key_t key) @@ -47,7 +47,7 @@ static ares_status_t ares_dns_parse_and_set_dns_name(ares__buf_t *buf, ares_status_t status; char *name = NULL; - status = ares__dns_name_parse(buf, &name, is_hostname); + status = ares_dns_name_parse(buf, &name, is_hostname); if (status != ARES_SUCCESS) { return status; } @@ -60,7 +60,7 @@ static ares_status_t ares_dns_parse_and_set_dns_name(ares__buf_t *buf, return ARES_SUCCESS; } -static ares_status_t ares_dns_parse_and_set_dns_str(ares__buf_t *buf, +static ares_status_t ares_dns_parse_and_set_dns_str(ares_buf_t *buf, size_t max_len, ares_dns_rr_t *rr, ares_dns_rr_key_t key, @@ -69,7 +69,7 @@ static ares_status_t ares_dns_parse_and_set_dns_str(ares__buf_t *buf, ares_status_t status; char *str = NULL; - status = ares__buf_parse_dns_str(buf, max_len, &str); + status = ares_buf_parse_dns_str(buf, max_len, &str); if (status != ARES_SUCCESS) { return status; } @@ -88,34 +88,35 @@ static ares_status_t ares_dns_parse_and_set_dns_str(ares__buf_t *buf, } static ares_status_t - ares_dns_parse_and_set_dns_abin(ares__buf_t *buf, size_t max_len, + ares_dns_parse_and_set_dns_abin(ares_buf_t *buf, size_t max_len, ares_dns_rr_t *rr, ares_dns_rr_key_t key, ares_bool_t validate_printable) { - ares_status_t status; - ares__dns_multistring_t *strs = NULL; + ares_status_t status; + ares_dns_multistring_t *strs = NULL; - status = ares__buf_parse_dns_abinstr(buf, max_len, &strs, validate_printable); + status = + ares_dns_multistring_parse_buf(buf, max_len, &strs, validate_printable); if (status != ARES_SUCCESS) { return status; } status = ares_dns_rr_set_abin_own(rr, key, strs); if (status != ARES_SUCCESS) { - ares__dns_multistring_destroy(strs); + ares_dns_multistring_destroy(strs); return status; } return ARES_SUCCESS; } -static ares_status_t ares_dns_parse_and_set_be32(ares__buf_t *buf, +static ares_status_t ares_dns_parse_and_set_be32(ares_buf_t *buf, ares_dns_rr_t *rr, ares_dns_rr_key_t key) { ares_status_t status; unsigned int u32; - status = ares__buf_fetch_be32(buf, &u32); + status = ares_buf_fetch_be32(buf, &u32); if (status != ARES_SUCCESS) { return status; } @@ -123,14 +124,14 @@ static ares_status_t ares_dns_parse_and_set_be32(ares__buf_t *buf, return ares_dns_rr_set_u32(rr, key, u32); } -static ares_status_t ares_dns_parse_and_set_be16(ares__buf_t *buf, +static ares_status_t ares_dns_parse_and_set_be16(ares_buf_t *buf, ares_dns_rr_t *rr, ares_dns_rr_key_t key) { ares_status_t status; unsigned short u16; - status = ares__buf_fetch_be16(buf, &u16); + status = ares_buf_fetch_be16(buf, &u16); if (status != ARES_SUCCESS) { return status; } @@ -138,14 +139,14 @@ static ares_status_t ares_dns_parse_and_set_be16(ares__buf_t *buf, return ares_dns_rr_set_u16(rr, key, u16); } -static ares_status_t ares_dns_parse_and_set_u8(ares__buf_t *buf, +static ares_status_t ares_dns_parse_and_set_u8(ares_buf_t *buf, ares_dns_rr_t *rr, ares_dns_rr_key_t key) { ares_status_t status; unsigned char u8; - status = ares__buf_fetch_bytes(buf, &u8, 1); + status = ares_buf_fetch_bytes(buf, &u8, 1); if (status != ARES_SUCCESS) { return status; } @@ -153,7 +154,7 @@ static ares_status_t ares_dns_parse_and_set_u8(ares__buf_t *buf, return ares_dns_rr_set_u8(rr, key, u8); } -static ares_status_t ares_dns_parse_rr_a(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_a(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength) { struct in_addr addr; @@ -161,7 +162,7 @@ static ares_status_t ares_dns_parse_rr_a(ares__buf_t *buf, ares_dns_rr_t *rr, (void)rdlength; /* Not needed */ - status = ares__buf_fetch_bytes(buf, (unsigned char *)&addr, sizeof(addr)); + status = ares_buf_fetch_bytes(buf, (unsigned char *)&addr, sizeof(addr)); if (status != ARES_SUCCESS) { return status; } @@ -169,7 +170,7 @@ static ares_status_t ares_dns_parse_rr_a(ares__buf_t *buf, ares_dns_rr_t *rr, return ares_dns_rr_set_addr(rr, ARES_RR_A_ADDR, &addr); } -static ares_status_t ares_dns_parse_rr_ns(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_ns(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength) { (void)rdlength; /* Not needed */ @@ -178,8 +179,8 @@ static ares_status_t ares_dns_parse_rr_ns(ares__buf_t *buf, ares_dns_rr_t *rr, ARES_RR_NS_NSDNAME); } -static ares_status_t ares_dns_parse_rr_cname(ares__buf_t *buf, - ares_dns_rr_t *rr, size_t rdlength) +static ares_status_t ares_dns_parse_rr_cname(ares_buf_t *buf, ares_dns_rr_t *rr, + size_t rdlength) { (void)rdlength; /* Not needed */ @@ -187,7 +188,7 @@ static ares_status_t ares_dns_parse_rr_cname(ares__buf_t *buf, ARES_RR_CNAME_CNAME); } -static ares_status_t ares_dns_parse_rr_soa(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_soa(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength) { ares_status_t status; @@ -236,7 +237,7 @@ static ares_status_t ares_dns_parse_rr_soa(ares__buf_t *buf, ares_dns_rr_t *rr, return ares_dns_parse_and_set_be32(buf, rr, ARES_RR_SOA_MINIMUM); } -static ares_status_t ares_dns_parse_rr_ptr(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_ptr(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength) { (void)rdlength; /* Not needed */ @@ -245,11 +246,11 @@ static ares_status_t ares_dns_parse_rr_ptr(ares__buf_t *buf, ares_dns_rr_t *rr, ARES_RR_PTR_DNAME); } -static ares_status_t ares_dns_parse_rr_hinfo(ares__buf_t *buf, - ares_dns_rr_t *rr, size_t rdlength) +static ares_status_t ares_dns_parse_rr_hinfo(ares_buf_t *buf, ares_dns_rr_t *rr, + size_t rdlength) { ares_status_t status; - size_t orig_len = ares__buf_len(buf); + size_t orig_len = ares_buf_len(buf); (void)rdlength; /* Not needed */ @@ -269,7 +270,7 @@ static ares_status_t ares_dns_parse_rr_hinfo(ares__buf_t *buf, return status; } -static ares_status_t ares_dns_parse_rr_mx(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_mx(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength) { ares_status_t status; @@ -287,18 +288,18 @@ static ares_status_t ares_dns_parse_rr_mx(ares__buf_t *buf, ares_dns_rr_t *rr, ARES_RR_MX_EXCHANGE); } -static ares_status_t ares_dns_parse_rr_txt(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_txt(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength) { return ares_dns_parse_and_set_dns_abin(buf, rdlength, rr, ARES_RR_TXT_DATA, ARES_FALSE); } -static ares_status_t ares_dns_parse_rr_sig(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_sig(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength) { ares_status_t status; - size_t orig_len = ares__buf_len(buf); + size_t orig_len = ares_buf_len(buf); size_t len; unsigned char *data; @@ -348,7 +349,7 @@ static ares_status_t ares_dns_parse_rr_sig(ares__buf_t *buf, ares_dns_rr_t *rr, return ARES_EBADRESP; } - status = ares__buf_fetch_bytes_dup(buf, len, ARES_FALSE, &data); + status = ares_buf_fetch_bytes_dup(buf, len, ARES_FALSE, &data); if (status != ARES_SUCCESS) { return status; } @@ -362,7 +363,7 @@ static ares_status_t ares_dns_parse_rr_sig(ares__buf_t *buf, ares_dns_rr_t *rr, return ARES_SUCCESS; } -static ares_status_t ares_dns_parse_rr_aaaa(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_aaaa(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength) { struct ares_in6_addr addr; @@ -370,7 +371,7 @@ static ares_status_t ares_dns_parse_rr_aaaa(ares__buf_t *buf, ares_dns_rr_t *rr, (void)rdlength; /* Not needed */ - status = ares__buf_fetch_bytes(buf, (unsigned char *)&addr, sizeof(addr)); + status = ares_buf_fetch_bytes(buf, (unsigned char *)&addr, sizeof(addr)); if (status != ARES_SUCCESS) { return status; } @@ -378,7 +379,7 @@ static ares_status_t ares_dns_parse_rr_aaaa(ares__buf_t *buf, ares_dns_rr_t *rr, return ares_dns_rr_set_addr6(rr, ARES_RR_AAAA_ADDR, &addr); } -static ares_status_t ares_dns_parse_rr_srv(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_srv(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength) { ares_status_t status; @@ -408,11 +409,11 @@ static ares_status_t ares_dns_parse_rr_srv(ares__buf_t *buf, ares_dns_rr_t *rr, ARES_RR_SRV_TARGET); } -static ares_status_t ares_dns_parse_rr_naptr(ares__buf_t *buf, - ares_dns_rr_t *rr, size_t rdlength) +static ares_status_t ares_dns_parse_rr_naptr(ares_buf_t *buf, ares_dns_rr_t *rr, + size_t rdlength) { ares_status_t status; - size_t orig_len = ares__buf_len(buf); + size_t orig_len = ares_buf_len(buf); /* ORDER */ status = ares_dns_parse_and_set_be16(buf, rr, ARES_RR_NAPTR_ORDER); @@ -455,13 +456,13 @@ static ares_status_t ares_dns_parse_rr_naptr(ares__buf_t *buf, ARES_RR_NAPTR_REPLACEMENT); } -static ares_status_t ares_dns_parse_rr_opt(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_opt(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength, unsigned short raw_class, unsigned int raw_ttl) { ares_status_t status; - size_t orig_len = ares__buf_len(buf); + size_t orig_len = ares_buf_len(buf); unsigned short rcode_high; status = ares_dns_rr_set_u16(rr, ARES_RR_OPT_UDP_SIZE, raw_class); @@ -493,19 +494,19 @@ static ares_status_t ares_dns_parse_rr_opt(ares__buf_t *buf, ares_dns_rr_t *rr, unsigned char *val = NULL; /* Fetch be16 option */ - status = ares__buf_fetch_be16(buf, &opt); + status = ares_buf_fetch_be16(buf, &opt); if (status != ARES_SUCCESS) { return status; } /* Fetch be16 length */ - status = ares__buf_fetch_be16(buf, &len); + status = ares_buf_fetch_be16(buf, &len); if (status != ARES_SUCCESS) { return status; } if (len) { - status = ares__buf_fetch_bytes_dup(buf, len, ARES_TRUE, &val); + status = ares_buf_fetch_bytes_dup(buf, len, ARES_TRUE, &val); if (status != ARES_SUCCESS) { return status; } @@ -520,11 +521,11 @@ static ares_status_t ares_dns_parse_rr_opt(ares__buf_t *buf, ares_dns_rr_t *rr, return ARES_SUCCESS; } -static ares_status_t ares_dns_parse_rr_tlsa(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_tlsa(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength) { ares_status_t status; - size_t orig_len = ares__buf_len(buf); + size_t orig_len = ares_buf_len(buf); size_t len; unsigned char *data; @@ -548,7 +549,7 @@ static ares_status_t ares_dns_parse_rr_tlsa(ares__buf_t *buf, ares_dns_rr_t *rr, return ARES_EBADRESP; } - status = ares__buf_fetch_bytes_dup(buf, len, ARES_FALSE, &data); + status = ares_buf_fetch_bytes_dup(buf, len, ARES_FALSE, &data); if (status != ARES_SUCCESS) { return status; } @@ -562,11 +563,11 @@ static ares_status_t ares_dns_parse_rr_tlsa(ares__buf_t *buf, ares_dns_rr_t *rr, return ARES_SUCCESS; } -static ares_status_t ares_dns_parse_rr_svcb(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_svcb(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength) { ares_status_t status; - size_t orig_len = ares__buf_len(buf); + size_t orig_len = ares_buf_len(buf); status = ares_dns_parse_and_set_be16(buf, rr, ARES_RR_SVCB_PRIORITY); if (status != ARES_SUCCESS) { @@ -586,19 +587,19 @@ static ares_status_t ares_dns_parse_rr_svcb(ares__buf_t *buf, ares_dns_rr_t *rr, unsigned char *val = NULL; /* Fetch be16 option */ - status = ares__buf_fetch_be16(buf, &opt); + status = ares_buf_fetch_be16(buf, &opt); if (status != ARES_SUCCESS) { return status; } /* Fetch be16 length */ - status = ares__buf_fetch_be16(buf, &len); + status = ares_buf_fetch_be16(buf, &len); if (status != ARES_SUCCESS) { return status; } if (len) { - status = ares__buf_fetch_bytes_dup(buf, len, ARES_TRUE, &val); + status = ares_buf_fetch_bytes_dup(buf, len, ARES_TRUE, &val); if (status != ARES_SUCCESS) { return status; } @@ -613,11 +614,11 @@ static ares_status_t ares_dns_parse_rr_svcb(ares__buf_t *buf, ares_dns_rr_t *rr, return ARES_SUCCESS; } -static ares_status_t ares_dns_parse_rr_https(ares__buf_t *buf, - ares_dns_rr_t *rr, size_t rdlength) +static ares_status_t ares_dns_parse_rr_https(ares_buf_t *buf, ares_dns_rr_t *rr, + size_t rdlength) { ares_status_t status; - size_t orig_len = ares__buf_len(buf); + size_t orig_len = ares_buf_len(buf); status = ares_dns_parse_and_set_be16(buf, rr, ARES_RR_HTTPS_PRIORITY); if (status != ARES_SUCCESS) { @@ -637,19 +638,19 @@ static ares_status_t ares_dns_parse_rr_https(ares__buf_t *buf, unsigned char *val = NULL; /* Fetch be16 option */ - status = ares__buf_fetch_be16(buf, &opt); + status = ares_buf_fetch_be16(buf, &opt); if (status != ARES_SUCCESS) { return status; } /* Fetch be16 length */ - status = ares__buf_fetch_be16(buf, &len); + status = ares_buf_fetch_be16(buf, &len); if (status != ARES_SUCCESS) { return status; } if (len) { - status = ares__buf_fetch_bytes_dup(buf, len, ARES_TRUE, &val); + status = ares_buf_fetch_bytes_dup(buf, len, ARES_TRUE, &val); if (status != ARES_SUCCESS) { return status; } @@ -664,12 +665,12 @@ static ares_status_t ares_dns_parse_rr_https(ares__buf_t *buf, return ARES_SUCCESS; } -static ares_status_t ares_dns_parse_rr_uri(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_uri(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength) { char *name = NULL; ares_status_t status; - size_t orig_len = ares__buf_len(buf); + size_t orig_len = ares_buf_len(buf); size_t remaining_len; /* PRIORITY */ @@ -693,12 +694,12 @@ static ares_status_t ares_dns_parse_rr_uri(ares__buf_t *buf, ares_dns_rr_t *rr, } /* NOTE: Not in DNS string format */ - status = ares__buf_fetch_str_dup(buf, remaining_len, &name); + status = ares_buf_fetch_str_dup(buf, remaining_len, &name); if (status != ARES_SUCCESS) { return status; } - if (!ares__str_isprint(name, remaining_len)) { + if (!ares_str_isprint(name, remaining_len)) { ares_free(name); return ARES_EBADRESP; } @@ -713,13 +714,13 @@ static ares_status_t ares_dns_parse_rr_uri(ares__buf_t *buf, ares_dns_rr_t *rr, return ARES_SUCCESS; } -static ares_status_t ares_dns_parse_rr_caa(ares__buf_t *buf, ares_dns_rr_t *rr, +static ares_status_t ares_dns_parse_rr_caa(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength) { unsigned char *data = NULL; size_t data_len = 0; ares_status_t status; - size_t orig_len = ares__buf_len(buf); + size_t orig_len = ares_buf_len(buf); /* CRITICAL */ status = ares_dns_parse_and_set_u8(buf, rr, ARES_RR_CAA_CRITICAL); @@ -741,7 +742,7 @@ static ares_status_t ares_dns_parse_rr_caa(ares__buf_t *buf, ares_dns_rr_t *rr, status = ARES_EBADRESP; return status; } - status = ares__buf_fetch_bytes_dup(buf, data_len, ARES_TRUE, &data); + status = ares_buf_fetch_bytes_dup(buf, data_len, ARES_TRUE, &data); if (status != ARES_SUCCESS) { return status; } @@ -756,7 +757,7 @@ static ares_status_t ares_dns_parse_rr_caa(ares__buf_t *buf, ares_dns_rr_t *rr, return ARES_SUCCESS; } -static ares_status_t ares_dns_parse_rr_raw_rr(ares__buf_t *buf, +static ares_status_t ares_dns_parse_rr_raw_rr(ares_buf_t *buf, ares_dns_rr_t *rr, size_t rdlength, unsigned short raw_type) @@ -768,7 +769,7 @@ static ares_status_t ares_dns_parse_rr_raw_rr(ares__buf_t *buf, return ARES_SUCCESS; } - status = ares__buf_fetch_bytes_dup(buf, rdlength, ARES_FALSE, &bytes); + status = ares_buf_fetch_bytes_dup(buf, rdlength, ARES_FALSE, &bytes); if (status != ARES_SUCCESS) { return status; } @@ -789,7 +790,7 @@ static ares_status_t ares_dns_parse_rr_raw_rr(ares__buf_t *buf, return ARES_SUCCESS; } -static ares_status_t ares_dns_parse_header(ares__buf_t *buf, unsigned int flags, +static ares_status_t ares_dns_parse_header(ares_buf_t *buf, unsigned int flags, ares_dns_record_t **dnsrec, unsigned short *qdcount, unsigned short *ancount, @@ -833,13 +834,13 @@ static ares_status_t ares_dns_parse_header(ares__buf_t *buf, unsigned int flags, */ /* ID */ - status = ares__buf_fetch_be16(buf, &id); + status = ares_buf_fetch_be16(buf, &id); if (status != ARES_SUCCESS) { goto fail; } /* Flags */ - status = ares__buf_fetch_be16(buf, &u16); + status = ares_buf_fetch_be16(buf, &u16); if (status != ARES_SUCCESS) { goto fail; } @@ -888,25 +889,25 @@ static ares_status_t ares_dns_parse_header(ares__buf_t *buf, unsigned int flags, rcode = u16 & 0xf; /* QDCOUNT */ - status = ares__buf_fetch_be16(buf, qdcount); + status = ares_buf_fetch_be16(buf, qdcount); if (status != ARES_SUCCESS) { goto fail; } /* ANCOUNT */ - status = ares__buf_fetch_be16(buf, ancount); + status = ares_buf_fetch_be16(buf, ancount); if (status != ARES_SUCCESS) { goto fail; } /* NSCOUNT */ - status = ares__buf_fetch_be16(buf, nscount); + status = ares_buf_fetch_be16(buf, nscount); if (status != ARES_SUCCESS) { goto fail; } /* ARCOUNT */ - status = ares__buf_fetch_be16(buf, arcount); + status = ares_buf_fetch_be16(buf, arcount); if (status != ARES_SUCCESS) { goto fail; } @@ -957,7 +958,7 @@ static ares_status_t ares_dns_parse_header(ares__buf_t *buf, unsigned int flags, } static ares_status_t - ares_dns_parse_rr_data(ares__buf_t *buf, size_t rdlength, ares_dns_rr_t *rr, + ares_dns_parse_rr_data(ares_buf_t *buf, size_t rdlength, ares_dns_rr_t *rr, ares_dns_rec_type_t type, unsigned short raw_type, unsigned short raw_class, unsigned int raw_ttl) { @@ -1006,7 +1007,7 @@ static ares_status_t return ARES_EFORMERR; } -static ares_status_t ares_dns_parse_qd(ares__buf_t *buf, +static ares_status_t ares_dns_parse_qd(ares_buf_t *buf, ares_dns_record_t *dnsrec) { char *name = NULL; @@ -1031,20 +1032,20 @@ static ares_status_t ares_dns_parse_qd(ares__buf_t *buf, */ /* Name */ - status = ares__dns_name_parse(buf, &name, ARES_FALSE); + status = ares_dns_name_parse(buf, &name, ARES_FALSE); if (status != ARES_SUCCESS) { goto done; } /* Type */ - status = ares__buf_fetch_be16(buf, &u16); + status = ares_buf_fetch_be16(buf, &u16); if (status != ARES_SUCCESS) { goto done; } type = u16; /* Class */ - status = ares__buf_fetch_be16(buf, &u16); + status = ares_buf_fetch_be16(buf, &u16); if (status != ARES_SUCCESS) { goto done; } @@ -1061,7 +1062,7 @@ static ares_status_t ares_dns_parse_qd(ares__buf_t *buf, return status; } -static ares_status_t ares_dns_parse_rr(ares__buf_t *buf, unsigned int flags, +static ares_status_t ares_dns_parse_rr(ares_buf_t *buf, unsigned int flags, ares_dns_section_t sect, ares_dns_record_t *dnsrec) { @@ -1102,13 +1103,13 @@ static ares_status_t ares_dns_parse_rr(ares__buf_t *buf, unsigned int flags, */ /* Name */ - status = ares__dns_name_parse(buf, &name, ARES_FALSE); + status = ares_dns_name_parse(buf, &name, ARES_FALSE); if (status != ARES_SUCCESS) { goto done; } /* Type */ - status = ares__buf_fetch_be16(buf, &u16); + status = ares_buf_fetch_be16(buf, &u16); if (status != ARES_SUCCESS) { goto done; } @@ -1116,20 +1117,20 @@ static ares_status_t ares_dns_parse_rr(ares__buf_t *buf, unsigned int flags, raw_type = u16; /* Only used for raw rr data */ /* Class */ - status = ares__buf_fetch_be16(buf, &u16); + status = ares_buf_fetch_be16(buf, &u16); if (status != ARES_SUCCESS) { goto done; } qclass = u16; /* TTL */ - status = ares__buf_fetch_be32(buf, &ttl); + status = ares_buf_fetch_be32(buf, &ttl); if (status != ARES_SUCCESS) { goto done; } /* Length */ - status = ares__buf_fetch_be16(buf, &u16); + status = ares_buf_fetch_be16(buf, &u16); if (status != ARES_SUCCESS) { goto done; } @@ -1139,7 +1140,7 @@ static ares_status_t ares_dns_parse_rr(ares__buf_t *buf, unsigned int flags, type = ARES_REC_TYPE_RAW_RR; } - namecomp = ares_dns_rec_type_allow_name_compression(type); + namecomp = ares_dns_rec_allow_name_comp(type); if (sect == ARES_SECTION_ANSWER && (flags & (namecomp ? ARES_DNS_PARSE_AN_BASE_RAW : ARES_DNS_PARSE_AN_EXT_RAW))) { @@ -1157,7 +1158,7 @@ static ares_status_t ares_dns_parse_rr(ares__buf_t *buf, unsigned int flags, } /* Pull into another buffer for safety */ - if (rdlength > ares__buf_len(buf)) { + if (rdlength > ares_buf_len(buf)) { status = ARES_EBADRESP; goto done; } @@ -1173,7 +1174,7 @@ static ares_status_t ares_dns_parse_rr(ares__buf_t *buf, unsigned int flags, /* Record the current remaining length in the buffer so we can tell how * much was processed */ - remaining_len = ares__buf_len(buf); + remaining_len = ares_buf_len(buf); /* Fill in the data for the rr */ status = ares_dns_parse_rr_data(buf, rdlength, rr, type, raw_type, @@ -1183,7 +1184,7 @@ static ares_status_t ares_dns_parse_rr(ares__buf_t *buf, unsigned int flags, } /* Determine how many bytes were processed */ - processed_len = remaining_len - ares__buf_len(buf); + processed_len = remaining_len - ares_buf_len(buf); /* If too many bytes were processed, error! */ if (processed_len > rdlength) { @@ -1194,7 +1195,7 @@ static ares_status_t ares_dns_parse_rr(ares__buf_t *buf, unsigned int flags, /* If too few bytes were processed, consume the unprocessed data for this * record as the parser may not have wanted/needed to use it */ if (processed_len < rdlength) { - ares__buf_consume(buf, rdlength - processed_len); + ares_buf_consume(buf, rdlength - processed_len); } @@ -1203,7 +1204,7 @@ static ares_status_t ares_dns_parse_rr(ares__buf_t *buf, unsigned int flags, return status; } -static ares_status_t ares_dns_parse_buf(ares__buf_t *buf, unsigned int flags, +static ares_status_t ares_dns_parse_buf(ares_buf_t *buf, unsigned int flags, ares_dns_record_t **dnsrec) { ares_status_t status; @@ -1218,7 +1219,7 @@ static ares_status_t ares_dns_parse_buf(ares__buf_t *buf, unsigned int flags, } /* Maximum DNS packet size is 64k, even over TCP */ - if (ares__buf_len(buf) > 0xFFFF) { + if (ares_buf_len(buf) > 0xFFFF) { return ARES_EFORMERR; } @@ -1309,20 +1310,20 @@ static ares_status_t ares_dns_parse_buf(ares__buf_t *buf, unsigned int flags, ares_status_t ares_dns_parse(const unsigned char *buf, size_t buf_len, unsigned int flags, ares_dns_record_t **dnsrec) { - ares__buf_t *parser = NULL; + ares_buf_t *parser = NULL; ares_status_t status; if (buf == NULL || buf_len == 0 || dnsrec == NULL) { return ARES_EFORMERR; } - parser = ares__buf_create_const(buf, buf_len); + parser = ares_buf_create_const(buf, buf_len); if (parser == NULL) { return ARES_ENOMEM; } status = ares_dns_parse_buf(parser, flags, dnsrec); - ares__buf_destroy(parser); + ares_buf_destroy(parser); return status; } diff --git a/deps/cares/src/lib/record/ares_dns_private.h b/deps/cares/src/lib/record/ares_dns_private.h index 5b86fed51f9851..e8fd600d1d2008 100644 --- a/deps/cares/src/lib/record/ares_dns_private.h +++ b/deps/cares/src/lib/record/ares_dns_private.h @@ -26,26 +26,26 @@ #ifndef __ARES_DNS_PRIVATE_H #define __ARES_DNS_PRIVATE_H -ares_status_t ares_dns_record_duplicate_ex(ares_dns_record_t **dest, - const ares_dns_record_t *src); -ares_bool_t ares_dns_rec_type_allow_name_compression(ares_dns_rec_type_t type); -ares_bool_t ares_dns_opcode_isvalid(ares_dns_opcode_t opcode); -ares_bool_t ares_dns_rcode_isvalid(ares_dns_rcode_t rcode); -ares_bool_t ares_dns_flags_arevalid(unsigned short flags); -ares_bool_t ares_dns_rec_type_isvalid(ares_dns_rec_type_t type, - ares_bool_t is_query); -ares_bool_t ares_dns_class_isvalid(ares_dns_class_t qclass, - ares_dns_rec_type_t type, - ares_bool_t is_query); -ares_bool_t ares_dns_section_isvalid(ares_dns_section_t sect); +ares_status_t ares_dns_record_duplicate_ex(ares_dns_record_t **dest, + const ares_dns_record_t *src); +ares_bool_t ares_dns_rec_allow_name_comp(ares_dns_rec_type_t type); +ares_bool_t ares_dns_opcode_isvalid(ares_dns_opcode_t opcode); +ares_bool_t ares_dns_rcode_isvalid(ares_dns_rcode_t rcode); +ares_bool_t ares_dns_flags_arevalid(unsigned short flags); +ares_bool_t ares_dns_rec_type_isvalid(ares_dns_rec_type_t type, + ares_bool_t is_query); +ares_bool_t ares_dns_class_isvalid(ares_dns_class_t qclass, + ares_dns_rec_type_t type, + ares_bool_t is_query); +ares_bool_t ares_dns_section_isvalid(ares_dns_section_t sect); ares_status_t ares_dns_rr_set_str_own(ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key, char *val); ares_status_t ares_dns_rr_set_bin_own(ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key, unsigned char *val, size_t len); -ares_status_t ares_dns_rr_set_abin_own(ares_dns_rr_t *dns_rr, - ares_dns_rr_key_t key, - ares__dns_multistring_t *strs); +ares_status_t ares_dns_rr_set_abin_own(ares_dns_rr_t *dns_rr, + ares_dns_rr_key_t key, + ares_dns_multistring_t *strs); ares_status_t ares_dns_rr_set_opt_own(ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key, unsigned short opt, unsigned char *val, size_t val_len); @@ -53,16 +53,16 @@ ares_status_t ares_dns_record_rr_prealloc(ares_dns_record_t *dnsrec, ares_dns_section_t sect, size_t cnt); ares_dns_rr_t *ares_dns_get_opt_rr(ares_dns_record_t *rec); const ares_dns_rr_t *ares_dns_get_opt_rr_const(const ares_dns_record_t *rec); -void ares_dns_record_write_ttl_decrement(ares_dns_record_t *dnsrec, - unsigned int ttl_decrement); +void ares_dns_record_ttl_decrement(ares_dns_record_t *dnsrec, + unsigned int ttl_decrement); /* Same as ares_dns_write() but appends to an existing buffer object */ -ares_status_t ares_dns_write_buf(const ares_dns_record_t *dnsrec, - ares__buf_t *buf); +ares_status_t ares_dns_write_buf(const ares_dns_record_t *dnsrec, + ares_buf_t *buf); /* Same as ares_dns_write_buf(), but prepends a 16bit length */ -ares_status_t ares_dns_write_buf_tcp(const ares_dns_record_t *dnsrec, - ares__buf_t *buf); +ares_status_t ares_dns_write_buf_tcp(const ares_dns_record_t *dnsrec, + ares_buf_t *buf); /*! Create a DNS record object for a query. The arguments are the same as * those for ares_create_query(). @@ -99,15 +99,15 @@ struct ares_dns_qd { typedef struct { struct in_addr addr; -} ares__dns_a_t; +} ares_dns_a_t; typedef struct { char *nsdname; -} ares__dns_ns_t; +} ares_dns_ns_t; typedef struct { char *cname; -} ares__dns_cname_t; +} ares_dns_cname_t; typedef struct { char *mname; @@ -117,25 +117,25 @@ typedef struct { unsigned int retry; unsigned int expire; unsigned int minimum; -} ares__dns_soa_t; +} ares_dns_soa_t; typedef struct { char *dname; -} ares__dns_ptr_t; +} ares_dns_ptr_t; typedef struct { char *cpu; char *os; -} ares__dns_hinfo_t; +} ares_dns_hinfo_t; typedef struct { unsigned short preference; char *exchange; -} ares__dns_mx_t; +} ares_dns_mx_t; typedef struct { - ares__dns_multistring_t *strs; -} ares__dns_txt_t; + ares_dns_multistring_t *strs; +} ares_dns_txt_t; typedef struct { unsigned short type_covered; @@ -148,18 +148,18 @@ typedef struct { char *signers_name; unsigned char *signature; size_t signature_len; -} ares__dns_sig_t; +} ares_dns_sig_t; typedef struct { struct ares_in6_addr addr; -} ares__dns_aaaa_t; +} ares_dns_aaaa_t; typedef struct { unsigned short priority; unsigned short weight; unsigned short port; char *target; -} ares__dns_srv_t; +} ares_dns_srv_t; typedef struct { unsigned short order; @@ -168,21 +168,21 @@ typedef struct { char *services; char *regexp; char *replacement; -} ares__dns_naptr_t; +} ares_dns_naptr_t; typedef struct { unsigned short opt; unsigned char *val; size_t val_len; -} ares__dns_optval_t; +} ares_dns_optval_t; typedef struct { unsigned short udp_size; /*!< taken from class */ unsigned char version; /*!< taken from bits 8-16 of ttl */ unsigned short flags; /*!< Flags, remaining 16 bits, though only * 1 currently defined */ - ares__array_t *options; /*!< Type is ares__dns_optval_t */ -} ares__dns_opt_t; + ares_array_t *options; /*!< Type is ares_dns_optval_t */ +} ares_dns_opt_t; typedef struct { unsigned char cert_usage; @@ -190,26 +190,26 @@ typedef struct { unsigned char match; unsigned char *data; size_t data_len; -} ares__dns_tlsa_t; +} ares_dns_tlsa_t; typedef struct { unsigned short priority; char *target; - ares__array_t *params; /*!< Type is ares__dns_optval_t */ -} ares__dns_svcb_t; + ares_array_t *params; /*!< Type is ares_dns_optval_t */ +} ares_dns_svcb_t; typedef struct { unsigned short priority; unsigned short weight; char *target; -} ares__dns_uri_t; +} ares_dns_uri_t; typedef struct { unsigned char critical; char *tag; unsigned char *value; size_t value_len; -} ares__dns_caa_t; +} ares_dns_caa_t; /*! Raw, unparsed RR data */ typedef struct { @@ -217,7 +217,7 @@ typedef struct { * of those values since it wasn't parsed */ unsigned char *data; /*!< Raw RR data */ size_t length; /*!< Length of raw RR data */ -} ares__dns_raw_rr_t; +} ares_dns_raw_rr_t; /*! DNS RR data structure */ struct ares_dns_rr { @@ -228,25 +228,25 @@ struct ares_dns_rr { unsigned int ttl; union { - ares__dns_a_t a; - ares__dns_ns_t ns; - ares__dns_cname_t cname; - ares__dns_soa_t soa; - ares__dns_ptr_t ptr; - ares__dns_hinfo_t hinfo; - ares__dns_mx_t mx; - ares__dns_txt_t txt; - ares__dns_sig_t sig; - ares__dns_aaaa_t aaaa; - ares__dns_srv_t srv; - ares__dns_naptr_t naptr; - ares__dns_opt_t opt; - ares__dns_tlsa_t tlsa; - ares__dns_svcb_t svcb; - ares__dns_svcb_t https; /*!< https is a type of svcb, so this is right */ - ares__dns_uri_t uri; - ares__dns_caa_t caa; - ares__dns_raw_rr_t raw_rr; + ares_dns_a_t a; + ares_dns_ns_t ns; + ares_dns_cname_t cname; + ares_dns_soa_t soa; + ares_dns_ptr_t ptr; + ares_dns_hinfo_t hinfo; + ares_dns_mx_t mx; + ares_dns_txt_t txt; + ares_dns_sig_t sig; + ares_dns_aaaa_t aaaa; + ares_dns_srv_t srv; + ares_dns_naptr_t naptr; + ares_dns_opt_t opt; + ares_dns_tlsa_t tlsa; + ares_dns_svcb_t svcb; + ares_dns_svcb_t https; /*!< https is a type of svcb, so this is right */ + ares_dns_uri_t uri; + ares_dns_caa_t caa; + ares_dns_raw_rr_t raw_rr; } r; }; @@ -264,10 +264,10 @@ struct ares_dns_record { * the ttl of any resource records by * this amount. Used for cache */ - ares__array_t *qd; /*!< Type is ares_dns_qd_t */ - ares__array_t *an; /*!< Type is ares_dns_rr_t */ - ares__array_t *ns; /*!< Type is ares_dns_rr_t */ - ares__array_t *ar; /*!< Type is ares_dns_rr_t */ + ares_array_t *qd; /*!< Type is ares_dns_qd_t */ + ares_array_t *an; /*!< Type is ares_dns_rr_t */ + ares_array_t *ns; /*!< Type is ares_dns_rr_t */ + ares_array_t *ar; /*!< Type is ares_dns_rr_t */ }; #endif diff --git a/deps/cares/src/lib/record/ares_dns_record.c b/deps/cares/src/lib/record/ares_dns_record.c index 147049490943a6..ec0dfbd13c49f3 100644 --- a/deps/cares/src/lib/record/ares_dns_record.c +++ b/deps/cares/src/lib/record/ares_dns_record.c @@ -29,7 +29,7 @@ # include #endif -static void ares__dns_rr_free(ares_dns_rr_t *rr); +static void ares_dns_rr_free(ares_dns_rr_t *rr); static void ares_dns_qd_free_cb(void *arg) { @@ -46,7 +46,7 @@ static void ares_dns_rr_free_cb(void *arg) if (rr == NULL) { return; } - ares__dns_rr_free(rr); + ares_dns_rr_free(rr); } ares_status_t ares_dns_record_create(ares_dns_record_t **dnsrec, @@ -74,14 +74,10 @@ ares_status_t ares_dns_record_create(ares_dns_record_t **dnsrec, (*dnsrec)->flags = flags; (*dnsrec)->opcode = opcode; (*dnsrec)->rcode = rcode; - (*dnsrec)->qd = - ares__array_create(sizeof(ares_dns_qd_t), ares_dns_qd_free_cb); - (*dnsrec)->an = - ares__array_create(sizeof(ares_dns_rr_t), ares_dns_rr_free_cb); - (*dnsrec)->ns = - ares__array_create(sizeof(ares_dns_rr_t), ares_dns_rr_free_cb); - (*dnsrec)->ar = - ares__array_create(sizeof(ares_dns_rr_t), ares_dns_rr_free_cb); + (*dnsrec)->qd = ares_array_create(sizeof(ares_dns_qd_t), ares_dns_qd_free_cb); + (*dnsrec)->an = ares_array_create(sizeof(ares_dns_rr_t), ares_dns_rr_free_cb); + (*dnsrec)->ns = ares_array_create(sizeof(ares_dns_rr_t), ares_dns_rr_free_cb); + (*dnsrec)->ar = ares_array_create(sizeof(ares_dns_rr_t), ares_dns_rr_free_cb); if ((*dnsrec)->qd == NULL || (*dnsrec)->an == NULL || (*dnsrec)->ns == NULL || (*dnsrec)->ar == NULL) { @@ -134,7 +130,7 @@ ares_dns_rcode_t ares_dns_record_get_rcode(const ares_dns_record_t *dnsrec) return dnsrec->rcode; } -static void ares__dns_rr_free(ares_dns_rr_t *rr) +static void ares_dns_rr_free(ares_dns_rr_t *rr) { ares_free(rr->name); @@ -172,7 +168,7 @@ static void ares__dns_rr_free(ares_dns_rr_t *rr) break; case ARES_REC_TYPE_TXT: - ares__dns_multistring_destroy(rr->r.txt.strs); + ares_dns_multistring_destroy(rr->r.txt.strs); break; case ARES_REC_TYPE_SIG: @@ -192,7 +188,7 @@ static void ares__dns_rr_free(ares_dns_rr_t *rr) break; case ARES_REC_TYPE_OPT: - ares__array_destroy(rr->r.opt.options); + ares_array_destroy(rr->r.opt.options); break; case ARES_REC_TYPE_TLSA: @@ -201,12 +197,12 @@ static void ares__dns_rr_free(ares_dns_rr_t *rr) case ARES_REC_TYPE_SVCB: ares_free(rr->r.svcb.target); - ares__array_destroy(rr->r.svcb.params); + ares_array_destroy(rr->r.svcb.params); break; case ARES_REC_TYPE_HTTPS: ares_free(rr->r.https.target); - ares__array_destroy(rr->r.https.params); + ares_array_destroy(rr->r.https.params); break; case ARES_REC_TYPE_URI: @@ -231,16 +227,16 @@ void ares_dns_record_destroy(ares_dns_record_t *dnsrec) } /* Free questions */ - ares__array_destroy(dnsrec->qd); + ares_array_destroy(dnsrec->qd); /* Free answers */ - ares__array_destroy(dnsrec->an); + ares_array_destroy(dnsrec->an); /* Free authority */ - ares__array_destroy(dnsrec->ns); + ares_array_destroy(dnsrec->ns); /* Free additional */ - ares__array_destroy(dnsrec->ar); + ares_array_destroy(dnsrec->ar); ares_free(dnsrec); } @@ -250,7 +246,7 @@ size_t ares_dns_record_query_cnt(const ares_dns_record_t *dnsrec) if (dnsrec == NULL) { return 0; } - return ares__array_len(dnsrec->qd); + return ares_array_len(dnsrec->qd); } ares_status_t ares_dns_record_query_add(ares_dns_record_t *dnsrec, @@ -268,15 +264,15 @@ ares_status_t ares_dns_record_query_add(ares_dns_record_t *dnsrec, return ARES_EFORMERR; } - idx = ares__array_len(dnsrec->qd); - status = ares__array_insert_last((void **)&qd, dnsrec->qd); + idx = ares_array_len(dnsrec->qd); + status = ares_array_insert_last((void **)&qd, dnsrec->qd); if (status != ARES_SUCCESS) { return status; } qd->name = ares_strdup(name); if (qd->name == NULL) { - ares__array_remove_at(dnsrec->qd, idx); + ares_array_remove_at(dnsrec->qd, idx); return ARES_ENOMEM; } qd->qtype = qtype; @@ -290,11 +286,11 @@ ares_status_t ares_dns_record_query_set_name(ares_dns_record_t *dnsrec, char *orig_name = NULL; ares_dns_qd_t *qd; - if (dnsrec == NULL || idx >= ares__array_len(dnsrec->qd) || name == NULL) { + if (dnsrec == NULL || idx >= ares_array_len(dnsrec->qd) || name == NULL) { return ARES_EFORMERR; } - qd = ares__array_at(dnsrec->qd, idx); + qd = ares_array_at(dnsrec->qd, idx); orig_name = qd->name; qd->name = ares_strdup(name); @@ -313,12 +309,12 @@ ares_status_t ares_dns_record_query_set_type(ares_dns_record_t *dnsrec, { ares_dns_qd_t *qd; - if (dnsrec == NULL || idx >= ares__array_len(dnsrec->qd) || + if (dnsrec == NULL || idx >= ares_array_len(dnsrec->qd) || !ares_dns_rec_type_isvalid(qtype, ARES_TRUE)) { return ARES_EFORMERR; } - qd = ares__array_at(dnsrec->qd, idx); + qd = ares_array_at(dnsrec->qd, idx); qd->qtype = qtype; return ARES_SUCCESS; @@ -330,11 +326,11 @@ ares_status_t ares_dns_record_query_get(const ares_dns_record_t *dnsrec, ares_dns_class_t *qclass) { const ares_dns_qd_t *qd; - if (dnsrec == NULL || idx >= ares__array_len(dnsrec->qd)) { + if (dnsrec == NULL || idx >= ares_array_len(dnsrec->qd)) { return ARES_EFORMERR; } - qd = ares__array_at(dnsrec->qd, idx); + qd = ares_array_at(dnsrec->qd, idx); if (name != NULL) { *name = qd->name; } @@ -359,11 +355,11 @@ size_t ares_dns_record_rr_cnt(const ares_dns_record_t *dnsrec, switch (sect) { case ARES_SECTION_ANSWER: - return ares__array_len(dnsrec->an); + return ares_array_len(dnsrec->an); case ARES_SECTION_AUTHORITY: - return ares__array_len(dnsrec->ns); + return ares_array_len(dnsrec->ns); case ARES_SECTION_ADDITIONAL: - return ares__array_len(dnsrec->ar); + return ares_array_len(dnsrec->ar); } return 0; /* LCOV_EXCL_LINE: DefensiveCoding */ @@ -372,7 +368,7 @@ size_t ares_dns_record_rr_cnt(const ares_dns_record_t *dnsrec, ares_status_t ares_dns_record_rr_prealloc(ares_dns_record_t *dnsrec, ares_dns_section_t sect, size_t cnt) { - ares__array_t *arr = NULL; + ares_array_t *arr = NULL; if (dnsrec == NULL || !ares_dns_section_isvalid(sect)) { return ARES_EFORMERR; @@ -390,11 +386,11 @@ ares_status_t ares_dns_record_rr_prealloc(ares_dns_record_t *dnsrec, break; } - if (cnt < ares__array_len(arr)) { + if (cnt < ares_array_len(arr)) { return ARES_EFORMERR; } - return ares__array_set_size(arr, cnt); + return ares_array_set_size(arr, cnt); } ares_status_t ares_dns_record_rr_add(ares_dns_rr_t **rr_out, @@ -404,7 +400,7 @@ ares_status_t ares_dns_record_rr_add(ares_dns_rr_t **rr_out, ares_dns_class_t rclass, unsigned int ttl) { ares_dns_rr_t *rr = NULL; - ares__array_t *arr = NULL; + ares_array_t *arr = NULL; ares_status_t status; size_t idx; @@ -429,15 +425,15 @@ ares_status_t ares_dns_record_rr_add(ares_dns_rr_t **rr_out, break; } - idx = ares__array_len(arr); - status = ares__array_insert_last((void **)&rr, arr); + idx = ares_array_len(arr); + status = ares_array_insert_last((void **)&rr, arr); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } rr->name = ares_strdup(name); if (rr->name == NULL) { - ares__array_remove_at(arr, idx); + ares_array_remove_at(arr, idx); return ARES_ENOMEM; } @@ -454,7 +450,7 @@ ares_status_t ares_dns_record_rr_add(ares_dns_rr_t **rr_out, ares_status_t ares_dns_record_rr_del(ares_dns_record_t *dnsrec, ares_dns_section_t sect, size_t idx) { - ares__array_t *arr = NULL; + ares_array_t *arr = NULL; if (dnsrec == NULL || !ares_dns_section_isvalid(sect)) { return ARES_EFORMERR; @@ -472,13 +468,13 @@ ares_status_t ares_dns_record_rr_del(ares_dns_record_t *dnsrec, break; } - return ares__array_remove_at(arr, idx); + return ares_array_remove_at(arr, idx); } ares_dns_rr_t *ares_dns_record_rr_get(ares_dns_record_t *dnsrec, ares_dns_section_t sect, size_t idx) { - ares__array_t *arr = NULL; + ares_array_t *arr = NULL; if (dnsrec == NULL || !ares_dns_section_isvalid(sect)) { return NULL; @@ -496,7 +492,7 @@ ares_dns_rr_t *ares_dns_record_rr_get(ares_dns_record_t *dnsrec, break; } - return ares__array_at(arr, idx); + return ares_array_at(arr, idx); } const ares_dns_rr_t * @@ -849,14 +845,14 @@ const unsigned char *ares_dns_rr_get_bin(const ares_dns_rr_t *dns_rr, /* Array of strings, return concatenated version */ if (ares_dns_rr_key_datatype(key) == ARES_DATATYPE_ABINP) { - ares__dns_multistring_t * const *strs = + ares_dns_multistring_t * const *strs = ares_dns_rr_data_ptr_const(dns_rr, key, NULL); if (strs == NULL) { return NULL; } - return ares__dns_multistring_get_combined(*strs, len); + return ares_dns_multistring_combined(*strs, len); } /* Not a multi-string, just straight binary data */ @@ -877,7 +873,7 @@ const unsigned char *ares_dns_rr_get_bin(const ares_dns_rr_t *dns_rr, size_t ares_dns_rr_get_abin_cnt(const ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key) { - ares__dns_multistring_t * const *strs; + ares_dns_multistring_t * const *strs; if (ares_dns_rr_key_datatype(key) != ARES_DATATYPE_ABINP) { return 0; @@ -888,14 +884,14 @@ size_t ares_dns_rr_get_abin_cnt(const ares_dns_rr_t *dns_rr, return 0; } - return ares__dns_multistring_cnt(*strs); + return ares_dns_multistring_cnt(*strs); } const unsigned char *ares_dns_rr_get_abin(const ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key, size_t idx, size_t *len) { - ares__dns_multistring_t * const *strs; + ares_dns_multistring_t * const *strs; if (ares_dns_rr_key_datatype(key) != ARES_DATATYPE_ABINP) { return NULL; @@ -906,13 +902,13 @@ const unsigned char *ares_dns_rr_get_abin(const ares_dns_rr_t *dns_rr, return NULL; } - return ares__dns_multistring_get(*strs, idx, len); + return ares_dns_multistring_get(*strs, idx, len); } ares_status_t ares_dns_rr_del_abin(ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key, size_t idx) { - ares__dns_multistring_t **strs; + ares_dns_multistring_t **strs; if (ares_dns_rr_key_datatype(key) != ARES_DATATYPE_ABINP) { return ARES_EFORMERR; @@ -923,7 +919,7 @@ ares_status_t ares_dns_rr_del_abin(ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key, return ARES_EFORMERR; } - return ares__dns_multistring_del(*strs, idx); + return ares_dns_multistring_del(*strs, idx); } ares_status_t ares_dns_rr_add_abin(ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key, @@ -933,9 +929,9 @@ ares_status_t ares_dns_rr_add_abin(ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key, ares_dns_datatype_t datatype = ares_dns_rr_key_datatype(key); ares_bool_t is_nullterm = (datatype == ARES_DATATYPE_ABINP) ? ARES_TRUE : ARES_FALSE; - size_t alloclen = is_nullterm ? len + 1 : len; - unsigned char *temp; - ares__dns_multistring_t **strs; + size_t alloclen = is_nullterm ? len + 1 : len; + unsigned char *temp; + ares_dns_multistring_t **strs; if (ares_dns_rr_key_datatype(key) != ARES_DATATYPE_ABINP) { return ARES_EFORMERR; @@ -947,7 +943,7 @@ ares_status_t ares_dns_rr_add_abin(ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key, } if (*strs == NULL) { - *strs = ares__dns_multistring_create(); + *strs = ares_dns_multistring_create(); if (*strs == NULL) { return ARES_ENOMEM; } @@ -965,7 +961,7 @@ ares_status_t ares_dns_rr_add_abin(ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key, temp[len] = 0; } - status = ares__dns_multistring_add_own(*strs, temp, len); + status = ares_dns_multistring_add_own(*strs, temp, len); if (status != ARES_SUCCESS) { ares_free(temp); } @@ -994,7 +990,7 @@ const char *ares_dns_rr_get_str(const ares_dns_rr_t *dns_rr, size_t ares_dns_rr_get_opt_cnt(const ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key) { - ares__array_t * const *opts; + ares_array_t * const *opts; if (ares_dns_rr_key_datatype(key) != ARES_DATATYPE_OPT) { return 0; @@ -1005,15 +1001,15 @@ size_t ares_dns_rr_get_opt_cnt(const ares_dns_rr_t *dns_rr, return 0; } - return ares__array_len(*opts); + return ares_array_len(*opts); } 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__array_t * const *opts; - const ares__dns_optval_t *opt; + ares_array_t * const *opts; + const ares_dns_optval_t *opt; if (val) { *val = NULL; @@ -1031,7 +1027,7 @@ unsigned short ares_dns_rr_get_opt(const ares_dns_rr_t *dns_rr, return 65535; } - opt = ares__array_at(*opts, idx); + opt = ares_array_at(*opts, idx); if (opt == NULL) { return 65535; } @@ -1050,10 +1046,10 @@ 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) { - ares__array_t * const *opts; - size_t i; - size_t cnt; - const ares__dns_optval_t *optptr = NULL; + ares_array_t * const *opts; + size_t i; + size_t cnt; + const ares_dns_optval_t *optptr = NULL; if (val) { *val = NULL; @@ -1071,9 +1067,9 @@ ares_bool_t ares_dns_rr_get_opt_byid(const ares_dns_rr_t *dns_rr, return ARES_FALSE; } - cnt = ares__array_len(*opts); + cnt = ares_array_len(*opts); for (i = 0; i < cnt; i++) { - optptr = ares__array_at(*opts, i); + optptr = ares_array_at(*opts, i); if (optptr == NULL) { return ARES_FALSE; } @@ -1200,22 +1196,22 @@ ares_status_t ares_dns_rr_set_bin_own(ares_dns_rr_t *dns_rr, } if (ares_dns_rr_key_datatype(key) == ARES_DATATYPE_ABINP) { - ares__dns_multistring_t **strs = ares_dns_rr_data_ptr(dns_rr, key, NULL); + ares_dns_multistring_t **strs = ares_dns_rr_data_ptr(dns_rr, key, NULL); if (strs == NULL) { return ARES_EFORMERR; } if (*strs == NULL) { - *strs = ares__dns_multistring_create(); + *strs = ares_dns_multistring_create(); if (*strs == NULL) { return ARES_ENOMEM; } } /* Clear all existing entries as this is an override */ - ares__dns_multistring_clear(*strs); + ares_dns_multistring_clear(*strs); - return ares__dns_multistring_add_own(*strs, val, len); + return ares_dns_multistring_add_own(*strs, val, len); } bin = ares_dns_rr_data_ptr(dns_rr, key, &bin_len); @@ -1307,11 +1303,11 @@ ares_status_t ares_dns_rr_set_str(ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key, return status; } -ares_status_t ares_dns_rr_set_abin_own(ares_dns_rr_t *dns_rr, - ares_dns_rr_key_t key, - ares__dns_multistring_t *strs) +ares_status_t ares_dns_rr_set_abin_own(ares_dns_rr_t *dns_rr, + ares_dns_rr_key_t key, + ares_dns_multistring_t *strs) { - ares__dns_multistring_t **strs_ptr; + ares_dns_multistring_t **strs_ptr; if (ares_dns_rr_key_datatype(key) != ARES_DATATYPE_ABINP) { return ARES_EFORMERR; @@ -1323,16 +1319,16 @@ ares_status_t ares_dns_rr_set_abin_own(ares_dns_rr_t *dns_rr, } if (*strs_ptr != NULL) { - ares__dns_multistring_destroy(*strs_ptr); + ares_dns_multistring_destroy(*strs_ptr); } *strs_ptr = strs; return ARES_SUCCESS; } -static void ares__dns_opt_free_cb(void *arg) +static void ares_dns_opt_free_cb(void *arg) { - ares__dns_optval_t *opt = arg; + ares_dns_optval_t *opt = arg; if (opt == NULL) { return; } @@ -1343,11 +1339,11 @@ ares_status_t ares_dns_rr_set_opt_own(ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key, unsigned short opt, unsigned char *val, size_t val_len) { - ares__array_t **options; - ares__dns_optval_t *optptr = NULL; - size_t idx; - size_t cnt; - ares_status_t status; + ares_array_t **options; + ares_dns_optval_t *optptr = NULL; + size_t idx; + size_t cnt; + ares_status_t status; if (ares_dns_rr_key_datatype(key) != ARES_DATATYPE_OPT) { return ARES_EFORMERR; @@ -1360,15 +1356,15 @@ ares_status_t ares_dns_rr_set_opt_own(ares_dns_rr_t *dns_rr, if (*options == NULL) { *options = - ares__array_create(sizeof(ares__dns_optval_t), ares__dns_opt_free_cb); + ares_array_create(sizeof(ares_dns_optval_t), ares_dns_opt_free_cb); } if (*options == NULL) { return ARES_ENOMEM; } - cnt = ares__array_len(*options); + cnt = ares_array_len(*options); for (idx = 0; idx < cnt; idx++) { - optptr = ares__array_at(*options, idx); + optptr = ares_array_at(*options, idx); if (optptr == NULL) { return ARES_EFORMERR; } @@ -1382,7 +1378,7 @@ ares_status_t ares_dns_rr_set_opt_own(ares_dns_rr_t *dns_rr, goto done; } - status = ares__array_insert_last((void **)&optptr, *options); + status = ares_array_insert_last((void **)&optptr, *options); if (status != ARES_SUCCESS) { return status; } @@ -1424,10 +1420,10 @@ ares_status_t ares_dns_rr_del_opt_byid(ares_dns_rr_t *dns_rr, ares_dns_rr_key_t key, unsigned short opt) { - ares__array_t **options; - const ares__dns_optval_t *optptr; - size_t idx; - size_t cnt; + ares_array_t **options; + const ares_dns_optval_t *optptr; + size_t idx; + size_t cnt; if (ares_dns_rr_key_datatype(key) != ARES_DATATYPE_OPT) { return ARES_EFORMERR; @@ -1443,14 +1439,14 @@ ares_status_t ares_dns_rr_del_opt_byid(ares_dns_rr_t *dns_rr, return ARES_SUCCESS; } - cnt = ares__array_len(*options); + cnt = ares_array_len(*options); for (idx = 0; idx < cnt; idx++) { - optptr = ares__array_at_const(*options, idx); + optptr = ares_array_at_const(*options, idx); if (optptr == NULL) { return ARES_ENOTFOUND; } if (optptr->opt == opt) { - return ares__array_remove_at(*options, idx); + return ares_array_remove_at(*options, idx); } } @@ -1459,7 +1455,7 @@ ares_status_t ares_dns_rr_del_opt_byid(ares_dns_rr_t *dns_rr, char *ares_dns_addr_to_ptr(const struct ares_addr *addr) { - ares__buf_t *buf = NULL; + ares_buf_t *buf = NULL; const unsigned char *ptr = NULL; size_t ptr_len = 0; size_t i; @@ -1470,7 +1466,7 @@ char *ares_dns_addr_to_ptr(const struct ares_addr *addr) goto fail; } - buf = ares__buf_create(); + buf = ares_buf_create(); if (buf == NULL) { goto fail; } @@ -1485,47 +1481,47 @@ char *ares_dns_addr_to_ptr(const struct ares_addr *addr) for (i = ptr_len; i > 0; i--) { if (addr->family == AF_INET) { - status = ares__buf_append_num_dec(buf, (size_t)ptr[i - 1], 0); + status = ares_buf_append_num_dec(buf, (size_t)ptr[i - 1], 0); } else { unsigned char c; c = ptr[i - 1] & 0xF; - status = ares__buf_append_byte(buf, hexbytes[c]); + status = ares_buf_append_byte(buf, hexbytes[c]); if (status != ARES_SUCCESS) { goto fail; } - status = ares__buf_append_byte(buf, '.'); + status = ares_buf_append_byte(buf, '.'); if (status != ARES_SUCCESS) { goto fail; } c = (ptr[i - 1] >> 4) & 0xF; - status = ares__buf_append_byte(buf, hexbytes[c]); + status = ares_buf_append_byte(buf, hexbytes[c]); } if (status != ARES_SUCCESS) { goto fail; } - status = ares__buf_append_byte(buf, '.'); + status = ares_buf_append_byte(buf, '.'); if (status != ARES_SUCCESS) { goto fail; } } if (addr->family == AF_INET) { - status = ares__buf_append(buf, (const unsigned char *)"in-addr.arpa", 12); + status = ares_buf_append(buf, (const unsigned char *)"in-addr.arpa", 12); } else { - status = ares__buf_append(buf, (const unsigned char *)"ip6.arpa", 8); + status = ares_buf_append(buf, (const unsigned char *)"ip6.arpa", 8); } if (status != ARES_SUCCESS) { goto fail; } - return ares__buf_finish_str(buf, NULL); + return ares_buf_finish_str(buf, NULL); fail: - ares__buf_destroy(buf); + ares_buf_destroy(buf); return NULL; } @@ -1575,7 +1571,7 @@ ares_status_t *dnsrec = NULL; /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN */ - if (ares__is_onion_domain(name)) { + if (ares_is_onion_domain(name)) { status = ARES_ENOTFOUND; goto done; } diff --git a/deps/cares/src/lib/record/ares_dns_write.c b/deps/cares/src/lib/record/ares_dns_write.c index 8a3addd9f01b53..549017ffbc1768 100644 --- a/deps/cares/src/lib/record/ares_dns_write.c +++ b/deps/cares/src/lib/record/ares_dns_write.c @@ -31,7 +31,7 @@ static ares_status_t ares_dns_write_header(const ares_dns_record_t *dnsrec, - ares__buf_t *buf) + ares_buf_t *buf) { unsigned short u16; unsigned short opcode; @@ -40,7 +40,7 @@ static ares_status_t ares_dns_write_header(const ares_dns_record_t *dnsrec, ares_status_t status; /* ID */ - status = ares__buf_append_be16(buf, dnsrec->id); + status = ares_buf_append_be16(buf, dnsrec->id); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -99,35 +99,35 @@ static ares_status_t ares_dns_write_header(const ares_dns_record_t *dnsrec, } u16 |= rcode; - status = ares__buf_append_be16(buf, u16); + status = ares_buf_append_be16(buf, u16); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* QDCOUNT */ - status = ares__buf_append_be16( + status = ares_buf_append_be16( buf, (unsigned short)ares_dns_record_query_cnt(dnsrec)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* ANCOUNT */ - status = ares__buf_append_be16( + status = ares_buf_append_be16( buf, (unsigned short)ares_dns_record_rr_cnt(dnsrec, ARES_SECTION_ANSWER)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* NSCOUNT */ - status = ares__buf_append_be16(buf, (unsigned short)ares_dns_record_rr_cnt( - dnsrec, ARES_SECTION_AUTHORITY)); + status = ares_buf_append_be16(buf, (unsigned short)ares_dns_record_rr_cnt( + dnsrec, ARES_SECTION_AUTHORITY)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* ARCOUNT */ - status = ares__buf_append_be16(buf, (unsigned short)ares_dns_record_rr_cnt( - dnsrec, ARES_SECTION_ADDITIONAL)); + status = ares_buf_append_be16(buf, (unsigned short)ares_dns_record_rr_cnt( + dnsrec, ARES_SECTION_ADDITIONAL)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -136,8 +136,8 @@ static ares_status_t ares_dns_write_header(const ares_dns_record_t *dnsrec, } static ares_status_t ares_dns_write_questions(const ares_dns_record_t *dnsrec, - ares__llist_t **namelist, - ares__buf_t *buf) + ares_llist_t **namelist, + ares_buf_t *buf) { size_t i; @@ -153,19 +153,19 @@ static ares_status_t ares_dns_write_questions(const ares_dns_record_t *dnsrec, } /* Name */ - status = ares__dns_name_write(buf, namelist, ARES_TRUE, name); + status = ares_dns_name_write(buf, namelist, ARES_TRUE, name); if (status != ARES_SUCCESS) { return status; } /* Type */ - status = ares__buf_append_be16(buf, (unsigned short)qtype); + status = ares_buf_append_be16(buf, (unsigned short)qtype); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* Class */ - status = ares__buf_append_be16(buf, (unsigned short)qclass); + status = ares_buf_append_be16(buf, (unsigned short)qclass); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -174,9 +174,9 @@ static ares_status_t ares_dns_write_questions(const ares_dns_record_t *dnsrec, return ARES_SUCCESS; } -static ares_status_t ares_dns_write_rr_name(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_name(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist, + ares_llist_t **namelist, ares_bool_t validate_hostname, ares_dns_rr_key_t key) { @@ -187,10 +187,10 @@ static ares_status_t ares_dns_write_rr_name(ares__buf_t *buf, return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ } - return ares__dns_name_write(buf, namelist, validate_hostname, name); + return ares_dns_name_write(buf, namelist, validate_hostname, name); } -static ares_status_t ares_dns_write_rr_str(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_str(ares_buf_t *buf, const ares_dns_rr_t *rr, ares_dns_rr_key_t key) { @@ -209,7 +209,7 @@ static ares_status_t ares_dns_write_rr_str(ares__buf_t *buf, } /* Write 1 byte length */ - status = ares__buf_append_byte(buf, (unsigned char)(len & 0xFF)); + status = ares_buf_append_byte(buf, (unsigned char)(len & 0xFF)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -219,10 +219,10 @@ static ares_status_t ares_dns_write_rr_str(ares__buf_t *buf, } /* Write string */ - return ares__buf_append(buf, (const unsigned char *)str, len); + return ares_buf_append(buf, (const unsigned char *)str, len); } -static ares_status_t ares_dns_write_binstr(ares__buf_t *buf, +static ares_status_t ares_dns_write_binstr(ares_buf_t *buf, const unsigned char *bin, size_t bin_len) { @@ -240,14 +240,14 @@ static ares_status_t ares_dns_write_binstr(ares__buf_t *buf, } /* Length */ - status = ares__buf_append_byte(buf, (unsigned char)(len & 0xFF)); + status = ares_buf_append_byte(buf, (unsigned char)(len & 0xFF)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* String */ if (len) { - status = ares__buf_append(buf, ptr, len); + status = ares_buf_append(buf, ptr, len); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -260,7 +260,7 @@ static ares_status_t ares_dns_write_binstr(ares__buf_t *buf, return ARES_SUCCESS; } -static ares_status_t ares_dns_write_rr_abin(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_abin(ares_buf_t *buf, const ares_dns_rr_t *rr, ares_dns_rr_key_t key) { @@ -287,39 +287,39 @@ static ares_status_t ares_dns_write_rr_abin(ares__buf_t *buf, return status; } -static ares_status_t ares_dns_write_rr_be32(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_be32(ares_buf_t *buf, const ares_dns_rr_t *rr, ares_dns_rr_key_t key) { if (ares_dns_rr_key_datatype(key) != ARES_DATATYPE_U32) { return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ } - return ares__buf_append_be32(buf, ares_dns_rr_get_u32(rr, key)); + return ares_buf_append_be32(buf, ares_dns_rr_get_u32(rr, key)); } -static ares_status_t ares_dns_write_rr_be16(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_be16(ares_buf_t *buf, const ares_dns_rr_t *rr, ares_dns_rr_key_t key) { if (ares_dns_rr_key_datatype(key) != ARES_DATATYPE_U16) { return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ } - return ares__buf_append_be16(buf, ares_dns_rr_get_u16(rr, key)); + return ares_buf_append_be16(buf, ares_dns_rr_get_u16(rr, key)); } -static ares_status_t ares_dns_write_rr_u8(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_u8(ares_buf_t *buf, const ares_dns_rr_t *rr, ares_dns_rr_key_t key) { if (ares_dns_rr_key_datatype(key) != ARES_DATATYPE_U8) { return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ } - return ares__buf_append_byte(buf, ares_dns_rr_get_u8(rr, key)); + return ares_buf_append_byte(buf, ares_dns_rr_get_u8(rr, key)); } -static ares_status_t ares_dns_write_rr_a(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_a(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { const struct in_addr *addr; (void)namelist; @@ -329,28 +329,28 @@ static ares_status_t ares_dns_write_rr_a(ares__buf_t *buf, return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ } - return ares__buf_append(buf, (const unsigned char *)addr, sizeof(*addr)); + return ares_buf_append(buf, (const unsigned char *)addr, sizeof(*addr)); } -static ares_status_t ares_dns_write_rr_ns(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_ns(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { return ares_dns_write_rr_name(buf, rr, namelist, ARES_FALSE, ARES_RR_NS_NSDNAME); } -static ares_status_t ares_dns_write_rr_cname(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_cname(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { return ares_dns_write_rr_name(buf, rr, namelist, ARES_FALSE, ARES_RR_CNAME_CNAME); } -static ares_status_t ares_dns_write_rr_soa(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_soa(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { ares_status_t status; @@ -396,17 +396,17 @@ static ares_status_t ares_dns_write_rr_soa(ares__buf_t *buf, return ares_dns_write_rr_be32(buf, rr, ARES_RR_SOA_MINIMUM); } -static ares_status_t ares_dns_write_rr_ptr(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_ptr(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { return ares_dns_write_rr_name(buf, rr, namelist, ARES_FALSE, ARES_RR_PTR_DNAME); } -static ares_status_t ares_dns_write_rr_hinfo(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_hinfo(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { ares_status_t status; @@ -422,9 +422,9 @@ static ares_status_t ares_dns_write_rr_hinfo(ares__buf_t *buf, return ares_dns_write_rr_str(buf, rr, ARES_RR_HINFO_OS); } -static ares_status_t ares_dns_write_rr_mx(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_mx(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { ares_status_t status; @@ -439,17 +439,17 @@ static ares_status_t ares_dns_write_rr_mx(ares__buf_t *buf, ARES_RR_MX_EXCHANGE); } -static ares_status_t ares_dns_write_rr_txt(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_txt(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { (void)namelist; return ares_dns_write_rr_abin(buf, rr, ARES_RR_TXT_DATA); } -static ares_status_t ares_dns_write_rr_sig(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_sig(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { ares_status_t status; const unsigned char *data; @@ -512,12 +512,12 @@ static ares_status_t ares_dns_write_rr_sig(ares__buf_t *buf, return ARES_EFORMERR; } - return ares__buf_append(buf, data, len); + return ares_buf_append(buf, data, len); } -static ares_status_t ares_dns_write_rr_aaaa(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_aaaa(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { const struct ares_in6_addr *addr; (void)namelist; @@ -527,12 +527,12 @@ static ares_status_t ares_dns_write_rr_aaaa(ares__buf_t *buf, return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ } - return ares__buf_append(buf, (const unsigned char *)addr, sizeof(*addr)); + return ares_buf_append(buf, (const unsigned char *)addr, sizeof(*addr)); } -static ares_status_t ares_dns_write_rr_srv(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_srv(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { ares_status_t status; @@ -559,9 +559,9 @@ static ares_status_t ares_dns_write_rr_srv(ares__buf_t *buf, ARES_RR_SRV_TARGET); } -static ares_status_t ares_dns_write_rr_naptr(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_naptr(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { ares_status_t status; @@ -600,11 +600,11 @@ static ares_status_t ares_dns_write_rr_naptr(ares__buf_t *buf, ARES_RR_NAPTR_REPLACEMENT); } -static ares_status_t ares_dns_write_rr_opt(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_opt(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { - size_t len = ares__buf_len(buf); + size_t len = ares_buf_len(buf); ares_status_t status; unsigned int ttl = 0; size_t i; @@ -620,9 +620,9 @@ static ares_status_t ares_dns_write_rr_opt(ares__buf_t *buf, /* We need to go back and overwrite the class and ttl that were emitted as * the OPT record overloads them for its own use (yes, very strange!) */ - status = ares__buf_set_length(buf, len - 2 /* RDLENGTH */ - - 4 /* TTL */ - - 2 /* CLASS */); + status = ares_buf_set_length(buf, len - 2 /* RDLENGTH */ + - 4 /* TTL */ + - 2 /* CLASS */); if (status != ARES_SUCCESS) { return status; } @@ -638,13 +638,13 @@ static ares_status_t ares_dns_write_rr_opt(ares__buf_t *buf, ttl |= (unsigned int)ares_dns_rr_get_u8(rr, ARES_RR_OPT_VERSION) << 16; ttl |= (unsigned int)ares_dns_rr_get_u16(rr, ARES_RR_OPT_FLAGS); - status = ares__buf_append_be32(buf, ttl); + status = ares_buf_append_be32(buf, ttl); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* Now go back to real end */ - status = ares__buf_set_length(buf, len); + status = ares_buf_set_length(buf, len); if (status != ARES_SUCCESS) { return status; } @@ -658,20 +658,20 @@ static ares_status_t ares_dns_write_rr_opt(ares__buf_t *buf, opt = ares_dns_rr_get_opt(rr, ARES_RR_OPT_OPTIONS, i, &val, &val_len); /* BE16 option */ - status = ares__buf_append_be16(buf, opt); + status = ares_buf_append_be16(buf, opt); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* BE16 length */ - status = ares__buf_append_be16(buf, (unsigned short)(val_len & 0xFFFF)); + status = ares_buf_append_be16(buf, (unsigned short)(val_len & 0xFFFF)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* Value */ if (val && val_len) { - status = ares__buf_append(buf, val, val_len); + status = ares_buf_append(buf, val, val_len); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -681,9 +681,9 @@ static ares_status_t ares_dns_write_rr_opt(ares__buf_t *buf, return ARES_SUCCESS; } -static ares_status_t ares_dns_write_rr_tlsa(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_tlsa(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { ares_status_t status; const unsigned char *data; @@ -715,12 +715,12 @@ static ares_status_t ares_dns_write_rr_tlsa(ares__buf_t *buf, return ARES_EFORMERR; } - return ares__buf_append(buf, data, len); + return ares_buf_append(buf, data, len); } -static ares_status_t ares_dns_write_rr_svcb(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_svcb(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { ares_status_t status; size_t i; @@ -747,20 +747,20 @@ static ares_status_t ares_dns_write_rr_svcb(ares__buf_t *buf, opt = ares_dns_rr_get_opt(rr, ARES_RR_SVCB_PARAMS, i, &val, &val_len); /* BE16 option */ - status = ares__buf_append_be16(buf, opt); + status = ares_buf_append_be16(buf, opt); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* BE16 length */ - status = ares__buf_append_be16(buf, (unsigned short)(val_len & 0xFFFF)); + status = ares_buf_append_be16(buf, (unsigned short)(val_len & 0xFFFF)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* Value */ if (val && val_len) { - status = ares__buf_append(buf, val, val_len); + status = ares_buf_append(buf, val, val_len); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -769,9 +769,9 @@ static ares_status_t ares_dns_write_rr_svcb(ares__buf_t *buf, return ARES_SUCCESS; } -static ares_status_t ares_dns_write_rr_https(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_https(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { ares_status_t status; size_t i; @@ -798,20 +798,20 @@ static ares_status_t ares_dns_write_rr_https(ares__buf_t *buf, opt = ares_dns_rr_get_opt(rr, ARES_RR_HTTPS_PARAMS, i, &val, &val_len); /* BE16 option */ - status = ares__buf_append_be16(buf, opt); + status = ares_buf_append_be16(buf, opt); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* BE16 length */ - status = ares__buf_append_be16(buf, (unsigned short)(val_len & 0xFFFF)); + status = ares_buf_append_be16(buf, (unsigned short)(val_len & 0xFFFF)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* Value */ if (val && val_len) { - status = ares__buf_append(buf, val, val_len); + status = ares_buf_append(buf, val, val_len); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -820,9 +820,9 @@ static ares_status_t ares_dns_write_rr_https(ares__buf_t *buf, return ARES_SUCCESS; } -static ares_status_t ares_dns_write_rr_uri(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_uri(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { ares_status_t status; const char *target; @@ -848,13 +848,13 @@ static ares_status_t ares_dns_write_rr_uri(ares__buf_t *buf, return ARES_EFORMERR; } - return ares__buf_append(buf, (const unsigned char *)target, - ares_strlen(target)); + return ares_buf_append(buf, (const unsigned char *)target, + ares_strlen(target)); } -static ares_status_t ares_dns_write_rr_caa(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_caa(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { const unsigned char *data = NULL; size_t data_len = 0; @@ -880,14 +880,14 @@ static ares_status_t ares_dns_write_rr_caa(ares__buf_t *buf, return ARES_EFORMERR; } - return ares__buf_append(buf, data, data_len); + return ares_buf_append(buf, data, data_len); } -static ares_status_t ares_dns_write_rr_raw_rr(ares__buf_t *buf, +static ares_status_t ares_dns_write_rr_raw_rr(ares_buf_t *buf, const ares_dns_rr_t *rr, - ares__llist_t **namelist) + ares_llist_t **namelist) { - size_t len = ares__buf_len(buf); + size_t len = ares_buf_len(buf); ares_status_t status; const unsigned char *data = NULL; size_t data_len = 0; @@ -902,10 +902,10 @@ static ares_status_t ares_dns_write_rr_raw_rr(ares__buf_t *buf, /* We need to go back and overwrite the type that was emitted by the parent * function */ - status = ares__buf_set_length(buf, len - 2 /* RDLENGTH */ - - 4 /* TTL */ - - 2 /* CLASS */ - - 2 /* TYPE */); + status = ares_buf_set_length(buf, len - 2 /* RDLENGTH */ + - 4 /* TTL */ + - 2 /* CLASS */ + - 2 /* TYPE */); if (status != ARES_SUCCESS) { return status; } @@ -916,7 +916,7 @@ static ares_status_t ares_dns_write_rr_raw_rr(ares__buf_t *buf, } /* Now go back to real end */ - status = ares__buf_set_length(buf, len); + status = ares_buf_set_length(buf, len); if (status != ARES_SUCCESS) { return status; } @@ -931,13 +931,13 @@ static ares_status_t ares_dns_write_rr_raw_rr(ares__buf_t *buf, return ARES_SUCCESS; } - return ares__buf_append(buf, data, data_len); + return ares_buf_append(buf, data, data_len); } static ares_status_t ares_dns_write_rr(const ares_dns_record_t *dnsrec, - ares__llist_t **namelist, + ares_llist_t **namelist, ares_dns_section_t section, - ares__buf_t *buf) + ares_buf_t *buf) { size_t i; @@ -945,7 +945,7 @@ static ares_status_t ares_dns_write_rr(const ares_dns_record_t *dnsrec, const ares_dns_rr_t *rr; ares_dns_rec_type_t type; ares_bool_t allow_compress; - ares__llist_t **namelistptr = NULL; + ares_llist_t **namelistptr = NULL; size_t pos_len; ares_status_t status; size_t rdlength; @@ -958,27 +958,27 @@ static ares_status_t ares_dns_write_rr(const ares_dns_record_t *dnsrec, } type = ares_dns_rr_get_type(rr); - allow_compress = ares_dns_rec_type_allow_name_compression(type); + allow_compress = ares_dns_rec_allow_name_comp(type); if (allow_compress) { namelistptr = namelist; } /* Name */ status = - ares__dns_name_write(buf, namelist, ARES_TRUE, ares_dns_rr_get_name(rr)); + ares_dns_name_write(buf, namelist, ARES_TRUE, ares_dns_rr_get_name(rr)); if (status != ARES_SUCCESS) { return status; } /* Type */ - status = ares__buf_append_be16(buf, (unsigned short)type); + status = ares_buf_append_be16(buf, (unsigned short)type); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* Class */ status = - ares__buf_append_be16(buf, (unsigned short)ares_dns_rr_get_class(rr)); + ares_buf_append_be16(buf, (unsigned short)ares_dns_rr_get_class(rr)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -990,14 +990,14 @@ static ares_status_t ares_dns_write_rr(const ares_dns_record_t *dnsrec, } else { ttl -= rr->parent->ttl_decrement; } - status = ares__buf_append_be32(buf, ttl); + status = ares_buf_append_be32(buf, ttl); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* Length */ - pos_len = ares__buf_len(buf); /* Save to write real length later */ - status = ares__buf_append_be16(buf, 0); + pos_len = ares_buf_len(buf); /* Save to write real length later */ + status = ares_buf_append_be16(buf, 0); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -1072,20 +1072,20 @@ static ares_status_t ares_dns_write_rr(const ares_dns_record_t *dnsrec, /* Back off write pointer, write real length, then go back to proper * position */ - end_length = ares__buf_len(buf); + end_length = ares_buf_len(buf); rdlength = end_length - pos_len - 2; - status = ares__buf_set_length(buf, pos_len); + status = ares_buf_set_length(buf, pos_len); if (status != ARES_SUCCESS) { return status; } - status = ares__buf_append_be16(buf, (unsigned short)(rdlength & 0xFFFF)); + status = ares_buf_append_be16(buf, (unsigned short)(rdlength & 0xFFFF)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_set_length(buf, end_length); + status = ares_buf_set_length(buf, end_length); if (status != ARES_SUCCESS) { return status; } @@ -1095,17 +1095,17 @@ static ares_status_t ares_dns_write_rr(const ares_dns_record_t *dnsrec, } ares_status_t ares_dns_write_buf(const ares_dns_record_t *dnsrec, - ares__buf_t *buf) + ares_buf_t *buf) { - ares__llist_t *namelist = NULL; - size_t orig_len; - ares_status_t status; + ares_llist_t *namelist = NULL; + size_t orig_len; + ares_status_t status; if (dnsrec == NULL || buf == NULL) { return ARES_EFORMERR; } - orig_len = ares__buf_len(buf); + orig_len = ares_buf_len(buf); status = ares_dns_write_header(dnsrec, buf); if (status != ARES_SUCCESS) { @@ -1133,16 +1133,16 @@ ares_status_t ares_dns_write_buf(const ares_dns_record_t *dnsrec, } done: - ares__llist_destroy(namelist); + ares_llist_destroy(namelist); if (status != ARES_SUCCESS) { - ares__buf_set_length(buf, orig_len); + ares_buf_set_length(buf, orig_len); } return status; } ares_status_t ares_dns_write_buf_tcp(const ares_dns_record_t *dnsrec, - ares__buf_t *buf) + ares_buf_t *buf) { ares_status_t status; size_t orig_len; @@ -1153,10 +1153,10 @@ ares_status_t ares_dns_write_buf_tcp(const ares_dns_record_t *dnsrec, return ARES_EFORMERR; } - orig_len = ares__buf_len(buf); + orig_len = ares_buf_len(buf); /* Write placeholder for length */ - status = ares__buf_append_be16(buf, 0); + status = ares_buf_append_be16(buf, 0); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -1167,7 +1167,7 @@ ares_status_t ares_dns_write_buf_tcp(const ares_dns_record_t *dnsrec, goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - len = ares__buf_len(buf); + len = ares_buf_len(buf); msg_len = len - orig_len - 2; if (msg_len > 65535) { status = ARES_EBADQUERY; @@ -1176,16 +1176,16 @@ ares_status_t ares_dns_write_buf_tcp(const ares_dns_record_t *dnsrec, /* Now we need to overwrite the length, so we jump back to the original * message length, overwrite the section and jump back */ - ares__buf_set_length(buf, orig_len); - status = ares__buf_append_be16(buf, (unsigned short)(msg_len & 0xFFFF)); + ares_buf_set_length(buf, orig_len); + status = ares_buf_append_be16(buf, (unsigned short)(msg_len & 0xFFFF)); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: UntestablePath */ } - ares__buf_set_length(buf, len); + ares_buf_set_length(buf, len); done: if (status != ARES_SUCCESS) { - ares__buf_set_length(buf, orig_len); + ares_buf_set_length(buf, orig_len); } return status; } @@ -1193,7 +1193,7 @@ ares_status_t ares_dns_write_buf_tcp(const ares_dns_record_t *dnsrec, ares_status_t ares_dns_write(const ares_dns_record_t *dnsrec, unsigned char **buf, size_t *buf_len) { - ares__buf_t *b = NULL; + ares_buf_t *b = NULL; ares_status_t status; if (buf == NULL || buf_len == NULL || dnsrec == NULL) { @@ -1203,7 +1203,7 @@ ares_status_t ares_dns_write(const ares_dns_record_t *dnsrec, *buf = NULL; *buf_len = 0; - b = ares__buf_create(); + b = ares_buf_create(); if (b == NULL) { return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -1211,16 +1211,16 @@ ares_status_t ares_dns_write(const ares_dns_record_t *dnsrec, status = ares_dns_write_buf(dnsrec, b); if (status != ARES_SUCCESS) { - ares__buf_destroy(b); + ares_buf_destroy(b); return status; } - *buf = ares__buf_finish_bin(b, buf_len); + *buf = ares_buf_finish_bin(b, buf_len); return status; } -void ares_dns_record_write_ttl_decrement(ares_dns_record_t *dnsrec, - unsigned int ttl_decrement) +void ares_dns_record_ttl_decrement(ares_dns_record_t *dnsrec, + unsigned int ttl_decrement) { if (dnsrec == NULL) { return; diff --git a/deps/cares/src/lib/str/ares__buf.c b/deps/cares/src/lib/str/ares_buf.c similarity index 55% rename from deps/cares/src/lib/str/ares__buf.c rename to deps/cares/src/lib/str/ares_buf.c index bf6d4a0e1d3712..69e6b38aac849e 100644 --- a/deps/cares/src/lib/str/ares__buf.c +++ b/deps/cares/src/lib/str/ares_buf.c @@ -24,13 +24,13 @@ * SPDX-License-Identifier: MIT */ #include "ares_private.h" -#include "ares__buf.h" +#include "ares_buf.h" #include #ifdef HAVE_STDINT_H # include #endif -struct ares__buf { +struct ares_buf { const unsigned char *data; /*!< pointer to start of data buffer */ size_t data_len; /*!< total size of data in buffer */ @@ -43,9 +43,9 @@ struct ares__buf { * SIZE_MAX if not set. */ }; -ares__buf_t *ares__buf_create(void) +ares_buf_t *ares_buf_create(void) { - ares__buf_t *buf = ares_malloc_zero(sizeof(*buf)); + ares_buf_t *buf = ares_malloc_zero(sizeof(*buf)); if (buf == NULL) { return NULL; } @@ -54,15 +54,15 @@ ares__buf_t *ares__buf_create(void) return buf; } -ares__buf_t *ares__buf_create_const(const unsigned char *data, size_t data_len) +ares_buf_t *ares_buf_create_const(const unsigned char *data, size_t data_len) { - ares__buf_t *buf; + ares_buf_t *buf; if (data == NULL || data_len == 0) { return NULL; } - buf = ares__buf_create(); + buf = ares_buf_create(); if (buf == NULL) { return NULL; } @@ -73,7 +73,7 @@ ares__buf_t *ares__buf_create_const(const unsigned char *data, size_t data_len) return buf; } -void ares__buf_destroy(ares__buf_t *buf) +void ares_buf_destroy(ares_buf_t *buf) { if (buf == NULL) { return; @@ -82,7 +82,7 @@ void ares__buf_destroy(ares__buf_t *buf) ares_free(buf); } -static ares_bool_t ares__buf_is_const(const ares__buf_t *buf) +static ares_bool_t ares_buf_is_const(const ares_buf_t *buf) { if (buf == NULL) { return ARES_FALSE; /* LCOV_EXCL_LINE: DefensiveCoding */ @@ -95,7 +95,7 @@ static ares_bool_t ares__buf_is_const(const ares__buf_t *buf) return ARES_FALSE; } -void ares__buf_reclaim(ares__buf_t *buf) +void ares_buf_reclaim(ares_buf_t *buf) { size_t prefix_size; size_t data_size; @@ -104,7 +104,7 @@ void ares__buf_reclaim(ares__buf_t *buf) return; } - if (ares__buf_is_const(buf)) { + if (ares_buf_is_const(buf)) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ } @@ -135,8 +135,7 @@ void ares__buf_reclaim(ares__buf_t *buf) } } -static ares_status_t ares__buf_ensure_space(ares__buf_t *buf, - size_t needed_size) +static ares_status_t ares_buf_ensure_space(ares_buf_t *buf, size_t needed_size) { size_t remaining_size; size_t alloc_size; @@ -146,11 +145,11 @@ static ares_status_t ares__buf_ensure_space(ares__buf_t *buf, return ARES_EFORMERR; } - if (ares__buf_is_const(buf)) { + if (ares_buf_is_const(buf)) { return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ } - /* When calling ares__buf_finish_str() we end up adding a null terminator, + /* When calling ares_buf_finish_str() we end up adding a null terminator, * so we want to ensure the size is always sufficient for this as we don't * want an ARES_ENOMEM at that point */ needed_size++; @@ -162,7 +161,7 @@ static ares_status_t ares__buf_ensure_space(ares__buf_t *buf, } /* See if just moving consumed data frees up enough space */ - ares__buf_reclaim(buf); + ares_buf_reclaim(buf); remaining_size = buf->alloc_buf_len - buf->data_len; if (remaining_size >= needed_size) { @@ -194,9 +193,9 @@ static ares_status_t ares__buf_ensure_space(ares__buf_t *buf, return ARES_SUCCESS; } -ares_status_t ares__buf_set_length(ares__buf_t *buf, size_t len) +ares_status_t ares_buf_set_length(ares_buf_t *buf, size_t len) { - if (buf == NULL || ares__buf_is_const(buf)) { + if (buf == NULL || ares_buf_is_const(buf)) { return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ } @@ -208,8 +207,8 @@ ares_status_t ares__buf_set_length(ares__buf_t *buf, size_t len) return ARES_SUCCESS; } -ares_status_t ares__buf_append(ares__buf_t *buf, const unsigned char *data, - size_t data_len) +ares_status_t ares_buf_append(ares_buf_t *buf, const unsigned char *data, + size_t data_len) { ares_status_t status; @@ -221,7 +220,7 @@ ares_status_t ares__buf_append(ares__buf_t *buf, const unsigned char *data, return ARES_SUCCESS; } - status = ares__buf_ensure_space(buf, data_len); + status = ares_buf_ensure_space(buf, data_len); if (status != ARES_SUCCESS) { return status; } @@ -231,21 +230,21 @@ ares_status_t ares__buf_append(ares__buf_t *buf, const unsigned char *data, return ARES_SUCCESS; } -ares_status_t ares__buf_append_byte(ares__buf_t *buf, unsigned char b) +ares_status_t ares_buf_append_byte(ares_buf_t *buf, unsigned char b) { - return ares__buf_append(buf, &b, 1); + return ares_buf_append(buf, &b, 1); } -ares_status_t ares__buf_append_be16(ares__buf_t *buf, unsigned short u16) +ares_status_t ares_buf_append_be16(ares_buf_t *buf, unsigned short u16) { ares_status_t status; - status = ares__buf_append_byte(buf, (unsigned char)((u16 >> 8) & 0xff)); + status = ares_buf_append_byte(buf, (unsigned char)((u16 >> 8) & 0xff)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_append_byte(buf, (unsigned char)(u16 & 0xff)); + status = ares_buf_append_byte(buf, (unsigned char)(u16 & 0xff)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -253,26 +252,26 @@ ares_status_t ares__buf_append_be16(ares__buf_t *buf, unsigned short u16) return ARES_SUCCESS; } -ares_status_t ares__buf_append_be32(ares__buf_t *buf, unsigned int u32) +ares_status_t ares_buf_append_be32(ares_buf_t *buf, unsigned int u32) { ares_status_t status; - status = ares__buf_append_byte(buf, ((unsigned char)(u32 >> 24) & 0xff)); + status = ares_buf_append_byte(buf, ((unsigned char)(u32 >> 24) & 0xff)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_append_byte(buf, ((unsigned char)(u32 >> 16) & 0xff)); + status = ares_buf_append_byte(buf, ((unsigned char)(u32 >> 16) & 0xff)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_append_byte(buf, ((unsigned char)(u32 >> 8) & 0xff)); + status = ares_buf_append_byte(buf, ((unsigned char)(u32 >> 8) & 0xff)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_append_byte(buf, ((unsigned char)u32 & 0xff)); + status = ares_buf_append_byte(buf, ((unsigned char)u32 & 0xff)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -280,7 +279,7 @@ ares_status_t ares__buf_append_be32(ares__buf_t *buf, unsigned int u32) return ARES_SUCCESS; } -unsigned char *ares__buf_append_start(ares__buf_t *buf, size_t *len) +unsigned char *ares_buf_append_start(ares_buf_t *buf, size_t *len) { ares_status_t status; @@ -288,17 +287,17 @@ unsigned char *ares__buf_append_start(ares__buf_t *buf, size_t *len) return NULL; } - status = ares__buf_ensure_space(buf, *len); + status = ares_buf_ensure_space(buf, *len); if (status != ARES_SUCCESS) { return NULL; } - /* -1 for possible null terminator for ares__buf_finish_str() */ + /* -1 for possible null terminator for ares_buf_finish_str() */ *len = buf->alloc_buf_len - buf->data_len - 1; return buf->alloc_buf + buf->data_len; } -void ares__buf_append_finish(ares__buf_t *buf, size_t len) +void ares_buf_append_finish(ares_buf_t *buf, size_t len) { if (buf == NULL) { return; @@ -307,18 +306,17 @@ void ares__buf_append_finish(ares__buf_t *buf, size_t len) buf->data_len += len; } -unsigned char *ares__buf_finish_bin(ares__buf_t *buf, size_t *len) +unsigned char *ares_buf_finish_bin(ares_buf_t *buf, size_t *len) { unsigned char *ptr = NULL; - if (buf == NULL || len == NULL || ares__buf_is_const(buf)) { + if (buf == NULL || len == NULL || ares_buf_is_const(buf)) { return NULL; } - ares__buf_reclaim(buf); + ares_buf_reclaim(buf); /* We don't want to return NULL except on failure, may be zero-length */ - if (buf->alloc_buf == NULL && - ares__buf_ensure_space(buf, 1) != ARES_SUCCESS) { + if (buf->alloc_buf == NULL && ares_buf_ensure_space(buf, 1) != ARES_SUCCESS) { return NULL; /* LCOV_EXCL_LINE: OutOfMemory */ } ptr = buf->alloc_buf; @@ -327,12 +325,12 @@ unsigned char *ares__buf_finish_bin(ares__buf_t *buf, size_t *len) return ptr; } -char *ares__buf_finish_str(ares__buf_t *buf, size_t *len) +char *ares_buf_finish_str(ares_buf_t *buf, size_t *len) { char *ptr; size_t mylen; - ptr = (char *)ares__buf_finish_bin(buf, &mylen); + ptr = (char *)ares_buf_finish_bin(buf, &mylen); if (ptr == NULL) { return NULL; } @@ -341,14 +339,14 @@ char *ares__buf_finish_str(ares__buf_t *buf, size_t *len) *len = mylen; } - /* NOTE: ensured via ares__buf_ensure_space() that there is always at least + /* NOTE: ensured via ares_buf_ensure_space() that there is always at least * 1 extra byte available for this specific use-case */ ptr[mylen] = 0; return ptr; } -void ares__buf_tag(ares__buf_t *buf) +void ares_buf_tag(ares_buf_t *buf) { if (buf == NULL) { return; @@ -357,7 +355,7 @@ void ares__buf_tag(ares__buf_t *buf) buf->tag_offset = buf->offset; } -ares_status_t ares__buf_tag_rollback(ares__buf_t *buf) +ares_status_t ares_buf_tag_rollback(ares_buf_t *buf) { if (buf == NULL || buf->tag_offset == SIZE_MAX) { return ARES_EFORMERR; @@ -368,7 +366,7 @@ ares_status_t ares__buf_tag_rollback(ares__buf_t *buf) return ARES_SUCCESS; } -ares_status_t ares__buf_tag_clear(ares__buf_t *buf) +ares_status_t ares_buf_tag_clear(ares_buf_t *buf) { if (buf == NULL || buf->tag_offset == SIZE_MAX) { return ARES_EFORMERR; @@ -378,7 +376,7 @@ ares_status_t ares__buf_tag_clear(ares__buf_t *buf) return ARES_SUCCESS; } -const unsigned char *ares__buf_tag_fetch(const ares__buf_t *buf, size_t *len) +const unsigned char *ares_buf_tag_fetch(const ares_buf_t *buf, size_t *len) { if (buf == NULL || buf->tag_offset == SIZE_MAX || len == NULL) { return NULL; @@ -388,7 +386,7 @@ const unsigned char *ares__buf_tag_fetch(const ares__buf_t *buf, size_t *len) return buf->data + buf->tag_offset; } -size_t ares__buf_tag_length(const ares__buf_t *buf) +size_t ares_buf_tag_length(const ares_buf_t *buf) { if (buf == NULL || buf->tag_offset == SIZE_MAX) { return 0; @@ -396,11 +394,11 @@ size_t ares__buf_tag_length(const ares__buf_t *buf) return buf->offset - buf->tag_offset; } -ares_status_t ares__buf_tag_fetch_bytes(const ares__buf_t *buf, - unsigned char *bytes, size_t *len) +ares_status_t ares_buf_tag_fetch_bytes(const ares_buf_t *buf, + unsigned char *bytes, size_t *len) { size_t ptr_len = 0; - const unsigned char *ptr = ares__buf_tag_fetch(buf, &ptr_len); + const unsigned char *ptr = ares_buf_tag_fetch(buf, &ptr_len); if (ptr == NULL || bytes == NULL || len == NULL) { return ARES_EFORMERR; @@ -418,8 +416,25 @@ ares_status_t ares__buf_tag_fetch_bytes(const ares__buf_t *buf, return ARES_SUCCESS; } -ares_status_t ares__buf_tag_fetch_string(const ares__buf_t *buf, char *str, - size_t len) +ares_status_t ares_buf_tag_fetch_constbuf(const ares_buf_t *buf, + ares_buf_t **newbuf) +{ + size_t ptr_len = 0; + const unsigned char *ptr = ares_buf_tag_fetch(buf, &ptr_len); + + if (ptr == NULL || newbuf == NULL) { + return ARES_EFORMERR; + } + + *newbuf = ares_buf_create_const(ptr, ptr_len); + if (*newbuf == NULL) { + return ARES_ENOMEM; + } + return ARES_SUCCESS; +} + +ares_status_t ares_buf_tag_fetch_string(const ares_buf_t *buf, char *str, + size_t len) { size_t out_len; ares_status_t status; @@ -432,7 +447,7 @@ ares_status_t ares__buf_tag_fetch_string(const ares__buf_t *buf, char *str, /* Space for NULL terminator */ out_len = len - 1; - status = ares__buf_tag_fetch_bytes(buf, (unsigned char *)str, &out_len); + status = ares_buf_tag_fetch_bytes(buf, (unsigned char *)str, &out_len); if (status != ARES_SUCCESS) { return status; } @@ -442,7 +457,7 @@ ares_status_t ares__buf_tag_fetch_string(const ares__buf_t *buf, char *str, /* Validate string is printable */ for (i = 0; i < out_len; i++) { - if (!ares__isprint(str[i])) { + if (!ares_isprint(str[i])) { return ARES_EBADSTR; } } @@ -450,7 +465,32 @@ ares_status_t ares__buf_tag_fetch_string(const ares__buf_t *buf, char *str, return ARES_SUCCESS; } -static const unsigned char *ares__buf_fetch(const ares__buf_t *buf, size_t *len) +ares_status_t ares_buf_tag_fetch_strdup(const ares_buf_t *buf, char **str) +{ + size_t ptr_len = 0; + const unsigned char *ptr = ares_buf_tag_fetch(buf, &ptr_len); + + if (ptr == NULL || str == NULL) { + return ARES_EFORMERR; + } + + if (!ares_str_isprint((const char *)ptr, ptr_len)) { + return ARES_EBADSTR; + } + + *str = ares_malloc(ptr_len + 1); + if (*str == NULL) { + return ARES_ENOMEM; + } + + if (ptr_len > 0) { + memcpy(*str, ptr, ptr_len); + } + (*str)[ptr_len] = 0; + return ARES_SUCCESS; +} + +static const unsigned char *ares_buf_fetch(const ares_buf_t *buf, size_t *len) { if (len != NULL) { *len = 0; @@ -468,9 +508,9 @@ static const unsigned char *ares__buf_fetch(const ares__buf_t *buf, size_t *len) return buf->data + buf->offset; } -ares_status_t ares__buf_consume(ares__buf_t *buf, size_t len) +ares_status_t ares_buf_consume(ares_buf_t *buf, size_t len) { - size_t remaining_len = ares__buf_len(buf); + size_t remaining_len = ares_buf_len(buf); if (remaining_len < len) { return ARES_EBADRESP; @@ -480,10 +520,10 @@ ares_status_t ares__buf_consume(ares__buf_t *buf, size_t len) return ARES_SUCCESS; } -ares_status_t ares__buf_fetch_be16(ares__buf_t *buf, unsigned short *u16) +ares_status_t ares_buf_fetch_be16(ares_buf_t *buf, unsigned short *u16) { size_t remaining_len; - const unsigned char *ptr = ares__buf_fetch(buf, &remaining_len); + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); unsigned int u32; if (buf == NULL || u16 == NULL || remaining_len < sizeof(*u16)) { @@ -495,13 +535,13 @@ ares_status_t ares__buf_fetch_be16(ares__buf_t *buf, unsigned short *u16) u32 = ((unsigned int)(ptr[0]) << 8 | (unsigned int)ptr[1]); *u16 = (unsigned short)(u32 & 0xFFFF); - return ares__buf_consume(buf, sizeof(*u16)); + return ares_buf_consume(buf, sizeof(*u16)); } -ares_status_t ares__buf_fetch_be32(ares__buf_t *buf, unsigned int *u32) +ares_status_t ares_buf_fetch_be32(ares_buf_t *buf, unsigned int *u32) { size_t remaining_len; - const unsigned char *ptr = ares__buf_fetch(buf, &remaining_len); + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); if (buf == NULL || u32 == NULL || remaining_len < sizeof(*u32)) { return ARES_EBADRESP; @@ -510,29 +550,29 @@ ares_status_t ares__buf_fetch_be32(ares__buf_t *buf, unsigned int *u32) *u32 = ((unsigned int)(ptr[0]) << 24 | (unsigned int)(ptr[1]) << 16 | (unsigned int)(ptr[2]) << 8 | (unsigned int)(ptr[3])); - return ares__buf_consume(buf, sizeof(*u32)); + return ares_buf_consume(buf, sizeof(*u32)); } -ares_status_t ares__buf_fetch_bytes(ares__buf_t *buf, unsigned char *bytes, - size_t len) +ares_status_t ares_buf_fetch_bytes(ares_buf_t *buf, unsigned char *bytes, + size_t len) { size_t remaining_len; - const unsigned char *ptr = ares__buf_fetch(buf, &remaining_len); + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); if (buf == NULL || bytes == NULL || len == 0 || remaining_len < len) { return ARES_EBADRESP; } memcpy(bytes, ptr, len); - return ares__buf_consume(buf, len); + return ares_buf_consume(buf, len); } -ares_status_t ares__buf_fetch_bytes_dup(ares__buf_t *buf, size_t len, - ares_bool_t null_term, - unsigned char **bytes) +ares_status_t ares_buf_fetch_bytes_dup(ares_buf_t *buf, size_t len, + ares_bool_t null_term, + unsigned char **bytes) { size_t remaining_len; - const unsigned char *ptr = ares__buf_fetch(buf, &remaining_len); + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); if (buf == NULL || bytes == NULL || len == 0 || remaining_len < len) { return ARES_EBADRESP; @@ -547,18 +587,26 @@ ares_status_t ares__buf_fetch_bytes_dup(ares__buf_t *buf, size_t len, if (null_term) { (*bytes)[len] = 0; } - return ares__buf_consume(buf, len); + return ares_buf_consume(buf, len); } -ares_status_t ares__buf_fetch_str_dup(ares__buf_t *buf, size_t len, char **str) +ares_status_t ares_buf_fetch_str_dup(ares_buf_t *buf, size_t len, char **str) { size_t remaining_len; - const unsigned char *ptr = ares__buf_fetch(buf, &remaining_len); + size_t i; + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); if (buf == NULL || str == NULL || len == 0 || remaining_len < len) { return ARES_EBADRESP; } + /* Validate string is printable */ + for (i = 0; i < len; i++) { + if (!ares_isprint(ptr[i])) { + return ARES_EBADSTR; + } + } + *str = ares_malloc(len + 1); if (*str == NULL) { return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -567,30 +615,30 @@ ares_status_t ares__buf_fetch_str_dup(ares__buf_t *buf, size_t len, char **str) memcpy(*str, ptr, len); (*str)[len] = 0; - return ares__buf_consume(buf, len); + return ares_buf_consume(buf, len); } -ares_status_t ares__buf_fetch_bytes_into_buf(ares__buf_t *buf, - ares__buf_t *dest, size_t len) +ares_status_t ares_buf_fetch_bytes_into_buf(ares_buf_t *buf, ares_buf_t *dest, + size_t len) { size_t remaining_len; - const unsigned char *ptr = ares__buf_fetch(buf, &remaining_len); + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); ares_status_t status; if (buf == NULL || dest == NULL || len == 0 || remaining_len < len) { return ARES_EBADRESP; } - status = ares__buf_append(dest, ptr, len); + status = ares_buf_append(dest, ptr, len); if (status != ARES_SUCCESS) { return status; } - return ares__buf_consume(buf, len); + return ares_buf_consume(buf, len); } -static ares_bool_t ares__is_whitespace(unsigned char c, - ares_bool_t include_linefeed) +static ares_bool_t ares_is_whitespace(unsigned char c, + ares_bool_t include_linefeed) { switch (c) { case '\r': @@ -607,11 +655,11 @@ static ares_bool_t ares__is_whitespace(unsigned char c, return ARES_FALSE; } -size_t ares__buf_consume_whitespace(ares__buf_t *buf, - ares_bool_t include_linefeed) +size_t ares_buf_consume_whitespace(ares_buf_t *buf, + ares_bool_t include_linefeed) { size_t remaining_len = 0; - const unsigned char *ptr = ares__buf_fetch(buf, &remaining_len); + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); size_t i; if (ptr == NULL) { @@ -619,21 +667,21 @@ size_t ares__buf_consume_whitespace(ares__buf_t *buf, } for (i = 0; i < remaining_len; i++) { - if (!ares__is_whitespace(ptr[i], include_linefeed)) { + if (!ares_is_whitespace(ptr[i], include_linefeed)) { break; } } if (i > 0) { - ares__buf_consume(buf, i); + ares_buf_consume(buf, i); } return i; } -size_t ares__buf_consume_nonwhitespace(ares__buf_t *buf) +size_t ares_buf_consume_nonwhitespace(ares_buf_t *buf) { size_t remaining_len = 0; - const unsigned char *ptr = ares__buf_fetch(buf, &remaining_len); + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); size_t i; if (ptr == NULL) { @@ -641,21 +689,21 @@ size_t ares__buf_consume_nonwhitespace(ares__buf_t *buf) } for (i = 0; i < remaining_len; i++) { - if (ares__is_whitespace(ptr[i], ARES_TRUE)) { + if (ares_is_whitespace(ptr[i], ARES_TRUE)) { break; } } if (i > 0) { - ares__buf_consume(buf, i); + ares_buf_consume(buf, i); } return i; } -size_t ares__buf_consume_line(ares__buf_t *buf, ares_bool_t include_linefeed) +size_t ares_buf_consume_line(ares_buf_t *buf, ares_bool_t include_linefeed) { size_t remaining_len = 0; - const unsigned char *ptr = ares__buf_fetch(buf, &remaining_len); + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); size_t i; if (ptr == NULL) { @@ -674,28 +722,40 @@ size_t ares__buf_consume_line(ares__buf_t *buf, ares_bool_t include_linefeed) } if (i > 0) { - ares__buf_consume(buf, i); + ares_buf_consume(buf, i); } return i; } -size_t ares__buf_consume_until_charset(ares__buf_t *buf, - const unsigned char *charset, size_t len, - ares_bool_t require_charset) +size_t ares_buf_consume_until_charset(ares_buf_t *buf, + const unsigned char *charset, size_t len, + ares_bool_t require_charset) { size_t remaining_len = 0; - const unsigned char *ptr = ares__buf_fetch(buf, &remaining_len); - size_t i; + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); + size_t pos; ares_bool_t found = ARES_FALSE; if (ptr == NULL || charset == NULL || len == 0) { return 0; } - for (i = 0; i < remaining_len; i++) { + /* Optimize for single character searches */ + if (len == 1) { + const unsigned char *p = memchr(ptr, charset[0], remaining_len); + if (p != NULL) { + found = ARES_TRUE; + pos = (size_t)(p - ptr); + } else { + pos = remaining_len; + } + goto done; + } + + for (pos = 0; pos < remaining_len; pos++) { size_t j; for (j = 0; j < len; j++) { - if (ptr[i] == charset[j]) { + if (ptr[pos] == charset[j]) { found = ARES_TRUE; goto done; } @@ -704,20 +764,50 @@ size_t ares__buf_consume_until_charset(ares__buf_t *buf, done: if (require_charset && !found) { + return SIZE_MAX; + } + + if (pos > 0) { + ares_buf_consume(buf, pos); + } + return pos; +} + +size_t ares_buf_consume_until_seq(ares_buf_t *buf, const unsigned char *seq, + size_t len, ares_bool_t require_seq) +{ + size_t remaining_len = 0; + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); + const unsigned char *p; + size_t consume_len = 0; + + if (ptr == NULL || seq == NULL || len == 0) { return 0; } - if (i > 0) { - ares__buf_consume(buf, i); + p = ares_memmem(ptr, remaining_len, seq, len); + if (require_seq && p == NULL) { + return SIZE_MAX; } - return i; + + if (p != NULL) { + consume_len = (size_t)(p - ptr); + } else { + consume_len = remaining_len; + } + + if (consume_len > 0) { + ares_buf_consume(buf, consume_len); + } + + return consume_len; } -size_t ares__buf_consume_charset(ares__buf_t *buf, const unsigned char *charset, - size_t len) +size_t ares_buf_consume_charset(ares_buf_t *buf, const unsigned char *charset, + size_t len) { size_t remaining_len = 0; - const unsigned char *ptr = ares__buf_fetch(buf, &remaining_len); + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); size_t i; if (ptr == NULL || charset == NULL || len == 0) { @@ -738,28 +828,30 @@ size_t ares__buf_consume_charset(ares__buf_t *buf, const unsigned char *charset, } if (i > 0) { - ares__buf_consume(buf, i); + ares_buf_consume(buf, i); } return i; } -static void ares__buf_destroy_cb(void *arg) +static void ares_buf_destroy_cb(void *arg) { - ares__buf_destroy(arg); + ares_buf_t **buf = arg; + ares_buf_destroy(*buf); } -static ares_bool_t ares__buf_split_isduplicate(ares__llist_t *list, - const unsigned char *val, - size_t len, - ares__buf_split_t flags) +static ares_bool_t ares_buf_split_isduplicate(ares_array_t *arr, + const unsigned char *val, + size_t len, + ares_buf_split_t flags) { - ares__llist_node_t *node; + size_t i; + size_t num = ares_array_len(arr); - for (node = ares__llist_node_first(list); node != NULL; - node = ares__llist_node_next(node)) { - const ares__buf_t *buf = ares__llist_node_val(node); - size_t plen = 0; - const unsigned char *ptr = ares__buf_peek(buf, &plen); + for (i = 0; i < num; i++) { + ares_buf_t **bufptr = ares_array_at(arr, i); + const ares_buf_t *buf = *bufptr; + size_t plen = 0; + const unsigned char *ptr = ares_buf_peek(buf, &plen); /* Can't be duplicate if lengths mismatch */ if (plen != len) { @@ -767,61 +859,62 @@ static ares_bool_t ares__buf_split_isduplicate(ares__llist_t *list, } if (flags & ARES_BUF_SPLIT_CASE_INSENSITIVE) { - if (ares__memeq_ci(ptr, val, len)) { + if (ares_memeq_ci(ptr, val, len)) { return ARES_TRUE; } } else { - if (memcmp(ptr, val, len) == 0) { + if (ares_memeq(ptr, val, len)) { return ARES_TRUE; } } } + return ARES_FALSE; } -ares_status_t ares__buf_split(ares__buf_t *buf, const unsigned char *delims, - size_t delims_len, ares__buf_split_t flags, - size_t max_sections, ares__llist_t **list) +ares_status_t ares_buf_split(ares_buf_t *buf, const unsigned char *delims, + size_t delims_len, ares_buf_split_t flags, + size_t max_sections, ares_array_t **arr) { ares_status_t status = ARES_SUCCESS; ares_bool_t first = ARES_TRUE; - if (buf == NULL || delims == NULL || delims_len == 0 || list == NULL) { + if (buf == NULL || delims == NULL || delims_len == 0 || arr == NULL) { return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ } - *list = ares__llist_create(ares__buf_destroy_cb); - if (*list == NULL) { + *arr = ares_array_create(sizeof(ares_buf_t *), ares_buf_destroy_cb); + if (*arr == NULL) { status = ARES_ENOMEM; goto done; } - while (ares__buf_len(buf)) { + while (ares_buf_len(buf)) { size_t len = 0; const unsigned char *ptr; if (first) { /* No delimiter yet, just tag the start */ - ares__buf_tag(buf); + ares_buf_tag(buf); } else { - if (flags & ARES_BUF_SPLIT_DONT_CONSUME_DELIMS) { + if (flags & ARES_BUF_SPLIT_KEEP_DELIMS) { /* tag then eat delimiter so its first byte in buffer */ - ares__buf_tag(buf); - ares__buf_consume(buf, 1); + ares_buf_tag(buf); + ares_buf_consume(buf, 1); } else { /* throw away delimiter */ - ares__buf_consume(buf, 1); - ares__buf_tag(buf); + ares_buf_consume(buf, 1); + ares_buf_tag(buf); } } - if (max_sections && ares__llist_len(*list) >= max_sections - 1) { - ares__buf_consume(buf, ares__buf_len(buf)); + if (max_sections && ares_array_len(*arr) >= max_sections - 1) { + ares_buf_consume(buf, ares_buf_len(buf)); } else { - ares__buf_consume_until_charset(buf, delims, delims_len, ARES_FALSE); + ares_buf_consume_until_charset(buf, delims, delims_len, ARES_FALSE); } - ptr = ares__buf_tag_fetch(buf, &len); + ptr = ares_buf_tag_fetch(buf, &len); /* Shouldn't be possible */ if (ptr == NULL) { @@ -832,7 +925,7 @@ ares_status_t ares__buf_split(ares__buf_t *buf, const unsigned char *delims, if (flags & ARES_BUF_SPLIT_LTRIM) { size_t i; for (i = 0; i < len; i++) { - if (!ares__is_whitespace(ptr[i], ARES_TRUE)) { + if (!ares_is_whitespace(ptr[i], ARES_TRUE)) { break; } } @@ -841,22 +934,22 @@ ares_status_t ares__buf_split(ares__buf_t *buf, const unsigned char *delims, } if (flags & ARES_BUF_SPLIT_RTRIM) { - while (len > 0 && ares__is_whitespace(ptr[len - 1], ARES_TRUE)) { + while (len > 0 && ares_is_whitespace(ptr[len - 1], ARES_TRUE)) { len--; } } if (len != 0 || flags & ARES_BUF_SPLIT_ALLOW_BLANK) { - ares__buf_t *data; + ares_buf_t *data; if (!(flags & ARES_BUF_SPLIT_NO_DUPLICATES) || - !ares__buf_split_isduplicate(*list, ptr, len, flags)) { + !ares_buf_split_isduplicate(*arr, ptr, len, flags)) { /* Since we don't allow const buffers of 0 length, and user wants * 0-length buffers, swap what we do here */ if (len) { - data = ares__buf_create_const(ptr, len); + data = ares_buf_create_const(ptr, len); } else { - data = ares__buf_create(); + data = ares_buf_create(); } if (data == NULL) { @@ -864,9 +957,9 @@ ares_status_t ares__buf_split(ares__buf_t *buf, const unsigned char *delims, goto done; } - if (ares__llist_insert_last(*list, data) == NULL) { - ares__buf_destroy(data); - status = ARES_ENOMEM; + status = ares_array_insertdata_last(*arr, &data); + if (status != ARES_SUCCESS) { + ares_buf_destroy(data); goto done; } } @@ -877,18 +970,110 @@ ares_status_t ares__buf_split(ares__buf_t *buf, const unsigned char *delims, done: if (status != ARES_SUCCESS) { - ares__llist_destroy(*list); - *list = NULL; + ares_array_destroy(*arr); + *arr = NULL; } return status; } -ares_bool_t ares__buf_begins_with(const ares__buf_t *buf, - const unsigned char *data, size_t data_len) +static void ares_free_split_array(void *arg) +{ + void **ptr = arg; + ares_free(*ptr); +} + +ares_status_t ares_buf_split_str_array(ares_buf_t *buf, + const unsigned char *delims, + size_t delims_len, + ares_buf_split_t flags, + size_t max_sections, ares_array_t **arr) +{ + ares_status_t status; + ares_array_t *split = NULL; + size_t i; + size_t len; + + if (arr == NULL) { + return ARES_EFORMERR; + } + + *arr = NULL; + + status = ares_buf_split(buf, delims, delims_len, flags, max_sections, &split); + if (status != ARES_SUCCESS) { + goto done; + } + + *arr = ares_array_create(sizeof(char *), ares_free_split_array); + if (*arr == NULL) { + status = ARES_ENOMEM; + goto done; + } + + len = ares_array_len(split); + for (i = 0; i < len; i++) { + ares_buf_t **bufptr = ares_array_at(split, i); + ares_buf_t *lbuf = *bufptr; + char *str = NULL; + + status = ares_buf_fetch_str_dup(lbuf, ares_buf_len(lbuf), &str); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_array_insertdata_last(*arr, &str); + if (status != ARES_SUCCESS) { + ares_free(str); + goto done; + } + } + +done: + ares_array_destroy(split); + if (status != ARES_SUCCESS) { + ares_array_destroy(*arr); + *arr = NULL; + } + return status; +} + +ares_status_t ares_buf_split_str(ares_buf_t *buf, const unsigned char *delims, + size_t delims_len, ares_buf_split_t flags, + size_t max_sections, char ***strs, + size_t *nstrs) +{ + ares_status_t status; + ares_array_t *arr = NULL; + + if (strs == NULL || nstrs == NULL) { + return ARES_EFORMERR; + } + + *strs = NULL; + *nstrs = 0; + + status = ares_buf_split_str_array(buf, delims, delims_len, flags, + max_sections, &arr); + + if (status != ARES_SUCCESS) { + goto done; + } + +done: + if (status == ARES_SUCCESS) { + *strs = ares_array_finish(arr, nstrs); + } else { + ares_array_destroy(arr); + } + return status; +} + +ares_bool_t ares_buf_begins_with(const ares_buf_t *buf, + const unsigned char *data, size_t data_len) { size_t remaining_len = 0; - const unsigned char *ptr = ares__buf_fetch(buf, &remaining_len); + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); if (ptr == NULL || data == NULL || data_len == 0) { return ARES_FALSE; @@ -905,7 +1090,7 @@ ares_bool_t ares__buf_begins_with(const ares__buf_t *buf, return ARES_TRUE; } -size_t ares__buf_len(const ares__buf_t *buf) +size_t ares_buf_len(const ares_buf_t *buf) { if (buf == NULL) { return 0; @@ -914,12 +1099,28 @@ size_t ares__buf_len(const ares__buf_t *buf) return buf->data_len - buf->offset; } -const unsigned char *ares__buf_peek(const ares__buf_t *buf, size_t *len) +const unsigned char *ares_buf_peek(const ares_buf_t *buf, size_t *len) { - return ares__buf_fetch(buf, len); + return ares_buf_fetch(buf, len); +} + +ares_status_t ares_buf_peek_byte(const ares_buf_t *buf, unsigned char *b) +{ + size_t remaining_len = 0; + const unsigned char *ptr = ares_buf_fetch(buf, &remaining_len); + + if (buf == NULL || b == NULL) { + return ARES_EFORMERR; + } + + if (remaining_len == 0) { + return ARES_EBADRESP; + } + *b = ptr[0]; + return ARES_SUCCESS; } -size_t ares__buf_get_position(const ares__buf_t *buf) +size_t ares_buf_get_position(const ares_buf_t *buf) { if (buf == NULL) { return 0; @@ -927,7 +1128,7 @@ size_t ares__buf_get_position(const ares__buf_t *buf) return buf->offset; } -ares_status_t ares__buf_set_position(ares__buf_t *buf, size_t idx) +ares_status_t ares_buf_set_position(ares_buf_t *buf, size_t idx) { if (buf == NULL) { return ARES_EFORMERR; @@ -941,84 +1142,14 @@ ares_status_t ares__buf_set_position(ares__buf_t *buf, size_t idx) return ARES_SUCCESS; } -ares_status_t ares__buf_parse_dns_abinstr(ares__buf_t *buf, - size_t remaining_len, - ares__dns_multistring_t **strs, - ares_bool_t validate_printable) -{ - unsigned char len; - ares_status_t status = ARES_EBADRESP; - size_t orig_len = ares__buf_len(buf); - - if (buf == NULL) { - return ARES_EFORMERR; - } - - if (remaining_len == 0) { - return ARES_EBADRESP; - } - - if (strs != NULL) { - *strs = ares__dns_multistring_create(); - if (*strs == NULL) { - return ARES_ENOMEM; - } - } - - while (orig_len - ares__buf_len(buf) < remaining_len) { - status = ares__buf_fetch_bytes(buf, &len, 1); - if (status != ARES_SUCCESS) { - break; /* LCOV_EXCL_LINE: DefensiveCoding */ - } - - if (len) { - /* When used by the _str() parser, it really needs to be validated to - * be a valid printable ascii string. Do that here */ - if (validate_printable && ares__buf_len(buf) >= len) { - size_t mylen; - const char *data = (const char *)ares__buf_peek(buf, &mylen); - if (!ares__str_isprint(data, len)) { - status = ARES_EBADSTR; - break; - } - } - - if (strs != NULL) { - unsigned char *data = NULL; - status = ares__buf_fetch_bytes_dup(buf, len, ARES_TRUE, &data); - if (status != ARES_SUCCESS) { - break; - } - status = ares__dns_multistring_add_own(*strs, data, len); - if (status != ARES_SUCCESS) { - ares_free(data); - break; - } - } else { - status = ares__buf_consume(buf, len); - if (status != ARES_SUCCESS) { - break; - } - } - } - } - - if (status != ARES_SUCCESS && strs != NULL) { - ares__dns_multistring_destroy(*strs); - *strs = NULL; - } - - return status; -} - static ares_status_t - ares__buf_parse_dns_binstr_int(ares__buf_t *buf, size_t remaining_len, - unsigned char **bin, size_t *bin_len, - ares_bool_t validate_printable) + ares_buf_parse_dns_binstr_int(ares_buf_t *buf, size_t remaining_len, + unsigned char **bin, size_t *bin_len, + ares_bool_t validate_printable) { unsigned char len; ares_status_t status = ARES_EBADRESP; - ares__buf_t *binbuf = NULL; + ares_buf_t *binbuf = NULL; if (buf == NULL) { return ARES_EFORMERR; @@ -1028,12 +1159,12 @@ static ares_status_t return ARES_EBADRESP; } - binbuf = ares__buf_create(); + binbuf = ares_buf_create(); if (binbuf == NULL) { return ARES_ENOMEM; } - status = ares__buf_fetch_bytes(buf, &len, 1); + status = ares_buf_fetch_bytes(buf, &len, 1); if (status != ARES_SUCCESS) { goto done; /* LCOV_EXCL_LINE: DefensiveCoding */ } @@ -1048,32 +1179,32 @@ static ares_status_t if (len) { /* When used by the _str() parser, it really needs to be validated to * be a valid printable ascii string. Do that here */ - if (validate_printable && ares__buf_len(buf) >= len) { + if (validate_printable && ares_buf_len(buf) >= len) { size_t mylen; - const char *data = (const char *)ares__buf_peek(buf, &mylen); - if (!ares__str_isprint(data, len)) { + const char *data = (const char *)ares_buf_peek(buf, &mylen); + if (!ares_str_isprint(data, len)) { status = ARES_EBADSTR; goto done; } } if (bin != NULL) { - status = ares__buf_fetch_bytes_into_buf(buf, binbuf, len); + status = ares_buf_fetch_bytes_into_buf(buf, binbuf, len); } else { - status = ares__buf_consume(buf, len); + status = ares_buf_consume(buf, len); } } done: if (status != ARES_SUCCESS) { - ares__buf_destroy(binbuf); + ares_buf_destroy(binbuf); } else { if (bin != NULL) { size_t mylen = 0; - /* NOTE: we use ares__buf_finish_str() here as we guarantee NULL + /* NOTE: we use ares_buf_finish_str() here as we guarantee NULL * Termination even though we are technically returning binary data. */ - *bin = (unsigned char *)ares__buf_finish_str(binbuf, &mylen); + *bin = (unsigned char *)ares_buf_finish_str(binbuf, &mylen); *bin_len = mylen; } } @@ -1081,32 +1212,32 @@ static ares_status_t return status; } -ares_status_t ares__buf_parse_dns_binstr(ares__buf_t *buf, size_t remaining_len, - unsigned char **bin, size_t *bin_len) +ares_status_t ares_buf_parse_dns_binstr(ares_buf_t *buf, size_t remaining_len, + unsigned char **bin, size_t *bin_len) { - return ares__buf_parse_dns_binstr_int(buf, remaining_len, bin, bin_len, - ARES_FALSE); + return ares_buf_parse_dns_binstr_int(buf, remaining_len, bin, bin_len, + ARES_FALSE); } -ares_status_t ares__buf_parse_dns_str(ares__buf_t *buf, size_t remaining_len, - char **str) +ares_status_t ares_buf_parse_dns_str(ares_buf_t *buf, size_t remaining_len, + char **str) { size_t len; - return ares__buf_parse_dns_binstr_int(buf, remaining_len, - (unsigned char **)str, &len, ARES_TRUE); + return ares_buf_parse_dns_binstr_int(buf, remaining_len, + (unsigned char **)str, &len, ARES_TRUE); } -ares_status_t ares__buf_append_num_dec(ares__buf_t *buf, size_t num, size_t len) +ares_status_t ares_buf_append_num_dec(ares_buf_t *buf, size_t num, size_t len) { size_t i; size_t mod; if (len == 0) { - len = ares__count_digits(num); + len = ares_count_digits(num); } - mod = ares__pow(10, len); + mod = ares_pow(10, len); for (i = len; i > 0; i--) { size_t digit = (num % mod); @@ -1120,7 +1251,7 @@ ares_status_t ares__buf_append_num_dec(ares__buf_t *buf, size_t num, size_t len) } digit /= mod; - status = ares__buf_append_byte(buf, '0' + (unsigned char)(digit & 0xFF)); + status = ares_buf_append_byte(buf, '0' + (unsigned char)(digit & 0xFF)); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -1128,18 +1259,18 @@ ares_status_t ares__buf_append_num_dec(ares__buf_t *buf, size_t num, size_t len) return ARES_SUCCESS; } -ares_status_t ares__buf_append_num_hex(ares__buf_t *buf, size_t num, size_t len) +ares_status_t ares_buf_append_num_hex(ares_buf_t *buf, size_t num, size_t len) { size_t i; static const unsigned char hexbytes[] = "0123456789ABCDEF"; if (len == 0) { - len = ares__count_hexdigits(num); + len = ares_count_hexdigits(num); } for (i = len; i > 0; i--) { ares_status_t status; - status = ares__buf_append_byte(buf, hexbytes[(num >> ((i - 1) * 4)) & 0xF]); + status = ares_buf_append_byte(buf, hexbytes[(num >> ((i - 1) * 4)) & 0xF]); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -1147,48 +1278,48 @@ ares_status_t ares__buf_append_num_hex(ares__buf_t *buf, size_t num, size_t len) return ARES_SUCCESS; } -ares_status_t ares__buf_append_str(ares__buf_t *buf, const char *str) +ares_status_t ares_buf_append_str(ares_buf_t *buf, const char *str) { - return ares__buf_append(buf, (const unsigned char *)str, ares_strlen(str)); + return ares_buf_append(buf, (const unsigned char *)str, ares_strlen(str)); } -static ares_status_t ares__buf_hexdump_line(ares__buf_t *buf, size_t idx, - const unsigned char *data, - size_t len) +static ares_status_t ares_buf_hexdump_line(ares_buf_t *buf, size_t idx, + const unsigned char *data, + size_t len) { size_t i; ares_status_t status; /* Address */ - status = ares__buf_append_num_hex(buf, idx, 6); + status = ares_buf_append_num_hex(buf, idx, 6); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } /* | */ - status = ares__buf_append_str(buf, " | "); + status = ares_buf_append_str(buf, " | "); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } for (i = 0; i < 16; i++) { if (i >= len) { - status = ares__buf_append_str(buf, " "); + status = ares_buf_append_str(buf, " "); } else { - status = ares__buf_append_num_hex(buf, data[i], 2); + status = ares_buf_append_num_hex(buf, data[i], 2); } if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__buf_append_byte(buf, ' '); + status = ares_buf_append_byte(buf, ' '); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } } /* | */ - status = ares__buf_append_str(buf, " | "); + status = ares_buf_append_str(buf, " | "); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -1197,24 +1328,24 @@ static ares_status_t ares__buf_hexdump_line(ares__buf_t *buf, size_t idx, if (i >= len) { break; } - status = ares__buf_append_byte(buf, ares__isprint(data[i]) ? data[i] : '.'); + status = ares_buf_append_byte(buf, ares_isprint(data[i]) ? data[i] : '.'); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } } - return ares__buf_append_byte(buf, '\n'); + return ares_buf_append_byte(buf, '\n'); } -ares_status_t ares__buf_hexdump(ares__buf_t *buf, const unsigned char *data, - size_t len) +ares_status_t ares_buf_hexdump(ares_buf_t *buf, const unsigned char *data, + size_t len) { size_t i; /* Each line is 16 bytes */ for (i = 0; i < len; i += 16) { ares_status_t status; - status = ares__buf_hexdump_line(buf, i, data + i, len - i); + status = ares_buf_hexdump_line(buf, i, data + i, len - i); if (status != ARES_SUCCESS) { return status; /* LCOV_EXCL_LINE: OutOfMemory */ } @@ -1223,7 +1354,7 @@ ares_status_t ares__buf_hexdump(ares__buf_t *buf, const unsigned char *data, return ARES_SUCCESS; } -ares_status_t ares__buf_load_file(const char *filename, ares__buf_t *buf) +ares_status_t ares_buf_load_file(const char *filename, ares_buf_t *buf) { FILE *fp = NULL; unsigned char *ptr = NULL; @@ -1238,7 +1369,7 @@ ares_status_t ares__buf_load_file(const char *filename, ares__buf_t *buf) fp = fopen(filename, "rb"); if (fp == NULL) { - int error = ERRNO; + int error = errno; switch (error) { case ENOENT: case ESRCH: @@ -1278,7 +1409,7 @@ ares_status_t ares__buf_load_file(const char *filename, ares__buf_t *buf) /* Read entire data into buffer */ ptr_len = len; - ptr = ares__buf_append_start(buf, &ptr_len); + ptr = ares_buf_append_start(buf, &ptr_len); if (ptr == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ goto done; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -1290,7 +1421,7 @@ ares_status_t ares__buf_load_file(const char *filename, ares__buf_t *buf) goto done; /* LCOV_EXCL_LINE: DefensiveCoding */ } - ares__buf_append_finish(buf, len); + ares_buf_append_finish(buf, len); status = ARES_SUCCESS; done: diff --git a/deps/cares/src/lib/str/ares_str.c b/deps/cares/src/lib/str/ares_str.c index ade61041eb920b..f6bfabf11f4467 100644 --- a/deps/cares/src/lib/str/ares_str.c +++ b/deps/cares/src/lib/str/ares_str.c @@ -101,14 +101,30 @@ ares_bool_t ares_str_isnum(const char *str) } for (i = 0; str[i] != 0; i++) { - if (str[i] < '0' || str[i] > '9') { + if (!ares_isdigit(str[i])) { return ARES_FALSE; } } return ARES_TRUE; } -void ares__str_rtrim(char *str) +ares_bool_t ares_str_isalnum(const char *str) +{ + size_t i; + + if (str == NULL || *str == 0) { + return ARES_FALSE; + } + + for (i = 0; str[i] != 0; i++) { + if (!ares_isdigit(str[i]) && !ares_isalpha(str[i])) { + return ARES_FALSE; + } + } + return ARES_TRUE; +} + +void ares_str_rtrim(char *str) { size_t len; size_t i; @@ -119,14 +135,14 @@ void ares__str_rtrim(char *str) len = ares_strlen(str); for (i = len; i > 0; i--) { - if (!ares__isspace(str[i - 1])) { + if (!ares_isspace(str[i - 1])) { break; } } str[i] = 0; } -void ares__str_ltrim(char *str) +void ares_str_ltrim(char *str) { size_t i; size_t len; @@ -135,7 +151,7 @@ void ares__str_ltrim(char *str) return; /* LCOV_EXCL_LINE: DefensiveCoding */ } - for (i = 0; str[i] != 0 && ares__isspace(str[i]); i++) { + for (i = 0; str[i] != 0 && ares_isspace(str[i]); i++) { /* Do nothing */ } @@ -150,15 +166,15 @@ void ares__str_ltrim(char *str) str[len - i] = 0; } -void ares__str_trim(char *str) +void ares_str_trim(char *str) { - ares__str_ltrim(str); - ares__str_rtrim(str); + ares_str_ltrim(str); + ares_str_rtrim(str); } /* tolower() is locale-specific. Use a lookup table fast conversion that only * operates on ASCII */ -static const unsigned char ares__tolower_lookup[] = { +static const unsigned char ares_tolower_lookup[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, @@ -181,81 +197,80 @@ static const unsigned char ares__tolower_lookup[] = { 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF }; -unsigned char ares__tolower(unsigned char c) +unsigned char ares_tolower(unsigned char c) { - return ares__tolower_lookup[c]; + return ares_tolower_lookup[c]; } -ares_bool_t ares__memeq_ci(const unsigned char *ptr, const unsigned char *val, - size_t len) +void ares_str_lower(char *str) { size_t i; - for (i = 0; i < len; i++) { - if (ares__tolower_lookup[ptr[i]] != ares__tolower_lookup[val[i]]) { - return ARES_FALSE; - } + + if (str == NULL) { + return; + } + + for (i = 0; str[i] != 0; i++) { + str[i] = (char)ares_tolower((unsigned char)str[i]); } - return ARES_TRUE; } -ares_bool_t ares__isspace(int ch) +unsigned char *ares_memmem(const unsigned char *big, size_t big_len, + const unsigned char *little, size_t little_len) { - switch (ch) { - case '\r': - case '\t': - case ' ': - case '\v': - case '\f': - case '\n': - return ARES_TRUE; - default: + unsigned char *ptr; + + if (big == NULL || little == NULL || big_len == 0 || little_len == 0) { + return NULL; + } + +#ifdef HAVE_MEMMEM + ptr = memmem(big, big_len, little, little_len); + return ptr; +#else + while (1) { + ptr = memchr(big, little[0], big_len); + if (ptr == NULL) { + break; + } + + big_len -= (size_t)(ptr - big); + big = ptr; + if (big_len < little_len) { break; + } + + if (memcmp(big, little, little_len) == 0) { + return ptr; + } + + big++; + big_len--; } - return ARES_FALSE; + + return NULL; +#endif } -ares_bool_t ares__isprint(int ch) +ares_bool_t ares_memeq(const unsigned char *ptr, const unsigned char *val, + size_t len) { - if (ch >= 0x20 && ch <= 0x7E) { - return ARES_TRUE; - } - return ARES_FALSE; + return memcmp(ptr, val, len) == 0 ? ARES_TRUE : ARES_FALSE; } -/* Character set allowed by hostnames. This is to include the normal - * domain name character set plus: - * - underscores which are used in SRV records. - * - Forward slashes such as are used for classless in-addr.arpa - * delegation (CNAMEs) - * - Asterisks may be used for wildcard domains in CNAMEs as seen in the - * real world. - * While RFC 2181 section 11 does state not to do validation, - * that applies to servers, not clients. Vulnerabilities have been - * reported when this validation is not performed. Security is more - * important than edge-case compatibility (which is probably invalid - * anyhow). */ -ares_bool_t ares__is_hostnamech(int ch) +ares_bool_t ares_memeq_ci(const unsigned char *ptr, const unsigned char *val, + size_t len) { - /* [A-Za-z0-9-*._/] - * Don't use isalnum() as it is locale-specific - */ - if (ch >= 'A' && ch <= 'Z') { - return ARES_TRUE; - } - if (ch >= 'a' && ch <= 'z') { - return ARES_TRUE; - } - if (ch >= '0' && ch <= '9') { - return ARES_TRUE; - } - if (ch == '-' || ch == '.' || ch == '_' || ch == '/' || ch == '*') { - return ARES_TRUE; + size_t i; + for (i = 0; i < len; i++) { + if (ares_tolower_lookup[ptr[i]] != ares_tolower_lookup[val[i]]) { + return ARES_FALSE; + } } - - return ARES_FALSE; + return ARES_TRUE; } -ares_bool_t ares__is_hostname(const char *str) +ares_bool_t ares_is_hostname(const char *str) { size_t i; @@ -264,14 +279,14 @@ ares_bool_t ares__is_hostname(const char *str) } for (i = 0; str[i] != 0; i++) { - if (!ares__is_hostnamech(str[i])) { + if (!ares_is_hostnamech(str[i])) { return ARES_FALSE; } } return ARES_TRUE; } -ares_bool_t ares__str_isprint(const char *str, size_t len) +ares_bool_t ares_str_isprint(const char *str, size_t len) { size_t i; @@ -280,9 +295,197 @@ ares_bool_t ares__str_isprint(const char *str, size_t len) } for (i = 0; i < len; i++) { - if (!ares__isprint(str[i])) { + if (!ares_isprint(str[i])) { return ARES_FALSE; } } return ARES_TRUE; } + +int ares_strcmp(const char *a, const char *b) +{ + if (a == NULL && b == NULL) { + return 0; + } + + if (a != NULL && b == NULL) { + if (*a == 0) { + return 0; + } + return 1; + } + + if (a == NULL && b != NULL) { + if (*b == 0) { + return 0; + } + return -1; + } + + return strcmp(a, b); +} + +int ares_strncmp(const char *a, const char *b, size_t n) +{ + if (n == 0) { + return 0; + } + + if (a == NULL && b == NULL) { + return 0; + } + + if (a != NULL && b == NULL) { + if (*a == 0) { + return 0; + } + return 1; + } + + if (a == NULL && b != NULL) { + if (*b == 0) { + return 0; + } + return -1; + } + + return strncmp(a, b, n); +} + +int ares_strcasecmp(const char *a, const char *b) +{ + if (a == NULL && b == NULL) { + return 0; + } + + if (a != NULL && b == NULL) { + if (*a == 0) { + return 0; + } + return 1; + } + + if (a == NULL && b != NULL) { + if (*b == 0) { + return 0; + } + return -1; + } + +#if defined(HAVE_STRCASECMP) + return strcasecmp(a, b); +#elif defined(HAVE_STRCMPI) + return strcmpi(a, b); +#elif defined(HAVE_STRICMP) + return stricmp(a, b); +#else + { + size_t i; + + for (i = 0; i < (size_t)-1; i++) { + int c1 = ares_tolower(a[i]); + int c2 = ares_tolower(b[i]); + if (c1 != c2) { + return c1 - c2; + } + if (!c1) { + break; + } + } + } + return 0; +#endif +} + +int ares_strncasecmp(const char *a, const char *b, size_t n) +{ + if (n == 0) { + return 0; + } + + if (a == NULL && b == NULL) { + return 0; + } + + if (a != NULL && b == NULL) { + if (*a == 0) { + return 0; + } + return 1; + } + + if (a == NULL && b != NULL) { + if (*b == 0) { + return 0; + } + return -1; + } + +#if defined(HAVE_STRNCASECMP) + return strncasecmp(a, b, n); +#elif defined(HAVE_STRNCMPI) + return strncmpi(a, b, n); +#elif defined(HAVE_STRNICMP) + return strnicmp(a, b, n); +#else + { + size_t i; + + for (i = 0; i < n; i++) { + int c1 = ares_tolower(a[i]); + int c2 = ares_tolower(b[i]); + if (c1 != c2) { + return c1 - c2; + } + if (!c1) { + break; + } + } + } + return 0; +#endif +} + +ares_bool_t ares_strcaseeq(const char *a, const char *b) +{ + return ares_strcasecmp(a, b) == 0 ? ARES_TRUE : ARES_FALSE; +} + +ares_bool_t ares_strcaseeq_max(const char *a, const char *b, size_t n) +{ + return ares_strncasecmp(a, b, n) == 0 ? ARES_TRUE : ARES_FALSE; +} + +ares_bool_t ares_streq(const char *a, const char *b) +{ + return ares_strcmp(a, b) == 0 ? ARES_TRUE : ARES_FALSE; +} + +ares_bool_t ares_streq_max(const char *a, const char *b, size_t n) +{ + return ares_strncmp(a, b, n) == 0 ? ARES_TRUE : ARES_FALSE; +} + +void ares_free_array(void *arrp, size_t nmembers, void (*freefunc)(void *)) +{ + size_t i; + void **arr = arrp; + + if (arr == NULL) { + return; + } + + if (freefunc != NULL) { + if (nmembers == SIZE_MAX) { + for (i = 0; arr[i] != NULL; i++) { + freefunc(arr[i]); + } + } else { + for (i = 0; i < nmembers; i++) { + freefunc(arr[i]); + } + } + } + + ares_free(arr); +} diff --git a/deps/cares/src/lib/str/ares_str.h b/deps/cares/src/lib/str/ares_str.h deleted file mode 100644 index 440758c21be61f..00000000000000 --- a/deps/cares/src/lib/str/ares_str.h +++ /dev/null @@ -1,89 +0,0 @@ -/* MIT License - * - * Copyright (c) 1998 Massachusetts Institute of Technology - * Copyright (c) The c-ares project and its contributors - * - * 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 (including the next - * paragraph) 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 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * SPDX-License-Identifier: MIT - */ -#ifndef __ARES_STR_H -#define __ARES_STR_H - -char *ares_strdup(const char *s1); - -size_t ares_strlen(const char *str); - -/*! Copy string from source to destination with destination buffer size - * provided. The destination is guaranteed to be null terminated, if the - * provided buffer isn't large enough, only those bytes from the source that - * will fit will be copied. - * - * \param[out] dest Destination buffer - * \param[in] src Source to copy - * \param[in] dest_size Size of destination buffer - * \return String length. Will be at most dest_size-1 - */ -size_t ares_strcpy(char *dest, const char *src, size_t dest_size); - -ares_bool_t ares_str_isnum(const char *str); - -void ares__str_ltrim(char *str); -void ares__str_rtrim(char *str); -void ares__str_trim(char *str); - -unsigned char ares__tolower(unsigned char c); -ares_bool_t ares__memeq_ci(const unsigned char *ptr, const unsigned char *val, - size_t len); - -ares_bool_t ares__isspace(int ch); -ares_bool_t ares__isprint(int ch); -ares_bool_t ares__is_hostnamech(int ch); - -ares_bool_t ares__is_hostname(const char *str); - -/*! Validate the string provided is printable. The length specified must be - * at least the size of the buffer provided. If a NULL-terminator is hit - * before the length provided is hit, this will not be considered a valid - * printable string. This does not validate that the string is actually - * NULL terminated. - * - * \param[in] str Buffer containing string to evaluate. - * \param[in] len Number of characters to evaluate within provided buffer. - * If 0, will return TRUE since it did not hit an exception. - * \return ARES_TRUE if the entire string is printable, ARES_FALSE if not. - */ -ares_bool_t ares__str_isprint(const char *str, size_t len); - -/* We only care about ASCII rules */ -#define ares__isascii(x) (((unsigned char)x) <= 127) -#define ares__isdigit(x) \ - (((unsigned char)x) >= '0' && ((unsigned char)x) <= '9') -#define ares__isxdigit(x) \ - (ares__isdigit(x) || \ - (((unsigned char)x) >= 'a' && ((unsigned char)x) <= 'f') || \ - (((unsigned char)x) >= 'A' && ((unsigned char)x) <= 'F')) -#define ares__isupper(x) \ - (((unsigned char)x) >= 'A' && ((unsigned char)x) <= 'Z') -#define ares__islower(x) \ - (((unsigned char)x) >= 'a' && ((unsigned char)x) <= 'z') -#define ares__isalpha(x) (ares__islower(x) || ares__isupper(x)) - -#endif /* __ARES_STR_H */ diff --git a/deps/cares/src/lib/str/ares_strsplit.c b/deps/cares/src/lib/str/ares_strsplit.c index dee307d7799f51..4431c5044d5d3c 100644 --- a/deps/cares/src/lib/str/ares_strsplit.c +++ b/deps/cares/src/lib/str/ares_strsplit.c @@ -25,21 +25,12 @@ */ #include "ares_private.h" -void ares__strsplit_free(char **elms, size_t num_elm) +void ares_strsplit_free(char **elms, size_t num_elm) { - size_t i; - - if (elms == NULL) { - return; - } - - for (i = 0; i < num_elm; i++) { - ares_free(elms[i]); - } - ares_free(elms); + ares_free_array(elms, num_elm, ares_free); } -char **ares__strsplit_duplicate(char **elms, size_t num_elm) +char **ares_strsplit_duplicate(char **elms, size_t num_elm) { size_t i; char **out; @@ -56,23 +47,19 @@ char **ares__strsplit_duplicate(char **elms, size_t num_elm) for (i = 0; i < num_elm; i++) { out[i] = ares_strdup(elms[i]); if (out[i] == NULL) { - ares__strsplit_free(out, num_elm); /* LCOV_EXCL_LINE: OutOfMemory */ - return NULL; /* LCOV_EXCL_LINE: OutOfMemory */ + ares_strsplit_free(out, num_elm); /* LCOV_EXCL_LINE: OutOfMemory */ + return NULL; /* LCOV_EXCL_LINE: OutOfMemory */ } } return out; } -char **ares__strsplit(const char *in, const char *delms, size_t *num_elm) +char **ares_strsplit(const char *in, const char *delms, size_t *num_elm) { - ares_status_t status; - ares__buf_t *buf = NULL; - ares__llist_t *llist = NULL; - ares__llist_node_t *node; - char **out = NULL; - size_t cnt = 0; - size_t idx = 0; + ares_status_t status; + ares_buf_t *buf = NULL; + char **out = NULL; if (in == NULL || delms == NULL || num_elm == NULL) { return NULL; /* LCOV_EXCL_LINE: DefensiveCoding */ @@ -80,52 +67,22 @@ char **ares__strsplit(const char *in, const char *delms, size_t *num_elm) *num_elm = 0; - buf = ares__buf_create_const((const unsigned char *)in, ares_strlen(in)); + buf = ares_buf_create_const((const unsigned char *)in, ares_strlen(in)); if (buf == NULL) { return NULL; } - status = ares__buf_split( + status = ares_buf_split_str( buf, (const unsigned char *)delms, ares_strlen(delms), - ARES_BUF_SPLIT_NO_DUPLICATES | ARES_BUF_SPLIT_CASE_INSENSITIVE, 0, &llist); + ARES_BUF_SPLIT_NO_DUPLICATES | ARES_BUF_SPLIT_CASE_INSENSITIVE, 0, &out, + num_elm); if (status != ARES_SUCCESS) { goto done; } - cnt = ares__llist_len(llist); - if (cnt == 0) { - status = ARES_EFORMERR; - goto done; - } - - - out = ares_malloc_zero(cnt * sizeof(*out)); - if (out == NULL) { - status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ - goto done; /* LCOV_EXCL_LINE: OutOfMemory */ - } - - for (node = ares__llist_node_first(llist); node != NULL; - node = ares__llist_node_next(node)) { - ares__buf_t *val = ares__llist_node_val(node); - char *temp = NULL; - - status = ares__buf_fetch_str_dup(val, ares__buf_len(val), &temp); - if (status != ARES_SUCCESS) { - goto done; - } - - out[idx++] = temp; - } - - *num_elm = cnt; - status = ARES_SUCCESS; - done: - ares__llist_destroy(llist); - ares__buf_destroy(buf); + ares_buf_destroy(buf); if (status != ARES_SUCCESS) { - ares__strsplit_free(out, cnt); out = NULL; } diff --git a/deps/cares/src/lib/str/ares_strsplit.h b/deps/cares/src/lib/str/ares_strsplit.h index ee997804f012f1..0da090263af691 100644 --- a/deps/cares/src/lib/str/ares_strsplit.h +++ b/deps/cares/src/lib/str/ares_strsplit.h @@ -40,12 +40,12 @@ * returns an allocated array of allocated string elements. * */ -char **ares__strsplit(const char *in, const char *delms, size_t *num_elm); +char **ares_strsplit(const char *in, const char *delms, size_t *num_elm); -/* Frees the result returned from ares__strsplit(). */ -void ares__strsplit_free(char **elms, size_t num_elm); +/* Frees the result returned from ares_strsplit(). */ +void ares_strsplit_free(char **elms, size_t num_elm); /* Duplicate the array */ -char **ares__strsplit_duplicate(char **elms, size_t num_elm); +char **ares_strsplit_duplicate(char **elms, size_t num_elm); #endif /* HEADER_CARES_STRSPLIT_H */ diff --git a/deps/cares/src/lib/util/ares__threads.h b/deps/cares/src/lib/util/ares__threads.h deleted file mode 100644 index 108354dfc1e17f..00000000000000 --- a/deps/cares/src/lib/util/ares__threads.h +++ /dev/null @@ -1,60 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Brad House - * - * 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 (including the next - * paragraph) 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 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * SPDX-License-Identifier: MIT - */ -#ifndef __ARES__THREADS_H -#define __ARES__THREADS_H - -struct ares__thread_mutex; -typedef struct ares__thread_mutex ares__thread_mutex_t; - -ares__thread_mutex_t *ares__thread_mutex_create(void); -void ares__thread_mutex_destroy(ares__thread_mutex_t *mut); -void ares__thread_mutex_lock(ares__thread_mutex_t *mut); -void ares__thread_mutex_unlock(ares__thread_mutex_t *mut); - - -struct ares__thread_cond; -typedef struct ares__thread_cond ares__thread_cond_t; - -ares__thread_cond_t *ares__thread_cond_create(void); -void ares__thread_cond_destroy(ares__thread_cond_t *cond); -void ares__thread_cond_signal(ares__thread_cond_t *cond); -void ares__thread_cond_broadcast(ares__thread_cond_t *cond); -ares_status_t ares__thread_cond_wait(ares__thread_cond_t *cond, - ares__thread_mutex_t *mut); -ares_status_t ares__thread_cond_timedwait(ares__thread_cond_t *cond, - ares__thread_mutex_t *mut, - unsigned long timeout_ms); - - -struct ares__thread; -typedef struct ares__thread ares__thread_t; - -typedef void *(*ares__thread_func_t)(void *arg); -ares_status_t ares__thread_create(ares__thread_t **thread, - ares__thread_func_t func, void *arg); -ares_status_t ares__thread_join(ares__thread_t *thread, void **rv); - -#endif diff --git a/deps/cares/src/lib/util/ares__iface_ips.c b/deps/cares/src/lib/util/ares_iface_ips.c similarity index 69% rename from deps/cares/src/lib/util/ares__iface_ips.c rename to deps/cares/src/lib/util/ares_iface_ips.c index 56dc25790412e4..46cb291e300ec2 100644 --- a/deps/cares/src/lib/util/ares__iface_ips.c +++ b/deps/cares/src/lib/util/ares_iface_ips.c @@ -59,41 +59,40 @@ #endif -static ares_status_t ares__iface_ips_enumerate(ares__iface_ips_t *ips, - const char *name); +static ares_status_t ares_iface_ips_enumerate(ares_iface_ips_t *ips, + const char *name); typedef struct { - char *name; - struct ares_addr addr; - unsigned char netmask; - unsigned int ll_scope; - ares__iface_ip_flags_t flags; -} ares__iface_ip_t; - -struct ares__iface_ips { - ares__array_t *ips; /*!< Type is ares__iface_ip_t */ - ares__iface_ip_flags_t enum_flags; + char *name; + struct ares_addr addr; + unsigned char netmask; + unsigned int ll_scope; + ares_iface_ip_flags_t flags; +} ares_iface_ip_t; + +struct ares_iface_ips { + ares_array_t *ips; /*!< Type is ares_iface_ip_t */ + ares_iface_ip_flags_t enum_flags; }; -static void ares__iface_ip_free_cb(void *arg) +static void ares_iface_ip_free_cb(void *arg) { - ares__iface_ip_t *ip = arg; + ares_iface_ip_t *ip = arg; if (ip == NULL) { return; } ares_free(ip->name); } -static ares__iface_ips_t *ares__iface_ips_alloc(ares__iface_ip_flags_t flags) +static ares_iface_ips_t *ares_iface_ips_alloc(ares_iface_ip_flags_t flags) { - ares__iface_ips_t *ips = ares_malloc_zero(sizeof(*ips)); + ares_iface_ips_t *ips = ares_malloc_zero(sizeof(*ips)); if (ips == NULL) { return NULL; /* LCOV_EXCL_LINE: OutOfMemory */ } ips->enum_flags = flags; - ips->ips = - ares__array_create(sizeof(ares__iface_ip_t), ares__iface_ip_free_cb); + ips->ips = ares_array_create(sizeof(ares_iface_ip_t), ares_iface_ip_free_cb); if (ips->ips == NULL) { ares_free(ips); /* LCOV_EXCL_LINE: OutOfMemory */ return NULL; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -101,18 +100,18 @@ static ares__iface_ips_t *ares__iface_ips_alloc(ares__iface_ip_flags_t flags) return ips; } -void ares__iface_ips_destroy(ares__iface_ips_t *ips) +void ares_iface_ips_destroy(ares_iface_ips_t *ips) { if (ips == NULL) { return; } - ares__array_destroy(ips->ips); + ares_array_destroy(ips->ips); ares_free(ips); } -ares_status_t ares__iface_ips(ares__iface_ips_t **ips, - ares__iface_ip_flags_t flags, const char *name) +ares_status_t ares_iface_ips(ares_iface_ips_t **ips, + ares_iface_ip_flags_t flags, const char *name) { ares_status_t status; @@ -120,15 +119,15 @@ ares_status_t ares__iface_ips(ares__iface_ips_t **ips, return ARES_EFORMERR; } - *ips = ares__iface_ips_alloc(flags); + *ips = ares_iface_ips_alloc(flags); if (*ips == NULL) { return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares__iface_ips_enumerate(*ips, name); + status = ares_iface_ips_enumerate(*ips, name); if (status != ARES_SUCCESS) { /* LCOV_EXCL_START: UntestablePath */ - ares__iface_ips_destroy(*ips); + ares_iface_ips_destroy(*ips); *ips = NULL; return status; /* LCOV_EXCL_STOP */ @@ -138,12 +137,12 @@ ares_status_t ares__iface_ips(ares__iface_ips_t **ips, } static ares_status_t - ares__iface_ips_add(ares__iface_ips_t *ips, ares__iface_ip_flags_t flags, - const char *name, const struct ares_addr *addr, - unsigned char netmask, unsigned int ll_scope) + ares_iface_ips_add(ares_iface_ips_t *ips, ares_iface_ip_flags_t flags, + const char *name, const struct ares_addr *addr, + unsigned char netmask, unsigned int ll_scope) { - ares__iface_ip_t *ip; - ares_status_t status; + ares_iface_ip_t *ip; + ares_status_t status; if (ips == NULL || name == NULL || addr == NULL) { return ARES_EFORMERR; /* LCOV_EXCL_LINE: DefensiveCoding */ @@ -162,7 +161,7 @@ static ares_status_t } /* Check for link-local */ - if (ares__addr_is_linklocal(addr)) { + if (ares_addr_is_linklocal(addr)) { flags |= ARES_IFACE_IP_LINKLOCAL; } if (flags & ARES_IFACE_IP_LINKLOCAL && @@ -190,7 +189,7 @@ static ares_status_t } } - status = ares__array_insert_last((void **)&ip, ips->ips); + status = ares_array_insert_last((void **)&ip, ips->ips); if (status != ARES_SUCCESS) { return status; } @@ -203,30 +202,30 @@ static ares_status_t memcpy(&ip->addr, addr, sizeof(*addr)); ip->name = ares_strdup(name); if (ip->name == NULL) { - ares__array_remove_last(ips->ips); + ares_array_remove_last(ips->ips); return ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ } return ARES_SUCCESS; } -size_t ares__iface_ips_cnt(const ares__iface_ips_t *ips) +size_t ares_iface_ips_cnt(const ares_iface_ips_t *ips) { if (ips == NULL) { return 0; } - return ares__array_len(ips->ips); + return ares_array_len(ips->ips); } -const char *ares__iface_ips_get_name(const ares__iface_ips_t *ips, size_t idx) +const char *ares_iface_ips_get_name(const ares_iface_ips_t *ips, size_t idx) { - const ares__iface_ip_t *ip; + const ares_iface_ip_t *ip; if (ips == NULL) { return NULL; } - ip = ares__array_at_const(ips->ips, idx); + ip = ares_array_at_const(ips->ips, idx); if (ip == NULL) { return NULL; } @@ -234,16 +233,16 @@ const char *ares__iface_ips_get_name(const ares__iface_ips_t *ips, size_t idx) return ip->name; } -const struct ares_addr *ares__iface_ips_get_addr(const ares__iface_ips_t *ips, - size_t idx) +const struct ares_addr *ares_iface_ips_get_addr(const ares_iface_ips_t *ips, + size_t idx) { - const ares__iface_ip_t *ip; + const ares_iface_ip_t *ip; if (ips == NULL) { return NULL; } - ip = ares__array_at_const(ips->ips, idx); + ip = ares_array_at_const(ips->ips, idx); if (ip == NULL) { return NULL; } @@ -251,16 +250,16 @@ const struct ares_addr *ares__iface_ips_get_addr(const ares__iface_ips_t *ips, return &ip->addr; } -ares__iface_ip_flags_t ares__iface_ips_get_flags(const ares__iface_ips_t *ips, - size_t idx) +ares_iface_ip_flags_t ares_iface_ips_get_flags(const ares_iface_ips_t *ips, + size_t idx) { - const ares__iface_ip_t *ip; + const ares_iface_ip_t *ip; if (ips == NULL) { return 0; } - ip = ares__array_at_const(ips->ips, idx); + ip = ares_array_at_const(ips->ips, idx); if (ip == NULL) { return 0; } @@ -268,16 +267,16 @@ ares__iface_ip_flags_t ares__iface_ips_get_flags(const ares__iface_ips_t *ips, return ip->flags; } -unsigned char ares__iface_ips_get_netmask(const ares__iface_ips_t *ips, - size_t idx) +unsigned char ares_iface_ips_get_netmask(const ares_iface_ips_t *ips, + size_t idx) { - const ares__iface_ip_t *ip; + const ares_iface_ip_t *ip; if (ips == NULL) { return 0; } - ip = ares__array_at_const(ips->ips, idx); + ip = ares_array_at_const(ips->ips, idx); if (ip == NULL) { return 0; } @@ -285,16 +284,16 @@ unsigned char ares__iface_ips_get_netmask(const ares__iface_ips_t *ips, return ip->netmask; } -unsigned int ares__iface_ips_get_ll_scope(const ares__iface_ips_t *ips, - size_t idx) +unsigned int ares_iface_ips_get_ll_scope(const ares_iface_ips_t *ips, + size_t idx) { - const ares__iface_ip_t *ip; + const ares_iface_ip_t *ip; if (ips == NULL) { return 0; } - ip = ares__array_at_const(ips->ips, idx); + ip = ares_array_at_const(ips->ips, idx); if (ip == NULL) { return 0; } @@ -334,7 +333,7 @@ static ares_bool_t name_match(const char *name, const char *adapter_name, return ARES_TRUE; } - if (strcasecmp(name, adapter_name) == 0) { + if (ares_strcaseeq(name, adapter_name)) { return ARES_TRUE; } @@ -345,8 +344,8 @@ static ares_bool_t name_match(const char *name, const char *adapter_name, return ARES_FALSE; } -static ares_status_t ares__iface_ips_enumerate(ares__iface_ips_t *ips, - const char *name) +static ares_status_t ares_iface_ips_enumerate(ares_iface_ips_t *ips, + const char *name) { ULONG myflags = GAA_FLAG_INCLUDE_PREFIX /*|GAA_FLAG_INCLUDE_ALL_INTERFACES */; ULONG outBufLen = 0; @@ -377,7 +376,7 @@ static ares_status_t ares__iface_ips_enumerate(ares__iface_ips_t *ips, for (address = addresses; address != NULL; address = address->Next) { IP_ADAPTER_UNICAST_ADDRESS *ipaddr = NULL; - ares__iface_ip_flags_t addrflag = 0; + ares_iface_ip_flags_t addrflag = 0; char ifname[64] = ""; # if defined(HAVE_CONVERTINTERFACEINDEXTOLUID) && \ @@ -431,9 +430,9 @@ static ares_status_t ares__iface_ips_enumerate(ares__iface_ips_t *ips, continue; } - status = ares__iface_ips_add(ips, addrflag, ifname, &addr, - ipaddr->OnLinkPrefixLength /* netmask */, - address->Ipv6IfIndex /* ll_scope */); + status = ares_iface_ips_add(ips, addrflag, ifname, &addr, + ipaddr->OnLinkPrefixLength /* netmask */, + address->Ipv6IfIndex /* ll_scope */); if (status != ARES_SUCCESS) { goto done; @@ -454,13 +453,13 @@ static unsigned char count_addr_bits(const unsigned char *addr, size_t addr_len) unsigned char count = 0; for (i = 0; i < addr_len; i++) { - count += ares__count_bits_u8(addr[i]); + count += ares_count_bits_u8(addr[i]); } return count; } -static ares_status_t ares__iface_ips_enumerate(ares__iface_ips_t *ips, - const char *name) +static ares_status_t ares_iface_ips_enumerate(ares_iface_ips_t *ips, + const char *name) { struct ifaddrs *ifap = NULL; struct ifaddrs *ifa = NULL; @@ -472,10 +471,10 @@ static ares_status_t ares__iface_ips_enumerate(ares__iface_ips_t *ips, } for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) { - ares__iface_ip_flags_t addrflag = 0; - struct ares_addr addr; - unsigned char netmask = 0; - unsigned int ll_scope = 0; + ares_iface_ip_flags_t addrflag = 0; + struct ares_addr addr; + unsigned char netmask = 0; + unsigned int ll_scope = 0; if (ifa->ifa_addr == NULL) { continue; @@ -515,12 +514,12 @@ static ares_status_t ares__iface_ips_enumerate(ares__iface_ips_t *ips, } /* Name mismatch */ - if (name != NULL && strcasecmp(ifa->ifa_name, name) != 0) { + if (name != NULL && !ares_strcaseeq(ifa->ifa_name, name)) { continue; } - status = ares__iface_ips_add(ips, addrflag, ifa->ifa_name, &addr, netmask, - ll_scope); + status = ares_iface_ips_add(ips, addrflag, ifa->ifa_name, &addr, netmask, + ll_scope); if (status != ARES_SUCCESS) { goto done; } @@ -533,8 +532,8 @@ static ares_status_t ares__iface_ips_enumerate(ares__iface_ips_t *ips, #else -static ares_status_t ares__iface_ips_enumerate(ares__iface_ips_t *ips, - const char *name) +static ares_status_t ares_iface_ips_enumerate(ares_iface_ips_t *ips, + const char *name) { (void)ips; (void)name; @@ -544,7 +543,7 @@ static ares_status_t ares__iface_ips_enumerate(ares__iface_ips_t *ips, #endif -unsigned int ares__if_nametoindex(const char *name) +unsigned int ares_os_if_nametoindex(const char *name) { #ifdef HAVE_IF_NAMETOINDEX if (name == NULL) { @@ -552,36 +551,35 @@ unsigned int ares__if_nametoindex(const char *name) } return if_nametoindex(name); #else - ares_status_t status; - ares__iface_ips_t *ips = NULL; - size_t i; - unsigned int index = 0; + ares_status_t status; + ares_iface_ips_t *ips = NULL; + size_t i; + unsigned int index = 0; if (name == NULL) { return 0; } status = - ares__iface_ips(&ips, ARES_IFACE_IP_V6 | ARES_IFACE_IP_LINKLOCAL, name); + ares_iface_ips(&ips, ARES_IFACE_IP_V6 | ARES_IFACE_IP_LINKLOCAL, name); if (status != ARES_SUCCESS) { goto done; } - for (i = 0; i < ares__iface_ips_cnt(ips); i++) { - if (ares__iface_ips_get_flags(ips, i) & ARES_IFACE_IP_LINKLOCAL) { - index = ares__iface_ips_get_ll_scope(ips, i); + for (i = 0; i < ares_iface_ips_cnt(ips); i++) { + if (ares_iface_ips_get_flags(ips, i) & ARES_IFACE_IP_LINKLOCAL) { + index = ares_iface_ips_get_ll_scope(ips, i); goto done; } } done: - ares__iface_ips_destroy(ips); + ares_iface_ips_destroy(ips); return index; #endif } -const char *ares__if_indextoname(unsigned int index, char *name, - size_t name_len) +const char *ares_os_if_indextoname(unsigned int index, char *name, size_t name_len) { #ifdef HAVE_IF_INDEXTONAME if (name_len < IF_NAMESIZE) { @@ -589,10 +587,10 @@ const char *ares__if_indextoname(unsigned int index, char *name, } return if_indextoname(index, name); #else - ares_status_t status; - ares__iface_ips_t *ips = NULL; - size_t i; - const char *ptr = NULL; + ares_status_t status; + ares_iface_ips_t *ips = NULL; + size_t i; + const char *ptr = NULL; if (name == NULL || name_len < IF_NAMESIZE) { goto done; @@ -603,22 +601,22 @@ const char *ares__if_indextoname(unsigned int index, char *name, } status = - ares__iface_ips(&ips, ARES_IFACE_IP_V6 | ARES_IFACE_IP_LINKLOCAL, NULL); + ares_iface_ips(&ips, ARES_IFACE_IP_V6 | ARES_IFACE_IP_LINKLOCAL, NULL); if (status != ARES_SUCCESS) { goto done; } - for (i = 0; i < ares__iface_ips_cnt(ips); i++) { - if (ares__iface_ips_get_flags(ips, i) & ARES_IFACE_IP_LINKLOCAL && - ares__iface_ips_get_ll_scope(ips, i) == index) { - ares_strcpy(name, ares__iface_ips_get_name(ips, i), name_len); + for (i = 0; i < ares_iface_ips_cnt(ips); i++) { + if (ares_iface_ips_get_flags(ips, i) & ARES_IFACE_IP_LINKLOCAL && + ares_iface_ips_get_ll_scope(ips, i) == index) { + ares_strcpy(name, ares_iface_ips_get_name(ips, i), name_len); ptr = name; goto done; } } done: - ares__iface_ips_destroy(ips); + ares_iface_ips_destroy(ips); return ptr; #endif } diff --git a/deps/cares/src/lib/util/ares__iface_ips.h b/deps/cares/src/lib/util/ares_iface_ips.h similarity index 77% rename from deps/cares/src/lib/util/ares__iface_ips.h rename to deps/cares/src/lib/util/ares_iface_ips.h index 61ff736a796361..f22e09046a065b 100644 --- a/deps/cares/src/lib/util/ares__iface_ips.h +++ b/deps/cares/src/lib/util/ares_iface_ips.h @@ -42,18 +42,18 @@ typedef enum { /*! Default, enumerate all ips for online interfaces, including loopback */ ARES_IFACE_IP_DEFAULT = (ARES_IFACE_IP_V4 | ARES_IFACE_IP_V6 | ARES_IFACE_IP_LOOPBACK | ARES_IFACE_IP_LINKLOCAL) -} ares__iface_ip_flags_t; +} ares_iface_ip_flags_t; -struct ares__iface_ips; +struct ares_iface_ips; /*! Opaque pointer for holding enumerated interface ip addresses */ -typedef struct ares__iface_ips ares__iface_ips_t; +typedef struct ares_iface_ips ares_iface_ips_t; -/*! Destroy ip address enumeration created by ares__iface_ips(). +/*! Destroy ip address enumeration created by ares_iface_ips(). * * \param[in] ips Initialized IP address enumeration structure */ -void ares__iface_ips_destroy(ares__iface_ips_t *ips); +void ares_iface_ips_destroy(ares_iface_ips_t *ips); /*! Enumerate ip addresses on interfaces * @@ -63,15 +63,15 @@ void ares__iface_ips_destroy(ares__iface_ips_t *ips); * \return ARES_ENOMEM on out of memory, ARES_ENOTIMP if not supported on * the system, ARES_SUCCESS on success */ -ares_status_t ares__iface_ips(ares__iface_ips_t **ips, - ares__iface_ip_flags_t flags, const char *name); +ares_status_t ares_iface_ips(ares_iface_ips_t **ips, + ares_iface_ip_flags_t flags, const char *name); /*! Count of ips enumerated * * \param[in] ips Initialized IP address enumeration structure * \return count */ -size_t ares__iface_ips_cnt(const ares__iface_ips_t *ips); +size_t ares_iface_ips_cnt(const ares_iface_ips_t *ips); /*! Retrieve interface name * @@ -79,7 +79,7 @@ size_t ares__iface_ips_cnt(const ares__iface_ips_t *ips); * \param[in] idx Index of entry to pull * \return interface name */ -const char *ares__iface_ips_get_name(const ares__iface_ips_t *ips, size_t idx); +const char *ares_iface_ips_get_name(const ares_iface_ips_t *ips, size_t idx); /*! Retrieve interface address * @@ -87,8 +87,8 @@ const char *ares__iface_ips_get_name(const ares__iface_ips_t *ips, size_t idx); * \param[in] idx Index of entry to pull * \return interface address */ -const struct ares_addr *ares__iface_ips_get_addr(const ares__iface_ips_t *ips, - size_t idx); +const struct ares_addr *ares_iface_ips_get_addr(const ares_iface_ips_t *ips, + size_t idx); /*! Retrieve interface address flags * @@ -96,8 +96,8 @@ const struct ares_addr *ares__iface_ips_get_addr(const ares__iface_ips_t *ips, * \param[in] idx Index of entry to pull * \return interface address flags */ -ares__iface_ip_flags_t ares__iface_ips_get_flags(const ares__iface_ips_t *ips, - size_t idx); +ares_iface_ip_flags_t ares_iface_ips_get_flags(const ares_iface_ips_t *ips, + size_t idx); /*! Retrieve interface address netmask * @@ -105,8 +105,8 @@ ares__iface_ip_flags_t ares__iface_ips_get_flags(const ares__iface_ips_t *ips, * \param[in] idx Index of entry to pull * \return interface address netmask */ -unsigned char ares__iface_ips_get_netmask(const ares__iface_ips_t *ips, - size_t idx); +unsigned char ares_iface_ips_get_netmask(const ares_iface_ips_t *ips, + size_t idx); /*! Retrieve interface ipv6 link local scope * @@ -114,8 +114,8 @@ unsigned char ares__iface_ips_get_netmask(const ares__iface_ips_t *ips, * \param[in] idx Index of entry to pull * \return interface ipv6 link local scope */ -unsigned int ares__iface_ips_get_ll_scope(const ares__iface_ips_t *ips, - size_t idx); +unsigned int ares_iface_ips_get_ll_scope(const ares_iface_ips_t *ips, + size_t idx); /*! Retrieve the interface index (aka link local scope) from the interface @@ -124,7 +124,7 @@ unsigned int ares__iface_ips_get_ll_scope(const ares__iface_ips_t *ips, * \param[in] name Interface name * \return 0 on failure, index otherwise */ -unsigned int ares__if_nametoindex(const char *name); +unsigned int ares_os_if_nametoindex(const char *name); /*! Retrieves the interface name from the index (aka link local scope) * @@ -133,7 +133,7 @@ unsigned int ares__if_nametoindex(const char *name); * \param[in] name_len Length of provided buffer, must be at least IF_NAMESIZE * \return NULL on failure, or pointer to name on success */ -const char *ares__if_indextoname(unsigned int index, char *name, - size_t name_len); +const char *ares_os_if_indextoname(unsigned int index, char *name, + size_t name_len); #endif diff --git a/deps/cares/src/lib/util/ares_math.c b/deps/cares/src/lib/util/ares_math.c index 45999bdeababa6..1106bf6bf151f8 100644 --- a/deps/cares/src/lib/util/ares_math.c +++ b/deps/cares/src/lib/util/ares_math.c @@ -29,7 +29,7 @@ /* Uses public domain code snippets from * http://graphics.stanford.edu/~seander/bithacks.html */ -static unsigned int ares__round_up_pow2_u32(unsigned int n) +static unsigned int ares_round_up_pow2_u32(unsigned int n) { /* NOTE: if already a power of 2, will return itself, not the next */ n--; @@ -42,7 +42,7 @@ static unsigned int ares__round_up_pow2_u32(unsigned int n) return n; } -static ares_int64_t ares__round_up_pow2_u64(ares_int64_t n) +static ares_int64_t ares_round_up_pow2_u64(ares_int64_t n) { /* NOTE: if already a power of 2, will return itself, not the next */ n--; @@ -56,7 +56,7 @@ static ares_int64_t ares__round_up_pow2_u64(ares_int64_t n) return n; } -ares_bool_t ares__is_64bit(void) +ares_bool_t ares_is_64bit(void) { #ifdef _MSC_VER # pragma warning(push) @@ -70,16 +70,16 @@ ares_bool_t ares__is_64bit(void) #endif } -size_t ares__round_up_pow2(size_t n) +size_t ares_round_up_pow2(size_t n) { - if (ares__is_64bit()) { - return (size_t)ares__round_up_pow2_u64((ares_int64_t)n); + if (ares_is_64bit()) { + return (size_t)ares_round_up_pow2_u64((ares_int64_t)n); } - return (size_t)ares__round_up_pow2_u32((unsigned int)n); + return (size_t)ares_round_up_pow2_u32((unsigned int)n); } -size_t ares__log2(size_t n) +size_t ares_log2(size_t n) { static const unsigned char tab32[32] = { 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, @@ -92,7 +92,7 @@ size_t ares__log2(size_t n) 56, 45, 25, 31, 35, 16, 9, 12, 44, 24, 15, 8, 23, 7, 6, 5 }; - if (!ares__is_64bit()) { + if (!ares_is_64bit()) { return tab32[(n * 0x077CB531) >> 27]; } @@ -100,7 +100,7 @@ size_t ares__log2(size_t n) } /* x^y */ -size_t ares__pow(size_t x, size_t y) +size_t ares_pow(size_t x, size_t y) { size_t res = 1; @@ -118,7 +118,7 @@ size_t ares__pow(size_t x, size_t y) return res; } -size_t ares__count_digits(size_t n) +size_t ares_count_digits(size_t n) { size_t digits; @@ -132,7 +132,7 @@ size_t ares__count_digits(size_t n) return digits; } -size_t ares__count_hexdigits(size_t n) +size_t ares_count_hexdigits(size_t n) { size_t digits; @@ -146,7 +146,7 @@ size_t ares__count_hexdigits(size_t n) return digits; } -unsigned char ares__count_bits_u8(unsigned char x) +unsigned char ares_count_bits_u8(unsigned char x) { /* Implementation obtained from: * http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetTable */ diff --git a/deps/cares/src/lib/str/ares_strcasecmp.c b/deps/cares/src/lib/util/ares_math.h similarity index 53% rename from deps/cares/src/lib/str/ares_strcasecmp.c rename to deps/cares/src/lib/util/ares_math.h index 76b835fd8e92f1..52fa1facf01e47 100644 --- a/deps/cares/src/lib/str/ares_strcasecmp.c +++ b/deps/cares/src/lib/util/ares_math.h @@ -1,7 +1,6 @@ /* MIT License * - * Copyright (c) 1998 Massachusetts Institute of Technology - * Copyright (c) The c-ares project and its contributors + * Copyright (c) 2024 Brad House * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,56 +23,23 @@ * * SPDX-License-Identifier: MIT */ +#ifndef __ARES_MATH_H +#define __ARES_MATH_H -#include "ares_private.h" -#include "ares_strcasecmp.h" - -#ifndef HAVE_STRCASECMP -int ares_strcasecmp(const char *a, const char *b) -{ -# if defined(HAVE_STRCMPI) - return strcmpi(a, b); -# elif defined(HAVE_STRICMP) - return stricmp(a, b); -# else - size_t i; - - for (i = 0; i < (size_t)-1; i++) { - int c1 = ares__tolower(a[i]); - int c2 = ares__tolower(b[i]); - if (c1 != c2) { - return c1 - c2; - } - if (!c1) { - break; - } - } - return 0; -# endif -} +#ifdef _MSC_VER +typedef __int64 ares_int64_t; +typedef unsigned __int64 ares_uint64_t; +#else +typedef long long ares_int64_t; +typedef unsigned long long ares_uint64_t; #endif -#ifndef HAVE_STRNCASECMP -int ares_strncasecmp(const char *a, const char *b, size_t n) -{ -# if defined(HAVE_STRNCMPI) - return strncmpi(a, b, n); -# elif defined(HAVE_STRNICMP) - return strnicmp(a, b, n); -# else - size_t i; +ares_bool_t ares_is_64bit(void); +size_t ares_round_up_pow2(size_t n); +size_t ares_log2(size_t n); +size_t ares_pow(size_t x, size_t y); +size_t ares_count_digits(size_t n); +size_t ares_count_hexdigits(size_t n); +unsigned char ares_count_bits_u8(unsigned char x); - for (i = 0; i < n; i++) { - int c1 = ares__tolower(a[i]); - int c2 = ares__tolower(b[i]); - if (c1 != c2) { - return c1 - c2; - } - if (!c1) { - break; - } - } - return 0; -# endif -} #endif diff --git a/deps/cares/src/lib/util/ares_rand.c b/deps/cares/src/lib/util/ares_rand.c index c57bb706e68e5b..408999951a78ca 100644 --- a/deps/cares/src/lib/util/ares_rand.c +++ b/deps/cares/src/lib/util/ares_rand.c @@ -55,7 +55,7 @@ typedef struct ares_rand_rc4 { static unsigned int ares_u32_from_ptr(void *addr) { /* LCOV_EXCL_START: FallbackCode */ - if (ares__is_64bit()) { + if (ares_is_64bit()) { return (unsigned int)((((ares_uint64_t)addr >> 32) & 0xFFFFFFFF) | ((ares_uint64_t)addr & 0xFFFFFFFF)); } @@ -77,9 +77,13 @@ static void ares_rc4_generate_key(ares_rand_rc4 *rc4_state, unsigned char *key, return; } +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + /* For fuzzing, random should be deterministic */ + srand(0); +#else /* Randomness is hard to come by. Maybe the system randomizes heap and stack * addresses. Maybe the current timestamp give us some randomness. Use - * rc4_state (heap), &i (stack), and ares__tvnow() + * rc4_state (heap), &i (stack), and ares_tvnow() */ data = ares_u32_from_ptr(rc4_state); memcpy(key + len, &data, sizeof(data)); @@ -89,13 +93,14 @@ static void ares_rc4_generate_key(ares_rand_rc4 *rc4_state, unsigned char *key, memcpy(key + len, &data, sizeof(data)); len += sizeof(data); - ares__tvnow(&tv); + ares_tvnow(&tv); data = (unsigned int)((tv.sec | tv.usec) & 0xFFFFFFFF); memcpy(key + len, &data, sizeof(data)); len += sizeof(data); srand(ares_u32_from_ptr(rc4_state) | ares_u32_from_ptr(&i) | (unsigned int)((tv.sec | tv.usec) & 0xFFFFFFFF)); +#endif for (i = len; i < key_len; i++) { key[i] = (unsigned char)(rand() % 256); /* LCOV_EXCL_LINE */ @@ -188,10 +193,15 @@ BOOLEAN WINAPI SystemFunction036(PVOID RandomBuffer, ULONG RandomBufferLength); #endif -static ares_bool_t ares__init_rand_engine(ares_rand_state *state) +static ares_bool_t ares_init_rand_engine(ares_rand_state *state) { state->cache_remaining = 0; +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + /* For fuzzing, random should be deterministic */ + state->bad_backends |= ARES_RAND_OS | ARES_RAND_FILE; +#endif + #if defined(HAVE_ARC4RANDOM_BUF) || defined(HAVE_GETRANDOM) || defined(_WIN32) if (!(state->bad_backends & ARES_RAND_OS)) { state->type = ARES_RAND_OS; @@ -223,7 +233,7 @@ static ares_bool_t ares__init_rand_engine(ares_rand_state *state) return ARES_TRUE; /* LCOV_EXCL_LINE: UntestablePath */ } -ares_rand_state *ares__init_rand_state(void) +ares_rand_state *ares_init_rand_state(void) { ares_rand_state *state = NULL; @@ -232,7 +242,7 @@ ares_rand_state *ares__init_rand_state(void) return NULL; } - if (!ares__init_rand_engine(state)) { + if (!ares_init_rand_engine(state)) { ares_free(state); /* LCOV_EXCL_LINE: UntestablePath */ return NULL; /* LCOV_EXCL_LINE: UntestablePath */ } @@ -240,7 +250,7 @@ ares_rand_state *ares__init_rand_state(void) return state; } -static void ares__clear_rand_state(ares_rand_state *state) +static void ares_clear_rand_state(ares_rand_state *state) { if (!state) { return; /* LCOV_EXCL_LINE: DefensiveCoding */ @@ -259,26 +269,26 @@ static void ares__clear_rand_state(ares_rand_state *state) } } -static void ares__reinit_rand(ares_rand_state *state) +static void ares_reinit_rand(ares_rand_state *state) { /* LCOV_EXCL_START: UntestablePath */ - ares__clear_rand_state(state); - ares__init_rand_engine(state); + ares_clear_rand_state(state); + ares_init_rand_engine(state); /* LCOV_EXCL_STOP */ } -void ares__destroy_rand_state(ares_rand_state *state) +void ares_destroy_rand_state(ares_rand_state *state) { if (!state) { return; } - ares__clear_rand_state(state); + ares_clear_rand_state(state); ares_free(state); } -static void ares__rand_bytes_fetch(ares_rand_state *state, unsigned char *buf, - size_t len) +static void ares_rand_bytes_fetch(ares_rand_state *state, unsigned char *buf, + size_t len) { while (1) { size_t bytes_read = 0; @@ -344,17 +354,17 @@ static void ares__rand_bytes_fetch(ares_rand_state *state, unsigned char *buf, /* If we didn't return before we got here, that means we had a critical rand * failure and need to reinitialized */ - ares__reinit_rand(state); /* LCOV_EXCL_LINE: UntestablePath */ + ares_reinit_rand(state); /* LCOV_EXCL_LINE: UntestablePath */ } } -void ares__rand_bytes(ares_rand_state *state, unsigned char *buf, size_t len) +void ares_rand_bytes(ares_rand_state *state, unsigned char *buf, size_t len) { /* See if we need to refill the cache to serve the request, but if len is * excessive, we're not going to update our cache or serve from cache */ if (len > state->cache_remaining && len < sizeof(state->cache)) { size_t fetch_size = sizeof(state->cache) - state->cache_remaining; - ares__rand_bytes_fetch(state, state->cache, fetch_size); + ares_rand_bytes_fetch(state, state->cache, fetch_size); state->cache_remaining = sizeof(state->cache); } @@ -367,13 +377,13 @@ void ares__rand_bytes(ares_rand_state *state, unsigned char *buf, size_t len) } /* Serve direct due to excess size of request */ - ares__rand_bytes_fetch(state, buf, len); + ares_rand_bytes_fetch(state, buf, len); } -unsigned short ares__generate_new_id(ares_rand_state *state) +unsigned short ares_generate_new_id(ares_rand_state *state) { unsigned short r = 0; - ares__rand_bytes(state, (unsigned char *)&r, sizeof(r)); + ares_rand_bytes(state, (unsigned char *)&r, sizeof(r)); return r; } diff --git a/deps/cares/src/lib/ares_platform.h b/deps/cares/src/lib/util/ares_rand.h similarity index 72% rename from deps/cares/src/lib/ares_platform.h rename to deps/cares/src/lib/util/ares_rand.h index 768eaddddd9ce3..81c61bf46488ae 100644 --- a/deps/cares/src/lib/ares_platform.h +++ b/deps/cares/src/lib/util/ares_rand.h @@ -1,7 +1,6 @@ /* MIT License * - * Copyright (c) 1998 Massachusetts Institute of Technology - * Copyright (c) 2004 Daniel Stenberg + * Copyright (c) 2024 Brad House * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,27 +23,14 @@ * * SPDX-License-Identifier: MIT */ -#ifndef HEADER_CARES_PLATFORM_H -#define HEADER_CARES_PLATFORM_H +#ifndef __ARES_RAND_H +#define __ARES_RAND_H -#if defined(_WIN32) && !defined(MSDOS) +struct ares_rand_state; +typedef struct ares_rand_state ares_rand_state; -typedef enum { - WIN_UNKNOWN, - WIN_3X, - WIN_9X, - WIN_NT, - WIN_CE -} win_platform; - -win_platform ares__getplatform(void); - -#endif - -#if defined(_WIN32_WCE) - -struct servent *getservbyport(int port, const char *proto); +ares_rand_state *ares_init_rand_state(void); +void ares_destroy_rand_state(ares_rand_state *state); +void ares_rand_bytes(ares_rand_state *state, unsigned char *buf, size_t len); #endif - -#endif /* HEADER_CARES_PLATFORM_H */ diff --git a/deps/cares/src/lib/util/ares__threads.c b/deps/cares/src/lib/util/ares_threads.c similarity index 64% rename from deps/cares/src/lib/util/ares__threads.c rename to deps/cares/src/lib/util/ares_threads.c index b47544451d9d4f..ab0b51afb70577 100644 --- a/deps/cares/src/lib/util/ares__threads.c +++ b/deps/cares/src/lib/util/ares_threads.c @@ -28,13 +28,13 @@ #ifdef CARES_THREADS # ifdef _WIN32 -struct ares__thread_mutex { +struct ares_thread_mutex { CRITICAL_SECTION mutex; }; -ares__thread_mutex_t *ares__thread_mutex_create(void) +ares_thread_mutex_t *ares_thread_mutex_create(void) { - ares__thread_mutex_t *mut = ares_malloc_zero(sizeof(*mut)); + ares_thread_mutex_t *mut = ares_malloc_zero(sizeof(*mut)); if (mut == NULL) { return NULL; } @@ -43,7 +43,7 @@ ares__thread_mutex_t *ares__thread_mutex_create(void) return mut; } -void ares__thread_mutex_destroy(ares__thread_mutex_t *mut) +void ares_thread_mutex_destroy(ares_thread_mutex_t *mut) { if (mut == NULL) { return; @@ -52,7 +52,7 @@ void ares__thread_mutex_destroy(ares__thread_mutex_t *mut) ares_free(mut); } -void ares__thread_mutex_lock(ares__thread_mutex_t *mut) +void ares_thread_mutex_lock(ares_thread_mutex_t *mut) { if (mut == NULL) { return; @@ -60,7 +60,7 @@ void ares__thread_mutex_lock(ares__thread_mutex_t *mut) EnterCriticalSection(&mut->mutex); } -void ares__thread_mutex_unlock(ares__thread_mutex_t *mut) +void ares_thread_mutex_unlock(ares_thread_mutex_t *mut) { if (mut == NULL) { return; @@ -68,13 +68,13 @@ void ares__thread_mutex_unlock(ares__thread_mutex_t *mut) LeaveCriticalSection(&mut->mutex); } -struct ares__thread_cond { +struct ares_thread_cond { CONDITION_VARIABLE cond; }; -ares__thread_cond_t *ares__thread_cond_create(void) +ares_thread_cond_t *ares_thread_cond_create(void) { - ares__thread_cond_t *cond = ares_malloc_zero(sizeof(*cond)); + ares_thread_cond_t *cond = ares_malloc_zero(sizeof(*cond)); if (cond == NULL) { return NULL; } @@ -82,7 +82,7 @@ ares__thread_cond_t *ares__thread_cond_create(void) return cond; } -void ares__thread_cond_destroy(ares__thread_cond_t *cond) +void ares_thread_cond_destroy(ares_thread_cond_t *cond) { if (cond == NULL) { return; @@ -90,7 +90,7 @@ void ares__thread_cond_destroy(ares__thread_cond_t *cond) ares_free(cond); } -void ares__thread_cond_signal(ares__thread_cond_t *cond) +void ares_thread_cond_signal(ares_thread_cond_t *cond) { if (cond == NULL) { return; @@ -98,7 +98,7 @@ void ares__thread_cond_signal(ares__thread_cond_t *cond) WakeConditionVariable(&cond->cond); } -void ares__thread_cond_broadcast(ares__thread_cond_t *cond) +void ares_thread_cond_broadcast(ares_thread_cond_t *cond) { if (cond == NULL) { return; @@ -106,8 +106,8 @@ void ares__thread_cond_broadcast(ares__thread_cond_t *cond) WakeAllConditionVariable(&cond->cond); } -ares_status_t ares__thread_cond_wait(ares__thread_cond_t *cond, - ares__thread_mutex_t *mut) +ares_status_t ares_thread_cond_wait(ares_thread_cond_t *cond, + ares_thread_mutex_t *mut) { if (cond == NULL || mut == NULL) { return ARES_EFORMERR; @@ -117,9 +117,9 @@ ares_status_t ares__thread_cond_wait(ares__thread_cond_t *cond, return ARES_SUCCESS; } -ares_status_t ares__thread_cond_timedwait(ares__thread_cond_t *cond, - ares__thread_mutex_t *mut, - unsigned long timeout_ms) +ares_status_t ares_thread_cond_timedwait(ares_thread_cond_t *cond, + ares_thread_mutex_t *mut, + unsigned long timeout_ms) { if (cond == NULL || mut == NULL) { return ARES_EFORMERR; @@ -132,7 +132,7 @@ ares_status_t ares__thread_cond_timedwait(ares__thread_cond_t *cond, return ARES_SUCCESS; } -struct ares__thread { +struct ares_thread { HANDLE thread; DWORD id; @@ -142,18 +142,18 @@ struct ares__thread { }; /* Wrap for pthread compatibility */ -static DWORD WINAPI ares__thread_func(LPVOID lpParameter) +static DWORD WINAPI ares_thread_func(LPVOID lpParameter) { - ares__thread_t *thread = lpParameter; + ares_thread_t *thread = lpParameter; thread->rv = thread->func(thread->arg); return 0; } -ares_status_t ares__thread_create(ares__thread_t **thread, - ares__thread_func_t func, void *arg) +ares_status_t ares_thread_create(ares_thread_t **thread, + ares_thread_func_t func, void *arg) { - ares__thread_t *thr = NULL; + ares_thread_t *thr = NULL; if (func == NULL || thread == NULL) { return ARES_EFORMERR; @@ -166,7 +166,7 @@ ares_status_t ares__thread_create(ares__thread_t **thread, thr->func = func; thr->arg = arg; - thr->thread = CreateThread(NULL, 0, ares__thread_func, thr, 0, &thr->id); + thr->thread = CreateThread(NULL, 0, ares_thread_func, thr, 0, &thr->id); if (thr->thread == NULL) { ares_free(thr); return ARES_ESERVFAIL; @@ -176,7 +176,7 @@ ares_status_t ares__thread_create(ares__thread_t **thread, return ARES_SUCCESS; } -ares_status_t ares__thread_join(ares__thread_t *thread, void **rv) +ares_status_t ares_thread_join(ares_thread_t *thread, void **rv) { ares_status_t status = ARES_SUCCESS; @@ -211,14 +211,14 @@ ares_status_t ares__thread_join(ares__thread_t *thread, void **rv) # include # endif -struct ares__thread_mutex { +struct ares_thread_mutex { pthread_mutex_t mutex; }; -ares__thread_mutex_t *ares__thread_mutex_create(void) +ares_thread_mutex_t *ares_thread_mutex_create(void) { - pthread_mutexattr_t attr; - ares__thread_mutex_t *mut = ares_malloc_zero(sizeof(*mut)); + pthread_mutexattr_t attr; + ares_thread_mutex_t *mut = ares_malloc_zero(sizeof(*mut)); if (mut == NULL) { return NULL; } @@ -247,7 +247,7 @@ ares__thread_mutex_t *ares__thread_mutex_create(void) /* LCOV_EXCL_STOP */ } -void ares__thread_mutex_destroy(ares__thread_mutex_t *mut) +void ares_thread_mutex_destroy(ares_thread_mutex_t *mut) { if (mut == NULL) { return; @@ -256,7 +256,7 @@ void ares__thread_mutex_destroy(ares__thread_mutex_t *mut) ares_free(mut); } -void ares__thread_mutex_lock(ares__thread_mutex_t *mut) +void ares_thread_mutex_lock(ares_thread_mutex_t *mut) { if (mut == NULL) { return; @@ -264,7 +264,7 @@ void ares__thread_mutex_lock(ares__thread_mutex_t *mut) pthread_mutex_lock(&mut->mutex); } -void ares__thread_mutex_unlock(ares__thread_mutex_t *mut) +void ares_thread_mutex_unlock(ares_thread_mutex_t *mut) { if (mut == NULL) { return; @@ -272,13 +272,13 @@ void ares__thread_mutex_unlock(ares__thread_mutex_t *mut) pthread_mutex_unlock(&mut->mutex); } -struct ares__thread_cond { +struct ares_thread_cond { pthread_cond_t cond; }; -ares__thread_cond_t *ares__thread_cond_create(void) +ares_thread_cond_t *ares_thread_cond_create(void) { - ares__thread_cond_t *cond = ares_malloc_zero(sizeof(*cond)); + ares_thread_cond_t *cond = ares_malloc_zero(sizeof(*cond)); if (cond == NULL) { return NULL; } @@ -286,7 +286,7 @@ ares__thread_cond_t *ares__thread_cond_create(void) return cond; } -void ares__thread_cond_destroy(ares__thread_cond_t *cond) +void ares_thread_cond_destroy(ares_thread_cond_t *cond) { if (cond == NULL) { return; @@ -295,7 +295,7 @@ void ares__thread_cond_destroy(ares__thread_cond_t *cond) ares_free(cond); } -void ares__thread_cond_signal(ares__thread_cond_t *cond) +void ares_thread_cond_signal(ares_thread_cond_t *cond) { if (cond == NULL) { return; @@ -303,7 +303,7 @@ void ares__thread_cond_signal(ares__thread_cond_t *cond) pthread_cond_signal(&cond->cond); } -void ares__thread_cond_broadcast(ares__thread_cond_t *cond) +void ares_thread_cond_broadcast(ares_thread_cond_t *cond) { if (cond == NULL) { return; @@ -311,8 +311,8 @@ void ares__thread_cond_broadcast(ares__thread_cond_t *cond) pthread_cond_broadcast(&cond->cond); } -ares_status_t ares__thread_cond_wait(ares__thread_cond_t *cond, - ares__thread_mutex_t *mut) +ares_status_t ares_thread_cond_wait(ares_thread_cond_t *cond, + ares_thread_mutex_t *mut) { if (cond == NULL || mut == NULL) { return ARES_EFORMERR; @@ -322,7 +322,7 @@ ares_status_t ares__thread_cond_wait(ares__thread_cond_t *cond, return ARES_SUCCESS; } -static void ares__timespec_timeout(struct timespec *ts, unsigned long add_ms) +static void ares_timespec_timeout(struct timespec *ts, unsigned long add_ms) { # if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_REALTIME) clock_gettime(CLOCK_REALTIME, ts); @@ -345,9 +345,9 @@ static void ares__timespec_timeout(struct timespec *ts, unsigned long add_ms) } } -ares_status_t ares__thread_cond_timedwait(ares__thread_cond_t *cond, - ares__thread_mutex_t *mut, - unsigned long timeout_ms) +ares_status_t ares_thread_cond_timedwait(ares_thread_cond_t *cond, + ares_thread_mutex_t *mut, + unsigned long timeout_ms) { struct timespec ts; @@ -355,7 +355,7 @@ ares_status_t ares__thread_cond_timedwait(ares__thread_cond_t *cond, return ARES_EFORMERR; } - ares__timespec_timeout(&ts, timeout_ms); + ares_timespec_timeout(&ts, timeout_ms); if (pthread_cond_timedwait(&cond->cond, &mut->mutex, &ts) != 0) { return ARES_ETIMEOUT; @@ -364,14 +364,14 @@ ares_status_t ares__thread_cond_timedwait(ares__thread_cond_t *cond, return ARES_SUCCESS; } -struct ares__thread { +struct ares_thread { pthread_t thread; }; -ares_status_t ares__thread_create(ares__thread_t **thread, - ares__thread_func_t func, void *arg) +ares_status_t ares_thread_create(ares_thread_t **thread, + ares_thread_func_t func, void *arg) { - ares__thread_t *thr = NULL; + ares_thread_t *thr = NULL; if (func == NULL || thread == NULL) { return ARES_EFORMERR; @@ -390,7 +390,7 @@ ares_status_t ares__thread_create(ares__thread_t **thread, return ARES_SUCCESS; } -ares_status_t ares__thread_join(ares__thread_t *thread, void **rv) +ares_status_t ares_thread_join(ares_thread_t *thread, void **rv) { void *ret = NULL; ares_status_t status = ARES_SUCCESS; @@ -420,57 +420,57 @@ ares_bool_t ares_threadsafety(void) #else /* !CARES_THREADS */ /* NoOp */ -ares__thread_mutex_t *ares__thread_mutex_create(void) +ares_thread_mutex_t *ares_thread_mutex_create(void) { return NULL; } -void ares__thread_mutex_destroy(ares__thread_mutex_t *mut) +void ares_thread_mutex_destroy(ares_thread_mutex_t *mut) { (void)mut; } -void ares__thread_mutex_lock(ares__thread_mutex_t *mut) +void ares_thread_mutex_lock(ares_thread_mutex_t *mut) { (void)mut; } -void ares__thread_mutex_unlock(ares__thread_mutex_t *mut) +void ares_thread_mutex_unlock(ares_thread_mutex_t *mut) { (void)mut; } -ares__thread_cond_t *ares__thread_cond_create(void) +ares_thread_cond_t *ares_thread_cond_create(void) { return NULL; } -void ares__thread_cond_destroy(ares__thread_cond_t *cond) +void ares_thread_cond_destroy(ares_thread_cond_t *cond) { (void)cond; } -void ares__thread_cond_signal(ares__thread_cond_t *cond) +void ares_thread_cond_signal(ares_thread_cond_t *cond) { (void)cond; } -void ares__thread_cond_broadcast(ares__thread_cond_t *cond) +void ares_thread_cond_broadcast(ares_thread_cond_t *cond) { (void)cond; } -ares_status_t ares__thread_cond_wait(ares__thread_cond_t *cond, - ares__thread_mutex_t *mut) +ares_status_t ares_thread_cond_wait(ares_thread_cond_t *cond, + ares_thread_mutex_t *mut) { (void)cond; (void)mut; return ARES_ENOTIMP; } -ares_status_t ares__thread_cond_timedwait(ares__thread_cond_t *cond, - ares__thread_mutex_t *mut, - unsigned long timeout_ms) +ares_status_t ares_thread_cond_timedwait(ares_thread_cond_t *cond, + ares_thread_mutex_t *mut, + unsigned long timeout_ms) { (void)cond; (void)mut; @@ -478,8 +478,8 @@ ares_status_t ares__thread_cond_timedwait(ares__thread_cond_t *cond, return ARES_ENOTIMP; } -ares_status_t ares__thread_create(ares__thread_t **thread, - ares__thread_func_t func, void *arg) +ares_status_t ares_thread_create(ares_thread_t **thread, + ares_thread_func_t func, void *arg) { (void)thread; (void)func; @@ -487,7 +487,7 @@ ares_status_t ares__thread_create(ares__thread_t **thread, return ARES_ENOTIMP; } -ares_status_t ares__thread_join(ares__thread_t *thread, void **rv) +ares_status_t ares_thread_join(ares_thread_t *thread, void **rv) { (void)thread; (void)rv; @@ -501,7 +501,7 @@ ares_bool_t ares_threadsafety(void) #endif -ares_status_t ares__channel_threading_init(ares_channel_t *channel) +ares_status_t ares_channel_threading_init(ares_channel_t *channel) { ares_status_t status = ARES_SUCCESS; @@ -510,13 +510,13 @@ ares_status_t ares__channel_threading_init(ares_channel_t *channel) return ARES_SUCCESS; } - channel->lock = ares__thread_mutex_create(); + channel->lock = ares_thread_mutex_create(); if (channel->lock == NULL) { status = ARES_ENOMEM; goto done; } - channel->cond_empty = ares__thread_cond_create(); + channel->cond_empty = ares_thread_cond_create(); if (channel->cond_empty == NULL) { status = ARES_ENOMEM; goto done; @@ -524,27 +524,27 @@ ares_status_t ares__channel_threading_init(ares_channel_t *channel) done: if (status != ARES_SUCCESS) { - ares__channel_threading_destroy(channel); + ares_channel_threading_destroy(channel); } return status; } -void ares__channel_threading_destroy(ares_channel_t *channel) +void ares_channel_threading_destroy(ares_channel_t *channel) { - ares__thread_mutex_destroy(channel->lock); + ares_thread_mutex_destroy(channel->lock); channel->lock = NULL; - ares__thread_cond_destroy(channel->cond_empty); + ares_thread_cond_destroy(channel->cond_empty); channel->cond_empty = NULL; } -void ares__channel_lock(const ares_channel_t *channel) +void ares_channel_lock(const ares_channel_t *channel) { - ares__thread_mutex_lock(channel->lock); + ares_thread_mutex_lock(channel->lock); } -void ares__channel_unlock(const ares_channel_t *channel) +void ares_channel_unlock(const ares_channel_t *channel) { - ares__thread_mutex_unlock(channel->lock); + ares_thread_mutex_unlock(channel->lock); } /* Must not be holding a channel lock already, public function only */ @@ -562,29 +562,29 @@ ares_status_t ares_queue_wait_empty(ares_channel_t *channel, int timeout_ms) } if (timeout_ms >= 0) { - ares__tvnow(&tout); + ares_tvnow(&tout); tout.sec += (ares_int64_t)(timeout_ms / 1000); tout.usec += (unsigned int)(timeout_ms % 1000) * 1000; } - ares__thread_mutex_lock(channel->lock); - while (ares__llist_len(channel->all_queries)) { + ares_thread_mutex_lock(channel->lock); + while (ares_llist_len(channel->all_queries)) { if (timeout_ms < 0) { - ares__thread_cond_wait(channel->cond_empty, channel->lock); + ares_thread_cond_wait(channel->cond_empty, channel->lock); } else { ares_timeval_t tv_remaining; ares_timeval_t tv_now; unsigned long tms; - ares__tvnow(&tv_now); - ares__timeval_remaining(&tv_remaining, &tv_now, &tout); + ares_tvnow(&tv_now); + ares_timeval_remaining(&tv_remaining, &tv_now, &tout); tms = (unsigned long)((tv_remaining.sec * 1000) + (tv_remaining.usec / 1000)); if (tms == 0) { status = ARES_ETIMEOUT; } else { status = - ares__thread_cond_timedwait(channel->cond_empty, channel->lock, tms); + ares_thread_cond_timedwait(channel->cond_empty, channel->lock, tms); } /* If there was a timeout, don't loop. Otherwise, make sure this wasn't @@ -594,7 +594,7 @@ ares_status_t ares_queue_wait_empty(ares_channel_t *channel, int timeout_ms) } } } - ares__thread_mutex_unlock(channel->lock); + ares_thread_mutex_unlock(channel->lock); return status; } @@ -605,10 +605,10 @@ void ares_queue_notify_empty(ares_channel_t *channel) } /* We are guaranteed to be holding a channel lock already */ - if (ares__llist_len(channel->all_queries)) { + if (ares_llist_len(channel->all_queries)) { return; } /* Notify all waiters of the conditional */ - ares__thread_cond_broadcast(channel->cond_empty); + ares_thread_cond_broadcast(channel->cond_empty); } diff --git a/deps/cares/src/lib/util/ares_threads.h b/deps/cares/src/lib/util/ares_threads.h new file mode 100644 index 00000000000000..95c543e6e994f5 --- /dev/null +++ b/deps/cares/src/lib/util/ares_threads.h @@ -0,0 +1,60 @@ +/* MIT License + * + * Copyright (c) 2023 Brad House + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ +#ifndef __ARES__THREADS_H +#define __ARES__THREADS_H + +struct ares_thread_mutex; +typedef struct ares_thread_mutex ares_thread_mutex_t; + +ares_thread_mutex_t *ares_thread_mutex_create(void); +void ares_thread_mutex_destroy(ares_thread_mutex_t *mut); +void ares_thread_mutex_lock(ares_thread_mutex_t *mut); +void ares_thread_mutex_unlock(ares_thread_mutex_t *mut); + + +struct ares_thread_cond; +typedef struct ares_thread_cond ares_thread_cond_t; + +ares_thread_cond_t *ares_thread_cond_create(void); +void ares_thread_cond_destroy(ares_thread_cond_t *cond); +void ares_thread_cond_signal(ares_thread_cond_t *cond); +void ares_thread_cond_broadcast(ares_thread_cond_t *cond); +ares_status_t ares_thread_cond_wait(ares_thread_cond_t *cond, + ares_thread_mutex_t *mut); +ares_status_t ares_thread_cond_timedwait(ares_thread_cond_t *cond, + ares_thread_mutex_t *mut, + unsigned long timeout_ms); + + +struct ares_thread; +typedef struct ares_thread ares_thread_t; + +typedef void *(*ares_thread_func_t)(void *arg); +ares_status_t ares_thread_create(ares_thread_t **thread, + ares_thread_func_t func, void *arg); +ares_status_t ares_thread_join(ares_thread_t *thread, void **rv); + +#endif diff --git a/deps/cares/src/lib/util/ares_time.h b/deps/cares/src/lib/util/ares_time.h new file mode 100644 index 00000000000000..c6eaf97366379e --- /dev/null +++ b/deps/cares/src/lib/util/ares_time.h @@ -0,0 +1,48 @@ +/* MIT License + * + * Copyright (c) 2024 Brad House + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ +#ifndef __ARES_TIME_H +#define __ARES_TIME_H + +/*! struct timeval on some systems like Windows doesn't support 64bit time so + * therefore can't be used due to Y2K38 issues. Make our own that does have + * 64bit time. */ +typedef struct { + ares_int64_t sec; /*!< Seconds */ + unsigned int usec; /*!< Microseconds. Can't be negative. */ +} ares_timeval_t; + +/* return true if now is exactly check time or later */ +ares_bool_t ares_timedout(const ares_timeval_t *now, + const ares_timeval_t *check); + +void ares_tvnow(ares_timeval_t *now); +void ares_timeval_remaining(ares_timeval_t *remaining, + const ares_timeval_t *now, + const ares_timeval_t *tout); +void ares_timeval_diff(ares_timeval_t *tvdiff, const ares_timeval_t *tvstart, + const ares_timeval_t *tvstop); + +#endif diff --git a/deps/cares/src/lib/util/ares__timeval.c b/deps/cares/src/lib/util/ares_timeval.c similarity index 96% rename from deps/cares/src/lib/util/ares__timeval.c rename to deps/cares/src/lib/util/ares_timeval.c index e3a989dca87a1b..0b0845b6fb7ffe 100644 --- a/deps/cares/src/lib/util/ares__timeval.c +++ b/deps/cares/src/lib/util/ares_timeval.c @@ -28,7 +28,7 @@ #if defined(_WIN32) && !defined(MSDOS) -void ares__tvnow(ares_timeval_t *now) +void ares_tvnow(ares_timeval_t *now) { /* QueryPerformanceCounters() has been around since Windows 2000, though * significant fixes were made in later versions. Documentation states @@ -52,7 +52,7 @@ void ares__tvnow(ares_timeval_t *now) #elif defined(HAVE_CLOCK_GETTIME_MONOTONIC) -void ares__tvnow(ares_timeval_t *now) +void ares_tvnow(ares_timeval_t *now) { /* clock_gettime() is guaranteed to be increased monotonically when the * monotonic clock is queried. Time starting point is unspecified, it @@ -76,7 +76,7 @@ void ares__tvnow(ares_timeval_t *now) #elif defined(HAVE_GETTIMEOFDAY) -void ares__tvnow(ares_timeval_t *now) +void ares_tvnow(ares_timeval_t *now) { /* gettimeofday() is not granted to be increased monotonically, due to * clock drifting and external source time synchronization it can jump diff --git a/deps/cares/src/lib/util/ares_uri.c b/deps/cares/src/lib/util/ares_uri.c new file mode 100644 index 00000000000000..d656f8347f54c9 --- /dev/null +++ b/deps/cares/src/lib/util/ares_uri.c @@ -0,0 +1,1626 @@ +/* MIT License + * + * Copyright (c) 2024 Brad house + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ + + +#include "ares_private.h" +#include "ares_uri.h" +#ifdef HAVE_STDINT_H +# include +#endif + +struct ares_uri { + char scheme[16]; + char *username; + char *password; + unsigned short port; + char host[256]; + char *path; + ares_htable_dict_t *query; + char *fragment; +}; + +/* RFC3986 character set notes: + * gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" + * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + * / "*" / "+" / "," / ";" / "=" + * reserved = gen-delims / sub-delims + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + * scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) + * authority = [ userinfo "@" ] host [ ":" port ] + * userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) + * NOTE: Use of the format "user:password" in the userinfo field is + * deprecated. Applications should not render as clear text any data + * after the first colon (":") character found within a userinfo + * subcomponent unless the data after the colon is the empty string + * (indicating no password). + * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" + * query = *( pchar / "/" / "?" ) + * fragment = *( pchar / "/" / "?" ) + * + * NOTE: Due to ambiguity, "+" in a query must be percent-encoded, as old + * URLs used that for spaces. + */ + + +static ares_bool_t ares_uri_chis_subdelim(char x) +{ + switch (x) { + case '!': + return ARES_TRUE; + case '$': + return ARES_TRUE; + case '&': + return ARES_TRUE; + case '\'': + return ARES_TRUE; + case '(': + return ARES_TRUE; + case ')': + return ARES_TRUE; + case '*': + return ARES_TRUE; + case '+': + return ARES_TRUE; + case ',': + return ARES_TRUE; + case ';': + return ARES_TRUE; + case '=': + return ARES_TRUE; + default: + break; + } + return ARES_FALSE; +} + +/* These don't actually appear to be referenced in any logic */ +#if 0 +static ares_bool_t ares_uri_chis_gendelim(char x) +{ + switch (x) { + case ':': + return ARES_TRUE; + case '/': + return ARES_TRUE; + case '?': + return ARES_TRUE; + case '#': + return ARES_TRUE; + case '[': + return ARES_TRUE; + case ']': + return ARES_TRUE; + case '@': + return ARES_TRUE; + default: + break; + } + return ARES_FALSE; +} + + +static ares_bool_t ares_uri_chis_reserved(char x) +{ + return ares_uri_chis_gendelim(x) || ares_uri_chis_subdelim(x); +} +#endif + +static ares_bool_t ares_uri_chis_unreserved(char x) +{ + switch (x) { + case '-': + return ARES_TRUE; + case '.': + return ARES_TRUE; + case '_': + return ARES_TRUE; + case '~': + return ARES_TRUE; + default: + break; + } + return ares_isalpha(x) || ares_isdigit(x); +} + +static ares_bool_t ares_uri_chis_scheme(char x) +{ + switch (x) { + case '+': + return ARES_TRUE; + case '-': + return ARES_TRUE; + case '.': + return ARES_TRUE; + default: + break; + } + return ares_isalpha(x) || ares_isdigit(x); +} + +static ares_bool_t ares_uri_chis_authority(char x) +{ + /* This one here isn't well defined. We are going to include the valid + * characters of the subfields plus known delimiters */ + return ares_uri_chis_unreserved(x) || ares_uri_chis_subdelim(x) || x == '%' || + x == '[' || x == ']' || x == '@' || x == ':'; +} + +static ares_bool_t ares_uri_chis_userinfo(char x) +{ + /* NOTE: we don't include ':' here since we are using that as our + * username/password delimiter */ + return ares_uri_chis_unreserved(x) || ares_uri_chis_subdelim(x); +} + +static ares_bool_t ares_uri_chis_path(char x) +{ + switch (x) { + case ':': + return ARES_TRUE; + case '@': + return ARES_TRUE; + /* '/' isn't in the spec as a path character since its technically a + * delimiter but we're not splitting on '/' so we accept it as valid */ + case '/': + return ARES_TRUE; + default: + break; + } + return ares_uri_chis_unreserved(x) || ares_uri_chis_subdelim(x); +} + +static ares_bool_t ares_uri_chis_path_enc(char x) +{ + return ares_uri_chis_path(x) || x == '%'; +} + +static ares_bool_t ares_uri_chis_query(char x) +{ + switch (x) { + case '/': + return ARES_TRUE; + case '?': + return ARES_TRUE; + default: + break; + } + + /* Exclude & and = used as delimiters, they're valid characters in the + * set, just not for the individual pieces */ + return ares_uri_chis_path(x) && x != '&' && x != '='; +} + +static ares_bool_t ares_uri_chis_query_enc(char x) +{ + return ares_uri_chis_query(x) || x == '%'; +} + +static ares_bool_t ares_uri_chis_fragment(char x) +{ + switch (x) { + case '/': + return ARES_TRUE; + case '?': + return ARES_TRUE; + default: + break; + } + return ares_uri_chis_path(x); +} + +static ares_bool_t ares_uri_chis_fragment_enc(char x) +{ + return ares_uri_chis_fragment(x) || x == '%'; +} + +ares_uri_t *ares_uri_create(void) +{ + ares_uri_t *uri = ares_malloc_zero(sizeof(*uri)); + + if (uri == NULL) { + return NULL; + } + + uri->query = ares_htable_dict_create(); + if (uri->query == NULL) { + ares_free(uri); + return NULL; + } + + return uri; +} + +void ares_uri_destroy(ares_uri_t *uri) +{ + if (uri == NULL) { + return; + } + + ares_free(uri->username); + ares_free(uri->password); + ares_free(uri->path); + ares_free(uri->fragment); + ares_htable_dict_destroy(uri->query); + ares_free(uri); +} + +static ares_bool_t ares_uri_scheme_is_valid(const char *uri) +{ + size_t i; + + if (ares_strlen(uri) == 0) { + return ARES_FALSE; + } + + if (!ares_isalpha(*uri)) { + return ARES_FALSE; + } + + for (i = 0; uri[i] != 0; i++) { + if (!ares_uri_chis_scheme(uri[i])) { + return ARES_FALSE; + } + } + return ARES_TRUE; +} + +static ares_bool_t ares_uri_str_isvalid(const char *str, size_t max_len, + ares_bool_t (*ischr)(char)) +{ + size_t i; + + if (str == NULL) { + return ARES_FALSE; + } + + for (i = 0; i != max_len && str[i] != 0; i++) { + if (!ischr(str[i])) { + return ARES_FALSE; + } + } + return ARES_TRUE; +} + +ares_status_t ares_uri_set_scheme(ares_uri_t *uri, const char *scheme) +{ + if (uri == NULL) { + return ARES_EFORMERR; + } + + if (!ares_uri_scheme_is_valid(scheme)) { + return ARES_EBADSTR; + } + + ares_strcpy(uri->scheme, scheme, sizeof(uri->scheme)); + ares_str_lower(uri->scheme); + + return ARES_SUCCESS; +} + +const char *ares_uri_get_scheme(const ares_uri_t *uri) +{ + if (uri == NULL) { + return NULL; + } + + return uri->scheme; +} + +static ares_status_t ares_uri_set_username_own(ares_uri_t *uri, char *username) +{ + if (uri == NULL) { + return ARES_EFORMERR; + } + + if (username != NULL && (!ares_str_isprint(username, ares_strlen(username)) || + ares_strlen(username) == 0)) { + return ARES_EBADSTR; + } + + + ares_free(uri->username); + uri->username = username; + return ARES_SUCCESS; +} + +ares_status_t ares_uri_set_username(ares_uri_t *uri, const char *username) +{ + ares_status_t status; + char *temp = NULL; + + if (uri == NULL) { + return ARES_EFORMERR; + } + + if (username != NULL) { + temp = ares_strdup(username); + if (temp == NULL) { + return ARES_ENOMEM; + } + } + + status = ares_uri_set_username_own(uri, temp); + if (status != ARES_SUCCESS) { + ares_free(temp); + } + + return status; +} + +const char *ares_uri_get_username(const ares_uri_t *uri) +{ + if (uri == NULL) { + return NULL; + } + + return uri->username; +} + +static ares_status_t ares_uri_set_password_own(ares_uri_t *uri, char *password) +{ + if (uri == NULL) { + return ARES_EFORMERR; + } + + if (password != NULL && !ares_str_isprint(password, ares_strlen(password))) { + return ARES_EBADSTR; + } + + ares_free(uri->password); + uri->password = password; + return ARES_SUCCESS; +} + +ares_status_t ares_uri_set_password(ares_uri_t *uri, const char *password) +{ + ares_status_t status; + char *temp = NULL; + + if (uri == NULL) { + return ARES_EFORMERR; + } + + if (password != NULL) { + temp = ares_strdup(password); + if (temp == NULL) { + return ARES_ENOMEM; + } + } + + status = ares_uri_set_password_own(uri, temp); + if (status != ARES_SUCCESS) { + ares_free(temp); + } + + return status; +} + +const char *ares_uri_get_password(const ares_uri_t *uri) +{ + if (uri == NULL) { + return NULL; + } + + return uri->password; +} + +ares_status_t ares_uri_set_host(ares_uri_t *uri, const char *host) +{ + struct ares_addr addr; + size_t addrlen; + char hoststr[256]; + char *ll_scope; + + if (uri == NULL || ares_strlen(host) == 0 || + ares_strlen(host) >= sizeof(hoststr)) { + return ARES_EFORMERR; + } + + ares_strcpy(hoststr, host, sizeof(hoststr)); + + /* Look for '%' which could be a link-local scope for ipv6 addresses and + * parse it off */ + ll_scope = strchr(hoststr, '%'); + if (ll_scope != NULL) { + *ll_scope = 0; + ll_scope++; + if (!ares_str_isalnum(ll_scope)) { + return ARES_EBADNAME; + } + } + + /* If its an IP address, normalize it */ + memset(&addr, 0, sizeof(addr)); + addr.family = AF_UNSPEC; + if (ares_dns_pton(hoststr, &addr, &addrlen) != NULL) { + char ipaddr[INET6_ADDRSTRLEN]; + ares_inet_ntop(addr.family, &addr.addr, ipaddr, sizeof(ipaddr)); + /* Only IPv6 is allowed to have a scope */ + if (ll_scope != NULL && addr.family != AF_INET6) { + return ARES_EBADNAME; + } + + if (ll_scope != NULL) { + snprintf(uri->host, sizeof(uri->host), "%s%%%s", ipaddr, ll_scope); + } else { + ares_strcpy(uri->host, ipaddr, sizeof(uri->host)); + } + return ARES_SUCCESS; + } + + /* If its a hostname, make sure its a valid charset */ + if (!ares_is_hostname(host)) { + return ARES_EBADNAME; + } + + ares_strcpy(uri->host, host, sizeof(uri->host)); + return ARES_SUCCESS; +} + +const char *ares_uri_get_host(const ares_uri_t *uri) +{ + if (uri == NULL) { + return NULL; + } + + return uri->host; +} + +ares_status_t ares_uri_set_port(ares_uri_t *uri, unsigned short port) +{ + if (uri == NULL) { + return ARES_EFORMERR; + } + uri->port = port; + return ARES_SUCCESS; +} + +unsigned short ares_uri_get_port(const ares_uri_t *uri) +{ + if (uri == NULL) { + return 0; + } + return uri->port; +} + +/* URI spec says path normalization is a requirement */ +static char *ares_uri_path_normalize(const char *path) +{ + ares_status_t status; + ares_array_t *arr = NULL; + ares_buf_t *outpath = NULL; + ares_buf_t *inpath = NULL; + ares_ssize_t i; + size_t j; + size_t len; + + inpath = + ares_buf_create_const((const unsigned char *)path, ares_strlen(path)); + if (inpath == NULL) { + status = ARES_ENOMEM; + goto done; + } + + outpath = ares_buf_create(); + if (outpath == NULL) { + status = ARES_ENOMEM; + goto done; + } + + status = ares_buf_split_str_array(inpath, (const unsigned char *)"/", 1, + ARES_BUF_SPLIT_TRIM, 0, &arr); + if (status != ARES_SUCCESS) { + return NULL; + } + + for (i = 0; i < (ares_ssize_t)ares_array_len(arr); i++) { + const char **strptr = ares_array_at(arr, (size_t)i); + const char *str = *strptr; + + if (ares_streq(str, ".")) { + ares_array_remove_at(arr, (size_t)i); + i--; + } else if (ares_streq(str, "..")) { + if (i != 0) { + ares_array_remove_at(arr, (size_t)i - 1); + i--; + } + ares_array_remove_at(arr, (size_t)i); + i--; + } + } + + status = ares_buf_append_byte(outpath, '/'); + if (status != ARES_SUCCESS) { + goto done; + } + + len = ares_array_len(arr); + for (j = 0; j < len; j++) { + const char **strptr = ares_array_at(arr, j); + const char *str = *strptr; + status = ares_buf_append_str(outpath, str); + if (status != ARES_SUCCESS) { + goto done; + } + + /* Path separator, but on the last entry, we need to check if it was + * originally terminated or not because they have different meanings */ + if (j != len - 1 || path[ares_strlen(path) - 1] == '/') { + status = ares_buf_append_byte(outpath, '/'); + if (status != ARES_SUCCESS) { + goto done; + } + } + } + +done: + ares_array_destroy(arr); + ares_buf_destroy(inpath); + if (status != ARES_SUCCESS) { + ares_buf_destroy(outpath); + return NULL; + } + + return ares_buf_finish_str(outpath, NULL); +} + +ares_status_t ares_uri_set_path(ares_uri_t *uri, const char *path) +{ + char *temp = NULL; + + if (uri == NULL) { + return ARES_EFORMERR; + } + + if (path != NULL && !ares_str_isprint(path, ares_strlen(path))) { + return ARES_EBADSTR; + } + + if (path != NULL) { + temp = ares_uri_path_normalize(path); + if (temp == NULL) { + return ARES_ENOMEM; + } + } + + ares_free(uri->path); + uri->path = temp; + + return ARES_SUCCESS; +} + +const char *ares_uri_get_path(const ares_uri_t *uri) +{ + if (uri == NULL) { + return NULL; + } + + return uri->path; +} + +ares_status_t ares_uri_set_query_key(ares_uri_t *uri, const char *key, + const char *val) +{ + if (uri == NULL || key == NULL || *key == 0) { + return ARES_EFORMERR; + } + + if (!ares_str_isprint(key, ares_strlen(key)) || + (val != NULL && !ares_str_isprint(val, ares_strlen(val)))) { + return ARES_EBADSTR; + } + + if (!ares_htable_dict_insert(uri->query, key, val)) { + return ARES_ENOMEM; + } + return ARES_SUCCESS; +} + +ares_status_t ares_uri_del_query_key(ares_uri_t *uri, const char *key) +{ + if (uri == NULL || key == NULL || *key == 0 || + !ares_str_isprint(key, ares_strlen(key))) { + return ARES_EFORMERR; + } + + if (!ares_htable_dict_remove(uri->query, key)) { + return ARES_ENOTFOUND; + } + + return ARES_SUCCESS; +} + +const char *ares_uri_get_query_key(const ares_uri_t *uri, const char *key) +{ + if (uri == NULL || key == NULL || *key == 0 || + !ares_str_isprint(key, ares_strlen(key))) { + return NULL; + } + + return ares_htable_dict_get_direct(uri->query, key); +} + +char **ares_uri_get_query_keys(const ares_uri_t *uri, size_t *num) +{ + if (uri == NULL || num == NULL) { + return NULL; + } + + return ares_htable_dict_keys(uri->query, num); +} + +static ares_status_t ares_uri_set_fragment_own(ares_uri_t *uri, char *fragment) +{ + if (uri == NULL) { + return ARES_EFORMERR; + } + + if (fragment != NULL && !ares_str_isprint(fragment, ares_strlen(fragment))) { + return ARES_EBADSTR; + } + + ares_free(uri->fragment); + uri->fragment = fragment; + return ARES_SUCCESS; +} + +ares_status_t ares_uri_set_fragment(ares_uri_t *uri, const char *fragment) +{ + ares_status_t status; + char *temp = NULL; + + if (uri == NULL) { + return ARES_EFORMERR; + } + + if (fragment != NULL) { + temp = ares_strdup(fragment); + if (temp == NULL) { + return ARES_ENOMEM; + } + } + + status = ares_uri_set_fragment_own(uri, temp); + if (status != ARES_SUCCESS) { + ares_free(temp); + } + + return status; +} + +const char *ares_uri_get_fragment(const ares_uri_t *uri) +{ + if (uri == NULL) { + return NULL; + } + return uri->fragment; +} + +static ares_status_t ares_uri_encode_buf(ares_buf_t *buf, const char *str, + ares_bool_t (*ischr)(char)) +{ + size_t i; + + if (buf == NULL || str == NULL) { + return ARES_EFORMERR; + } + + for (i = 0; str[i] != 0; i++) { + if (ischr(str[i])) { + if (ares_buf_append_byte(buf, (unsigned char)str[i]) != ARES_SUCCESS) { + return ARES_ENOMEM; + } + } else { + if (ares_buf_append_byte(buf, '%') != ARES_SUCCESS) { + return ARES_ENOMEM; + } + if (ares_buf_append_num_hex(buf, (size_t)str[i], 2) != ARES_SUCCESS) { + return ARES_ENOMEM; + } + } + } + return ARES_SUCCESS; +} + +static ares_status_t ares_uri_write_scheme(const ares_uri_t *uri, + ares_buf_t *buf) +{ + ares_status_t status; + + status = ares_buf_append_str(buf, uri->scheme); + if (status != ARES_SUCCESS) { + return status; + } + + status = ares_buf_append_str(buf, "://"); + + return status; +} + +static ares_status_t ares_uri_write_authority(const ares_uri_t *uri, + ares_buf_t *buf) +{ + ares_status_t status; + ares_bool_t is_ipv6 = ARES_FALSE; + + if (ares_strlen(uri->username)) { + status = ares_uri_encode_buf(buf, uri->username, ares_uri_chis_userinfo); + if (status != ARES_SUCCESS) { + return status; + } + } + + if (ares_strlen(uri->password)) { + status = ares_buf_append_byte(buf, ':'); + if (status != ARES_SUCCESS) { + return status; + } + + status = ares_uri_encode_buf(buf, uri->password, ares_uri_chis_userinfo); + if (status != ARES_SUCCESS) { + return status; + } + } + + if (ares_strlen(uri->username) || ares_strlen(uri->password)) { + status = ares_buf_append_byte(buf, '@'); + if (status != ARES_SUCCESS) { + return status; + } + } + + /* We need to write ipv6 addresses with [ ] */ + if (strchr(uri->host, '%') != NULL) { + /* If we have a % in the name, it must be ipv6 link local scope, so we + * don't need to check anything else */ + is_ipv6 = ARES_TRUE; + } else { + /* Parse the host to see if it is an ipv6 address */ + struct ares_addr addr; + size_t addrlen; + memset(&addr, 0, sizeof(addr)); + addr.family = AF_INET6; + if (ares_dns_pton(uri->host, &addr, &addrlen) != NULL) { + is_ipv6 = ARES_TRUE; + } + } + + if (is_ipv6) { + status = ares_buf_append_byte(buf, '['); + if (status != ARES_SUCCESS) { + return status; + } + } + + status = ares_buf_append_str(buf, uri->host); + if (status != ARES_SUCCESS) { + return status; + } + + if (is_ipv6) { + status = ares_buf_append_byte(buf, ']'); + if (status != ARES_SUCCESS) { + return status; + } + } + + if (uri->port > 0) { + status = ares_buf_append_byte(buf, ':'); + if (status != ARES_SUCCESS) { + return status; + } + status = ares_buf_append_num_dec(buf, uri->port, 0); + if (status != ARES_SUCCESS) { + return status; + } + } + + return status; +} + +static ares_status_t ares_uri_write_path(const ares_uri_t *uri, ares_buf_t *buf) +{ + ares_status_t status; + + if (ares_strlen(uri->path) == 0) { + return ARES_SUCCESS; + } + + if (*uri->path != '/') { + status = ares_buf_append_byte(buf, '/'); + if (status != ARES_SUCCESS) { + return status; + } + } + + status = ares_uri_encode_buf(buf, uri->path, ares_uri_chis_path); + if (status != ARES_SUCCESS) { + return status; + } + + return ARES_SUCCESS; +} + +static ares_status_t ares_uri_write_query(const ares_uri_t *uri, + ares_buf_t *buf) +{ + ares_status_t status; + char **keys; + size_t num_keys = 0; + size_t i; + + if (ares_htable_dict_num_keys(uri->query) == 0) { + return ARES_SUCCESS; + } + + keys = ares_uri_get_query_keys(uri, &num_keys); + if (keys == NULL || num_keys == 0) { + return ARES_ENOMEM; + } + + status = ares_buf_append_byte(buf, '?'); + if (status != ARES_SUCCESS) { + goto done; + } + + for (i = 0; i < num_keys; i++) { + const char *val; + + if (i != 0) { + status = ares_buf_append_byte(buf, '&'); + if (status != ARES_SUCCESS) { + goto done; + } + } + + status = ares_uri_encode_buf(buf, keys[i], ares_uri_chis_query); + if (status != ARES_SUCCESS) { + goto done; + } + + val = ares_uri_get_query_key(uri, keys[i]); + if (val != NULL) { + status = ares_buf_append_byte(buf, '='); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_encode_buf(buf, val, ares_uri_chis_query); + if (status != ARES_SUCCESS) { + goto done; + } + } + } + +done: + ares_free_array(keys, num_keys, ares_free); + return status; +} + +static ares_status_t ares_uri_write_fragment(const ares_uri_t *uri, + ares_buf_t *buf) +{ + ares_status_t status; + + if (!ares_strlen(uri->fragment)) { + return ARES_SUCCESS; + } + + status = ares_buf_append_byte(buf, '#'); + if (status != ARES_SUCCESS) { + return status; + } + + status = ares_uri_encode_buf(buf, uri->fragment, ares_uri_chis_fragment); + if (status != ARES_SUCCESS) { + return status; + } + + return ARES_SUCCESS; +} + +ares_status_t ares_uri_write_buf(const ares_uri_t *uri, ares_buf_t *buf) +{ + ares_status_t status; + size_t orig_len; + + if (uri == NULL || buf == NULL) { + return ARES_EFORMERR; + } + + if (ares_strlen(uri->scheme) == 0 || ares_strlen(uri->host) == 0) { + return ARES_ENODATA; + } + + orig_len = ares_buf_len(buf); + + status = ares_uri_write_scheme(uri, buf); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_write_authority(uri, buf); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_write_path(uri, buf); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_write_query(uri, buf); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_write_fragment(uri, buf); + if (status != ARES_SUCCESS) { + goto done; + } + +done: + if (status != ARES_SUCCESS) { + ares_buf_set_length(buf, orig_len); + } + return status; +} + +ares_status_t ares_uri_write(char **out, const ares_uri_t *uri) +{ + ares_buf_t *buf; + ares_status_t status; + + if (out == NULL || uri == NULL) { + return ARES_EFORMERR; + } + + *out = NULL; + + buf = ares_buf_create(); + if (buf == NULL) { + return ARES_ENOMEM; + } + + status = ares_uri_write_buf(uri, buf); + if (status != ARES_SUCCESS) { + ares_buf_destroy(buf); + return status; + } + + *out = ares_buf_finish_str(buf, NULL); + return ARES_SUCCESS; +} + +#define xdigit_val(x) \ + ((x >= '0' && x <= '9') \ + ? (x - '0') \ + : ((x >= 'A' && x <= 'F') ? (x - 'A' + 10) : (x - 'a' + 10))) + +static ares_status_t ares_uri_decode_inplace(char *str, ares_bool_t is_query, + ares_bool_t must_be_printable, + size_t *out_len) +{ + size_t i; + size_t len = 0; + + for (i = 0; str[i] != 0; i++) { + if (is_query && str[i] == '+') { + str[len++] = ' '; + continue; + } + + if (str[i] != '%') { + str[len++] = str[i]; + continue; + } + + if (!ares_isxdigit(str[i + 1]) || !ares_isxdigit(str[i + 2])) { + return ARES_EBADSTR; + } + + str[len] = (char)(xdigit_val(str[i + 1]) << 4 | xdigit_val(str[i + 2])); + + if (must_be_printable && !ares_isprint(str[len])) { + return ARES_EBADSTR; + } + + len++; + + i += 2; + } + + str[len] = 0; + + *out_len = len; + return ARES_SUCCESS; +} + +static ares_status_t ares_uri_parse_scheme(ares_uri_t *uri, ares_buf_t *buf) +{ + ares_status_t status; + size_t bytes; + char scheme[sizeof(uri->scheme)]; + + ares_buf_tag(buf); + + bytes = + ares_buf_consume_until_seq(buf, (const unsigned char *)"://", 3, ARES_TRUE); + if (bytes == SIZE_MAX || bytes > sizeof(uri->scheme)) { + return ARES_EBADSTR; + } + + status = ares_buf_tag_fetch_string(buf, scheme, sizeof(scheme)); + if (status != ARES_SUCCESS) { + return status; + } + + status = ares_uri_set_scheme(uri, scheme); + if (status != ARES_SUCCESS) { + return status; + } + + /* Consume :// */ + ares_buf_consume(buf, 3); + + return ARES_SUCCESS; +} + +static ares_status_t ares_uri_parse_userinfo(ares_uri_t *uri, ares_buf_t *buf) +{ + size_t userinfo_len; + size_t username_len; + ares_bool_t has_password = ARES_FALSE; + char *temp = NULL; + ares_status_t status; + size_t len; + + ares_buf_tag(buf); + + /* Search for @, if its not found, return */ + userinfo_len = ares_buf_consume_until_charset(buf, (const unsigned char *)"@", + 1, ARES_TRUE); + + if (userinfo_len == SIZE_MAX) { + return ARES_SUCCESS; + } + + /* Rollback since now we know there really is userinfo */ + ares_buf_tag_rollback(buf); + + /* Search for ':', if it isn't found or its past the '@' then we only have + * a username and no password */ + ares_buf_tag(buf); + username_len = ares_buf_consume_until_charset(buf, (const unsigned char *)":", + 1, ARES_TRUE); + if (username_len < userinfo_len) { + has_password = ARES_TRUE; + status = ares_buf_tag_fetch_strdup(buf, &temp); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_decode_inplace(temp, ARES_FALSE, ARES_TRUE, &len); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_set_username_own(uri, temp); + if (status != ARES_SUCCESS) { + goto done; + } + temp = NULL; + + /* Consume : */ + ares_buf_consume(buf, 1); + } + + ares_buf_tag(buf); + ares_buf_consume_until_charset(buf, (const unsigned char *)"@", 1, ARES_TRUE); + status = ares_buf_tag_fetch_strdup(buf, &temp); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_decode_inplace(temp, ARES_FALSE, ARES_TRUE, &len); + if (status != ARES_SUCCESS) { + goto done; + } + + if (has_password) { + status = ares_uri_set_password_own(uri, temp); + } else { + status = ares_uri_set_username_own(uri, temp); + } + if (status != ARES_SUCCESS) { + goto done; + } + temp = NULL; + + /* Consume @ */ + ares_buf_consume(buf, 1); + +done: + ares_free(temp); + return status; +} + +static ares_status_t ares_uri_parse_hostport(ares_uri_t *uri, ares_buf_t *buf) +{ + unsigned char b; + char host[256]; + char port[6]; + size_t len; + ares_status_t status; + + status = ares_buf_peek_byte(buf, &b); + if (status != ARES_SUCCESS) { + return status; + } + + /* Bracketed syntax for ipv6 addresses */ + if (b == '[') { + ares_buf_consume(buf, 1); + ares_buf_tag(buf); + len = ares_buf_consume_until_charset(buf, (const unsigned char *)"]", 1, + ARES_TRUE); + if (len == SIZE_MAX) { + return ARES_EBADSTR; + } + + status = ares_buf_tag_fetch_string(buf, host, sizeof(host)); + if (status != ARES_SUCCESS) { + return status; + } + /* Consume ']' */ + ares_buf_consume(buf, 1); + } else { + /* Either ipv4 or hostname */ + ares_buf_tag(buf); + ares_buf_consume_until_charset(buf, (const unsigned char *)":", 1, + ARES_FALSE); + + status = ares_buf_tag_fetch_string(buf, host, sizeof(host)); + if (status != ARES_SUCCESS) { + return status; + } + } + + status = ares_uri_set_host(uri, host); + if (status != ARES_SUCCESS) { + return status; + } + + /* No port if nothing left to consume */ + if (!ares_buf_len(buf)) { + return status; + } + + status = ares_buf_peek_byte(buf, &b); + if (status != ARES_SUCCESS) { + return status; + } + + /* Only valid extra character at this point is ':' */ + if (b != ':') { + return ARES_EBADSTR; + } + ares_buf_consume(buf, 1); + + len = ares_buf_len(buf); + if (len == 0 || len > sizeof(port) - 1) { + return ARES_EBADSTR; + } + + status = ares_buf_fetch_bytes(buf, (unsigned char *)port, len); + if (status != ARES_SUCCESS) { + return status; + } + port[len] = 0; + + if (!ares_str_isnum(port)) { + return ARES_EBADSTR; + } + + status = ares_uri_set_port(uri, (unsigned short)atoi(port)); + if (status != ARES_SUCCESS) { + return status; + } + + return ARES_SUCCESS; +} + +static ares_status_t ares_uri_parse_authority(ares_uri_t *uri, ares_buf_t *buf) +{ + ares_status_t status; + size_t bytes; + ares_buf_t *auth = NULL; + const unsigned char *ptr; + size_t ptr_len; + + ares_buf_tag(buf); + + bytes = ares_buf_consume_until_charset(buf, (const unsigned char *)"/?#", 3, + ARES_FALSE); + if (bytes == 0) { + return ARES_EBADSTR; + } + + status = ares_buf_tag_fetch_constbuf(buf, &auth); + if (status != ARES_SUCCESS) { + goto done; + } + + ptr = ares_buf_peek(auth, &ptr_len); + if (!ares_uri_str_isvalid((const char *)ptr, ptr_len, + ares_uri_chis_authority)) { + status = ARES_EBADSTR; + goto done; + } + + status = ares_uri_parse_userinfo(uri, auth); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_parse_hostport(uri, auth); + if (status != ARES_SUCCESS) { + goto done; + } + + /* NOTE: the /, ?, or # is still in the buffer at this point so it can + * be used to determine what parser should be called next */ + +done: + ares_buf_destroy(auth); + return status; +} + +static ares_status_t ares_uri_parse_path(ares_uri_t *uri, ares_buf_t *buf) +{ + unsigned char b; + char *path = NULL; + ares_status_t status; + size_t len; + + if (ares_buf_len(buf) == 0) { + return ARES_SUCCESS; + } + + status = ares_buf_peek_byte(buf, &b); + if (status != ARES_SUCCESS) { + return status; + } + + /* Not a path, must be one of the others */ + if (b != '/') { + return ARES_SUCCESS; + } + + ares_buf_tag(buf); + ares_buf_consume_until_charset(buf, (const unsigned char *)"?#", 2, + ARES_FALSE); + status = ares_buf_tag_fetch_strdup(buf, &path); + if (status != ARES_SUCCESS) { + goto done; + } + + if (!ares_uri_str_isvalid(path, SIZE_MAX, ares_uri_chis_path_enc)) { + status = ARES_EBADSTR; + goto done; + } + + status = ares_uri_decode_inplace(path, ARES_FALSE, ARES_TRUE, &len); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_set_path(uri, path); + if (status != ARES_SUCCESS) { + goto done; + } + +done: + ares_free(path); + return status; +} + +static ares_status_t ares_uri_parse_query_buf(ares_uri_t *uri, ares_buf_t *buf) +{ + ares_status_t status = ARES_SUCCESS; + char *key = NULL; + char *val = NULL; + + while (ares_buf_len(buf) > 0) { + unsigned char b = 0; + size_t len; + + ares_buf_tag(buf); + + /* Its valid to have only a key with no value, so we search for both + * delims */ + len = ares_buf_consume_until_charset(buf, (const unsigned char *)"&=", 2, + ARES_FALSE); + if (len == 0) { + /* If we're here, we have a zero length key which is invalid */ + status = ARES_EBADSTR; + goto done; + } + + if (ares_buf_len(buf) > 0) { + /* Determine if we stopped on & or = */ + status = ares_buf_peek_byte(buf, &b); + if (status != ARES_SUCCESS) { + goto done; + } + } + + status = ares_buf_tag_fetch_strdup(buf, &key); + if (status != ARES_SUCCESS) { + goto done; + } + + if (!ares_uri_str_isvalid(key, SIZE_MAX, ares_uri_chis_query_enc)) { + status = ARES_EBADSTR; + goto done; + } + + status = ares_uri_decode_inplace(key, ARES_TRUE, ARES_TRUE, &len); + if (status != ARES_SUCCESS) { + goto done; + } + + /* Fetch Value */ + if (b == '=') { + /* Skip delimiter */ + ares_buf_consume(buf, 1); + ares_buf_tag(buf); + len = ares_buf_consume_until_charset(buf, (const unsigned char *)"&", 1, + ARES_FALSE); + if (len > 0) { + status = ares_buf_tag_fetch_strdup(buf, &val); + if (status != ARES_SUCCESS) { + goto done; + } + + if (!ares_uri_str_isvalid(val, SIZE_MAX, ares_uri_chis_query_enc)) { + status = ARES_EBADSTR; + goto done; + } + + status = ares_uri_decode_inplace(val, ARES_TRUE, ARES_TRUE, &len); + if (status != ARES_SUCCESS) { + goto done; + } + } + } + + if (b != 0) { + /* Consume '&' */ + ares_buf_consume(buf, 1); + } + + status = ares_uri_set_query_key(uri, key, val); + if (status != ARES_SUCCESS) { + goto done; + } + + ares_free(key); + key = NULL; + ares_free(val); + val = NULL; + } + +done: + ares_free(key); + ares_free(val); + return status; +} + +static ares_status_t ares_uri_parse_query(ares_uri_t *uri, ares_buf_t *buf) +{ + unsigned char b; + ares_status_t status; + ares_buf_t *query = NULL; + size_t len; + + if (ares_buf_len(buf) == 0) { + return ARES_SUCCESS; + } + + status = ares_buf_peek_byte(buf, &b); + if (status != ARES_SUCCESS) { + return status; + } + + /* Not a query, must be one of the others */ + if (b != '?') { + return ARES_SUCCESS; + } + + /* Only possible terminator is fragment indicator of '#' */ + ares_buf_consume(buf, 1); + ares_buf_tag(buf); + len = ares_buf_consume_until_charset(buf, (const unsigned char *)"#", 1, + ARES_FALSE); + if (len == 0) { + /* No data, return */ + return ARES_SUCCESS; + } + + status = ares_buf_tag_fetch_constbuf(buf, &query); + if (status != ARES_SUCCESS) { + return status; + } + + status = ares_uri_parse_query_buf(uri, query); + ares_buf_destroy(query); + + return status; +} + +static ares_status_t ares_uri_parse_fragment(ares_uri_t *uri, ares_buf_t *buf) +{ + unsigned char b; + char *fragment = NULL; + ares_status_t status; + size_t len; + + if (ares_buf_len(buf) == 0) { + return ARES_SUCCESS; + } + + status = ares_buf_peek_byte(buf, &b); + if (status != ARES_SUCCESS) { + return status; + } + + /* Not a fragment, must be one of the others */ + if (b != '#') { + return ARES_SUCCESS; + } + + ares_buf_consume(buf, 1); + + if (ares_buf_len(buf) == 0) { + return ARES_SUCCESS; + } + + /* Rest of the buffer is the fragment */ + status = ares_buf_fetch_str_dup(buf, ares_buf_len(buf), &fragment); + if (status != ARES_SUCCESS) { + goto done; + } + + if (!ares_uri_str_isvalid(fragment, SIZE_MAX, ares_uri_chis_fragment_enc)) { + status = ARES_EBADSTR; + goto done; + } + + status = ares_uri_decode_inplace(fragment, ARES_FALSE, ARES_TRUE, &len); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_set_fragment_own(uri, fragment); + if (status != ARES_SUCCESS) { + goto done; + } + fragment = NULL; + +done: + ares_free(fragment); + return status; +} + +ares_status_t ares_uri_parse_buf(ares_uri_t **out, ares_buf_t *buf) +{ + ares_status_t status; + ares_uri_t *uri = NULL; + size_t orig_pos; + + if (out == NULL || buf == NULL) { + return ARES_EFORMERR; + } + + *out = NULL; + + orig_pos = ares_buf_get_position(buf); + + uri = ares_uri_create(); + if (uri == NULL) { + status = ARES_ENOMEM; + goto done; + } + + status = ares_uri_parse_scheme(uri, buf); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_parse_authority(uri, buf); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_parse_path(uri, buf); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_parse_query(uri, buf); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_parse_fragment(uri, buf); + if (status != ARES_SUCCESS) { + goto done; + } + +done: + if (status != ARES_SUCCESS) { + ares_buf_set_position(buf, orig_pos); + ares_uri_destroy(uri); + } else { + *out = uri; + } + return status; +} + +ares_status_t ares_uri_parse(ares_uri_t **out, const char *str) +{ + ares_status_t status; + ares_buf_t *buf = NULL; + + if (out == NULL || str == NULL) { + return ARES_EFORMERR; + } + + *out = NULL; + + buf = ares_buf_create(); + if (buf == NULL) { + status = ARES_ENOMEM; + goto done; + } + + status = ares_buf_append_str(buf, str); + if (status != ARES_SUCCESS) { + goto done; + } + + status = ares_uri_parse_buf(out, buf); + if (status != ARES_SUCCESS) { + goto done; + } + +done: + ares_buf_destroy(buf); + + return status; +} diff --git a/deps/cares/src/lib/util/ares_uri.h b/deps/cares/src/lib/util/ares_uri.h new file mode 100644 index 00000000000000..6a703cba5b53c5 --- /dev/null +++ b/deps/cares/src/lib/util/ares_uri.h @@ -0,0 +1,252 @@ +/* MIT License + * + * Copyright (c) 2024 Brad House + * + * 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 (including the next + * paragraph) 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ +#ifndef __ARES_URI_H +#define __ARES_URI_H + +/*! \addtogroup ares_uri URI parser and writer implementation + * + * This is a fairly complete URI parser and writer implementation (RFC 3986) for + * schemes which use the :// syntax. Does not currently support URIs without an + * authority section, such as "mailto:person@example.com". + * + * Its implementation is overkill for our current needs to be able to express + * DNS server configuration, but there was really no reason not to support + * a greater subset of the specification. + * + * @{ + */ + + +struct ares_uri; + +/*! URI object */ +typedef struct ares_uri ares_uri_t; + +/*! Create a new URI object + * + * \return new ares_uri_t, must be freed with ares_uri_destroy() + */ +ares_uri_t *ares_uri_create(void); + +/*! Destroy an initialized URI object + * + * \param[in] uri Initialized URI object + */ +void ares_uri_destroy(ares_uri_t *uri); + +/*! Set the URI scheme. Automatically lower-cases the scheme provided. + * Only allows Alpha, Digit, +, -, and . characters. Maximum length is + * 15 characters. This is required to be set to write a URI. + * + * \param[in] uri Initialized URI object + * \param[in] scheme Scheme to set the object to use + * \return ARES_SUCCESS on success + */ +ares_status_t ares_uri_set_scheme(ares_uri_t *uri, const char *scheme); + +/*! Retrieve the currently configured URI scheme. + * + * \param[in] uri Initialized URI object + * \return string containing URI scheme + */ +const char *ares_uri_get_scheme(const ares_uri_t *uri); + +/*! Set the username in the URI object + * + * \param[in] uri Initialized URI object + * \param[in] username Username to set. May be NULL to unset existing username. + * \return ARES_SUCCESS on success + */ +ares_status_t ares_uri_set_username(ares_uri_t *uri, const char *username); + +/*! Retrieve the currently configured username. + * + * \param[in] uri Initialized URI object + * \return string containing username, maybe NULL if not set. + */ +const char *ares_uri_get_username(const ares_uri_t *uri); + +/*! Set the password in the URI object + * + * \param[in] uri Initialized URI object + * \param[in] password Password to set. May be NULL to unset existing password. + * \return ARES_SUCCESS on success + */ +ares_status_t ares_uri_set_password(ares_uri_t *uri, const char *password); + +/*! Retrieve the currently configured password. + * + * \param[in] uri Initialized URI object + * \return string containing password, maybe NULL if not set. + */ +const char *ares_uri_get_password(const ares_uri_t *uri); + +/*! Set the host or ip address in the URI object. This is required to be + * set to write a URI. The character set is strictly validated. + * + * \param[in] uri Initialized URI object + * \param[in] host IPv4, IPv6, or hostname to set. + * \return ARES_SUCCESS on success + */ +ares_status_t ares_uri_set_host(ares_uri_t *uri, const char *host); + +/*! Retrieve the currently configured host (or ip address). IPv6 addresses + * May include a link-local scope (e.g. fe80::b542:84df:1719:65e3%en0). + * + * \param[in] uri Initialized URI object + * \return string containing host, maybe NULL if not set. + */ +const char *ares_uri_get_host(const ares_uri_t *uri); + +/*! Set the port to use in the URI object. A port value of 0 will omit + * the port from the URI when written, thus using the scheme's default. + * + * \param[in] uri Initialized URI object + * \param[in] port Port to set. Use 0 to unset. + * \return ARES_SUCCESS on success + */ +ares_status_t ares_uri_set_port(ares_uri_t *uri, unsigned short port); + +/*! Retrieve the currently configured port + * + * \param[in] uri Initialized URI object + * \return port number, or 0 if not set. + */ +unsigned short ares_uri_get_port(const ares_uri_t *uri); + +/*! Set the path in the URI object. Unsupported characters will be URI-encoded + * when written. + * + * \param[in] uri Initialized URI object + * \param[in] path Path to set. May be NULL to unset existing path. + * \return ARES_SUCCESS on success + */ +ares_status_t ares_uri_set_path(ares_uri_t *uri, const char *path); + +/*! Retrieves the path in the URI object. If retrieved after parse, this + * value will be URI-decoded already. + * + * \param[in] uri Initialized URI object + * \return path string, or NULL if not set. + */ +const char *ares_uri_get_path(const ares_uri_t *uri); + +/*! Set a new query key/value pair. There is no set order for query keys + * when output in the URI, they will be emitted in a random order. Keys are + * case-insensitive. Query keys and values will be automatically URI-encoded + * when written. + * + * \param[in] uri Initialized URI object + * \param[in] key Query key to use, must be non-zero length. + * \param[in] val Query value to use, may be NULL. + * \return ARES_SUCCESS on success + */ +ares_status_t ares_uri_set_query_key(ares_uri_t *uri, const char *key, + const char *val); + +/*! Delete a specific query key. + * + * \param[in] uri Initialized URI object + * \param[in] key Key to delete. + * \return ARES_SUCCESS if deleted, ARES_ENOTFOUND if not found + */ +ares_status_t ares_uri_del_query_key(ares_uri_t *uri, const char *key); + +/*! Retrieve the value associted with a query key. Keys are case-insensitive. + * + * \param[in] uri Initialized URI object + * \param[in] key Key to retrieve. + * \return string representing value, may be NULL if either not found or + * NULL value set. There is currently no way to indicate the + * difference. + */ +const char *ares_uri_get_query_key(const ares_uri_t *uri, const char *key); + +/*! Retrieve a complete list of query keys. + * + * \param[in] uri Initialized URI object + * \param[out] num Number of keys. + * \return NULL on failure or no keys. Use + * ares_free_array(keys, num, ares_free) when done with array. + */ +char **ares_uri_get_query_keys(const ares_uri_t *uri, size_t *num); + +/*! Set the fragment in the URI object. Unsupported characters will be + * URI-encoded when written. + * + * \param[in] uri Initialized URI object + * \param[in] fragment Fragment to set. May be NULL to unset existing fragment. + * \return ARES_SUCCESS on success + */ +ares_status_t ares_uri_set_fragment(ares_uri_t *uri, const char *fragment); + +/*! Retrieves the fragment in the URI object. If retrieved after parse, this + * value will be URI-decoded already. + * + * \param[in] uri Initialized URI object + * \return fragment string, or NULL if not set. + */ +const char *ares_uri_get_fragment(const ares_uri_t *uri); + +/*! Parse the provided URI buffer into a new URI object. + * + * \param[out] out Returned new URI object. free with ares_uri_destroy(). + * \param[in] buf Buffer object containing the URI + * \return ARES_SUCCESS on successful parse. On failure the 'buf' object will + * be restored to its initial state in case another parser needs to + * be attempted. + */ +ares_status_t ares_uri_parse_buf(ares_uri_t **out, ares_buf_t *buf); + +/*! Parse the provided URI string into a new URI object. + * + * \param[out] out Returned new URI object. free with ares_uri_destroy(). + * \param[in] uri URI string to parse + * \return ARES_SUCCESS on successful parse + */ +ares_status_t ares_uri_parse(ares_uri_t **out, const char *uri); + +/*! Write URI object to a new string buffer. Requires at least the scheme + * and host to be set for this to succeed. + * + * \param[out] out Returned new URI string. Free with ares_free(). + * \param[in] uri Initialized URI object. + * \return ARES_SUCCESS on successful write. + */ +ares_status_t ares_uri_write(char **out, const ares_uri_t *uri); + +/*! Write URI object to an existing ares_buf_t object. Requires at least the + * scheme and host to be set for this to succeed. + * + * \param[in] uri Initialized URI object. + * \param[in,out] buf Destination buf object. + * \return ARES_SUCCESS on successful write. + */ +ares_status_t ares_uri_write_buf(const ares_uri_t *uri, ares_buf_t *buf); + +/*! @} */ + +#endif /* __ARES_URI_H */ diff --git a/deps/cares/src/tools/CMakeLists.txt b/deps/cares/src/tools/CMakeLists.txt index e23d0f23c781f7..c8c0041e54de81 100644 --- a/deps/cares/src/tools/CMakeLists.txt +++ b/deps/cares/src/tools/CMakeLists.txt @@ -11,6 +11,7 @@ IF (CARES_BUILD_TOOLS) PUBLIC "$" "$" "$" + "$" "$" "$" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" @@ -25,13 +26,18 @@ IF (CARES_BUILD_TOOLS) TARGET_COMPILE_DEFINITIONS (ahost PRIVATE HAVE_CONFIG_H=1 CARES_NO_DEPRECATED) TARGET_LINK_LIBRARIES (ahost PRIVATE ${PROJECT_NAME}) + + # Avoid "fatal error C1041: cannot open program database" due to multiple + # targets trying to use the same PDB. /FS does NOT resolve this issue. + SET_TARGET_PROPERTIES(ahost PROPERTIES COMPILE_PDB_NAME ahost.pdb) + IF (CARES_INSTALL) INSTALL (TARGETS ahost COMPONENT Tools ${TARGETS_INST_DEST}) ENDIF () # Build adig - ADD_EXECUTABLE (adig adig.c ${SAMPLESOURCES}) + ADD_EXECUTABLE (adig adig.c) # Don't build adig and ahost in parallel. This is to prevent a Windows MSVC # build error due to them both using the same source files. ADD_DEPENDENCIES(adig ahost) @@ -39,6 +45,7 @@ IF (CARES_BUILD_TOOLS) PUBLIC "$" "$" "$" + "$" "$" "$" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" @@ -53,6 +60,11 @@ IF (CARES_BUILD_TOOLS) TARGET_COMPILE_DEFINITIONS (adig PRIVATE HAVE_CONFIG_H=1 CARES_NO_DEPRECATED) TARGET_LINK_LIBRARIES (adig PRIVATE ${PROJECT_NAME}) + + # Avoid "fatal error C1041: cannot open program database" due to multiple + # targets trying to use the same PDB. /FS does NOT resolve this issue. + SET_TARGET_PROPERTIES(adig PROPERTIES COMPILE_PDB_NAME adig.pdb) + IF (CARES_INSTALL) INSTALL (TARGETS adig COMPONENT Tools ${TARGETS_INST_DEST}) ENDIF () diff --git a/deps/cares/src/tools/Makefile.am b/deps/cares/src/tools/Makefile.am index ba7a672f89faf5..439b40b192a880 100644 --- a/deps/cares/src/tools/Makefile.am +++ b/deps/cares/src/tools/Makefile.am @@ -16,6 +16,7 @@ AM_CPPFLAGS += -I$(top_builddir)/include \ -I$(top_builddir)/src/lib \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src/lib \ + -I$(top_srcdir)/src/lib/include \ -DCARES_NO_DEPRECATED include Makefile.inc @@ -28,6 +29,6 @@ ahost_SOURCES = ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS) ahost_CFLAGS = $(AM_CFLAGS) ahost_CPPFLAGS = $(AM_CPPFLAGS) -adig_SOURCES = adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS) +adig_SOURCES = adig.c adig_CFLAGS = $(AM_CFLAGS) adig_CPPFLAGS = $(AM_CPPFLAGS) diff --git a/deps/cares/src/tools/Makefile.in b/deps/cares/src/tools/Makefile.in index e1b661ec1d7cbf..ace5023f03cfb6 100644 --- a/deps/cares/src/tools/Makefile.in +++ b/deps/cares/src/tools/Makefile.in @@ -126,12 +126,7 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = ahost$(EXEEXT) adig$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) -am__dirstamp = $(am__leading_dot)dirstamp -am__objects_1 = adig-ares_getopt.$(OBJEXT) \ - ../lib/str/adig-ares_strcasecmp.$(OBJEXT) -am__objects_2 = -am_adig_OBJECTS = adig-adig.$(OBJEXT) $(am__objects_1) \ - $(am__objects_2) +am_adig_OBJECTS = adig-adig.$(OBJEXT) adig_OBJECTS = $(am_adig_OBJECTS) adig_LDADD = $(LDADD) am__DEPENDENCIES_1 = @@ -144,9 +139,9 @@ am__v_lt_1 = adig_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(adig_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__objects_3 = ahost-ares_getopt.$(OBJEXT) \ - ../lib/str/ahost-ares_strcasecmp.$(OBJEXT) -am_ahost_OBJECTS = ahost-ahost.$(OBJEXT) $(am__objects_3) \ +am__objects_1 = ahost-ares_getopt.$(OBJEXT) +am__objects_2 = +am_ahost_OBJECTS = ahost-ahost.$(OBJEXT) $(am__objects_1) \ $(am__objects_2) ahost_OBJECTS = $(am_ahost_OBJECTS) ahost_LDADD = $(LDADD) @@ -170,9 +165,7 @@ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ../lib/str/$(DEPDIR)/adig-ares_strcasecmp.Po \ - ../lib/str/$(DEPDIR)/ahost-ares_strcasecmp.Po \ - ./$(DEPDIR)/adig-adig.Po ./$(DEPDIR)/adig-ares_getopt.Po \ +am__depfiles_remade = ./$(DEPDIR)/adig-adig.Po \ ./$(DEPDIR)/ahost-ahost.Po ./$(DEPDIR)/ahost-ares_getopt.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -230,7 +223,8 @@ AM_CFLAGS = @AM_CFLAGS@ # might possibly already be installed in the system. AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_builddir)/include \ -I$(top_builddir)/src/lib -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/lib -DCARES_NO_DEPRECATED + -I$(top_srcdir)/src/lib -I$(top_srcdir)/src/lib/include \ + -DCARES_NO_DEPRECATED AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ @@ -396,12 +390,8 @@ EXTRA_DIST = CMakeLists.txt Makefile.inc # Copyright (C) The c-ares project and its contributors # SPDX-License-Identifier: MIT -SAMPLESOURCES = ares_getopt.c \ - ../lib/str/ares_strcasecmp.c - -SAMPLEHEADERS = ares_getopt.h \ - ../lib/str/ares_strcasecmp.h - +SAMPLESOURCES = ares_getopt.c +SAMPLEHEADERS = ares_getopt.h # We're not interested in code coverage of the test apps themselves, but need # to link with gcov if building with code coverage enabled @@ -409,7 +399,7 @@ LDADD = $(top_builddir)/src/lib/libcares.la $(CODE_COVERAGE_LIBS) ahost_SOURCES = ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS) ahost_CFLAGS = $(AM_CFLAGS) ahost_CPPFLAGS = $(AM_CPPFLAGS) -adig_SOURCES = adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS) +adig_SOURCES = adig.c adig_CFLAGS = $(AM_CFLAGS) adig_CPPFLAGS = $(AM_CPPFLAGS) all: all-am @@ -450,21 +440,10 @@ $(am__aclocal_m4_deps): clean-noinstPROGRAMS: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) -../lib/str/$(am__dirstamp): - @$(MKDIR_P) ../lib/str - @: >>../lib/str/$(am__dirstamp) -../lib/str/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) ../lib/str/$(DEPDIR) - @: >>../lib/str/$(DEPDIR)/$(am__dirstamp) -../lib/str/adig-ares_strcasecmp.$(OBJEXT): ../lib/str/$(am__dirstamp) \ - ../lib/str/$(DEPDIR)/$(am__dirstamp) adig$(EXEEXT): $(adig_OBJECTS) $(adig_DEPENDENCIES) $(EXTRA_adig_DEPENDENCIES) @rm -f adig$(EXEEXT) $(AM_V_CCLD)$(adig_LINK) $(adig_OBJECTS) $(adig_LDADD) $(LIBS) -../lib/str/ahost-ares_strcasecmp.$(OBJEXT): \ - ../lib/str/$(am__dirstamp) \ - ../lib/str/$(DEPDIR)/$(am__dirstamp) ahost$(EXEEXT): $(ahost_OBJECTS) $(ahost_DEPENDENCIES) $(EXTRA_ahost_DEPENDENCIES) @rm -f ahost$(EXEEXT) @@ -472,15 +451,11 @@ ahost$(EXEEXT): $(ahost_OBJECTS) $(ahost_DEPENDENCIES) $(EXTRA_ahost_DEPENDENCIE mostlyclean-compile: -rm -f *.$(OBJEXT) - -rm -f ../lib/str/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@../lib/str/$(DEPDIR)/adig-ares_strcasecmp.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@../lib/str/$(DEPDIR)/ahost-ares_strcasecmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adig-adig.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adig-ares_getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ahost-ahost.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ahost-ares_getopt.Po@am__quote@ # am--include-marker @@ -528,34 +503,6 @@ adig-adig.obj: adig.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adig_CPPFLAGS) $(CPPFLAGS) $(adig_CFLAGS) $(CFLAGS) -c -o adig-adig.obj `if test -f 'adig.c'; then $(CYGPATH_W) 'adig.c'; else $(CYGPATH_W) '$(srcdir)/adig.c'; fi` -adig-ares_getopt.o: ares_getopt.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adig_CPPFLAGS) $(CPPFLAGS) $(adig_CFLAGS) $(CFLAGS) -MT adig-ares_getopt.o -MD -MP -MF $(DEPDIR)/adig-ares_getopt.Tpo -c -o adig-ares_getopt.o `test -f 'ares_getopt.c' || echo '$(srcdir)/'`ares_getopt.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/adig-ares_getopt.Tpo $(DEPDIR)/adig-ares_getopt.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares_getopt.c' object='adig-ares_getopt.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adig_CPPFLAGS) $(CPPFLAGS) $(adig_CFLAGS) $(CFLAGS) -c -o adig-ares_getopt.o `test -f 'ares_getopt.c' || echo '$(srcdir)/'`ares_getopt.c - -adig-ares_getopt.obj: ares_getopt.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adig_CPPFLAGS) $(CPPFLAGS) $(adig_CFLAGS) $(CFLAGS) -MT adig-ares_getopt.obj -MD -MP -MF $(DEPDIR)/adig-ares_getopt.Tpo -c -o adig-ares_getopt.obj `if test -f 'ares_getopt.c'; then $(CYGPATH_W) 'ares_getopt.c'; else $(CYGPATH_W) '$(srcdir)/ares_getopt.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/adig-ares_getopt.Tpo $(DEPDIR)/adig-ares_getopt.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ares_getopt.c' object='adig-ares_getopt.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adig_CPPFLAGS) $(CPPFLAGS) $(adig_CFLAGS) $(CFLAGS) -c -o adig-ares_getopt.obj `if test -f 'ares_getopt.c'; then $(CYGPATH_W) 'ares_getopt.c'; else $(CYGPATH_W) '$(srcdir)/ares_getopt.c'; fi` - -../lib/str/adig-ares_strcasecmp.o: ../lib/str/ares_strcasecmp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adig_CPPFLAGS) $(CPPFLAGS) $(adig_CFLAGS) $(CFLAGS) -MT ../lib/str/adig-ares_strcasecmp.o -MD -MP -MF ../lib/str/$(DEPDIR)/adig-ares_strcasecmp.Tpo -c -o ../lib/str/adig-ares_strcasecmp.o `test -f '../lib/str/ares_strcasecmp.c' || echo '$(srcdir)/'`../lib/str/ares_strcasecmp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/str/$(DEPDIR)/adig-ares_strcasecmp.Tpo ../lib/str/$(DEPDIR)/adig-ares_strcasecmp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/str/ares_strcasecmp.c' object='../lib/str/adig-ares_strcasecmp.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adig_CPPFLAGS) $(CPPFLAGS) $(adig_CFLAGS) $(CFLAGS) -c -o ../lib/str/adig-ares_strcasecmp.o `test -f '../lib/str/ares_strcasecmp.c' || echo '$(srcdir)/'`../lib/str/ares_strcasecmp.c - -../lib/str/adig-ares_strcasecmp.obj: ../lib/str/ares_strcasecmp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adig_CPPFLAGS) $(CPPFLAGS) $(adig_CFLAGS) $(CFLAGS) -MT ../lib/str/adig-ares_strcasecmp.obj -MD -MP -MF ../lib/str/$(DEPDIR)/adig-ares_strcasecmp.Tpo -c -o ../lib/str/adig-ares_strcasecmp.obj `if test -f '../lib/str/ares_strcasecmp.c'; then $(CYGPATH_W) '../lib/str/ares_strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/../lib/str/ares_strcasecmp.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/str/$(DEPDIR)/adig-ares_strcasecmp.Tpo ../lib/str/$(DEPDIR)/adig-ares_strcasecmp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/str/ares_strcasecmp.c' object='../lib/str/adig-ares_strcasecmp.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adig_CPPFLAGS) $(CPPFLAGS) $(adig_CFLAGS) $(CFLAGS) -c -o ../lib/str/adig-ares_strcasecmp.obj `if test -f '../lib/str/ares_strcasecmp.c'; then $(CYGPATH_W) '../lib/str/ares_strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/../lib/str/ares_strcasecmp.c'; fi` - ahost-ahost.o: ahost.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ahost_CPPFLAGS) $(CPPFLAGS) $(ahost_CFLAGS) $(CFLAGS) -MT ahost-ahost.o -MD -MP -MF $(DEPDIR)/ahost-ahost.Tpo -c -o ahost-ahost.o `test -f 'ahost.c' || echo '$(srcdir)/'`ahost.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ahost-ahost.Tpo $(DEPDIR)/ahost-ahost.Po @@ -584,20 +531,6 @@ ahost-ares_getopt.obj: ares_getopt.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ahost_CPPFLAGS) $(CPPFLAGS) $(ahost_CFLAGS) $(CFLAGS) -c -o ahost-ares_getopt.obj `if test -f 'ares_getopt.c'; then $(CYGPATH_W) 'ares_getopt.c'; else $(CYGPATH_W) '$(srcdir)/ares_getopt.c'; fi` -../lib/str/ahost-ares_strcasecmp.o: ../lib/str/ares_strcasecmp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ahost_CPPFLAGS) $(CPPFLAGS) $(ahost_CFLAGS) $(CFLAGS) -MT ../lib/str/ahost-ares_strcasecmp.o -MD -MP -MF ../lib/str/$(DEPDIR)/ahost-ares_strcasecmp.Tpo -c -o ../lib/str/ahost-ares_strcasecmp.o `test -f '../lib/str/ares_strcasecmp.c' || echo '$(srcdir)/'`../lib/str/ares_strcasecmp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/str/$(DEPDIR)/ahost-ares_strcasecmp.Tpo ../lib/str/$(DEPDIR)/ahost-ares_strcasecmp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/str/ares_strcasecmp.c' object='../lib/str/ahost-ares_strcasecmp.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ahost_CPPFLAGS) $(CPPFLAGS) $(ahost_CFLAGS) $(CFLAGS) -c -o ../lib/str/ahost-ares_strcasecmp.o `test -f '../lib/str/ares_strcasecmp.c' || echo '$(srcdir)/'`../lib/str/ares_strcasecmp.c - -../lib/str/ahost-ares_strcasecmp.obj: ../lib/str/ares_strcasecmp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ahost_CPPFLAGS) $(CPPFLAGS) $(ahost_CFLAGS) $(CFLAGS) -MT ../lib/str/ahost-ares_strcasecmp.obj -MD -MP -MF ../lib/str/$(DEPDIR)/ahost-ares_strcasecmp.Tpo -c -o ../lib/str/ahost-ares_strcasecmp.obj `if test -f '../lib/str/ares_strcasecmp.c'; then $(CYGPATH_W) '../lib/str/ares_strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/../lib/str/ares_strcasecmp.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/str/$(DEPDIR)/ahost-ares_strcasecmp.Tpo ../lib/str/$(DEPDIR)/ahost-ares_strcasecmp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/str/ares_strcasecmp.c' object='../lib/str/ahost-ares_strcasecmp.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ahost_CPPFLAGS) $(CPPFLAGS) $(ahost_CFLAGS) $(CFLAGS) -c -o ../lib/str/ahost-ares_strcasecmp.obj `if test -f '../lib/str/ares_strcasecmp.c'; then $(CYGPATH_W) '../lib/str/ares_strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/../lib/str/ares_strcasecmp.c'; fi` - mostlyclean-libtool: -rm -f *.lo @@ -718,8 +651,6 @@ clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) - -$(am__rm_f) ../lib/str/$(DEPDIR)/$(am__dirstamp) - -$(am__rm_f) ../lib/str/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -730,10 +661,7 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am - -rm -f ../lib/str/$(DEPDIR)/adig-ares_strcasecmp.Po - -rm -f ../lib/str/$(DEPDIR)/ahost-ares_strcasecmp.Po -rm -f ./$(DEPDIR)/adig-adig.Po - -rm -f ./$(DEPDIR)/adig-ares_getopt.Po -rm -f ./$(DEPDIR)/ahost-ahost.Po -rm -f ./$(DEPDIR)/ahost-ares_getopt.Po -rm -f Makefile @@ -781,10 +709,7 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -f ../lib/str/$(DEPDIR)/adig-ares_strcasecmp.Po - -rm -f ../lib/str/$(DEPDIR)/ahost-ares_strcasecmp.Po -rm -f ./$(DEPDIR)/adig-adig.Po - -rm -f ./$(DEPDIR)/adig-ares_getopt.Po -rm -f ./$(DEPDIR)/ahost-ahost.Po -rm -f ./$(DEPDIR)/ahost-ares_getopt.Po -rm -f Makefile diff --git a/deps/cares/src/tools/Makefile.inc b/deps/cares/src/tools/Makefile.inc index 4c6b6aaa978ce3..088c7d4e06206d 100644 --- a/deps/cares/src/tools/Makefile.inc +++ b/deps/cares/src/tools/Makefile.inc @@ -1,7 +1,5 @@ # Copyright (C) The c-ares project and its contributors # SPDX-License-Identifier: MIT -SAMPLESOURCES = ares_getopt.c \ - ../lib/str/ares_strcasecmp.c +SAMPLESOURCES = ares_getopt.c -SAMPLEHEADERS = ares_getopt.h \ - ../lib/str/ares_strcasecmp.h +SAMPLEHEADERS = ares_getopt.h diff --git a/deps/cares/src/tools/adig.c b/deps/cares/src/tools/adig.c index 8b2ad2e96a6219..fce210a8053578 100644 --- a/deps/cares/src/tools/adig.c +++ b/deps/cares/src/tools/adig.c @@ -43,226 +43,159 @@ #endif #include "ares.h" +#include "ares_array.h" +#include "ares_buf.h" #include "ares_dns.h" +#include "ares_getopt.h" +#include "ares_mem.h" +#include "ares_str.h" -#ifndef HAVE_STRDUP -# include "str/ares_str.h" -# define strdup(ptr) ares_strdup(ptr) -#endif +#include "limits.h" -#ifndef HAVE_STRCASECMP -# include "str/ares_strcasecmp.h" -# define strcasecmp(p1, p2) ares_strcasecmp(p1, p2) +#ifndef PATH_MAX +# define PATH_MAX 1024 #endif -#ifndef HAVE_STRNCASECMP -# include "str/ares_strcasecmp.h" -# define strncasecmp(p1, p2, n) ares_strncasecmp(p1, p2, n) -#endif - -#include "ares_getopt.h" +typedef struct { + unsigned short port; + size_t tries; + size_t ndots; + ares_bool_t tcp; + ares_bool_t ignore_tc; + char *search; + ares_bool_t do_search; + ares_bool_t aa_flag; + ares_bool_t ad_flag; + ares_bool_t cd_flag; + ares_bool_t rd_flag; + /* ares_bool_t do_flag; */ + ares_bool_t edns; + size_t udp_size; + ares_bool_t primary; + ares_bool_t aliases; + ares_bool_t stayopen; + ares_bool_t dns0x20; + ares_bool_t display_class; + ares_bool_t display_ttl; + ares_bool_t display_command; + ares_bool_t display_stats; + ares_bool_t display_query; + ares_bool_t display_question; + ares_bool_t display_answer; + ares_bool_t display_authority; + ares_bool_t display_additional; + ares_bool_t display_comments; +} dns_options_t; typedef struct { + dns_options_t opts; ares_bool_t is_help; + ares_bool_t no_rcfile; struct ares_options options; int optmask; ares_dns_class_t qclass; ares_dns_rec_type_t qtype; - int args_processed; + char *name; char *servers; char error[256]; } adig_config_t; -typedef struct { - const char *name; - int value; -} nv_t; - -static const nv_t configflags[] = { - { "usevc", ARES_FLAG_USEVC }, - { "primary", ARES_FLAG_PRIMARY }, - { "igntc", ARES_FLAG_IGNTC }, - { "norecurse", ARES_FLAG_NORECURSE }, - { "stayopen", ARES_FLAG_STAYOPEN }, - { "noaliases", ARES_FLAG_NOALIASES }, - { "edns", ARES_FLAG_EDNS }, - { "dns0x20", ARES_FLAG_DNS0x20 } +static adig_config_t global_config; + + +static const char *helpstr[] = { + "usage: adig [@server] [-c class] [-p port#] [-q name] [-t type] [-x addr]", + " [name] [type] [class] [queryopt...]", + "", + "@server: server ip address. May specify multiple in comma delimited " + "format.", + " may be specified in URI format", + "name: name of the resource record that is to be looked up", + "type: what type of query is required. e.g. - A, AAAA, MX, TXT, etc. If", + " no specified, A will be used.", + "class: Sets the query class, defaults to IN. May also be HS or CH.", + "", + "FLAGS", + "-c class: Sets the query class, defaults to IN. May also be HS or CH.", + "-h: Prints this help.", + "-p port: Sends query to a port other than 53. Often recommended to set", + " the port using @server instead.", + "-q name: Specifies the domain name to query. Useful to distinguish name", + " from other arguments", + "-r: Skip adigrc processing", + "-s: Server (alias for @server syntax), compatibility with old cmdline", + "-t type: Indicates resource record type to query. Useful to distinguish", + " type from other arguments", + "-x addr: Simplified reverse lookups. Sets the type to PTR and forms a", + " valid in-arpa query string", + "", + "QUERY OPTIONS", + "+[no]aaonly: Sets the aa flag in the query. Default is off.", + "+[no]aaflag: Alias for +[no]aaonly", + "+[no]additional: Toggles printing the additional section. On by default.", + "+[no]adflag: Sets the ad (authentic data) bit in the query. Default is", + " off.", + "+[no]aliases: Whether or not to honor the HOSTALIASES file. Default is", + " on.", + "+[no]all: Toggles all of +[no]cmd, +[no]stats, +[no]question,", + " +[no]answer, +[no]authority, +[no]additional, " + "+[no]comments", + "+[no]answer: Toggles printing the answer. On by default.", + "+[no]authority: Toggles printing the authority. On by default.", + "+bufsize=#: UDP EDNS 0 packet size allowed. Defaults to 1232.", + "+[no]cdflag: Sets the CD (checking disabled) bit in the query. Default", + " is off.", + "+[no]class: Display the class when printing the record. On by " + "default.", + "+[no]cmd: Toggles printing the command requested. On by default.", + "+[no]comments: Toggles printing the comments. On by default", + "+[no]defname: Alias for +[no]search", + "+domain=somename: Sets the search list to a single domain.", + "+[no]dns0x20: Whether or not to use DNS 0x20 case randomization when", + " sending queries. Default is off.", + "+[no]edns[=#]: Enable or disable EDNS. Only allows a value of 0 if", + " specified. Default is to enable EDNS.", + "+[no]ignore: Ignore truncation on UDP, by default retried on TCP.", + "+[no]keepopen: Whether or not the server connection should be " + "persistent.", + " Default is off.", + "+ndots=#: Sets the number of dots that must appear before being", + " considered absolute. Defaults to 1.", + "+[no]primary: Whether or not to only use a single server if more than " + "one", + " server is available. Defaults to using all servers.", + "+[no]qr: Toggles printing the request query. Off by default.", + "+[no]question: Toggles printing the question. On by default.", + "+[no]recurse: Toggles the RD (Recursion Desired) bit. On by default.", + "+retry=#: Same as +tries but does not include the initial attempt.", + "+[no]search: To use or not use the search list. Search list is not " + "used", + " by default.", + "+[no]stats: Toggles printing the statistics. On by default.", + "+[no]tcp: Whether to use TCP when querying name servers. Default is", + " UDP.", + "+tries=#: Number of query tries. Defaults to 3.", + "+[no]ttlid: Display the TTL when printing the record. On by default.", + "+[no]vc: Alias for +[no]tcp", + "", + NULL }; -static const size_t nconfigflags = sizeof(configflags) / sizeof(*configflags); - -static int lookup_flag(const nv_t *nv, size_t num_nv, const char *name) -{ - size_t i; - - if (name == NULL) { - return 0; - } - - for (i = 0; i < num_nv; i++) { - if (strcasecmp(nv[i].name, name) == 0) { - return nv[i].value; - } - } - - return 0; -} -static void free_config(adig_config_t *config) +static void free_config(void) { - free(config->servers); - memset(config, 0, sizeof(*config)); + free(global_config.servers); + free(global_config.name); + free(global_config.opts.search); + memset(&global_config, 0, sizeof(global_config)); } static void print_help(void) { - /* Split due to maximum c89 string literal of 509 bytes */ + size_t i; printf("adig version %s\n\n", ares_version(NULL)); - printf( - "usage: adig [-h] [-d] [-f flag] [[-s server] ...] [-T|U port] [-c class]\n" - " [-t type] name ...\n\n"); - printf(" -h : Display this help and exit.\n"); - printf(" -d : Print some extra debugging output.\n"); - printf( - " -f flag : Add a behavior control flag. May be specified more than " - "once\n" - " to add additional flags. Possible values are:\n" - " igntc - do not retry a truncated query as TCP, just\n" - " return the truncated answer\n" - " noaliases - don't honor the HOSTALIASES environment\n" - " variable\n"); - printf(" norecurse - don't query upstream servers recursively\n" - " primary - use the first server\n" - " stayopen - don't close the communication sockets\n" - " usevc - use TCP only\n" - " edns - use EDNS\n" - " dns0x20 - enable DNS 0x20 support\n"); - printf( - " -s server : Connect to the specified DNS server, instead of the\n" - " system's default one(s). Servers are tried in round-robin,\n" - " if the previous one failed.\n"); - printf(" -T port : Connect to the specified TCP port of DNS server.\n"); - printf(" -U port : Connect to the specified UDP port of DNS server.\n"); - printf(" -c class : Set the query class. Possible values for class are:\n" - " ANY, CHAOS, HS and IN (default)\n"); - printf( - " -t type : Query records of the specified type. Possible values for\n" - " type are:\n" - " A (default), AAAA, ANY, CNAME, HINFO, MX, NAPTR, NS, PTR,\n" - " SOA, SRV, TXT, TLSA, URI, CAA, SVCB, HTTPS\n\n"); -} - -static ares_bool_t read_cmdline(int argc, const char * const *argv, - adig_config_t *config) -{ - ares_getopt_state_t state; - int c; - - ares_getopt_init(&state, argc, argv); - state.opterr = 0; - - while ((c = ares_getopt(&state, "dh?f:s:c:t:T:U:")) != -1) { - int f; - - switch (c) { - case 'd': -#ifdef WATT32 - dbug_init(); -#endif - break; - - case 'h': - config->is_help = ARES_TRUE; - return ARES_TRUE; - - case 'f': - f = lookup_flag(configflags, nconfigflags, state.optarg); - if (f == 0) { - snprintf(config->error, sizeof(config->error), "flag %s unknown", - state.optarg); - } - - config->options.flags |= f; - config->optmask |= ARES_OPT_FLAGS; - break; - - case 's': - if (state.optarg == NULL) { - snprintf(config->error, sizeof(config->error), "%s", - "missing servers"); - return ARES_FALSE; - } - if (config->servers) { - free(config->servers); - } - config->servers = strdup(state.optarg); - break; - - case 'c': - if (!ares_dns_class_fromstr(&config->qclass, state.optarg)) { - snprintf(config->error, sizeof(config->error), - "unrecognized class %s", state.optarg); - return ARES_FALSE; - } - break; - - case 't': - if (!ares_dns_rec_type_fromstr(&config->qtype, state.optarg)) { - snprintf(config->error, sizeof(config->error), "unrecognized type %s", - state.optarg); - return ARES_FALSE; - } - break; - - case 'T': - { - /* Set the TCP port number. */ - long port = strtol(state.optarg, NULL, 0); - - if (port <= 0 || port > 65535) { - snprintf(config->error, sizeof(config->error), - "invalid port number"); - return ARES_FALSE; - } - config->options.tcp_port = (unsigned short)port; - config->options.flags |= ARES_FLAG_USEVC; - config->optmask |= ARES_OPT_TCP_PORT; - } - break; - - case 'U': - { - /* Set the TCP port number. */ - long port = strtol(state.optarg, NULL, 0); - - if (port <= 0 || port > 65535) { - snprintf(config->error, sizeof(config->error), - "invalid port number"); - return ARES_FALSE; - } - config->options.udp_port = (unsigned short)port; - config->options.flags |= ARES_FLAG_USEVC; - config->optmask |= ARES_OPT_UDP_PORT; - } - break; - - case ':': - snprintf(config->error, sizeof(config->error), - "%c requires an argument", state.optopt); - return ARES_FALSE; - - default: - snprintf(config->error, sizeof(config->error), - "unrecognized option: %c", state.optopt); - return ARES_FALSE; - } + for (i = 0; helpstr[i] != NULL; i++) { + printf("%s\n", helpstr[i]); } - - config->args_processed = state.optind; - if (config->args_processed >= argc) { - snprintf(config->error, sizeof(config->error), "missing query name"); - return ARES_FALSE; - } - return ARES_TRUE; } static void print_flags(ares_dns_flags_t flags) @@ -308,7 +241,11 @@ static void print_header(const ares_dns_record_t *dnsrec) static void print_question(const ares_dns_record_t *dnsrec) { size_t i; - printf(";; QUESTION SECTION:\n"); + + if (global_config.opts.display_comments) { + printf(";; QUESTION SECTION:\n"); + } + for (i = 0; i < ares_dns_record_query_cnt(dnsrec); i++) { const char *name; ares_dns_rec_type_t qtype; @@ -329,10 +266,17 @@ static void print_question(const ares_dns_record_t *dnsrec) if (len + 1 < 16) { printf("\t"); } - printf("%s\t%s\n", ares_dns_class_tostr(qclass), - ares_dns_rec_type_tostr(qtype)); + + if (global_config.opts.display_class) { + printf("%s\t", ares_dns_class_tostr(qclass)); + } + + printf("%s\n", ares_dns_rec_type_tostr(qtype)); + } + + if (global_config.opts.display_comments) { + printf("\n"); } - printf("\n"); } static void print_opt_none(const unsigned char *val, size_t val_len) @@ -667,9 +611,15 @@ static void print_rr(const ares_dns_rr_t *rr) printf("\t"); } - printf("%u\t%s\t%s\t", ares_dns_rr_get_ttl(rr), - ares_dns_class_tostr(ares_dns_rr_get_class(rr)), - ares_dns_rec_type_tostr(rtype)); + if (global_config.opts.display_ttl) { + printf("%u\t", ares_dns_rr_get_ttl(rr)); + } + + if (global_config.opts.display_class) { + printf("%s\t", ares_dns_class_tostr(ares_dns_rr_get_class(rr))); + } + + printf("%s\t", ares_dns_rec_type_tostr(rtype)); /* Output params here */ for (i = 0; i < keys_cnt; i++) { @@ -718,12 +668,12 @@ static void print_rr(const ares_dns_rr_t *rr) printf("\n"); } -static const ares_dns_rr_t *has_opt(ares_dns_record_t *dnsrec, - ares_dns_section_t section) +static const ares_dns_rr_t *has_opt(const ares_dns_record_t *dnsrec, + ares_dns_section_t section) { size_t i; for (i = 0; i < ares_dns_record_rr_cnt(dnsrec, section); i++) { - const ares_dns_rr_t *rr = ares_dns_record_rr_get(dnsrec, section, i); + const ares_dns_rr_t *rr = ares_dns_record_rr_get_const(dnsrec, section, i); if (ares_dns_rr_get_type(rr) == ARES_REC_TYPE_OPT) { return rr; } @@ -731,7 +681,8 @@ static const ares_dns_rr_t *has_opt(ares_dns_record_t *dnsrec, return NULL; } -static void print_section(ares_dns_record_t *dnsrec, ares_dns_section_t section) +static void print_section(const ares_dns_record_t *dnsrec, + ares_dns_section_t section) { size_t i; @@ -741,18 +692,22 @@ static void print_section(ares_dns_record_t *dnsrec, ares_dns_section_t section) return; } - printf(";; %s SECTION:\n", ares_dns_section_tostr(section)); + if (global_config.opts.display_comments) { + printf(";; %s SECTION:\n", ares_dns_section_tostr(section)); + } for (i = 0; i < ares_dns_record_rr_cnt(dnsrec, section); i++) { - const ares_dns_rr_t *rr = ares_dns_record_rr_get(dnsrec, section, i); + const ares_dns_rr_t *rr = ares_dns_record_rr_get_const(dnsrec, section, i); if (ares_dns_rr_get_type(rr) == ARES_REC_TYPE_OPT) { continue; } print_rr(rr); } - printf("\n"); + if (global_config.opts.display_comments) { + printf("\n"); + } } -static void print_opt_psuedosection(ares_dns_record_t *dnsrec) +static void print_opt_psuedosection(const ares_dns_record_t *dnsrec) { const ares_dns_rr_t *rr = has_opt(dnsrec, ARES_SECTION_ADDITIONAL); const unsigned char *cookie = NULL; @@ -767,7 +722,6 @@ static void print_opt_psuedosection(ares_dns_record_t *dnsrec) cookie = NULL; } - printf(";; OPT PSEUDOSECTION:\n"); printf("; EDNS: version: %u, flags: %u; udp: %u\n", (unsigned int)ares_dns_rr_get_u8(rr, ARES_RR_OPT_VERSION), @@ -781,60 +735,82 @@ static void print_opt_psuedosection(ares_dns_record_t *dnsrec) } } -static void callback(void *arg, int status, int timeouts, unsigned char *abuf, - int alen) +static void print_record(const ares_dns_record_t *dnsrec) { - ares_dns_record_t *dnsrec = NULL; - (void)arg; - (void)timeouts; + if (global_config.opts.display_comments) { + print_header(dnsrec); + print_opt_psuedosection(dnsrec); + } - /* We got a "Server status" */ - if (status >= ARES_SUCCESS && status <= ARES_EREFUSED) { - printf(";; Got answer:"); - } else { - printf(";;"); + if (global_config.opts.display_question) { + print_question(dnsrec); } - if (status != ARES_SUCCESS) { - printf(" %s", ares_strerror(status)); + if (global_config.opts.display_answer) { + print_section(dnsrec, ARES_SECTION_ANSWER); } - printf("\n"); - if (abuf == NULL || alen == 0) { - return; + if (global_config.opts.display_additional) { + print_section(dnsrec, ARES_SECTION_ADDITIONAL); } - status = (int)ares_dns_parse(abuf, (size_t)alen, 0, &dnsrec); - if (status != ARES_SUCCESS) { - fprintf(stderr, ";; FAILED TO PARSE DNS PACKET: %s\n", - ares_strerror(status)); - return; + if (global_config.opts.display_authority) { + print_section(dnsrec, ARES_SECTION_AUTHORITY); } - print_header(dnsrec); - print_opt_psuedosection(dnsrec); - print_question(dnsrec); - print_section(dnsrec, ARES_SECTION_ANSWER); - print_section(dnsrec, ARES_SECTION_ADDITIONAL); - print_section(dnsrec, ARES_SECTION_AUTHORITY); + if (global_config.opts.display_stats) { + unsigned char *abuf = NULL; + size_t alen = 0; + ares_dns_write(dnsrec, &abuf, &alen); + printf(";; MSG SIZE rcvd: %d\n\n", (int)alen); + ares_free_string(abuf); + } +} - printf(";; MSG SIZE rcvd: %d\n\n", alen); - ares_dns_record_destroy(dnsrec); +static void callback(void *arg, ares_status_t status, size_t timeouts, + const ares_dns_record_t *dnsrec) +{ + (void)arg; + (void)timeouts; + + if (global_config.opts.display_comments) { + /* We got a "Server status" */ + if (status >= ARES_SUCCESS && status <= ARES_EREFUSED) { + printf(";; Got answer:"); + } else { + printf(";;"); + } + if (status != ARES_SUCCESS) { + printf(" %s", ares_strerror((int)status)); + } + printf("\n"); + } + + print_record(dnsrec); } -static ares_status_t enqueue_query(ares_channel_t *channel, - const adig_config_t *config, - const char *name) +static ares_status_t enqueue_query(ares_channel_t *channel) { ares_dns_record_t *dnsrec = NULL; ares_dns_rr_t *rr = NULL; ares_status_t status; - unsigned char *buf = NULL; - size_t buf_len = 0; unsigned short flags = 0; char *nametemp = NULL; + const char *name = global_config.name; + + if (global_config.opts.aa_flag) { + flags |= ARES_FLAG_AA; + } + + if (global_config.opts.ad_flag) { + flags |= ARES_FLAG_AD; + } + + if (global_config.opts.cd_flag) { + flags |= ARES_FLAG_CD; + } - if (!(config->options.flags & ARES_FLAG_NORECURSE)) { + if (global_config.opts.rd_flag) { flags |= ARES_FLAG_RD; } @@ -846,7 +822,7 @@ static ares_status_t enqueue_query(ares_channel_t *channel, /* If it is a PTR record, convert from ip address into in-arpa form * automatically */ - if (config->qtype == ARES_REC_TYPE_PTR) { + if (global_config.qtype == ARES_REC_TYPE_PTR) { struct ares_addr addr; size_t len; addr.family = AF_UNSPEC; @@ -857,27 +833,33 @@ static ares_status_t enqueue_query(ares_channel_t *channel, } } - status = - ares_dns_record_query_add(dnsrec, name, config->qtype, config->qclass); + status = ares_dns_record_query_add(dnsrec, name, global_config.qtype, + global_config.qclass); if (status != ARES_SUCCESS) { goto done; } - status = ares_dns_record_rr_add(&rr, dnsrec, ARES_SECTION_ADDITIONAL, "", - ARES_REC_TYPE_OPT, ARES_CLASS_IN, 0); - if (status != ARES_SUCCESS) { - goto done; + if (global_config.opts.edns) { + status = ares_dns_record_rr_add(&rr, dnsrec, ARES_SECTION_ADDITIONAL, "", + ARES_REC_TYPE_OPT, ARES_CLASS_IN, 0); + if (status != ARES_SUCCESS) { + goto done; + } + ares_dns_rr_set_u16(rr, ARES_RR_OPT_UDP_SIZE, + (unsigned short)global_config.opts.udp_size); + ares_dns_rr_set_u8(rr, ARES_RR_OPT_VERSION, 0); } - ares_dns_rr_set_u16(rr, ARES_RR_OPT_UDP_SIZE, 1280); - ares_dns_rr_set_u8(rr, ARES_RR_OPT_VERSION, 0); - status = ares_dns_write(dnsrec, &buf, &buf_len); - if (status != ARES_SUCCESS) { - goto done; + if (global_config.opts.display_query) { + printf(";; Sending:\n"); + print_record(dnsrec); } - ares_send(channel, buf, (int)buf_len, callback, NULL); - ares_free_string(buf); + if (global_config.opts.do_search) { + status = ares_search_dnsrec(channel, dnsrec, callback, NULL); + } else { + status = ares_send_dnsrec(channel, dnsrec, callback, NULL, NULL); + } done: ares_free_string(nametemp); @@ -924,12 +906,584 @@ static int event_loop(ares_channel_t *channel) return 0; } +typedef enum { + OPT_TYPE_BOOL, + OPT_TYPE_STRING, + OPT_TYPE_SIZE_T, + OPT_TYPE_U16, + OPT_TYPE_FUNC +} opt_type_t; + +/* Callback called with OPT_TYPE_FUNC when processing options. + * \param[in] prefix prefix character for option + * \param[in] name name for option + * \param[in] is_true ARES_TRUE unless option was prefixed with 'no' + * \param[in] value value for option + * \return ARES_TRUE on success, ARES_FALSE on failure. Should fill in + * global_config.error on error */ +typedef ares_bool_t (*dig_opt_cb_t)(char prefix, const char *name, + ares_bool_t is_true, const char *value); + +static ares_bool_t opt_class_cb(char prefix, const char *name, + ares_bool_t is_true, const char *value) +{ + (void)prefix; + (void)name; + (void)is_true; + + if (!ares_dns_class_fromstr(&global_config.qclass, value)) { + snprintf(global_config.error, sizeof(global_config.error), + "unrecognized class %s", value); + return ARES_FALSE; + } + + return ARES_TRUE; +} + +static ares_bool_t opt_type_cb(char prefix, const char *name, + ares_bool_t is_true, const char *value) +{ + (void)prefix; + (void)name; + (void)is_true; + + if (!ares_dns_rec_type_fromstr(&global_config.qtype, value)) { + snprintf(global_config.error, sizeof(global_config.error), + "unrecognized record type %s", value); + return ARES_FALSE; + } + return ARES_TRUE; +} + +static ares_bool_t opt_ptr_cb(char prefix, const char *name, + ares_bool_t is_true, const char *value) +{ + (void)prefix; + (void)name; + (void)is_true; + global_config.qtype = ARES_REC_TYPE_PTR; + ares_free(global_config.name); + global_config.name = strdup(value); + return ARES_TRUE; +} + +static ares_bool_t opt_all_cb(char prefix, const char *name, + ares_bool_t is_true, const char *value) +{ + (void)prefix; + (void)name; + (void)value; + + global_config.opts.display_command = is_true; + global_config.opts.display_stats = is_true; + global_config.opts.display_question = is_true; + global_config.opts.display_answer = is_true; + global_config.opts.display_authority = is_true; + global_config.opts.display_additional = is_true; + global_config.opts.display_comments = is_true; + return ARES_TRUE; +} + +static ares_bool_t opt_edns_cb(char prefix, const char *name, + ares_bool_t is_true, const char *value) +{ + (void)prefix; + (void)name; + + global_config.opts.edns = is_true; + if (is_true && value != NULL && atoi(value) > 0) { + snprintf(global_config.error, sizeof(global_config.error), + "edns 0 only supported"); + return ARES_FALSE; + } + return ARES_TRUE; +} + +static ares_bool_t opt_retry_cb(char prefix, const char *name, + ares_bool_t is_true, const char *value) +{ + (void)prefix; + (void)name; + (void)is_true; + + if (!ares_str_isnum(value)) { + snprintf(global_config.error, sizeof(global_config.error), + "value not numeric"); + return ARES_FALSE; + } + + global_config.opts.tries = strtoul(value, NULL, 10) + 1; + return ARES_TRUE; +} + +static ares_bool_t opt_dig_bare_cb(char prefix, const char *name, + ares_bool_t is_true, const char *value) +{ + (void)prefix; + (void)name; + (void)is_true; + + /* Handle @servers */ + if (*value == '@') { + free(global_config.servers); + global_config.servers = strdup(value + 1); + return ARES_TRUE; + } + + /* Make sure we don't pass options */ + if (*value == '-' || *value == '+') { + snprintf(global_config.error, sizeof(global_config.error), + "unrecognized argument %s", value); + return ARES_FALSE; + } + + /* See if it is a DNS class */ + if (ares_dns_class_fromstr(&global_config.qclass, value)) { + return ARES_TRUE; + } + + /* See if it is a DNS record type */ + if (ares_dns_rec_type_fromstr(&global_config.qtype, value)) { + return ARES_TRUE; + } + + /* See if it is a domain name */ + if (ares_is_hostname(value)) { + free(global_config.name); + global_config.name = strdup(value); + return ARES_TRUE; + } + + snprintf(global_config.error, sizeof(global_config.error), + "unrecognized argument %s", value); + return ARES_FALSE; +} + +static const struct { + /* Prefix for option. If 0 then this param is a non-option and type must be + * OPT_TYPE_FUNC where the entire value for the param will be passed */ + char prefix; + /* Name of option. If null, there is none and the value is expected to be + * immediately after the prefix character */ + const char *name; + /* Separator between key and value. If 0 then uses the next argument as the + * value, otherwise splits on the separator. BOOL types won't ever use a + * separator and is ignored.*/ + char separator; + /* Type of parameter passed in. If it is OPT_TYPE_FUNC, then it calls the + * dig_opt_cb_t callback */ + opt_type_t type; + /* Pointer to argument to fill in */ + void *opt; + /* Callback if OPT_TYPE_FUNC */ + dig_opt_cb_t cb; +} dig_options[] = { + /* -4 (ipv4 only) */ + /* -6 (ipv6 only) */ + /* { '-', "b", 0, OPT_TYPE_FUNC, NULL, opt_bind_address_cb }, + */ + { '-', "c", 0, OPT_TYPE_FUNC, NULL, opt_class_cb }, + /* -f file */ + { '-', "h", 0, OPT_TYPE_BOOL, &global_config.is_help, NULL }, + /* -k keyfile */ + /* -m (memory usage debugging) */ + { '-', "p", 0, OPT_TYPE_U16, &global_config.opts.port, NULL }, + { '-', "q", 0, OPT_TYPE_STRING, &global_config.name, NULL }, + { '-', "r", 0, OPT_TYPE_BOOL, &global_config.no_rcfile, NULL }, + { '-', "s", 0, OPT_TYPE_STRING, &global_config.servers, NULL }, + { '-', "t", 0, OPT_TYPE_FUNC, NULL, opt_type_cb }, + /* -u (print microseconds instead of milliseconds) */ + { '-', "x", 0, OPT_TYPE_FUNC, NULL, opt_ptr_cb }, + /* -y [hmac:]keynam:secret */ + { '+', "aaflag", 0, OPT_TYPE_BOOL, &global_config.opts.aa_flag, NULL }, + { '+', "aaonly", 0, OPT_TYPE_BOOL, &global_config.opts.aa_flag, NULL }, + { '+', "additional", 0, OPT_TYPE_BOOL, &global_config.opts.display_additional, + NULL }, + { '+', "adflag", 0, OPT_TYPE_BOOL, &global_config.opts.ad_flag, NULL }, + { '+', "aliases", 0, OPT_TYPE_BOOL, &global_config.opts.aliases, NULL }, + { '+', "all", '=', OPT_TYPE_FUNC, NULL, opt_all_cb }, + { '+', "answer", 0, OPT_TYPE_BOOL, &global_config.opts.display_answer, NULL }, + { '+', "authority", 0, OPT_TYPE_BOOL, &global_config.opts.display_authority, + NULL }, + { '+', "bufsize", '=', OPT_TYPE_SIZE_T, &global_config.opts.udp_size, NULL }, + { '+', "cdflag", 0, OPT_TYPE_BOOL, &global_config.opts.cd_flag, NULL }, + { '+', "class", 0, OPT_TYPE_BOOL, &global_config.opts.display_class, NULL }, + { '+', "cmd", 0, OPT_TYPE_BOOL, &global_config.opts.display_command, NULL }, + { '+', "comments", 0, OPT_TYPE_BOOL, &global_config.opts.display_comments, + NULL }, + { '+', "defname", 0, OPT_TYPE_BOOL, &global_config.opts.do_search, NULL }, + { '+', "dns0x20", 0, OPT_TYPE_BOOL, &global_config.opts.dns0x20, NULL }, + { '+', "domain", '=', OPT_TYPE_STRING, &global_config.opts.search, NULL }, + { '+', "edns", '=', OPT_TYPE_FUNC, NULL, opt_edns_cb }, + { '+', "keepopen", 0, OPT_TYPE_BOOL, &global_config.opts.stayopen, NULL }, + { '+', "ignore", 0, OPT_TYPE_BOOL, &global_config.opts.ignore_tc, NULL }, + { '+', "ndots", '=', OPT_TYPE_SIZE_T, &global_config.opts.ndots, NULL }, + { '+', "primary", 0, OPT_TYPE_BOOL, &global_config.opts.primary, NULL }, + { '+', "qr", 0, OPT_TYPE_BOOL, &global_config.opts.display_query, NULL }, + { '+', "question", 0, OPT_TYPE_BOOL, &global_config.opts.display_question, + NULL }, + { '+', "recurse", 0, OPT_TYPE_BOOL, &global_config.opts.rd_flag, NULL }, + { '+', "retry", '=', OPT_TYPE_FUNC, NULL, opt_retry_cb }, + { '+', "search", 0, OPT_TYPE_BOOL, &global_config.opts.do_search, NULL }, + { '+', "stats", 0, OPT_TYPE_BOOL, &global_config.opts.display_stats, NULL }, + { '+', "tcp", 0, OPT_TYPE_BOOL, &global_config.opts.tcp, NULL }, + { '+', "tries", '=', OPT_TYPE_SIZE_T, &global_config.opts.tries, NULL }, + { '+', "ttlid", 0, OPT_TYPE_BOOL, &global_config.opts.display_ttl, NULL }, + { '+', "vc", 0, OPT_TYPE_BOOL, &global_config.opts.tcp, NULL }, + { 0, NULL, 0, OPT_TYPE_FUNC, NULL, opt_dig_bare_cb }, + { 0, NULL, 0, 0, NULL, NULL } +}; + +static ares_bool_t read_cmdline(int argc, const char * const *argv, + int start_idx) +{ + int arg; + size_t opt; + + for (arg = start_idx; arg < argc; arg++) { + ares_bool_t option_handled = ARES_FALSE; + + for (opt = 0; !option_handled && + (dig_options[opt].opt != NULL || dig_options[opt].cb != NULL); + opt++) { + ares_bool_t is_true = ARES_TRUE; + const char *value = NULL; + const char *nameptr = NULL; + size_t namelen; + + /* Match prefix character */ + if (dig_options[opt].prefix != 0 && + dig_options[opt].prefix != *(argv[arg])) { + continue; + } + + nameptr = argv[arg]; + + /* skip prefix */ + if (dig_options[opt].prefix != 0) { + nameptr++; + } + + /* Negated option if it has a 'no' prefix */ + if (ares_streq_max(nameptr, "no", 2)) { + is_true = ARES_FALSE; + nameptr += 2; + } + + if (dig_options[opt].separator != 0) { + const char *ptr = strchr(nameptr, dig_options[opt].separator); + if (ptr == NULL) { + namelen = ares_strlen(nameptr); + } else { + namelen = (size_t)(ptr - nameptr); + value = ptr + 1; + } + } else { + namelen = ares_strlen(nameptr); + } + + /* Match name */ + if (dig_options[opt].name != NULL && + !ares_streq_max(nameptr, dig_options[opt].name, namelen)) { + continue; + } + + if (dig_options[opt].name == NULL) { + value = nameptr; + } + + /* We need another argument for the value */ + if (dig_options[opt].type != OPT_TYPE_BOOL && + dig_options[opt].prefix != 0 && dig_options[opt].separator == 0) { + if (arg == argc - 1) { + snprintf(global_config.error, sizeof(global_config.error), + "insufficient arguments for %c%s", dig_options[opt].prefix, + dig_options[opt].name); + return ARES_FALSE; + } + arg++; + value = argv[arg]; + } + + switch (dig_options[opt].type) { + case OPT_TYPE_BOOL: + { + ares_bool_t *b = dig_options[opt].opt; + if (b == NULL) { + snprintf(global_config.error, sizeof(global_config.error), + "invalid use for %c%s", dig_options[opt].prefix, + dig_options[opt].name); + return ARES_FALSE; + } + *b = is_true; + } + break; + case OPT_TYPE_STRING: + { + char **str = dig_options[opt].opt; + if (str == NULL) { + snprintf(global_config.error, sizeof(global_config.error), + "invalid use for %c%s", dig_options[opt].prefix, + dig_options[opt].name); + return ARES_FALSE; + } + if (value == NULL) { + snprintf(global_config.error, sizeof(global_config.error), + "missing value for %c%s", dig_options[opt].prefix, + dig_options[opt].name); + return ARES_FALSE; + } + if (*str != NULL) { + free(*str); + } + *str = strdup(value); + break; + } + case OPT_TYPE_SIZE_T: + { + size_t *s = dig_options[opt].opt; + if (s == NULL) { + snprintf(global_config.error, sizeof(global_config.error), + "invalid use for %c%s", dig_options[opt].prefix, + dig_options[opt].name); + return ARES_FALSE; + } + if (value == NULL) { + snprintf(global_config.error, sizeof(global_config.error), + "missing value for %c%s", dig_options[opt].prefix, + dig_options[opt].name); + return ARES_FALSE; + } + if (!ares_str_isnum(value)) { + snprintf(global_config.error, sizeof(global_config.error), + "%c%s is not a numeric value", dig_options[opt].prefix, + dig_options[opt].name); + return ARES_FALSE; + } + *s = strtoul(value, NULL, 10); + break; + } + case OPT_TYPE_U16: + { + unsigned short *s = dig_options[opt].opt; + if (s == NULL) { + snprintf(global_config.error, sizeof(global_config.error), + "invalid use for %c%s", dig_options[opt].prefix, + dig_options[opt].name); + return ARES_FALSE; + } + if (value == NULL) { + snprintf(global_config.error, sizeof(global_config.error), + "missing value for %c%s", dig_options[opt].prefix, + dig_options[opt].name); + return ARES_FALSE; + } + if (!ares_str_isnum(value)) { + snprintf(global_config.error, sizeof(global_config.error), + "%c%s is not a numeric value", dig_options[opt].prefix, + dig_options[opt].name); + return ARES_FALSE; + } + *s = (unsigned short)strtoul(value, NULL, 10); + break; + } + case OPT_TYPE_FUNC: + if (dig_options[opt].cb == NULL) { + snprintf(global_config.error, sizeof(global_config.error), + "missing callback"); + return ARES_FALSE; + } + if (!dig_options[opt].cb(dig_options[opt].prefix, + dig_options[opt].name, is_true, value)) { + return ARES_FALSE; + } + break; + } + option_handled = ARES_TRUE; + } + + if (!option_handled) { + snprintf(global_config.error, sizeof(global_config.error), + "unrecognized option %s", argv[arg]); + return ARES_FALSE; + } + } + + return ARES_TRUE; +} + +static ares_bool_t read_rcfile(void) +{ + char configdir[PATH_MAX]; + unsigned int cdlen = 0; + +#if !defined(WIN32) +# if !defined(__APPLE__) + char *configdir_xdg; +# endif + char *homedir; +#endif + + char rcfile[PATH_MAX]; + unsigned int rclen; + + size_t rcargc; + char **rcargv; + ares_buf_t *rcbuf; + ares_status_t rcstatus; + +#if defined(WIN32) + cdlen = (unsigned int)snprintf(configdir, sizeof(configdir), "%s/%s", + getenv("APPDATA"), "c-ares"); + +#elif defined(__APPLE__) + homedir = getenv("HOME"); + if (homedir != NULL) { + cdlen = (unsigned int)snprintf(configdir, sizeof(configdir), "%s/%s/%s/%s", + homedir, "Library", "Application Support", + "c-ares"); + } + +#else + configdir_xdg = getenv("XDG_CONFIG_HOME"); + + if (configdir_xdg == NULL) { + homedir = getenv("HOME"); + if (homedir != NULL) { + cdlen = (unsigned int)snprintf(configdir, sizeof(configdir), "%s/%s", + homedir, ".config"); + } + } else { + cdlen = + (unsigned int)snprintf(configdir, sizeof(configdir), "%s", configdir_xdg); + } + +#endif + + DEBUGF(fprintf(stderr, "read_cmdline() configdir: %s\n", configdir)); + + if (cdlen == 0 || cdlen > sizeof(configdir)) { + DEBUGF( + fprintf(stderr, "read_cmdline() skipping rcfile parsing on directory\n")); + return ARES_TRUE; + } + + rclen = + (unsigned int)snprintf(rcfile, sizeof(rcfile), "%s/adigrc", configdir); + + if (rclen > sizeof(rcfile)) { + DEBUGF(fprintf(stderr, "read_cmdline() skipping rcfile parsing on file\n")); + return ARES_TRUE; + } + + rcbuf = ares_buf_create(); + if (ares_buf_load_file(rcfile, rcbuf) == ARES_SUCCESS) { + rcstatus = ares_buf_split_str(rcbuf, (const unsigned char *)"\n ", 2, + ARES_BUF_SPLIT_TRIM, 0, &rcargv, &rcargc); + + if (rcstatus == ARES_SUCCESS) { + read_cmdline((int)rcargc, (const char * const *)rcargv, 0); + + } else { + snprintf(global_config.error, sizeof(global_config.error), + "rcfile is invalid: %s", ares_strerror((int)rcstatus)); + } + + ares_free_array(rcargv, rcargc, ares_free); + + if (rcstatus != ARES_SUCCESS) { + ares_buf_destroy(rcbuf); + return ARES_FALSE; + } + + } else { + DEBUGF(fprintf(stderr, "read_cmdline() failed to load rcfile")); + } + ares_buf_destroy(rcbuf); + + return ARES_TRUE; +} + +static void config_defaults(void) +{ + memset(&global_config, 0, sizeof(global_config)); + + global_config.opts.tries = 3; + global_config.opts.ndots = 1; + global_config.opts.rd_flag = ARES_TRUE; + global_config.opts.edns = ARES_TRUE; + global_config.opts.udp_size = 1232; + global_config.opts.aliases = ARES_TRUE; + global_config.opts.display_class = ARES_TRUE; + global_config.opts.display_ttl = ARES_TRUE; + global_config.opts.display_command = ARES_TRUE; + global_config.opts.display_stats = ARES_TRUE; + global_config.opts.display_question = ARES_TRUE; + global_config.opts.display_answer = ARES_TRUE; + global_config.opts.display_authority = ARES_TRUE; + global_config.opts.display_additional = ARES_TRUE; + global_config.opts.display_comments = ARES_TRUE; + global_config.qclass = ARES_CLASS_IN; + global_config.qtype = ARES_REC_TYPE_A; +} + +static void config_opts(void) +{ + global_config.optmask = ARES_OPT_FLAGS; + if (global_config.opts.tcp) { + global_config.options.flags |= ARES_FLAG_USEVC; + } + if (global_config.opts.primary) { + global_config.options.flags |= ARES_FLAG_PRIMARY; + } + if (global_config.opts.edns) { + global_config.options.flags |= ARES_FLAG_EDNS; + } + if (global_config.opts.stayopen) { + global_config.options.flags |= ARES_FLAG_STAYOPEN; + } + if (global_config.opts.dns0x20) { + global_config.options.flags |= ARES_FLAG_DNS0x20; + } + if (!global_config.opts.aliases) { + global_config.options.flags |= ARES_FLAG_NOALIASES; + } + if (!global_config.opts.rd_flag) { + global_config.options.flags |= ARES_FLAG_NORECURSE; + } + if (!global_config.opts.do_search) { + global_config.options.flags |= ARES_FLAG_NOSEARCH; + } + if (global_config.opts.ignore_tc) { + global_config.options.flags |= ARES_FLAG_IGNTC; + } + if (global_config.opts.port) { + global_config.optmask |= ARES_OPT_UDP_PORT; + global_config.optmask |= ARES_OPT_TCP_PORT; + global_config.options.udp_port = global_config.opts.port; + global_config.options.tcp_port = global_config.opts.port; + } + + global_config.optmask |= ARES_OPT_TRIES; + global_config.options.tries = (int)global_config.opts.tries; + + global_config.optmask |= ARES_OPT_NDOTS; + global_config.options.ndots = (int)global_config.opts.ndots; + + global_config.optmask |= ARES_OPT_EDNSPSZ; + global_config.options.ednspsz = (int)global_config.opts.udp_size; + + if (global_config.opts.search != NULL) { + global_config.optmask |= ARES_OPT_DOMAINS; + global_config.options.domains = &global_config.opts.search; + global_config.options.ndomains = 1; + } +} + int main(int argc, char **argv) { ares_channel_t *channel = NULL; ares_status_t status; - adig_config_t config; - int i; int rv = 0; #ifdef USE_WINSOCK @@ -944,62 +1498,73 @@ int main(int argc, char **argv) return 1; } - memset(&config, 0, sizeof(config)); - config.qclass = ARES_CLASS_IN; - config.qtype = ARES_REC_TYPE_A; - if (!read_cmdline(argc, (const char * const *)argv, &config)) { - printf("\n** ERROR: %s\n\n", config.error); + config_defaults(); + + if (!read_cmdline(argc, (const char * const *)argv, 1)) { + printf("\n** ERROR: %s\n\n", global_config.error); print_help(); rv = 1; goto done; } - if (config.is_help) { + if (global_config.no_rcfile && !read_rcfile()) { + fprintf(stderr, "\n** ERROR: %s\n", global_config.error); + } + + if (global_config.is_help) { print_help(); goto done; } - status = - (ares_status_t)ares_init_options(&channel, &config.options, config.optmask); + if (global_config.name == NULL) { + printf("missing query name\n"); + print_help(); + rv = 1; + goto done; + } + + config_opts(); + + status = (ares_status_t)ares_init_options(&channel, &global_config.options, + global_config.optmask); if (status != ARES_SUCCESS) { fprintf(stderr, "ares_init_options: %s\n", ares_strerror((int)status)); rv = 1; goto done; } - if (config.servers) { - status = (ares_status_t)ares_set_servers_ports_csv(channel, config.servers); + if (global_config.servers) { + status = + (ares_status_t)ares_set_servers_ports_csv(channel, global_config.servers); if (status != ARES_SUCCESS) { - fprintf(stderr, "ares_set_servers_ports_csv: %s\n", - ares_strerror((int)status)); + fprintf(stderr, "ares_set_servers_ports_csv: %s: %s\n", + ares_strerror((int)status), global_config.servers); rv = 1; goto done; } } - /* Enqueue a query for each separate name */ - for (i = config.args_processed; i < argc; i++) { - status = enqueue_query(channel, &config, argv[i]); - if (status != ARES_SUCCESS) { - fprintf(stderr, "Failed to create query for %s: %s\n", argv[i], - ares_strerror((int)status)); - rv = 1; - goto done; - } + /* Debug */ + if (global_config.opts.display_command) { + printf("\n; <<>> c-ares DiG %s <<>>", ares_version(NULL)); + printf(" %s", global_config.name); + printf("\n"); } - /* Debug */ - printf("\n; <<>> c-ares DiG %s <<>>", ares_version(NULL)); - for (i = config.args_processed; i < argc; i++) { - printf(" %s", argv[i]); + /* Enqueue a query for each separate name */ + status = enqueue_query(channel); + if (status != ARES_SUCCESS) { + fprintf(stderr, "Failed to create query for %s: %s\n", global_config.name, + ares_strerror((int)status)); + rv = 1; + goto done; } - printf("\n"); /* Process events */ rv = event_loop(channel); done: - free_config(&config); + free_config(); ares_destroy(channel); ares_library_cleanup(); diff --git a/deps/cares/src/tools/ahost.c b/deps/cares/src/tools/ahost.c index 73f29002a98e92..7d1d4a86dc7a2d 100644 --- a/deps/cares/src/tools/ahost.c +++ b/deps/cares/src/tools/ahost.c @@ -42,20 +42,7 @@ #include "ares_getopt.h" #include "ares_ipv6.h" -#ifndef HAVE_STRDUP -# include "str/ares_str.h" -# define strdup(ptr) ares_strdup(ptr) -#endif - -#ifndef HAVE_STRCASECMP -# include "str/ares_strcasecmp.h" -# define strcasecmp(p1, p2) ares_strcasecmp(p1, p2) -#endif - -#ifndef HAVE_STRNCASECMP -# include "str/ares_strcasecmp.h" -# define strncasecmp(p1, p2, n) ares_strncasecmp(p1, p2, n) -#endif +#include "ares_str.h" static void callback(void *arg, int status, int timeouts, struct hostent *host); static void ai_callback(void *arg, int status, int timeouts, @@ -111,11 +98,11 @@ int main(int argc, char **argv) options.domains[options.ndomains - 1] = strdup(state.optarg); break; case 't': - if (!strcasecmp(state.optarg, "a")) { + if (ares_strcaseeq(state.optarg, "a")) { addr_family = AF_INET; - } else if (!strcasecmp(state.optarg, "aaaa")) { + } else if (ares_strcaseeq(state.optarg, "aaaa")) { addr_family = AF_INET6; - } else if (!strcasecmp(state.optarg, "u")) { + } else if (ares_strcaseeq(state.optarg, "u")) { addr_family = AF_UNSPEC; } else { usage();